aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Aptel <aaptel@suse.com>2021-03-18 19:17:10 +0100
committerSteve French <stfrench@microsoft.com>2021-03-19 00:50:58 -0500
commitaf3ef3b1031634724a3763606695ebcd113d782b (patch)
tree589e504c57af5b35526dac8c8e84d33a633eea82
parent403dba003d17b3f0c1627b355cec2d74041cf648 (diff)
downloadlinux-stericsson-af3ef3b1031634724a3763606695ebcd113d782b.tar.gz
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 <aaptel@suse.com> CC: <stable@vger.kernel.org> # v5.11 Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/cifs/fs_context.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c
index 892f51a21278b..78889024a7ed0 100644
--- a/fs/cifs/fs_context.c
+++ b/fs/cifs/fs_context.c
@@ -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)