]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cifs: warn and fail if trying to use rootfs without the config option
authorAurelien Aptel <aaptel@suse.com>
Thu, 18 Mar 2021 18:17:10 +0000 (19:17 +0100)
committerSteve French <stfrench@microsoft.com>
Fri, 19 Mar 2021 05:50:58 +0000 (00:50 -0500)
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>
fs/cifs/fs_context.c

index 892f51a21278beed2e6cfd590b234c65134254a1..78889024a7ed04cabf5eb7b99e52b5b17fb9e931 100644 (file)
@@ -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)