Re: [RFC PATCH v7 18/26] fs: Support FSCONFIG_SET_USERLAND in fsconfig()
From: bot+bpf-ci
Date: Sun Nov 22 2026 - 15:28:34 EST
> fs: Support FSCONFIG_SET_USERLAND in fsconfig()
TL;DR: Nit only: in fsconfig_set_userland(), the fs_type restore block looks
unreachable, since the only swapping filesystem (cpuset) fails the flag check
first; it could possibly be dropped.
> diff --git a/fs/fsopen.c b/fs/fsopen.c
> --- a/fs/fsopen.c
> +++ b/fs/fsopen.c
[ ... ]
> +static int fsconfig_set_userland(struct fs_context *fc, struct fs_parameter *param)
> +{
[ ... ]
> + if (!(fc->fs_type->fs_flags &
> + (FS_USERLAND_MOUNT | FS_USERNS_DELEGATABLE)))
> + return -EOPNOTSUPP;
[ ... ]
> + if (fc->log.prefix && strcmp(fc->fs_type->name, fc->log.prefix)) {
> + struct file_system_type *orig;
> +
> + orig = get_fs_type_noload(fc->log.prefix);
> + if (!orig) {
> + fc->phase = FS_CONTEXT_FAILED;
> + return -ENODEV;
> + }
> + put_filesystem(fc->fs_type);
> + fc->fs_type = orig;
> + }
This isn't a bug, but can this restore block be reached?
fc->log.prefix is only set in alloc_fs_context(), to the original
fs_type->name, and no parameters have been parsed yet when
FSCONFIG_SET_USERLAND is accepted, so fc->fs_type can only differ from the
prefix if ->init_fs_context() swapped it.
In this tree cpuset_init_fs_context() is the only init_fs_context that does
that (to cgroup_fs_type), and cgroup_fs_type has neither FS_USERLAND_MOUNT
nor FS_USERNS_DELEGATABLE, so the flag check above returns -EOPNOTSUPP
first.
Is there a filesystem that can reach this restore with a swapped
fc->fs_type? If not, could the block be dropped to keep
fsconfig_set_userland() shorter?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/45063222848