Skip to contentSkip to conversation

cifs: warn and fail if trying to use rootfs without the config option

PATCH Applied Aurélien Aptel 2 participants 2 messages Mar 18, 2021 – Mar 19, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: warn and fail if trying to use rootfs without the config option

From: Aurelien Aptel <[email protected]>

---
 fs/cifs/fs_context.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/cifs/fs_context.c +4 -2
index 9b0e82bc584f..d0580e2d1f32 100644
@@ -1197,9 +1197,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)
Signature · 1 line
2.30.0
Applied
#1 lore raw

merged into cifs-2.6.git for-next

Quoted 29 lines · Aurélien Aptel

From: Aurelien Aptel <[email protected]>

---
 fs/cifs/fs_context.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/cifs/fs_context.c +4 -3
index 9b0e82bc584f..d0580e2d1f32 100644
@@ -1197,9 +1197,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)
--

2.30.0

Signature · 3 lines
Thanks,

Steve