FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Desktop

 
 
LinkBack Thread Tools
 
Old 03-07-2011, 09:51 PM
David Cantrell
 
Default Handle lv device and format resizes correctly (#681597)

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
 
Old 03-08-2011, 12:03 AM
David Cantrell
 
Default Handle lv device and format resizes correctly (#681597)

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

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

Thread Tools




All times are GMT. The time now is 01:50 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org