[PATCH 1/2] Resize: Update format size if aligning partition shrinks it. (#689179)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 pyanaconda/iw/autopart_type.py        |    4 ++++
 pyanaconda/iw/partition_dialog_gui.py |    2 ++
 pyanaconda/storage/partitioning.py    |    3 +++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/iw/autopart_type.py b/pyanaconda/iw/autopart_type.py
index d4ee6cb..e915e2a 100644
--- a/pyanaconda/iw/autopart_type.py
+++ b/pyanaconda/iw/autopart_type.py
@@ -133,6 +133,10 @@ def whichToShrink(storage, intf):
                                  % {'name': request.name, 'msg': e.message},
                                type="warning", custom_icon="error")
             continue
+        else:
+            # aligning the new partition end sector may have changed its size
+            if request.targetSize != request.format.targetSize:
+                request.format.targetSize = request.targetSize
 
         runResize = False
 
diff --git a/pyanaconda/iw/partition_dialog_gui.py b/pyanaconda/iw/partition_dialog_gui.py
index f19d2ea..d05bfdb 100644
--- a/pyanaconda/iw/partition_dialog_gui.py
+++ b/pyanaconda/iw/partition_dialog_gui.py
@@ -370,6 +370,8 @@ class PartitionEditor:
 
                     try:
                         actions.append(ActionResizeDevice(request, size))
+                        # aligning the new end sector may have changed the size
+                        size = request.targetSize
                         if request.format.type and request.format.exists:
                             actions.append(ActionResizeFormat(request, size))
                     except ValueError:
diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index 339edec..f4b6584 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -236,6 +236,9 @@ def scheduleShrinkActions(storage):
                                 % path)
         storage.devicetree.registerAction(ActionResizeFormat(device, size))
         storage.devicetree.registerAction(ActionResizeDevice(device, size))
+        # aligning the partition's new end sector may have changed the size
+        if device.targetSize != size:
+            device.format.targetSize = device.targetSize
 
 def doAutoPartition(anaconda):
     log.debug("doAutoPartition(%s)" % anaconda)
-- 
1.7.3.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux