[parted-devel] [PATCH] libparted/disk.c: Fix contiguous partition overlap warning

Brian C. Lane bcl at redhat.com
Tue Jun 25 19:59:32 BST 2019


On Wed, May 08, 2019 at 09:22:53AM -0700, Evan Green wrote:
 
> As you can see, min_start and max_end are equal, which is okay, since the
> proposed partition 10 is exactly 1 sector in size.
> 
> Signed-off-by: Evan Green <evgreen at chromium.org>
> ---
>  libparted/disk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libparted/disk.c b/libparted/disk.c
> index fe82f44..b4a8e2f 100644
> --- a/libparted/disk.c
> +++ b/libparted/disk.c
> @@ -1793,7 +1793,7 @@ _partition_get_overlap_constraint (PedPartition* part, PedGeometry* geom)
>  	if (walk)
>  		max_end = walk->geom.start - 1;
>  
> -	if (min_start >= max_end)
> +	if (min_start > max_end)
>  		return NULL;
>  
>  	ped_geometry_init (&free_space, part->disk->dev,
> -- 
> 2.20.1

Thanks for the patch and the detailed description. It looks ok to me.
The only concern I have is if some part of parted isn't treating the end
as inclusive we could see new problems show up. I've looked through the
callers of it, and they look ok.

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted



More information about the parted-devel mailing list