[master 1/2] Fix minSize for extended partitions (#1254875)
vojtechtrefny
installerbot-noreply at redhat.com
Wed Sep 16 07:51:52 UTC 2015
From: Vojtech Trefny <vtrefny at redhat.com>
---
blivet/devices/partition.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
index ed5e6c8..bbf965a 100644
--- a/blivet/devices/partition.py
+++ b/blivet/devices/partition.py
@@ -799,7 +799,18 @@ def readCurrentSize(self):
@property
def minSize(self):
- min_size = super(PartitionDevice, self).minSize
+ if self.isExtended:
+ logicals = self.disk.format.logicalPartitions
+ if logicals:
+ end_free = Size((self.partedPartition.geometry.end - logicals[-1].geometry.end) * \
+ self.disk.format.sectorSize)
+ min_size = self.alignTargetSize(self.currentSize - end_free)
+ else:
+ min_size = self.alignTargetSize(max(Size("1 KiB"), self.disk.format.alignment.grainSize))
+
+ else:
+ min_size = super(PartitionDevice, self).minSize
+
if self.resizable and min_size:
# Adjust the min size as needed so that aligning the end sector
# won't drive the actual size below the formatting's minimum.
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/3ab9b95dc552e0c3fc5f2261976cb767c819a17b
More information about the anaconda-patches
mailing list