lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E282FCF.4050602@redhat.com>
Date:	Thu, 21 Jul 2011 08:55:27 -0500
From:	Eric Sandeen <sandeen@...hat.com>
To:	Yongqiang Yang <xiaoqiangnk@...il.com>
CC:	linux-ext4@...r.kernel.org, tytso@....edu
Subject: Re: [PATCH V2] e2fsprogs: add ext2fs_group_blocks_count helper

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@...hat.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@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ