[PATCH] fix d_absolute_path() interplay with fsmount()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 30 Aug 2019 23:31:09 +0000 (19:31 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 30 Aug 2019 23:31:09 +0000 (19:31 -0400)
stuff in anon namespace should be treated as unattached.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/d_path.c

index a7d0a96b35ce5ebf47dec83bce25d531e9943af4..0f1fc1743302f329eb1b6ce7066237410ed6cc07 100644 (file)
@@ -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;