[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/4] gpt: prepare for tables with n_partition_array_entries != 12
From: |
Jim Meyering |
Subject: |
[PATCH 1/4] gpt: prepare for tables with n_partition_array_entries != 128 |
Date: |
Thu, 3 Nov 2011 22:18:55 +0100 |
From: Robert Herndon <address@hidden>
* libparted/labels/gpt.c (gpt_read_PE_array): When computing the size
of the partition array entry, use the value of "number of partition
array entries" read from a GPT header, not the default of 128 that we
use when creating new headers. Details here:
http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10173
---
libparted/labels/gpt.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 4c5f378..e239a2d 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -581,9 +581,8 @@ static void *
gpt_read_PE_array (PedDisk const *disk, GuidPartitionTableHeader_t const *gpt,
size_t *ptes_bytes)
{
- GPTDiskData *gpt_disk_data = disk->disk_specific;
uint32_t p_ent_size = PED_LE32_TO_CPU (gpt->SizeOfPartitionEntry);
- *ptes_bytes = p_ent_size * gpt_disk_data->entry_count;
+ *ptes_bytes = p_ent_size * PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries);
size_t ptes_sectors = ped_div_round_up (*ptes_bytes,
disk->dev->sector_size);
--
1.7.8.rc0.32.g87bf9
- GPT: don't misbehave with e.g., a 9-entry partition, Jim Meyering, 2011/11/03
- [PATCH 1/4] gpt: prepare for tables with n_partition_array_entries != 128,
Jim Meyering <=
- [PATCH 2/4] gpt: don't misbehave with e.g., a 9-entry partition array, Jim Meyering, 2011/11/03
- [PATCH 3/4] tests: rewrite/complete GPT-munging perl script, Jim Meyering, 2011/11/03
- [PATCH 4/4] tests: exercise the "GPT vs other-sized partition entry arrays" fixes, Jim Meyering, 2011/11/03
- Re: GPT: don't misbehave with e.g., a 9-entry partition, Seth Goldberg, 2011/11/03
- Re: GPT: don't misbehave with e.g., a 9-entry partition, Jim Meyering, 2011/11/04