Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs: fix is_mnt_ns_file()

Commit 1fa08aece425 ("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: 1fa08aece425 ("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>

authored by

Miklos Szeredi and committed by
Christian Brauner
aa21f333 867f8567

+8 -2
+8 -2
fs/namespace.c
··· 2055 2055 2056 2056 static bool is_mnt_ns_file(struct dentry *dentry) 2057 2057 { 2058 + struct ns_common *ns; 2059 + 2058 2060 /* 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; 2061 2067 } 2062 2068 2063 2069 struct ns_common *from_mnt_ns(struct mnt_namespace *mnt)