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