summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Granados Moreno <jgranado@redhat.com>2009-01-13 15:49:39 +0100
committerJoel Granados Moreno <jgranado@redhat.com>2009-01-14 14:09:20 +0100
commit6e634f25889d1e1634379631189831150d2814f1 (patch)
tree719ce7e2a8b365269c51b5c33f44bb19f9fd54a0
parente0658e396476e3ab6138396b6859e3bdaa52fd79 (diff)
downloadanaconda-6e634f25889d1e1634379631189831150d2814f1.tar.gz
anaconda-6e634f25889d1e1634379631189831150d2814f1.tar.xz
anaconda-6e634f25889d1e1634379631189831150d2814f1.zip
Do a check in lvm grow to catch negative sizes (#144676)
I'm guessing the error occurs during the partgrow function and/or the lvmgrow function. In either case its easier to just make sure that the values are ok and raise an exception if not. When req.size is set to 0, the exception is raised by the sanity checks.
-rw-r--r--autopart.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/autopart.py b/autopart.py
index c26594277..7f47e3d53 100644
--- a/autopart.py
+++ b/autopart.py
@@ -590,6 +590,9 @@ def growLogicalVolumes(diskset, requests):
if DEBUG_LVM_GROW:
log("Name, size, cursize, vgfree, fraction = %s %s %s %s %s", req.logicalVolumeName, req.size, cursize[req.logicalVolumeName], vgfree, fraction)
+ if req.size < 0:
+ req.size = 0
+
completed.append(req)
if nochange: