linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Maarten ter Huurne <maarten@treewalker.org>
Cc: Theodore Ts'o <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext4: Fixed corruption when online resizing a fs with 1K block size
Date: Wed, 8 May 2013 15:58:25 +0200	[thread overview]
Message-ID: <20130508135825.GA3810@quack.suse.cz> (raw)
In-Reply-To: <1367856367-15924-1-git-send-email-maarten@treewalker.org>

On Mon 06-05-13 18:06:07, Maarten ter Huurne wrote:
> Subtracting the number of the first data block places the superblock
> backups one block too early, corrupting the file system. When the block
> size is larger than 1K, the first data block is 0, so the subtraction
> has no effect and no corruption occurs.
  Looking where mke2fs places backup super blocks you are right. You can
add:
Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
> 
> Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
> ---
>  fs/ext4/resize.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
> index c169477..116c80d 100644
> --- a/fs/ext4/resize.c
> +++ b/fs/ext4/resize.c
> @@ -1654,12 +1654,10 @@ errout:
>  		err = err2;
>  
>  	if (!err) {
> -		ext4_fsblk_t first_block;
> -		first_block = ext4_group_first_block_no(sb, 0);
>  		if (test_opt(sb, DEBUG))
>  			printk(KERN_DEBUG "EXT4-fs: extended group to %llu "
>  			       "blocks\n", ext4_blocks_count(es));
> -		update_backups(sb, EXT4_SB(sb)->s_sbh->b_blocknr - first_block,
> +		update_backups(sb, EXT4_SB(sb)->s_sbh->b_blocknr,
>  			       (char *)es, sizeof(struct ext4_super_block), 0);
>  	}
>  	return err;
> -- 
> 1.7.10.4
> 
> --
> 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
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2013-05-08 13:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06 16:06 [PATCH] ext4: Fixed corruption when online resizing a fs with 1K block size Maarten ter Huurne
2013-05-08 13:58 ` Jan Kara [this message]
2013-06-17 13:07   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130508135825.GA3810@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten@treewalker.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).