summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:22 +0200
committerJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:22 +0200
commitad43d9b576213da888caf8d8960747942d114f76 (patch)
tree5c046be7671b7ca34f0bc5ad120993c5cd8332eb
parentf5c4e71525e6e7289e0f771639a9d3a484d45efb (diff)
downloadillumos-fusefs-ad43d9b576213da888caf8d8960747942d114f76.tar.gz
Fixed checking whether a directory is within a path
-rw-r--r--kernel/fuse_vnops.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/fuse_vnops.c b/kernel/fuse_vnops.c
index bffcbba..7a7be25 100644
--- a/kernel/fuse_vnops.c
+++ b/kernel/fuse_vnops.c
@@ -2609,11 +2609,18 @@ fuse_path_check(struct vnode *svp, struct vnode *tdvp, struct cred *credp)
DTRACE_PROBE2(fuse_path_check_err_parent,
char *, "Parent vnode not found",
struct vnode *, vp);
- vp = NULL;
/*
* XXX: Is this the right error no to return?
+ * The root directory is not in cache,
+ * if we reached it and the source is not
+ * the root directory, there is no error.
*/
- err = EINVAL;
+ if ((VTOFD(vp)->par_nid == FUSE_ROOT_ID)
+ && (VNODE_TO_NODEID(svp) != FUSE_ROOT_ID))
+ err = 0;
+ else
+ err = EINVAL;
+ vp = NULL;
break;
} else if (err) {
DTRACE_PROBE3(fuse_path_check_err_getvnode,