diff options
| author | Raghavendra G <rgowdapp@redhat.com> | 2013-12-11 14:32:49 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2014-01-28 08:44:06 -0800 | 
| commit | 6daac4eaedcda41bd588cff5948d894b9a86d082 (patch) | |
| tree | 2d9f968c290570175ace67ebaa7c52a543f57961 /xlators | |
| parent | c7ba4f37b048399481e14167a9a649f13a365cf0 (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>
Reviewed-on: http://review.gluster.org/6814
Diffstat (limited to 'xlators')
| -rw-r--r-- | xlators/features/quota/src/quota.c | 13 | 
1 files changed, 9 insertions, 4 deletions
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)) {  | 
