Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ext4: correct inconsistent error msg in nojournal mode

When we used the journal_async_commit mounting option in nojournal mode,
the kernel told me that "can't mount with journal_checksum", was very
confusing. I find that when we mount with journal_async_commit, both the
JOURNAL_ASYNC_COMMIT and EXPLICIT_JOURNAL_CHECKSUM flags are set. However,
in the error branch, CHECKSUM is checked before ASYNC_COMMIT. As a result,
the above inconsistency occurs, and the ASYNC_COMMIT branch becomes dead
code that cannot be executed. Therefore, we exchange the positions of the
two judgments to make the error msg more accurate.

Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20221109074343.4184862-1-libaokun1@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org

authored by

Baokun Li and committed by
Theodore Ts'o
89481b5f bb0fbc78

+6 -5
+6 -5
fs/ext4/super.c
··· 5288 5288 goto failed_mount3a; 5289 5289 } else { 5290 5290 /* Nojournal mode, all journal mount options are illegal */ 5291 - if (test_opt2(sb, EXPLICIT_JOURNAL_CHECKSUM)) { 5292 - ext4_msg(sb, KERN_ERR, "can't mount with " 5293 - "journal_checksum, fs mounted w/o journal"); 5294 - goto failed_mount3a; 5295 - } 5296 5291 if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) { 5297 5292 ext4_msg(sb, KERN_ERR, "can't mount with " 5298 5293 "journal_async_commit, fs mounted w/o journal"); 5294 + goto failed_mount3a; 5295 + } 5296 + 5297 + if (test_opt2(sb, EXPLICIT_JOURNAL_CHECKSUM)) { 5298 + ext4_msg(sb, KERN_ERR, "can't mount with " 5299 + "journal_checksum, fs mounted w/o journal"); 5299 5300 goto failed_mount3a; 5300 5301 } 5301 5302 if (sbi->s_commit_interval != JBD2_DEFAULT_MAX_COMMIT_AGE*HZ) {