Federico Simoncelli has uploaded a new change for review.
Change subject: fileVolume: improve size checks in _extendSizeRaw
......................................................................
fileVolume: improve size checks in _extendSizeRaw
Change-Id: I87695d67bd912f084e99314cff4ce42fd9d4cd2c
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/fileVolume.py
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/19508/1
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 4525b0e..33d97d9 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -578,7 +578,12 @@
# No real sanity checks here, they should be included in the calling
# function/method. We just validate the sizes to be consistent since
# they're computed and used in the pre-allocated case.
- if (newSizeBytes <= curSizeBytes):
+ if newSizeBytes == curSizeBytes:
+ return # Nothing to do
+ elif curSizeBytes <= 0:
+ raise se.StorageException(
+ "Volume size is impossible: %s" % curSizeBytes)
+ elif newSizeBytes < curSizeBytes:
raise se.VolumeResizeValueError(newSize)
if self.getVolType() == volume.PREALLOCATED_VOL:
--
To view, visit
http://gerrit.ovirt.org/19508
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I87695d67bd912f084e99314cff4ce42fd9d4cd2c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>