Skip to content

Commit eb51368

Browse files
committed
ext4: ignore journalled data options on remount if fs has no journal
This avoids a confusing failure in the init scripts when the /etc/fstab has data=writeback or data=journal but the file system does not have a journal. So check for this case explicitly, and warn the user that we are ignoring the (pointless, since they have no journal) data=* mount option. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent 5c8a0fb commit eb51368

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎fs/ext4/super.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,9 @@ static int parse_options(char *options, struct super_block *sb,
16831683
data_opt = EXT4_MOUNT_WRITEBACK_DATA;
16841684
datacheck:
16851685
if (is_remount) {
1686-
if (test_opt(sb, DATA_FLAGS) != data_opt) {
1686+
if (!sbi->s_journal)
1687+
ext4_msg(sb, KERN_WARNING, "Remounting file system with no journal so ignoring journalled data option");
1688+
else if (test_opt(sb, DATA_FLAGS) != data_opt) {
16871689
ext4_msg(sb, KERN_ERR,
16881690
"Cannot change data mode on remount");
16891691
return 0;

0 commit comments

Comments
 (0)