summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2013-12-11 14:32:49 +0530
committerVijay Bellur <vbellur@redhat.com>2013-12-15 21:06:09 -0800
commit44d644729b57ffbf71c70f21df0ffdd1e5fbb7c7 (patch)
tree5b2b707dac9134e98d960b29b4d7082bc19ec474 /xlators
parent51a614384e694f37d957a3aa3a562c34877e71d5 (diff)
features/quota: log usage only if hard limit not exceeded.
Change-Id: I60abf576999996e0d0d65534e1e416f6e10994c8 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> BUG: 969461 Reviewed-on: http://review.gluster.org/6479 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/quota/src/quota.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index 7156edcad1c..a531ab1231a 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -732,10 +732,6 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this,
}
UNLOCK (&ctx->lock);
- /* We log usage only if quota limit is configured on
- that inode. */
- quota_log_usage (this, ctx, _inode, delta);
-
if (need_validate) {
ret = quota_validate (frame, _inode, this,
quota_validate_cbk);
@@ -763,7 +759,16 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this,
= space_available;
}
+
+ if (space_available == 0) {
+ op_errno = EDQUOT;
+ goto err;
+ }
}
+
+ /* We log usage only if quota limit is configured on
+ that inode. */
+ quota_log_usage (this, ctx, _inode, delta);
}
if (__is_root_gfid (_inode->gfid)) {