diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/ext4.h | 1 | ||||
-rw-r--r-- | fs/ext4/super.c | 20 |
2 files changed, 15 insertions, 6 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 984ca0cb38c3..00d153f2f261 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -743,6 +743,7 @@ struct ext4_inode_info { | |||
743 | #define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */ | 743 | #define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */ |
744 | #define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ | 744 | #define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ |
745 | #define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ | 745 | #define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ |
746 | #define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */ | ||
746 | #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */ | 747 | #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */ |
747 | #define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */ | 748 | #define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */ |
748 | #define EXT4_MOUNT_DELALLOC 0x8000000 /* Delalloc support */ | 749 | #define EXT4_MOUNT_DELALLOC 0x8000000 /* Delalloc support */ |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 312211ee05af..d4ca92aab514 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1300,9 +1300,11 @@ static int parse_options(char *options, struct super_block *sb, | |||
1300 | *journal_devnum = option; | 1300 | *journal_devnum = option; |
1301 | break; | 1301 | break; |
1302 | case Opt_journal_checksum: | 1302 | case Opt_journal_checksum: |
1303 | break; /* Kept for backwards compatibility */ | 1303 | set_opt(sbi->s_mount_opt, JOURNAL_CHECKSUM); |
1304 | break; | ||
1304 | case Opt_journal_async_commit: | 1305 | case Opt_journal_async_commit: |
1305 | set_opt(sbi->s_mount_opt, JOURNAL_ASYNC_COMMIT); | 1306 | set_opt(sbi->s_mount_opt, JOURNAL_ASYNC_COMMIT); |
1307 | set_opt(sbi->s_mount_opt, JOURNAL_CHECKSUM); | ||
1306 | break; | 1308 | break; |
1307 | case Opt_noload: | 1309 | case Opt_noload: |
1308 | set_opt(sbi->s_mount_opt, NOLOAD); | 1310 | set_opt(sbi->s_mount_opt, NOLOAD); |
@@ -2759,14 +2761,20 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
2759 | goto failed_mount4; | 2761 | goto failed_mount4; |
2760 | } | 2762 | } |
2761 | 2763 | ||
2762 | jbd2_journal_set_features(sbi->s_journal, | 2764 | if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) { |
2763 | JBD2_FEATURE_COMPAT_CHECKSUM, 0, 0); | 2765 | jbd2_journal_set_features(sbi->s_journal, |
2764 | if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) | 2766 | JBD2_FEATURE_COMPAT_CHECKSUM, 0, |
2765 | jbd2_journal_set_features(sbi->s_journal, 0, 0, | ||
2766 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT); | 2767 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT); |
2767 | else | 2768 | } else if (test_opt(sb, JOURNAL_CHECKSUM)) { |
2769 | jbd2_journal_set_features(sbi->s_journal, | ||
2770 | JBD2_FEATURE_COMPAT_CHECKSUM, 0, 0); | ||
2768 | jbd2_journal_clear_features(sbi->s_journal, 0, 0, | 2771 | jbd2_journal_clear_features(sbi->s_journal, 0, 0, |
2769 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT); | 2772 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT); |
2773 | } else { | ||
2774 | jbd2_journal_clear_features(sbi->s_journal, | ||
2775 | JBD2_FEATURE_COMPAT_CHECKSUM, 0, | ||
2776 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT); | ||
2777 | } | ||
2770 | 2778 | ||
2771 | /* We have now updated the journal if required, so we can | 2779 | /* We have now updated the journal if required, so we can |
2772 | * validate the data journaling mode. */ | 2780 | * validate the data journaling mode. */ |