aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-18 13:14:14 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-18 13:14:14 -0700
commitb30d87cf969e1711f1f621b6b61efb145ee6c6d9 (patch)
tree44bc419b7f2b2559b9015e783358e7f8ea2601ac
parentMerge branch 'work.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (diff)
parent[PATCH] fix d_absolute_path() interplay with fsmount() (diff)
downloadlinux-dev-b30d87cf969e1711f1f621b6b61efb145ee6c6d9.tar.xz
linux-dev-b30d87cf969e1711f1f621b6b61efb145ee6c6d9.zip
Merge branch 'work.dcache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull d_path fix from Al Viro: "Fix d_absolute_path() regression in the last cycle (felt by tomoyo, mostly)" * 'work.dcache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: [PATCH] fix d_absolute_path() interplay with fsmount()
-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;