Skip to content

Commit

Permalink
[PATCH] fix d_absolute_path() interplay with fsmount()
Browse files Browse the repository at this point in the history
stuff in anon namespace should be treated as unattached.

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Aug 30, 2019
1 parent 5f9e832 commit f2683bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/d_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ static int prepend_path(const struct path *path,
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;
Expand Down

0 comments on commit f2683bd

Please sign in to comment.