From 12de69e4204c0dced7cccc8450954ad2e20c1075 Mon Sep 17 00:00:00 2001 From: Junaid Date: Fri, 8 Apr 2011 01:12:40 +0000 Subject: features/marker: Synchronise the read and write of marker_local_ref. Signed-off-by: Junaid Signed-off-by: Vijay Bellur BUG: 2663 (glusterfsd crash with bonnie++ when marker is enabled) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2663 --- xlators/features/marker/src/marker.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index c84469b15..e7a704874 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -158,16 +158,18 @@ marker_error_handler (xlator_t *this) int32_t marker_local_unref (marker_local_t *local) { + int32_t var = 0; + if (local == NULL) return -1; LOCK (&local->lock); { - local->ref--; + var = --local->ref; } UNLOCK (&local->lock); - if (local->ref != 0) + if (var != 0) goto out; loc_wipe (&local->loc); -- cgit