lvm: check resizing against format's targetSize (#580171).
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 ++++----
1 files changed, 4 insertions(+), 4 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
--
1.6.6
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
04-16-2010, 03:23 PM
David Lehman
lvm: check resizing against format's targetSize (#580171).
On Fri, 2010-04-16 at 13:58 +0200, Ales Kozumplik wrote:
> 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.
Since you'll now be relying on targetSize to match currentSize when no
resize has been requested, you probably need to change
storage.formats.FS._setTargetSize so that a new value of None sets
self._targetSize to self.currentSize instead of None.
Otherwise, ack.
Dave
> ---
> iw/lvm_dialog_gui.py | 8 ++++----
> 1 files changed, 4 insertions(+), 4 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
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
04-19-2010, 04:07 PM
Ales Kozumplik
lvm: check resizing against format's targetSize (#580171).
On 04/16/2010 05:23 PM, David Lehman wrote:
Since you'll now be relying on targetSize to match currentSize when no
resize has been requested, you probably need to change
storage.formats.FS._setTargetSize so that a new value of None sets
self._targetSize to self.currentSize instead of None.
Otherwise, ack.
Dave
Hi Dave,
I can't find a place where we do format.targetSize = None or similar.
And upon initialization, _targetSize is set to _size according to
FS.__init__().
Also currently the FS._setCurrentSize() method sort of reflects what it
does in StorageDevice, that is not thinking too much, just assigning the
value, whatever it is.
So is this really necessary and won't break the current arrangement?
Ales
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
04-20-2010, 05:57 PM
Ales Kozumplik
lvm: check resizing against format's targetSize (#580171).
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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list