diff options
author | Raghavendra G <raghavendra@gluster.com> | 2011-06-14 23:55:30 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-06-16 22:01:31 -0700 |
commit | 5c1c571ad6582142772351e4c106a5b1182a77bc (patch) | |
tree | 8168421553f8b59666723da16afad2cd607e1baa /xlators/features/marker/src/marker-quota.c | |
parent | d773462f7c6d1c3c81fa691fc5911641c5bf4394 (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.c')
-rw-r--r-- | xlators/features/marker/src/marker-quota.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index 84d0da9184a..2cf505ce0f2 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -108,11 +108,12 @@ dirty_inode_updation_done (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno) { quota_local_t *local = NULL; + int32_t value = 0; local = frame->local; if (!local->err) - QUOTA_SAFE_DECREMENT (&local->lock, local->ref); + QUOTA_SAFE_DECREMENT (&local->lock, local->ref, value); else frame->local = NULL; @@ -374,7 +375,7 @@ out: if (val== 0) { if (local->err) { - QUOTA_SAFE_DECREMENT (&local->lock, local->ref); + QUOTA_SAFE_DECREMENT (&local->lock, local->ref, val); quota_local_unref (this, local); } else @@ -1869,10 +1870,6 @@ mq_reduce_parent_size_xattr (call_frame_t *frame, void *cookie, goto err; } - if (local->size < 0) { - local->size = contribution->contribution; - } - QUOTA_ALLOC_OR_GOTO (size, int64_t, ret, err); *size = hton64 (-local->size); |