提交 39a62204 编写于 作者: T Theodore Ts'o 提交者: Yang Yingliang

ext4: improve explanation of a mount failure caused by a misconfigured kernel

stable inclusion
from linux-4.19.105
commit c48bf2fcad547900c34845d517d64ee7cdc77b2c

--------------------------------

commit d65d87a0 upstream.

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/20200215012738.565735-1-tytso@mit.edu
Google-Bug-Id: 149093531
Fixes: 7c319d32 ("ext4: make quota as first class supported feature")
Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 80dc5e12
...@@ -2973,17 +2973,11 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly) ...@@ -2973,17 +2973,11 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly)
return 0; return 0;
} }
#ifndef CONFIG_QUOTA #if !defined(CONFIG_QUOTA) || !defined(CONFIG_QFMT_V2)
if (ext4_has_feature_quota(sb) && !readonly) { if (!readonly && (ext4_has_feature_quota(sb) ||
ext4_has_feature_project(sb))) {
ext4_msg(sb, KERN_ERR, ext4_msg(sb, KERN_ERR,
"Filesystem with quota feature cannot be mounted RDWR " "The kernel was not built with CONFIG_QUOTA and CONFIG_QFMT_V2");
"without CONFIG_QUOTA");
return 0;
}
if (ext4_has_feature_project(sb) && !readonly) {
ext4_msg(sb, KERN_ERR,
"Filesystem with project quota feature cannot be mounted RDWR "
"without CONFIG_QUOTA");
return 0; return 0;
} }
#endif /* CONFIG_QUOTA */ #endif /* CONFIG_QUOTA */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册