7f4c2a
From d765d8885dabbb83baee26bef90b820978ec45cc Mon Sep 17 00:00:00 2001
7f4c2a
From: Venky Shankar <vshankar@redhat.com>
7f4c2a
Date: Tue, 2 Jun 2015 21:49:13 +0530
7f4c2a
Subject: [PATCH 079/101] contrib/timer-wheel: fix deadlock in del_timer()
7f4c2a
7f4c2a
    Backport of http://review.gluster.org/11050
7f4c2a
7f4c2a
commit eaf3bfa added mod_timers() and successfully screwed up
7f4c2a
del_timer() by incorrectly wrapping it within double lock
7f4c2a
blocks.
7f4c2a
7f4c2a
del_timer() was included before the above commit for the sake of
7f4c2a
timer API completion, thankfully noone used it till now.
7f4c2a
7f4c2a
Change-Id: I07a454a216cf09dbb84777a23630e74a1e7f2830
7f4c2a
BUG: 1231026
7f4c2a
Signed-off-by: Venky Shankar <vshankar@redhat.com>
7f4c2a
Reviewed-on: https://code.engineering.redhat.com/gerrit/50713
7f4c2a
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
7f4c2a
Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
7f4c2a
---
7f4c2a
 contrib/timer-wheel/timer-wheel.c |    2 +-
7f4c2a
 1 files changed, 1 insertions(+), 1 deletions(-)
7f4c2a
7f4c2a
diff --git a/contrib/timer-wheel/timer-wheel.c b/contrib/timer-wheel/timer-wheel.c
7f4c2a
index df8bb31..d9b2ccd 100644
7f4c2a
--- a/contrib/timer-wheel/timer-wheel.c
7f4c2a
+++ b/contrib/timer-wheel/timer-wheel.c
7f4c2a
@@ -225,7 +225,7 @@ void gf_tw_del_timer (struct tvec_base *base, struct gf_tw_timer_list *timer)
7f4c2a
                 if (timer_pending (timer))
7f4c2a
                         __gf_tw_detach_timer (timer);
7f4c2a
         }
7f4c2a
-        pthread_spin_lock (&base->lock);
7f4c2a
+        pthread_spin_unlock (&base->lock);
7f4c2a
 }
7f4c2a
 
7f4c2a
 int gf_tw_mod_timer_pending (struct tvec_base *base,
7f4c2a
-- 
7f4c2a
1.7.1
7f4c2a