Skip to content

Commit af3ef3b

Browse files
aaptelsmfrench
authored andcommitted
cifs: warn and fail if trying to use rootfs without the config option
If CONFIG_CIFS_ROOT is not set, rootfs mount option is invalid Signed-off-by: Aurelien Aptel <[email protected]> CC: <[email protected]> # v5.11 Signed-off-by: Steve French <[email protected]>
1 parent 403dba0 commit af3ef3b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/cifs/fs_context.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,9 +1196,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
11961196
pr_warn_once("Witness protocol support is experimental\n");
11971197
break;
11981198
case Opt_rootfs:
1199-
#ifdef CONFIG_CIFS_ROOT
1200-
ctx->rootfs = true;
1199+
#ifndef CONFIG_CIFS_ROOT
1200+
cifs_dbg(VFS, "rootfs support requires CONFIG_CIFS_ROOT config option\n");
1201+
goto cifs_parse_mount_err;
12011202
#endif
1203+
ctx->rootfs = true;
12021204
break;
12031205
case Opt_posixpaths:
12041206
if (result.negated)

0 commit comments

Comments
 (0)