Re: [PATCH] Handle lv device and format resizes correctly (#681597)

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

 



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@xxxxxxxxxx> 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@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

-- 
David Cantrell <dcantrell@xxxxxxxxxx>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10

_______________________________________________
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