diff options
author | Joel Granados Moreno <jgranado@redhat.com> | 2009-02-03 20:50:53 +0100 |
---|---|---|
committer | Joel Granados Moreno <jgranado@redhat.com> | 2009-02-03 21:43:59 +0100 |
commit | e88824b5cb6a05df8acba7169cd0c915f0c9e100 (patch) | |
tree | 011037558d85a2932776f64366124b21f9701612 | |
parent | b8023a175e7683ba3fbfb5b66d630b4d75110f2c (diff) | |
download | anaconda-e88824b5cb6a05df8acba7169cd0c915f0c9e100.tar.gz anaconda-e88824b5cb6a05df8acba7169cd0c915f0c9e100.tar.xz anaconda-e88824b5cb6a05df8acba7169cd0c915f0c9e100.zip |
Clamp the lv size on LV device creation. (#480793)
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.
-rw-r--r-- | partRequests.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/partRequests.py b/partRequests.py index 2942fa6aa..26b77f05a 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 |