summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/src/marker-quota-helper.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-06-14 23:55:30 +0000
committerAnand Avati <avati@gluster.com>2011-06-16 22:01:31 -0700
commit5c1c571ad6582142772351e4c106a5b1182a77bc (patch)
tree8168421553f8b59666723da16afad2cd607e1baa /xlators/features/marker/src/marker-quota-helper.c
parentd773462f7c6d1c3c81fa691fc5911641c5bf4394 (diff)
features/marker-quota: check for refcount being zero holding lock in quota_local_unref.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2697 (Quota: add-brick creates the size go awkward, though it was perfect earlier) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2697
Diffstat (limited to 'xlators/features/marker/src/marker-quota-helper.c')
-rw-r--r--xlators/features/marker/src/marker-quota-helper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c
index c56f8eac7d5..a559da808f8 100644
--- a/xlators/features/marker/src/marker-quota-helper.c
+++ b/xlators/features/marker/src/marker-quota-helper.c
@@ -356,12 +356,13 @@ quota_local_ref (quota_local_t *local)
int32_t
quota_local_unref (xlator_t *this, quota_local_t *local)
{
+ int32_t ref = 0;
if (local == NULL)
goto out;
- QUOTA_SAFE_DECREMENT (&local->lock, local->ref);
+ QUOTA_SAFE_DECREMENT (&local->lock, local->ref, ref);
- if (local->ref > 0)
+ if (ref > 0)
goto out;
if (local->fd != NULL)