From: Morgan Fainberg Date: Sat, 8 Jun 2013 00:18:59 +0000 (-0700) Subject: Minor Logic bug in NFS Driver. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4ecfcc3b17494845e3845d89246112743483f8cf;p=openstack-build%2Fcinder-build.git Minor Logic bug in NFS Driver. 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 --- diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py index c486b8abd..b83e3727e 100644 --- a/cinder/volume/drivers/nfs.py +++ b/cinder/volume/drivers/nfs.py @@ -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