]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ext4: enable journal checksum when metadata checksum feature enabled
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 30 Oct 2014 14:53:16 +0000 (10:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Nov 2014 16:59:59 +0000 (08:59 -0800)
commit 98c1a7593fa355fda7f5a5940c8bf5326ca964ba upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/super.c

index 608db5820740b6364fa0c07d288abe62d41def64..9fb3e6c0c578eae2dff94b61139efbc2da14581f 100644 (file)
@@ -3486,6 +3486,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)