Re: [PATCH 15/15][e2fsprogs] 64-bit mke2fs cleanup

Goswin von Brederlow
2008-07-16T16:31:44Z

"Jose R. Santos" <jrs@us.ibm.com> writes:

> diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
> index e9bfe49..5060fda 100644
> --- a/lib/ext2fs/initialize.c
> +++ b/lib/ext2fs/initialize.c
> @@ -200,9 +200,9 @@ errcode_t ext2fs_initialize(const char *name, int flags,
> super->s_blocks_per_group = EXT2_MAX_BLOCKS_PER_GROUP(super);
> super->s_frags_per_group = super->s_blocks_per_group * frags_per_block;
>
> - super->s_blocks_count = param->s_blocks_count;
> - super->s_r_blocks_count = param->s_r_blocks_count;
> - if (super->s_r_blocks_count >= param->s_blocks_count) {
> + ext2fs_blocks_count_set(super, param->s_blocks_count);
> + ext2fs_r_blocks_count_set(super, param->s_r_blocks_count);
> + if (ext2fs_r_blocks_count(super) >= ext2fs_blocks_count(param)) {
> retval = EXT2_ET_INVALID_ARGUMENT;
> goto cleanup;
> }

This needs to preserve the high bits from param:

+ ext2fs_blocks_count_set(super, ext2fs_blocks_count(param));
+ ext2fs_r_blocks_count_set(super, ext2fs_r_blocks_count(param->s_r_blocks_count));

MfG
Goswin