Skip to contentSkip to conversation

ext4: Fix mount failure with quota configured as module

PATCH In review Jan Kara 2 participants 2 messages Feb 21, 2020 ext4 file system

lore
Share & tools
lore

Jan Kara

author reviewer
#0 lore raw

PATCH 1/1 ext4: Fix mount failure with quota configured as module

When CONFIG_QFMT_V2 is configured as a module, the test in ext4_feature_set_ok() fails and so mount of filesystems with quota or project features fails. Fix the test to use IS_ENABLED macro which works properly even for modules.

Fixes d65d87a07476 ("ext4: improve explanation of a mount failure caused by a misconfigured kernel")
---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/super.c +1 -1
index f464dff09774..576b69d2ca41 100644
@@ -3009,7 +3009,7 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly)
 		return 0;
 	}
 
-#if !defined(CONFIG_QUOTA) || !defined(CONFIG_QFMT_V2)
+#if !IS_ENABLED(CONFIG_QUOTA) || !IS_ENABLED(CONFIG_QFMT_V2)
 	if (!readonly && (ext4_has_feature_quota(sb) ||
 			  ext4_has_feature_project(sb))) {
 		ext4_msg(sb, KERN_ERR,
Signature · 1 line
2.16.4
maintainer
#1 lore raw
Quoted 7 lines · Jan Kara

When CONFIG_QFMT_V2 is configured as a module, the test in ext4_feature_set_ok() fails and so mount of filesystems with quota or project features fails. Fix the test to use IS_ENABLED macro which works properly even for modules.

Fixes d65d87a07476 ("ext4: improve explanation of a mount failure caused by a misconfigured kernel")

Whoops, good catch. Thanks, applied.

- Ted