summaryrefslogtreecommitdiffstats
path: root/fs/d_path.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-08-30 19:31:09 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2019-08-30 19:31:09 -0400
commitf2683bd8d5bdebb929f05ae26ce6d9b578927ce5 (patch)
tree3a5fc98d46de7b73f22dea0893b8f126e4eb8f39 /fs/d_path.c
parent5f9e832c137075045d15cd6899ab0505cfb2ca4b (diff)
downloadlinux-f2683bd8d5bdebb929f05ae26ce6d9b578927ce5.tar.bz2
[PATCH] fix d_absolute_path() interplay with fsmount()
stuff in anon namespace should be treated as unattached. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/d_path.c')
-rw-r--r--fs/d_path.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/d_path.c b/fs/d_path.c
index a7d0a96b35ce..0f1fc1743302 100644
--- a/fs/d_path.c
+++ b/fs/d_path.c
@@ -116,8 +116,10 @@ restart:
vfsmnt = &mnt->mnt;
continue;
}
- if (!error)
- error = is_mounted(vfsmnt) ? 1 : 2;
+ if (is_mounted(vfsmnt) && !is_anon_ns(mnt->mnt_ns))
+ error = 1; // absolute root
+ else
+ error = 2; // detached or not attached yet
break;
}
parent = dentry->d_parent;