lbfdisk fails to resize a partition even if it lies before freespace, when the partition are not present on disk in order

Bug #1618862 reported by rahul
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
New
Undecided
Unassigned

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 post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.