Subject: bug#17108: [PATCH 1/4] libparted: Check AlternateLBA against LBA-1

From: Phillip Susi <[email-masked]>
Date: Thu, 27 Mar 2014 12:23:48 -0400

On 3/27/2014 11:00 AM, Brian C. Lane wrote:
> I haven't seen any evidence of that, and that isn't what's
> happening here.

Try running the test steps manually so you can see what is going on in
the middle before the test suite cleans it up.  Last time I did that,
the loop-file size went from 20m to 2g after running gpt-header-munge.
 That makes parted complain that the backup is in the wrong place.

> Ok, I'll check to make sure that isn't the case -- I thought the 
> location was updated when it was rewritten, but I'll double check.
> 
> But the basic problem here is that you are making calculations that
> are invalid, as revealed by the failing test. You cannot count on
> the AlternateLBA always being at the block after
> LastUsableLBA+Partition entries. This *may* be true, but it isn't
> guaranteed to be true.

How would it not be true?  The reason the calculation is that way
rather than last sector of the disk - 1 is because if you have a disk
that has been extended, then the backup is no longer at last sector -
1.  By changing it back to last sector - 1, you will be looking for it
in the wrong place after the disk has grown.