[parted-devel] [PATCH 1/8] libparted: do not omit last sector when creating full-dev geometry

Jim Meyering jim at meyering.net
Sat Oct 1 09:10:11 UTC 2011


Petr Uzel wrote:
> Note that ped_constraint_solve_max() is currently not used anywhere.
>
> * libparted/cs/constraint.c (ped_constraint_solve_max): full_dev now
> really represents whole device.

> ---
>  libparted/cs/constraint.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libparted/cs/constraint.c b/libparted/cs/constraint.c
> index e0f4c4d..1dad3ed 100644
> --- a/libparted/cs/constraint.c
> +++ b/libparted/cs/constraint.c
> @@ -449,7 +449,7 @@ ped_constraint_solve_max (const PedConstraint* constraint)
>  	if (!constraint)
>  		return NULL;
>  	dev = constraint->start_range->dev;
> -	ped_geometry_init (&full_dev, dev, 0, dev->length - 1);
> +	ped_geometry_init (&full_dev, dev, 0, dev->length);
>  	return ped_constraint_solve_nearest (constraint, &full_dev);
>  }

Good catch.
That is definitely a bug fix.
Applied.



More information about the parted-devel mailing list