summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ialloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2012-04-29 18:35:10 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-04-29 18:35:10 -0400
commitfa77dcfafeaa6bc73293c646bfc3d5192dcf0be2 (patch)
tree66c4232c2e5c1f59666e05164b77539a9b1dd290 /fs/ext4/ialloc.c
parent41a246d1ff75a95d2be3191ca6e6db139dc0f430 (diff)
downloadblackbird-op-linux-fa77dcfafeaa6bc73293c646bfc3d5192dcf0be2.tar.gz
blackbird-op-linux-fa77dcfafeaa6bc73293c646bfc3d5192dcf0be2.zip
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.c4
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:
gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
ext4_free_group_clusters_set(sb, gdp,
ext4_free_clusters_after_init(sb, group, gdp));
+ ext4_block_bitmap_csum_set(sb, group, gdp,
+ block_bitmap_bh,
+ EXT4_BLOCKS_PER_GROUP(sb) /
+ 8);
gdp->bg_checksum = ext4_group_desc_csum(sbi, group,
gdp);
}
OpenPOWER on IntegriCloud