summaryrefslogtreecommitdiffstats
path: root/fs/ext4/resize.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2012-04-29 18:29:10 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-04-29 18:29:10 -0400
commita9c4731780544d52b243bf46e4dd635c67fa9f84 (patch)
treedc735f2f59fa2107e8fed8e3d26f259557e34008 /fs/ext4/resize.c
parent0441984a3398970ab4820410b9cf4ff85bf3a6b0 (diff)
downloadop-kernel-dev-a9c4731780544d52b243bf46e4dd635c67fa9f84.zip
op-kernel-dev-a9c4731780544d52b243bf46e4dd635c67fa9f84.tar.gz
ext4: calculate and verify superblock checksum
Calculate and verify the superblock checksum. Since the UUID and block group number are embedded in each copy of the superblock, we need only checksum the entire block. Refactor some of the code to eliminate open-coding of the checksum update call. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/resize.c')
-rw-r--r--fs/ext4/resize.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 59fa0be..e037475 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -796,7 +796,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
ext4_kvfree(o_group_desc);
le16_add_cpu(&es->s_reserved_gdt_blocks, -1);
- err = ext4_handle_dirty_metadata(handle, NULL, EXT4_SB(sb)->s_sbh);
+ err = ext4_handle_dirty_super_now(handle, sb);
if (err)
ext4_std_error(sb, err);
@@ -968,6 +968,8 @@ static void update_backups(struct super_block *sb,
goto exit_err;
}
+ ext4_superblock_csum_set(sb, (struct ext4_super_block *)data);
+
while ((group = ext4_list_backups(sb, &three, &five, &seven)) < last) {
struct buffer_head *bh;
OpenPOWER on IntegriCloud