[parted-devel] [PATCH] parted: fix the resizepart command logic

Phil Susi psusi at ubuntu.com
Wed Apr 19 12:47:18 UTC 2017


On 4/18/2017 11:28 PM, Wang Dong wrote:
> The user offers an end, and if it is smaller than the partition end,
> it is a shrinking.  And this exception will only be raised when a shrinking
> happens. I think we can check if it is a shrinking earlier. I mean
> before to
> change the disk layout.

The user may specify to add 1 sector to the end, but after applying it,
the partition table code may decide to snap it down to a cylinder
boundary, resulting it in now shrinking the partition.

> "Your discard" can not be done without a device re-reading. User has to
> re-read
> the device to get the real disk layout. This is not good I think. It
> will confuse
> user.

You don't have to re-read.  As I said before, you just have to make a
copy of the PedDisk, modify the copy, leaving the original alone, and
then pick which to keep and which to discard.




More information about the parted-devel mailing list