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 Reviewed-by: Alexander Mikhalitsyn Signed-off-by: Christian Brauner (Amutable) --- kernel/bpf/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 #include #include +#include #include #include #include @@ -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