[PATCH] Clamp the lv size on LV device creation. (#480793)

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

 



We have managed to plug most pe size errors from the grow logic.  But
sometimes when LV do not go threw the grow logic they do not get
clamped.  This patch helps avoid troubles with unclamped non-growable
LVs.
---
 partRequests.py |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/partRequests.py b/partRequests.py
index 2942fa6..26b77f0 100644
--- a/partRequests.py
+++ b/partRequests.py
@@ -855,7 +855,18 @@ class LogicalVolumeRequestSpec(RequestSpec):
         """Return a device which can be solidified."""
         vg = partitions.getRequestByID(self.volumeGroup)
         vgname = vg.volumeGroupName
-        self.dev = fsset.LogicalVolumeDevice(vgname, self.size,
+
+        # we must pass the clamped size just in case.  When the request has
+        # gone through a grow process, it will have the clamped size.  But if
+        # it is not-growable, we need to make sure.  Don't touch if its
+        # preexisting.  We dont change self.size, because we don't want to be
+        # intrusive.
+        size = self.size
+        if self.preexist != 1:
+            vgreq = partitions.getRequestByID(self.volumeGroup)
+            size = lvm.clampLVSizeRequest(size, vgreq.pesize)
+
+        self.dev = fsset.LogicalVolumeDevice(vgname, size,
                                              self.logicalVolumeName,
                                              existing = self.preexist)
         return self.dev
-- 
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