[parted-devel] [PATCH] When comparing use the same type of formats.

Jim Meyering jim at meyering.net
Thu Feb 19 17:08:26 UTC 2009


Joel Granados Moreno <jgranado at redhat.com> writes:
> * libparted/labels/gpt.c (_parse_header()) : The problem is that
> last_usable_if_grown and last_usable_min_default should be both CPU
> format, but last_usable_if_grown is converted to LE64.  Patch taken from
> parted mailing list, author (petr.uzel at suse.cz).

Thanks.
That patch looks like it's probably ok, but,
please run git commit --amend --author '...' and then adjust the log:
it need not mention authorship, since git's headers will do that.
Also, if you can include a URL for the message, that'd be nice,
especially if it includes more details, e.g., on how to produce the failure.

If there is a convenient reproducer, let me know and I'll add a test.


>  libparted/labels/gpt.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
> index ae74123..df7a597 100644
> --- a/libparted/labels/gpt.c
> +++ b/libparted/labels/gpt.c
> @@ -676,10 +676,10 @@ _parse_header (PedDisk* disk, GuidPartitionTableHeader_t* gpt,
>  */
>
>  	last_usable_if_grown
> -		= PED_CPU_TO_LE64 (disk->dev->length - 2 -
> +		= disk->dev->length - 2 -
>  		((PedSector)(PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries)) *
>  		(PedSector)(PED_LE32_TO_CPU(gpt->SizeOfPartitionEntry)) /
> -		disk->dev->sector_size));
> +		disk->dev->sector_size);
>
>  	last_usable_min_default = disk->dev->length - 2 -
>  		GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / disk->dev->sector_size;



More information about the parted-devel mailing list