linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Don't calc checksum in update_backups in online resize.
@ 2012-09-20  6:33 Tao Ma
  2012-09-20 15:54 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Tao Ma @ 2012-09-20  6:33 UTC (permalink / raw)
  To: linux-ext4

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(-)

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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: Don't calc checksum in update_backups in online resize.
  2012-09-20  6:33 [PATCH] ext4: Don't calc checksum in update_backups in online resize Tao Ma
@ 2012-09-20 15:54 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2012-09-20 15:54 UTC (permalink / raw)
  To: Tao Ma; +Cc: linux-ext4

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-20 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20  6:33 [PATCH] ext4: Don't calc checksum in update_backups in online resize Tao Ma
2012-09-20 15:54 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).