[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 12/14: libnetfs: treat disconnected shadow roots as virtual roots
From: |
Samuel Thibault |
Subject: |
[hurd] 12/14: libnetfs: treat disconnected shadow roots as virtual roots |
Date: |
Sun, 22 May 2016 01:15:22 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 7dbebff1ff08d347aad14e76e371f1cb6991dac7
Author: Justus Winter <address@hidden>
Date: Thu Apr 21 17:51:40 2016 +0200
libnetfs: treat disconnected shadow roots as virtual roots
* libnetfs/dir-lookup.c (netfs_S_dir_lookup): Treat a shadow_root with
null shadow_root_parent as a "virtual root".
Analog to 6875a586.
---
libnetfs/dir-lookup.c | 33 +++++++++++++++++++++++----------
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c
index 3bcc745..731e53c 100644
--- a/libnetfs/dir-lookup.c
+++ b/libnetfs/dir-lookup.c
@@ -125,16 +125,29 @@ netfs_S_dir_lookup (struct protid *dircred,
if (dnp == dircred->po->shadow_root)
/* We're at the root of a shadow tree. */
{
- *do_retry = FS_RETRY_REAUTH;
- *retry_port = dircred->po->shadow_root_parent;
- *retry_port_type = MACH_MSG_TYPE_COPY_SEND;
- if (lastcomp && mustbedir) /* Trailing slash. */
- strcpy (retry_name, "/");
- else if (!lastcomp)
- strcpy (retry_name, nextname);
- err = 0;
- pthread_mutex_unlock (&dnp->lock);
- goto out;
+ if (dircred->po->shadow_root_parent == MACH_PORT_NULL)
+ {
+ /* This is a shadow root with no parent, meaning
+ we should treat it as a virtual root disconnected
+ from its real .. directory. */
+ err = 0;
+ np = dnp;
+ netfs_nref (np);
+ }
+ else
+ {
+ /* Punt the client up to the shadow root parent. */
+ *do_retry = FS_RETRY_REAUTH;
+ *retry_port = dircred->po->shadow_root_parent;
+ *retry_port_type = MACH_MSG_TYPE_COPY_SEND;
+ if (lastcomp && mustbedir) /* Trailing slash. */
+ strcpy (retry_name, "/");
+ else if (!lastcomp)
+ strcpy (retry_name, nextname);
+ err = 0;
+ pthread_mutex_unlock (&dnp->lock);
+ goto out;
+ }
}
else if (dircred->po->root_parent != MACH_PORT_NULL)
/* We're at a real translator root; even if DIRCRED->po has a
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (b90164e -> 04cfa52), Samuel Thibault, 2016/05/21
- [hurd] 01/14: Fix privileged operations on trivfs-translated nodes, Samuel Thibault, 2016/05/21
- [hurd] 04/14: startup: fix blunder, Samuel Thibault, 2016/05/21
- [hurd] 06/14: GNU Hurd 0.8, Samuel Thibault, 2016/05/21
- [hurd] 05/14: Complete changes to use -L instead of -Wl, -rpath-link, Samuel Thibault, 2016/05/21
- [hurd] 07/14: mach-defpager: fix panic invocation, Samuel Thibault, 2016/05/21
- [hurd] 02/14: libihash: fix corner case, Samuel Thibault, 2016/05/21
- [hurd] 12/14: libnetfs: treat disconnected shadow roots as virtual roots,
Samuel Thibault <=
- [hurd] 14/14: Avoid superfluous locking of node, Samuel Thibault, 2016/05/21
- [hurd] 10/14: libdiskfs: cosmetic changes, Samuel Thibault, 2016/05/21
- [hurd] 09/14: libnetfs: rename 'diruser' to 'dircred', Samuel Thibault, 2016/05/21
- [hurd] 08/14: libnetfs: rename 'error' to 'err', Samuel Thibault, 2016/05/21
- [hurd] 03/14: libihash: enable fast insertions replacing tombstones, Samuel Thibault, 2016/05/21
- [hurd] 11/14: Unify the short-circuit translator logic, Samuel Thibault, 2016/05/21
- [hurd] 13/14: utils/settrans: implement active translator stacking, Samuel Thibault, 2016/05/21