提交 7e6681f6 编写于 作者: E Eric Biggers 提交者: Zheng Zengkai

ext4: reject the 'commit' option on ext2 filesystems

stable inclusion
from stable-v5.10.121
commit d54ac6ca48c1fa44868faffcba7d8aeab8937f2e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d54ac6ca48c1fa44868faffcba7d8aeab8937f2e

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

[ Upstream commit cb8435dc ]

The 'commit' option is only applicable for ext3 and ext4 filesystems,
and has never been accepted by the ext2 filesystem driver, so the ext4
driver shouldn't allow it on ext2 filesystems.

This fixes a failure in xfstest ext4/053.

Fixes: 8dc0aa8c ("ext4: check incompatible mount options while mounting ext2/3")
Signed-off-by: NEric Biggers <ebiggers@google.com>
Reviewed-by: NRitesh Harjani <ritesh.list@gmail.com>
Reviewed-by: NLukas Czerner <lczerner@redhat.com>
Link: https://lore.kernel.org/r/20220510183232.172615-1-ebiggers@kernel.orgSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 21362241
...@@ -1980,6 +1980,7 @@ static const struct mount_opts { ...@@ -1980,6 +1980,7 @@ static const struct mount_opts {
MOPT_EXT4_ONLY | MOPT_CLEAR}, MOPT_EXT4_ONLY | MOPT_CLEAR},
{Opt_warn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_SET}, {Opt_warn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_SET},
{Opt_nowarn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_CLEAR}, {Opt_nowarn_on_error, EXT4_MOUNT_WARN_ON_ERROR, MOPT_CLEAR},
{Opt_commit, 0, MOPT_NO_EXT2},
{Opt_nojournal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM, {Opt_nojournal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM,
MOPT_EXT4_ONLY | MOPT_CLEAR}, MOPT_EXT4_ONLY | MOPT_CLEAR},
{Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM, {Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册