Hello,
there's a bug in _parse_header() function that may cause parted to
fail on 73.4 GB disks.
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 is attached.
--
Best regards / s pozdravem
Petr Uzel, Packages maintainer
---------------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: [EMAIL PROTECTED]
Lihovarská 1060/12 tel: +420 284 028 964
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz
>From 5cbc971f7d152c575b72e5a4b75bbce1bd13d351 Mon Sep 17 00:00:00 2001
From: Petr Uzel <[EMAIL PROTECTED]>
Date: Mon, 20 Oct 2008 11:09:28 +0200
Subject: [PATCH] Fixed improper data conversion in _parse_header()
---
libparted/labels/gpt.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 13d2e88..5ba4be9 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -675,11 +675,10 @@ _parse_header (PedDisk* disk, GuidPartitionTableHeader_t* gpt,
parted invocation.
*/
- last_usable_if_grown
- = PED_CPU_TO_LE64 (disk->dev->length - 2 -
+ last_usable_if_grown = 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.2
_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel