fs: fix is_mnt_ns_file()
commit aa21f333c86c8a09d39189de87abb0153d338190 upstream. Commit1fa08aece4("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:1fa08aece4("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
adcde2872f
commit
8790d511d4
+8
-2
@@ -2055,9 +2055,15 @@ SYSCALL_DEFINE1(oldumount, char __user *, name)
|
|||||||
|
|
||||||
static bool is_mnt_ns_file(struct dentry *dentry)
|
static bool is_mnt_ns_file(struct dentry *dentry)
|
||||||
{
|
{
|
||||||
|
struct ns_common *ns;
|
||||||
|
|
||||||
/* Is this a proxy for a mount namespace? */
|
/* Is this a proxy for a mount namespace? */
|
||||||
return dentry->d_op == &ns_dentry_operations &&
|
if (dentry->d_op != &ns_dentry_operations)
|
||||||
dentry->d_fsdata == &mntns_operations;
|
return false;
|
||||||
|
|
||||||
|
ns = d_inode(dentry)->i_private;
|
||||||
|
|
||||||
|
return ns->ops == &mntns_operations;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ns_common *from_mnt_ns(struct mnt_namespace *mnt)
|
struct ns_common *from_mnt_ns(struct mnt_namespace *mnt)
|
||||||
|
|||||||
Reference in New Issue
Block a user