Skip to content

Commit

Permalink
cifs: warn and fail if trying to use rootfs without the config option
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
aaptel authored and Steve French committed Mar 19, 2021
1 parent 403dba0 commit af3ef3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/cifs/fs_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,9 +1196,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
pr_warn_once("Witness protocol support is experimental\n");
break;
case Opt_rootfs:
#ifdef CONFIG_CIFS_ROOT
ctx->rootfs = true;
#ifndef CONFIG_CIFS_ROOT
cifs_dbg(VFS, "rootfs support requires CONFIG_CIFS_ROOT config option\n");
goto cifs_parse_mount_err;
#endif
ctx->rootfs = true;
break;
case Opt_posixpaths:
if (result.negated)
Expand Down

0 comments on commit af3ef3b

Please sign in to comment.