diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e1fb1d5de58e..f489ffb3605d 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -112,6 +112,16 @@ static struct file_system_type ext3_fs_type = { | |||
112 | #define IS_EXT3_SB(sb) (0) | 112 | #define IS_EXT3_SB(sb) (0) |
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | static int ext4_verify_csum_type(struct super_block *sb, | ||
116 | struct ext4_super_block *es) | ||
117 | { | ||
118 | if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, | ||
119 | EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) | ||
120 | return 1; | ||
121 | |||
122 | return es->s_checksum_type == EXT4_CRC32C_CHKSUM; | ||
123 | } | ||
124 | |||
115 | void *ext4_kvmalloc(size_t size, gfp_t flags) | 125 | void *ext4_kvmalloc(size_t size, gfp_t flags) |
116 | { | 126 | { |
117 | void *ret; | 127 | void *ret; |
@@ -3025,6 +3035,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
3025 | goto cantfind_ext4; | 3035 | goto cantfind_ext4; |
3026 | sbi->s_kbytes_written = le64_to_cpu(es->s_kbytes_written); | 3036 | sbi->s_kbytes_written = le64_to_cpu(es->s_kbytes_written); |
3027 | 3037 | ||
3038 | /* Check for a known checksum algorithm */ | ||
3039 | if (!ext4_verify_csum_type(sb, es)) { | ||
3040 | ext4_msg(sb, KERN_ERR, "VFS: Found ext4 filesystem with " | ||
3041 | "unknown checksum algorithm."); | ||
3042 | silent = 1; | ||
3043 | goto cantfind_ext4; | ||
3044 | } | ||
3045 | |||
3028 | /* Set defaults before we parse the mount options */ | 3046 | /* Set defaults before we parse the mount options */ |
3029 | def_mount_opts = le32_to_cpu(es->s_default_mount_opts); | 3047 | def_mount_opts = le32_to_cpu(es->s_default_mount_opts); |
3030 | set_opt(sb, INIT_INODE_TABLE); | 3048 | set_opt(sb, INIT_INODE_TABLE); |