[rhel6-branch] lvm: check resizing against format's targetSize (#580171).

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

 



lv.format.currentSize remains on the original value all the time. This
means that when the user resize the LV once, currentSize stays the same
and the test for change in lvm_dialog_gui.py always succeeds every time
the user reopens the LV edit dialog. This causes a traceback just below,
in ActionResizeFormat.
---
 iw/lvm_dialog_gui.py  |    8 ++++----
 storage/formats/fs.py |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
index b45c263..c06855b 100644
--- a/iw/lvm_dialog_gui.py
+++ b/iw/lvm_dialog_gui.py
@@ -1152,10 +1152,10 @@ class VolumeGroupEditor:
                     # check the lv's format also, explicitly, in case it is
                     # encrypted. in this case we must check them both.
                     if format.resizable and lv.format.resizable and \
-                       lv.targetSize != format.currentSize and \
-                       usedev.format.exists:
-                        new_size = lv.targetSize
-                        actions.append(ActionResizeFormat(usedev, new_size))
+                            lv.targetSize != format.targetSize and \
+                            usedev.format.exists:
+                        log.debug("resizing format on %s to %d" % (usedev.lvname, lv.targetSize))
+                        actions.append(ActionResizeFormat(usedev, lv.targetSize))
                 elif lv.format.type:
                     log.debug("new format: %s" % lv.format.type)
                     # destroy old format and any associated luks devices
diff --git a/storage/formats/fs.py b/storage/formats/fs.py
index 2fe9e80..bad8558 100644
--- a/storage/formats/fs.py
+++ b/storage/formats/fs.py
@@ -189,7 +189,7 @@ class FS(DeviceFormat):
 
         if newsize is None:
             # unset any outstanding resize request
-            self._targetSize = None
+            self._targetSize = self._size
             return
 
         if not self.minSize <= newsize < self.maxSize:
-- 
1.6.6

_______________________________________________
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