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

Joel Granados Moreno jgranado at redhat.com
Thu Feb 19 15:53:10 UTC 2009


* 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).
---
 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;
-- 
1.6.0.6




More information about the parted-devel mailing list