Re: [PATCH] check for negative lvm sizes.

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

 



Joel Granados Moreno wrote:
Hi List:

There is a corner case in rhel4 in which changing the autopartitioned
storage in a certain way (see bug for more info
https://bugzilla.redhat.com/show_bug.cgi?id=144676) it will give
negative lvm volume sizes.  This patch checks to see if there are
negative values present in the calculation of the logical volume
request.  It raises an exception if it finds any.

This is my, "I looked for the root of the problem, but didn't find it"
solution.  Teste a couple of times and it seems to get rid of the
problem.  I also tested on other installs, where the bug was not
present, and the patch doesn't seem to cause any problems.

Review greatly appreciated.


I haven't looked deep enough if there is any better solution
in parts growing code.

I think your fix can get us done with the bug without
damages. Maybe I'd prefer to give error message
which is raised in all other cases where adding growing partition
would mean such shrinking of VG that already existing
LV reqests can't be satisfied. In the case
of the bug, adding of growing part eats up all the space for
growing VG, so growing LV is "grown" to negation
of size of all non-growing LV requests).

The message is:

"Adding this partition would not "
"leave enough disk space for already "
"allocated logical volumes in ..."

and is raised after growLogicalVolumes call when we
"    # make sure our logical volumes still fit".
Attached patch would do it, but I don't insist much and
am ok with your patch if you don't like it ;)

Just FYI, this bug is also present in RHEL5 and fedora.


Radek
diff --git a/autopart.py b/autopart.py
index c265942..7f47e3d 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:
_______________________________________________
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