Skip to content

Commit d65d87a

Browse files
committed
ext4: improve explanation of a mount failure caused by a misconfigured kernel
If CONFIG_QFMT_V2 is not enabled, but CONFIG_QUOTA is enabled, when a user tries to mount a file system with the quota or project quota enabled, the kernel will emit a very confusing messsage: EXT4-fs warning (device vdc): ext4_enable_quotas:5914: Failed to enable quota tracking (type=0, err=-3). Please run e2fsck to fix. EXT4-fs (vdc): mount failed We will now report an explanatory message indicating which kernel configuration options have to be enabled, to avoid customer/sysadmin confusion. Link: https://lore.kernel.org/r/[email protected] Google-Bug-Id: 149093531 Fixes: 7c319d3 ("ext4: make quota as first class supported feature") Signed-off-by: Theodore Ts'o <[email protected]> Cc: [email protected]
1 parent c96dcee commit d65d87a

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

fs/ext4/super.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3009,17 +3009,11 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly)
30093009
return 0;
30103010
}
30113011

3012-
#ifndef CONFIG_QUOTA
3013-
if (ext4_has_feature_quota(sb) && !readonly) {
3012+
#if !defined(CONFIG_QUOTA) || !defined(CONFIG_QFMT_V2)
3013+
if (!readonly && (ext4_has_feature_quota(sb) ||
3014+
ext4_has_feature_project(sb))) {
30143015
ext4_msg(sb, KERN_ERR,
3015-
"Filesystem with quota feature cannot be mounted RDWR "
3016-
"without CONFIG_QUOTA");
3017-
return 0;
3018-
}
3019-
if (ext4_has_feature_project(sb) && !readonly) {
3020-
ext4_msg(sb, KERN_ERR,
3021-
"Filesystem with project quota feature cannot be mounted RDWR "
3022-
"without CONFIG_QUOTA");
3016+
"The kernel was not built with CONFIG_QUOTA and CONFIG_QFMT_V2");
30233017
return 0;
30243018
}
30253019
#endif /* CONFIG_QUOTA */

0 commit comments

Comments
 (0)