]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
libfs: drop redundant SB_I_NOEXEC/SB_I_NODEV in init_pseudo() callers
authorJohn Hubbard <jhubbard@nvidia.com>
Thu, 4 Jun 2026 02:53:15 +0000 (19:53 -0700)
committerChristian Brauner <brauner@kernel.org>
Thu, 4 Jun 2026 08:10:49 +0000 (10:10 +0200)
init_pseudo() now sets SB_I_NOEXEC and SB_I_NODEV by default, so the
per-caller assignments are redundant. Drop them.

Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Link: https://patch.msgid.link/20260604025315.245910-3-jhubbard@nvidia.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/aio.c
fs/anon_inodes.c
fs/nsfs.c
fs/pidfs.c
mm/secretmem.c
virt/kvm/guest_memfd.c

index 72247656084808217346402eeb24d16adc5a0215..f57fa21a250353019f78e56dda9ca1be2667892a 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -318,7 +318,6 @@ static int aio_init_fs_context(struct fs_context *fc)
        pfc = init_pseudo(fc, AIO_RING_MAGIC);
        if (!pfc)
                return -ENOMEM;
-       fc->s_iflags |= SB_I_NOEXEC;
        pfc->ops = &aio_super_operations;
        return 0;
 }
index b8381c7fb636952a7ebdfdd873de8d3043e89a14..a7b9b948e33d1126563c84497ffa3df34b33ac56 100644 (file)
@@ -86,8 +86,6 @@ static int anon_inodefs_init_fs_context(struct fs_context *fc)
        struct pseudo_fs_context *ctx = init_pseudo(fc, ANON_INODE_FS_MAGIC);
        if (!ctx)
                return -ENOMEM;
-       fc->s_iflags |= SB_I_NOEXEC;
-       fc->s_iflags |= SB_I_NODEV;
        ctx->dops = &anon_inodefs_dentry_operations;
        return 0;
 }
index 51e8c9430477b6d6346327135c88a85612b7e7e1..c43c127cc0351821babadec97947951daee36ee9 100644 (file)
--- a/fs/nsfs.c
+++ b/fs/nsfs.c
@@ -664,7 +664,6 @@ static int nsfs_init_fs_context(struct fs_context *fc)
        struct pseudo_fs_context *ctx = init_pseudo(fc, NSFS_MAGIC);
        if (!ctx)
                return -ENOMEM;
-       fc->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
        ctx->s_d_flags |= DCACHE_DONTCACHE;
        ctx->ops = &nsfs_ops;
        ctx->eops = &nsfs_export_operations;
index 1cce4f34a05128ba7f27bfd217db40c1e14da9a6..c363416766f1ea8aa112c5012f4c531afc006eb9 100644 (file)
@@ -1115,8 +1115,6 @@ static int pidfs_init_fs_context(struct fs_context *fc)
        if (!ctx)
                return -ENOMEM;
 
-       fc->s_iflags |= SB_I_NOEXEC;
-       fc->s_iflags |= SB_I_NODEV;
        ctx->s_d_flags |= DCACHE_DONTCACHE;
        ctx->ops = &pidfs_sops;
        ctx->eops = &pidfs_export_operations;
index 5f57ac4720d32d25fe80c8aac29c10d984c6fd82..4877c262cb1f6f678a7b307010e0d77a8d7b451d 100644 (file)
@@ -245,8 +245,6 @@ static int secretmem_init_fs_context(struct fs_context *fc)
        if (!ctx)
                return -ENOMEM;
 
-       fc->s_iflags |= SB_I_NOEXEC;
-       fc->s_iflags |= SB_I_NODEV;
        return 0;
 }
 
index 69c9d6d546b287b4f75ef69868259c082ca50933..80f201035d77527153ed7cc325e691d4c4380d9e 100644 (file)
@@ -973,8 +973,6 @@ static int kvm_gmem_init_fs_context(struct fs_context *fc)
        if (!init_pseudo(fc, GUEST_MEMFD_MAGIC))
                return -ENOMEM;
 
-       fc->s_iflags |= SB_I_NOEXEC;
-       fc->s_iflags |= SB_I_NODEV;
        ctx = fc->fs_private;
        ctx->ops = &kvm_gmem_super_operations;