[Bug 1618862] [NEW] lbfdisk fails to resize a partition even if it lies before freespace, when the partition are not present on disk in order
rahul
1618862 at bugs.launchpad.net
Wed Aug 31 12:16:35 UTC 2016
Public bug reported:
In util-linux libfdisk/src/partition.c
line:1082
function recount_resize()
the partition table that is passed on to the next function resize_get_last_possible()
should be sorted in order based on their start sectors and not on their partition numbers.
take this example:
partition are present in this order on the disk:
num start end size
1 0 10 11
4 11 21 10
5 22 30 9
2 31 40 10
freespace 41 60 20
in this case the resize of only partition number 2 to a size 25 will fail since the
check will find the max size to be part of partition 2 since it finds no freespace
between 2 and end of disk.
Current check goes in order of partitions and will return once it finds that next partition
after 2 is 4 and sets the max possible size for 2 as 10.
To prevent this scenario before sending the partition table for the check it should be sorted
according to the partition starts.
** Affects: util-linux (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to util-linux in Ubuntu.
https://bugs.launchpad.net/bugs/1618862
Title:
lbfdisk fails to resize a partition even if it lies before freespace,
when the partition are not present on disk in order
Status in util-linux package in Ubuntu:
New
Bug description:
In util-linux libfdisk/src/partition.c
line:1082
function recount_resize()
the partition table that is passed on to the next function resize_get_last_possible()
should be sorted in order based on their start sectors and not on their partition numbers.
take this example:
partition are present in this order on the disk:
num start end size
1 0 10 11
4 11 21 10
5 22 30 9
2 31 40 10
freespace 41 60 20
in this case the resize of only partition number 2 to a size 25 will fail since the
check will find the max size to be part of partition 2 since it finds no freespace
between 2 and end of disk.
Current check goes in order of partitions and will return once it finds that next partition
after 2 is 4 and sets the max possible size for 2 as 10.
To prevent this scenario before sending the partition table for the check it should be sorted
according to the partition starts.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1618862/+subscriptions
More information about the foundations-bugs
mailing list