diff options
author | Karel Zak | 2017-06-19 15:32:02 +0200 |
---|---|---|
committer | Karel Zak | 2017-06-19 15:32:02 +0200 |
commit | 5ec4400dec75864b475a8099ba31807fd1272af4 (patch) | |
tree | 6ae00a98f476f5200e5e6d294083c498e355f5e3 /libfdisk | |
parent | libfdisk: add more debug messages to get-last-possible resize space (diff) | |
download | kernel-qcow2-util-linux-5ec4400dec75864b475a8099ba31807fd1272af4.tar.gz kernel-qcow2-util-linux-5ec4400dec75864b475a8099ba31807fd1272af4.tar.xz kernel-qcow2-util-linux-5ec4400dec75864b475a8099ba31807fd1272af4.zip |
libfdisk: allow to resize container
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk')
-rw-r--r-- | libfdisk/src/partition.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libfdisk/src/partition.c b/libfdisk/src/partition.c index 58d294335..4455432cd 100644 --- a/libfdisk/src/partition.c +++ b/libfdisk/src/partition.c @@ -1070,11 +1070,18 @@ static int resize_get_last_possible( if (!fdisk_partition_has_start(pa) || !fdisk_partition_has_size(pa) || - fdisk_partition_is_container(pa)) { + (fdisk_partition_is_container(pa) && pa != cur)) { DBG(TAB, ul_debugobj(tb, " ignored (no start/size or container)")); continue; } + if (fdisk_partition_is_nested(pa) + && fdisk_partition_is_container(cur) + && pa->parent_partno == cur->partno) { + DBG(TAB, ul_debugobj(tb, " ignore (nested child of the current partition)")); + continue; + } + if (!last) { if (start >= pa->start && start < pa->start + pa->size) { if (fdisk_partition_is_freespace(pa) || pa == cur) { |