From 77cd50a12887b13db4c49be6a979a5ecb8239570 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 13 Apr 2011 10:37:31 +0000 Subject: quota/(f)truncate: pass correct delta for updating parent sizes after successful completion. Signed-off-by: Raghavendra G Signed-off-by: Anand Avati BUG: 2741 (Quota: new files not getting created even if space is available) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2741 --- xlators/features/quota/src/quota.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index b68689ed9..d3b970264 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -343,7 +343,7 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this, if (ctx != NULL) { LOCK (&ctx->lock); { - if (ctx->limit > 0) { + if (ctx->limit >= 0) { if (!just_validated && quota_timeout (&ctx->tv, priv->timeout)) { @@ -750,7 +750,7 @@ quota_update_size (xlator_t *this, inode_t *inode, char *name, ino_t par, _inode = inode_ref (inode); do { - if (ctx != NULL) { + if ((ctx != NULL) && (ctx->limit >= 0)) { LOCK (&ctx->lock); { ctx->size += delta; @@ -1860,7 +1860,7 @@ quota_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - delta = prebuf->ia_size - postbuf->ia_size; + delta = postbuf->ia_size - prebuf->ia_size; quota_update_size (this, local->loc.inode, NULL, 0, delta); @@ -1936,7 +1936,7 @@ quota_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - delta = prebuf->ia_size - postbuf->ia_size; + delta = postbuf->ia_size - prebuf->ia_size; quota_update_size (this, local->loc.inode, NULL, 0, delta); -- cgit