Skip to content

Commit aa21f33

Browse files
Miklos Szeredibrauner
authored andcommitted
fs: fix is_mnt_ns_file()
Commit 1fa08ae ("nsfs: convert to path_from_stashed() helper") reused nsfs dentry's d_fsdata, which no longer contains a pointer to proc_ns_operations. Fix the remaining use in is_mnt_ns_file(). Fixes: 1fa08ae ("nsfs: convert to path_from_stashed() helper") Cc: [email protected] # v6.9 Signed-off-by: Miklos Szeredi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Al Viro <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 867f856 commit aa21f33

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

fs/namespace.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,9 +2055,15 @@ SYSCALL_DEFINE1(oldumount, char __user *, name)
20552055

20562056
static bool is_mnt_ns_file(struct dentry *dentry)
20572057
{
2058+
struct ns_common *ns;
2059+
20582060
/* Is this a proxy for a mount namespace? */
2059-
return dentry->d_op == &ns_dentry_operations &&
2060-
dentry->d_fsdata == &mntns_operations;
2061+
if (dentry->d_op != &ns_dentry_operations)
2062+
return false;
2063+
2064+
ns = d_inode(dentry)->i_private;
2065+
2066+
return ns->ops == &mntns_operations;
20612067
}
20622068

20632069
struct ns_common *from_mnt_ns(struct mnt_namespace *mnt)

0 commit comments

Comments
 (0)