From b27ab7737f76d2a65e790afe3872f16dc3e7e078 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 2 Jun 2015 21:49:13 +0530 Subject: contrib/timer-wheel: fix deadlock in del_timer() Backport of http://review.gluster.org/11050 commit eaf3bfa added mod_timers() and successfully screwed up del_timer() by incorrectly wrapping it within double lock blocks. del_timer() was included before the above commit for the sake of timer API completion, thankfully noone used it till now. Change-Id: I07a454a216cf09dbb84777a23630e74a1e7f2830 BUG: 1227611 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/11056 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Raghavendra Bhat --- contrib/timer-wheel/timer-wheel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/timer-wheel/timer-wheel.c b/contrib/timer-wheel/timer-wheel.c index df8bb31fe87..d9b2ccdc68a 100644 --- a/contrib/timer-wheel/timer-wheel.c +++ b/contrib/timer-wheel/timer-wheel.c @@ -225,7 +225,7 @@ void gf_tw_del_timer (struct tvec_base *base, struct gf_tw_timer_list *timer) if (timer_pending (timer)) __gf_tw_detach_timer (timer); } - pthread_spin_lock (&base->lock); + pthread_spin_unlock (&base->lock); } int gf_tw_mod_timer_pending (struct tvec_base *base, -- cgit