[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [PATCH] Handle lv device and format resizes correctly (#681597)
- From: David Cantrell <dcantrell redhat com>
- To: Discussion of Development and Customization of the Red Hat Linux Installer <anaconda-devel-list redhat com>
- Subject: Re: [PATCH] Handle lv device and format resizes correctly (#681597)
- Date: Mon, 07 Mar 2011 15:03:26 -1000
Disregard, a case of me being able to unsuccessfully trace this code.
dlehman has a much nicer patch for this:
diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
index 0e86edf..1ceebd7 100644
--- a/iw/lvm_dialog_gui.py
+++ b/iw/lvm_dialog_gui.py
@@ -1177,7 +1177,7 @@ class VolumeGroupEditor:
# encrypted. in this case we must check them both.
if format.resizable and lv.format.resizable and \
lv.targetSize != format.targetSize and \
- lv.targetSize != lv.currentSize and \
+ lv.targetSize != origlv.currentSize and \
usedev.format.exists:
log.debug("resizing format on %s to %d" % (usedev.lvname, lv.targetSize))
actions.append(ActionResizeFormat(usedev, lv.targetSize))
David Cantrell <dcantrell redhat com> wrote:
> This fixes up a problem introduced with commit 758add3b, where resizing
> an existing logical volume may not cause a subsequent format resize
> action to be scheduled.
> ---
> iw/lvm_dialog_gui.py | 13 +++++++++++--
> 1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
> index 0e86edf..f11f194 100644
> --- a/iw/lvm_dialog_gui.py
> +++ b/iw/lvm_dialog_gui.py
> @@ -1173,12 +1173,21 @@ class VolumeGroupEditor:
> usedev.format.migrate = format.migrate
> actions.append(ActionMigrateFormat(usedev))
>
> + # check for a device resize action for this lv
> + subactions = filter(lambda x: x.isResize() and \
> + x.isDevice() and \
> + hasattr(x.device, "name") and \
> + lv.name.endswith(x.device.name),
> + actions)
> + haveDeviceResizeAction = False
> + if len(subactions) > 0:
> + haveDeviceResizeAction = True
> +
> # 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.targetSize and \
> - lv.targetSize != lv.currentSize and \
> - usedev.format.exists:
> + haveDeviceResizeAction 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:
> --
> 1.7.1
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list redhat com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
--
David Cantrell <dcantrell redhat com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]