summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2014-10-30 15:53:16 +0100
committerTheodore Ts'o <tytso@mit.edu>2014-10-30 15:53:16 +0100
commit98c1a7593fa355fda7f5a5940c8bf5326ca964ba (patch)
treea7cec556c2cbae4dd75c33dd290c7b0988aacff2 /fs/ext4
parentext4: fix oops when loading block bitmap failed (diff)
downloadlinux-98c1a7593fa355fda7f5a5940c8bf5326ca964ba.tar.xz
linux-98c1a7593fa355fda7f5a5940c8bf5326ca964ba.zip
ext4: enable journal checksum when metadata checksum feature enabled
If metadata checksumming is turned on for the FS, we need to tell the journal to use checksumming too. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@vger.kernel.org
Diffstat (limited to '')
-rw-r--r--fs/ext4/super.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 1eda6ab0ef9d..5c11e2153e36 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3526,6 +3526,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
#ifdef CONFIG_EXT4_FS_POSIX_ACL
set_opt(sb, POSIX_ACL);
#endif
+ /* don't forget to enable journal_csum when metadata_csum is enabled. */
+ if (ext4_has_metadata_csum(sb))
+ set_opt(sb, JOURNAL_CHECKSUM);
+
if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_DATA)
set_opt(sb, JOURNAL_DATA);
else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_ORDERED)