summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarun Shastry <vshastry@redhat.com>2013-10-23 16:10:31 +0530
committerVijay Bellur <vbellur@redhat.com>2014-01-28 22:43:04 -0800
commit3ab5d0672c7ef8a46e1b711e1593748bed407d32 (patch)
tree596ff04aa178acd9c5b1a4334c5dbbcc94861cbe
parent6dfe01d7e726675913e98dc65c6c7406e5060e15 (diff)
features/quota: Correct the statfs calculation when set limit is beyond ...
actual disk space. Fixed one of the cases where 'df' values data show wrong when the quota limit is greater than back-end disk space. Change-Id: I09fb71a37602c6f3daf6b91dd3fd19b7f5f76817 BUG: 969461 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/6126 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/features/quota/src/quota.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index 2812a2b13a9..416d9ce652a 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -3561,11 +3561,9 @@ quota_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
buf->f_blocks = blocks;
avail = buf->f_blocks - usage;
- avail = (avail >= 0) ? avail : 0;
+ avail = max (avail, 0);
- if (buf->f_bfree > avail) {
- buf->f_bfree = avail;
- }
+ buf->f_bfree = avail;
/*
* We have to assume that the total assigned quota
* won't cause us to dip into the reserved space,