From 44d644729b57ffbf71c70f21df0ffdd1e5fbb7c7 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 11 Dec 2013 14:32:49 +0530 Subject: features/quota: log usage only if hard limit not exceeded. Change-Id: I60abf576999996e0d0d65534e1e416f6e10994c8 Signed-off-by: Raghavendra G BUG: 969461 Reviewed-on: http://review.gluster.org/6479 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/quota/src/quota.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'xlators/features/quota') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 7156edcad..a531ab123 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)) { -- cgit