From 01d67311c83ae272f3ee3632c1e8f13ccebaca81 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 9 Jun 2011 00:00:10 +0000 Subject: features/quota: after validation on a path, reset variable just_validated to zero before checking the size of parent. 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 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'xlators/features/quota') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 5d1f304f..dc3ed30a 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -336,8 +336,16 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this, _inode = inode_ref (inode); - just_validated = local->just_validated; - local->just_validated = 0; + LOCK (&local->lock); + { + just_validated = local->just_validated; + local->just_validated = 0; + + if (just_validated) { + local->validate_count--; + } + } + UNLOCK (&local->lock); do { if (ctx != NULL) { @@ -388,6 +396,7 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this, inode_unref (_inode); _inode = parent; + just_validated = 0; if (_inode == NULL) { break; @@ -406,10 +415,6 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this, LOCK (&local->lock); { - if (just_validated) { - local->validate_count--; - } - validate_count = local->validate_count; link_count = local->link_count; if ((validate_count == 0) && (link_count == 0)) { -- cgit