diff options
| author | Junaid <junaid@gluster.com> | 2011-04-08 01:12:40 +0000 | 
|---|---|---|
| committer | Vijay Bellur <vijay@gluster.com> | 2011-04-08 00:20:46 -0700 | 
| commit | 12de69e4204c0dced7cccc8450954ad2e20c1075 (patch) | |
| tree | 5617547d7dc31bb86e78bb25c13164dba1fcd52d | |
| parent | ca381e5aeadb4e2fdced09c3e86b12498ce84c11 (diff) | |
features/marker: Synchronise the read and write of marker_local_ref.
Signed-off-by: Junaid <junaid@gluster.com>
Signed-off-by: Vijay Bellur <vijay@gluster.com>
BUG: 2663 (glusterfsd crash with bonnie++ when marker is enabled)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2663
| -rw-r--r-- | xlators/features/marker/src/marker.c | 6 | 
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index c84469b1547..e7a704874a8 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);  | 
