[PATCH] Do a check in lvm grow to catch negative sizes (#144676)

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

 



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.  For the case described in
the bug, raising an exception is the right thing to do.
---
 autopart.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/autopart.py b/autopart.py
index c265942..77ac650 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:
+                    raise PartitioningError, _("Could not allocate partitions")
+
 		completed.append(req)
 
 	    if nochange:
-- 
1.6.0.6

_______________________________________________
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