diff options
author | Tao Ma <boyu.mt@taobao.com> | 2012-10-22 00:34:32 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-10-22 00:34:32 -0400 |
commit | 79f1ba49569e5aec919b653c55b03274c2331701 (patch) | |
tree | 612d4200d13a10d5df0cb6508cc5b1e7fd10fd45 /fs/ext4/ext4.h | |
parent | 76495ec1d47e1c0fe0673faf9179bda6bc8ab5c2 (diff) |
ext4: Checksum the block bitmap properly with bigalloc enabled
In mke2fs, we only checksum the whole bitmap block and it is right.
While in the kernel, we use EXT4_BLOCKS_PER_GROUP to indicate the
size of the checksumed bitmap which is wrong when we enable bigalloc.
The right size should be EXT4_CLUSTERS_PER_GROUP and this patch fixes
it.
Also as every caller of ext4_block_bitmap_csum_set and
ext4_block_bitmap_csum_verify pass in EXT4_BLOCKS_PER_GROUP(sb)/8,
we'd better removes this parameter and sets it in the function itself.
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 78971cfd9c7f..3c20de1d59d0 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -1882,10 +1882,10 @@ int ext4_inode_bitmap_csum_verify(struct super_block *sb, ext4_group_t group, | |||
1882 | struct buffer_head *bh, int sz); | 1882 | struct buffer_head *bh, int sz); |
1883 | void ext4_block_bitmap_csum_set(struct super_block *sb, ext4_group_t group, | 1883 | void ext4_block_bitmap_csum_set(struct super_block *sb, ext4_group_t group, |
1884 | struct ext4_group_desc *gdp, | 1884 | struct ext4_group_desc *gdp, |
1885 | struct buffer_head *bh, int sz); | 1885 | struct buffer_head *bh); |
1886 | int ext4_block_bitmap_csum_verify(struct super_block *sb, ext4_group_t group, | 1886 | int ext4_block_bitmap_csum_verify(struct super_block *sb, ext4_group_t group, |
1887 | struct ext4_group_desc *gdp, | 1887 | struct ext4_group_desc *gdp, |
1888 | struct buffer_head *bh, int sz); | 1888 | struct buffer_head *bh); |
1889 | 1889 | ||
1890 | /* balloc.c */ | 1890 | /* balloc.c */ |
1891 | extern void ext4_validate_block_bitmap(struct super_block *sb, | 1891 | extern void ext4_validate_block_bitmap(struct super_block *sb, |