Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Development (http://www.linux-archive.org/fedora-development/)
-   -   Fix check for whether new lv size will fit in vg's free space. (http://www.linux-archive.org/fedora-development/540302-fix-check-whether-new-lv-size-will-fit-vgs-free-space.html)

David Lehman 06-15-2011 10:32 PM

Fix check for whether new lv size will fit in vg's free space.
 
vgSpacedUsed aligns the lv size so we don't get tripped up by
partially utilized PE.
---
pyanaconda/storage/devices.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 8c78aad..d908b76 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -2492,11 +2492,11 @@ class LVMLogicalVolumeDevice(DMDevice):
def _setSize(self, size):
size = self.vg.align(numeric_type(size))
log.debug("trying to set lv %s size to %dMB" % (self.name, size))
- if size <= (self.vg.freeSpace + self._size):
+ if size <= self.vg.freeSpace + self.vgSpaceUsed:
self._size = size
self.targetSize = size
else:
- log.debug("failed to set size: %dMB short" % (size - (self.vg.freeSpace + self._size),))
+ log.debug("failed to set size: %dMB short" % (size - (self.vg.freeSpace + self.vgSpaceUsed),))
raise ValueError("not enough free space in volume group")

size = property(StorageDevice._getSize, _setSize)
--
1.7.3.4

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


All times are GMT. The time now is 05:08 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.