[parted-devel] [PATCH] Fix gpt end of disk handling

Jim Meyering jim at meyering.net
Tue Jan 3 08:03:09 UTC 2012


Phillip Susi wrote:
> From: Phillip Susi <psusi at cfl.rr.com>
>
> There are two checks for problems with the end of disk.  The first checks
> to make sure that the backup gpt is actually at the end of the disk as it
> should be.  The second checks to see that the gpt's idea of where the disk
> ends is correct.  The handling of the backup gpt location was wrong because
> if you chose not to fix the error, then as soon as you made any changes the
> backup would be written to the end of the disk anyhow, only the previous
> backup would not be zeroed.
>
> This patch fixes the write path to put the backup gpt where the gpt says
> the disk ends, not where we think the disk ends.  This allows you to choose
> not to fix the end of disk problem ( disk has grown ), and the backup gpt
> will be written to the same place it was before, not the new end of disk.
>
> Since the backup is always written to where the gpt says the disk ends,
> the first check has been modified so that it compares the backup location
> with where the gpt says the disk ends instead of where we think it ends.
> Also, if you do not choose to fix the error, then we fail to read the
> partition table, since continuing with the error would result in the error
> being corrected anyway when the table is written.  The fix option for
> correcting the size of the disk also will now zero the old backup gpt.
>
> Signed-off-by: Phillip Susi <psusi at cfl.rr.com>

Thanks for the patch.  I like the sound of it.
Would you please write a NEWS entry for it?
Also, this will require a test to exercise the new behavior.

Also, please run this in your parted clone directories,

  git config format.signoff true

That arranges to suppress those Signed-off-by lines.
When you're the Author, an identical Signed-off-by line is just clutter.



More information about the parted-devel mailing list