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: stable@vger.kernel.org # v6.9 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Link: https://lore.kernel.org/r/20241211121118.85268-1-mszeredi@redhat.com Acked-by: Al Viro <viro@zeniv.linux.org.uk> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 867f856 commit aa21f33

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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)