diff options
author | Raghavendra G <raghavendra@gluster.com> | 2011-06-09 00:00:10 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-06-16 09:15:58 -0700 |
commit | 01d67311c83ae272f3ee3632c1e8f13ccebaca81 (patch) | |
tree | 2df137bf865658715b61557d6cda7b09ad27b5c6 /xlators/features/quota/src | |
parent | 9d2b83aaecd66c161863379be3ec22d45ffbe4fb (diff) |
features/quota: after validation on a path, reset variable just_validated to zero before checking the size of parent.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
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
Diffstat (limited to 'xlators/features/quota/src')
-rw-r--r-- | xlators/features/quota/src/quota.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 5d1f304f4..dc3ed30a7 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)) { |