diff mbox

ext4: Don't calc checksum in update_backups in online resize.

Message ID 1348122823-4930-1-git-send-email-tm@tao.ma
State Accepted, archived
Headers show

Commit Message

Tao Ma Sept. 20, 2012, 6:33 a.m. UTC
From: Tao Ma <boyu.mt@taobao.com>

update_backups is used to backup all the metadata blocks, so we should
not take it for granted that 'data' is pointed to a super block and use
ext4_superblock_csum_set to calculate the checksum there. In case
the data is a group descriptor block, it will corrupt the last group
descriptor. And e2fsck will complain it.

As all the metadata checksum should already be OK when we do the backup,
remove the wrong ext4_superblock_csum_set and it should be just fine.

Reported-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
---
 fs/ext4/resize.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

Comments

Theodore Ts'o Sept. 20, 2012, 3:54 p.m. UTC | #1
On Thu, Sep 20, 2012 at 02:33:43PM +0800, Tao Ma wrote:
> From: Tao Ma <boyu.mt@taobao.com>
> 
> update_backups is used to backup all the metadata blocks, so we should
> not take it for granted that 'data' is pointed to a super block and use
> ext4_superblock_csum_set to calculate the checksum there. In case
> the data is a group descriptor block, it will corrupt the last group
> descriptor. And e2fsck will complain it.
> 
> As all the metadata checksum should already be OK when we do the backup,
> remove the wrong ext4_superblock_csum_set and it should be just fine.
> 
> Reported-by: "Theodore Ts'o" <tytso@mit.edu>
> Signed-off-by: Tao Ma <boyu.mt@taobao.com>

Applied.  Thanks for finding the fix!!

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 41f6ef6..019d528 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -970,8 +970,6 @@  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;