Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: fsconfig: intercept non-new mount API in advance for FSCONFIG_CMD_CREATE_EXCL command

fsconfig with FSCONFIG_CMD_CREATE_EXCL command requires the new mount api,
here we should return -EOPNOTSUPP in advance to avoid extra procedure.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Link: https://lore.kernel.org/r/20240522030422.315892-1-lihongbo22@huawei.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Hongbo Li and committed by
Christian Brauner
ef44c8ab 3aa63a56

+1 -4
+1 -4
fs/fsopen.c
··· 220 220 if (!mount_capable(fc)) 221 221 return -EPERM; 222 222 223 - /* require the new mount api */ 224 - if (exclusive && fc->ops == &legacy_fs_context_ops) 225 - return -EOPNOTSUPP; 226 - 227 223 fc->phase = FS_CONTEXT_CREATING; 228 224 fc->exclusive = exclusive; 229 225 ··· 407 411 case FSCONFIG_SET_PATH: 408 412 case FSCONFIG_SET_PATH_EMPTY: 409 413 case FSCONFIG_SET_FD: 414 + case FSCONFIG_CMD_CREATE_EXCL: 410 415 ret = -EOPNOTSUPP; 411 416 goto out_f; 412 417 }