linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Yongqiang Yang <xiaoqiangnk@gmail.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH V2] e2fsprogs: add ext2fs_group_blocks_count helper
Date: Thu, 21 Jul 2011 08:55:27 -0500	[thread overview]
Message-ID: <4E282FCF.4050602@redhat.com> (raw)
In-Reply-To: <4E274F57.8020007@redhat.com>

On 7/20/11 4:57 PM, Eric Sandeen wrote:
> Code to count the number of blocks in the last partial
> group is cut and pasted around the e2fsprogs codebase, and
> is wrong in at least one instancem as pointed out by
> Yongqiang Yang (but not fixed in this patch).
> 
> Making this a helper function should improve matters.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Argh V3 coming today, I got a little too fast and loose sending this one
at the end of the day yesterday didn't I:

> @@ -499,18 +499,8 @@ retry:
>  		ext2fs_bg_flags_zap(fs, i);
>  		if (csum_flag)
>  			ext2fs_bg_flags_set(fs, i, EXT2_BG_INODE_UNINIT | EXT2_BG_INODE_ZEROED);
> -		if (i == fs->group_desc_count-1) {
> -			numblocks = (ext2fs_blocks_count(fs->super) -
> -				     fs->super->s_first_data_block) %
> -					     fs->super->s_blocks_per_group;
> -			if (!numblocks)
> -				numblocks = fs->super->s_blocks_per_group;
> -		} else {
> -			numblocks = fs->super->s_blocks_per_group;
> -			if (csum_flag)
> -				ext2fs_bg_flags_set(fs, i,
> -						    EXT2_BG_BLOCK_UNINIT);

still need to do that flag set with the new helper.

- Eric

> -		}
> +
> +		numblocks = ext2fs_group_blocks_count(fs, i);
>  
>  		has_super = ext2fs_bg_has_super(fs, i);
>  		if (has_super) {
> 
> --
> 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


  reply	other threads:[~2011-07-21 13:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 15:46 [PATCH] e2fsck: fix error in computing blocks of the ending group Yongqiang Yang
2011-07-19 16:18 ` Eric Sandeen
2011-07-20 21:46   ` [PATCH] e2fsprogs: add ext2fs_group_blocks_count helper Eric Sandeen
2011-07-20 21:57     ` [PATCH V2] " Eric Sandeen
2011-07-21 13:55       ` Eric Sandeen [this message]
2011-07-21 14:57         ` Yongqiang Yang
2011-07-21 15:06           ` Eric Sandeen
2011-07-21 18:15       ` [PATCH V3] " Eric Sandeen
2011-09-16 13:22         ` [V3] " Ted Ts'o
2011-07-21 14:54     ` [PATCH] " Yongqiang Yang
2011-07-21 17:40   ` [PATCH] e2fsck: fix error in computing blocks of the ending group Eric Sandeen
2011-07-22  4:18 ` [PATCH V2] " Eric Sandeen
2011-09-16 13:29   ` [V2] " Ted 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=4E282FCF.4050602@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=xiaoqiangnk@gmail.com \
    /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).