]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Minor Logic bug in NFS Driver.
authorMorgan Fainberg <m@metacloud.com>
Sat, 8 Jun 2013 00:18:59 +0000 (17:18 -0700)
committerMorgan Fainberg <m@metacloud.com>
Sat, 8 Jun 2013 00:32:42 +0000 (17:32 -0700)
When checking oversubscription rate, we need to ensure that we
check the _allocated_ (apparant size) not the _available_ (actual
usage) on the NFS share.  This fix ensures we are now checking the
correct values.  This bug allowed (effectively) a one-time
volume allocation that would push the "apparant" size over the
oversubscription rate.

Change-Id: I189b689cb76ac2a243aa6e255ce0c80d86e247ce
Fixes: bug #1188877
cinder/volume/drivers/nfs.py

index c486b8abd04abedfefc5dea84efad620b283381a..b83e3727e111130de20d031dbe8658b1866f754b 100644 (file)
@@ -346,10 +346,10 @@ class NfsDriver(RemoteFsDriver):
                 # NOTE(morganfainberg): If we are setup for oversubscription
                 # we need to calculate the apparent available space instead
                 # of just using the _actual_ available space.
-                if (total_available * oversub_ratio) < requested_volume_size:
+                if (total_allocated * oversub_ratio) < requested_volume_size:
                     LOG.debug(_('%s is above nfs_oversub_ratio'), nfs_share)
                     continue
-            elif total_available <= requested_volume_size:
+            elif total_allocated <= requested_volume_size:
                 LOG.debug(_('%s is above nfs_oversub_ratio'), nfs_share)
                 continue