[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RFC v3 09/44] bpf: use fc_init_pseudo() for bpffs



On Mon, Nov 16, 2026 at 3:21 AM Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> Initialize bpffs as a pseudo filesystem instead of raising
> SB_I_NOEXEC and SB_I_NODEV by hand. This adds SB_I_PSEUDO.
>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> Reviewed-by: Alexander Mikhalitsyn <alex@xxxxxxxxxxxx>
> Reviewed-by: Chris Down <chris@xxxxxxxxxxxxxx>
> Signed-off-by: Christian Brauner (Amutable) <brauner@xxxxxxxxxx>
> ---
>  kernel/bpf/inode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx>

> diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c
> index c6f328e4752e1..57cf3775c0766 100644
> --- a/kernel/bpf/inode.c
> +++ b/kernel/bpf/inode.c
> @@ -15,6 +15,7 @@
>  #include <linux/namei.h>
>  #include <linux/fs.h>
>  #include <linux/fs_context.h>
> +#include <linux/pseudo_fs.h>
>  #include <linux/fs_parser.h>
>  #include <linux/kdev_t.h>
>  #include <linux/filter.h>
> @@ -1197,8 +1198,6 @@ static int bpf_fill_super(struct super_block *sb, 
> struct fs_context *fc)
>         sb->s_magic = BPF_FS_MAGIC;
>         sb->s_op = &bpf_super_ops;
>         sb->s_xattr = bpf_fs_xattr_handlers;
> -       sb->s_iflags |= SB_I_NOEXEC;
> -       sb->s_iflags |= SB_I_NODEV;
>         sb->s_time_gran = 1;
>
>         inode = bpf_get_inode(sb, NULL, S_IFDIR | 0777);
> @@ -1261,6 +1260,7 @@ static int bpf_init_fs_context(struct fs_context *fc)
>         opts->delegate_attachs = 0;
>
>         fc->s_fs_info = opts;
> +       fc_init_pseudo(fc);
>         fc->ops = &bpf_context_ops;
>         return 0;
>  }
>
> --
> 2.53.0
>
>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.