diff options
author | Darrick J. Wong <djwong@us.ibm.com> | 2012-04-29 18:35:10 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-04-29 18:35:10 -0400 |
commit | fa77dcfafeaa6bc73293c646bfc3d5192dcf0be2 (patch) | |
tree | 66c4232c2e5c1f59666e05164b77539a9b1dd290 /fs/ext4/ialloc.c | |
parent | 41a246d1ff75a95d2be3191ca6e6db139dc0f430 (diff) |
ext4: calculate and verify block bitmap checksum
Compute and verify the checksum of the block bitmap; this checksum is
stored in the block group descriptor.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ialloc.c')
-rw-r--r-- | fs/ext4/ialloc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index fb897ec183c8..a6383fcb714b 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -753,6 +753,10 @@ got: | |||
753 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); | 753 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); |
754 | ext4_free_group_clusters_set(sb, gdp, | 754 | ext4_free_group_clusters_set(sb, gdp, |
755 | ext4_free_clusters_after_init(sb, group, gdp)); | 755 | ext4_free_clusters_after_init(sb, group, gdp)); |
756 | ext4_block_bitmap_csum_set(sb, group, gdp, | ||
757 | block_bitmap_bh, | ||
758 | EXT4_BLOCKS_PER_GROUP(sb) / | ||
759 | 8); | ||
756 | gdp->bg_checksum = ext4_group_desc_csum(sbi, group, | 760 | gdp->bg_checksum = ext4_group_desc_csum(sbi, group, |
757 | gdp); | 761 | gdp); |
758 | } | 762 | } |