t0210-gpt-resized-partition-entry-array failed because gpt-header-munge
did not relocate the LastUsableLBA to agree with the smaller table size.
This caused parted to complain that the backup was not at the end of the
disk ( as indicated by LastUsableLBA ), when in fact, it was.  Accept
the current AlternateLBA if it is *either* in the right place relative
to LastUsableLBA, or the last sector of the disk.
---
 libparted/labels/gpt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 42b0360..971c1c0 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -991,7 +991,8 @@ gpt_read (PedDisk *disk)
                        disk->dev->sector_size);
 
       gpt_disk_data->AlternateLBA = PED_LE64_TO_CPU 
(primary_gpt->AlternateLBA);
-      if (PED_LE64_TO_CPU (primary_gpt->AlternateLBA) != gpt_disk_end)
+      if (gpt_disk_data->AlternateLBA != gpt_disk_end &&
+         gpt_disk_data->AlternateLBA != disk->dev->length - 1)
         {
           if (ped_exception_throw
                   (PED_EXCEPTION_ERROR,
-- 
1.8.3.2




Reply via email to