Skip to content

Commit 27f394a

Browse files
tgnottinghamtytso
authored andcommitted
ext4: don't show data=<mode> option if defaulted
Previously, mount -l would show data=<mode> even if the ext4 default journaling mode was being used. Change this to be consistent with the rest of the options. Ext4 already did the right thing when the journaling mode being used matched the one specified in the superblock's default mount options. The reason it failed to do the right thing for the ext4 defaults is that, when set, they were never included in sbi->s_def_mount_opt (unlike the superblock's defaults, which were). Signed-off-by: Tyson Nottingham <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent ceec037 commit 27f394a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/ext4/super.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4112,10 +4112,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
41124112
* cope, else JOURNAL_DATA
41134113
*/
41144114
if (jbd2_journal_check_available_features
4115-
(sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE))
4115+
(sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE)) {
41164116
set_opt(sb, ORDERED_DATA);
4117-
else
4117+
sbi->s_def_mount_opt |= EXT4_MOUNT_ORDERED_DATA;
4118+
} else {
41184119
set_opt(sb, JOURNAL_DATA);
4120+
sbi->s_def_mount_opt |= EXT4_MOUNT_JOURNAL_DATA;
4121+
}
41194122
break;
41204123

41214124
case EXT4_MOUNT_ORDERED_DATA:

0 commit comments

Comments
 (0)