Adam Litke has uploaded a new change for review.

Change subject: Do not extend volume beyond truesize
......................................................................

Do not extend volume beyond truesize

When calling getNextVolumeSize on a volume that is close to fully
allocated, the function can return a value larger than the volume's real
capacity.  Add an explicit ceiling to prevent this.

Change-Id: Ib616224d88c886700a7f121eaf6da84ba8276e55
Signed-off-by: Adam Litke <ali...@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1155583
---
M vdsm/virt/vm.py
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/35757/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index adad036..a986327 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -868,8 +868,9 @@
         to be extended.  For the leaf volume curSize == self.apparentsize.
         For internal volumes it is discovered by calling irs.getVolumeSize().
         """
-        return (self.volExtensionChunk +
-                ((curSize + constants.MEGAB - 1) / constants.MEGAB))
+        nextSize = (self.volExtensionChunk +
+                    ((curSize + constants.MEGAB - 1) / constants.MEGAB))
+        return min(nextSize, self.truesize)
 
     @property
     def networkDev(self):


-- 
To view, visit http://gerrit.ovirt.org/35757
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib616224d88c886700a7f121eaf6da84ba8276e55
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <ali...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to