From 24b6f31e667dfa502b5e05312a1e55b8e3524381 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 8 Mar 2003 06:05:36 -0800 Subject: [PATCH] [PATCH] rpc_delete_timer race fix Patch from Ulrich Weigand Fix a race wherein timer_pending() returns false, but the timer handler is actually running on another CPU. We need to call del_timer_sync() regardless, so we wait for completion of the handler. --- net/sunrpc/sched.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index b36d08d5e71f0..87186b5fef428 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -158,10 +158,8 @@ void rpc_add_timer(struct rpc_task *task, rpc_action timer) static inline void rpc_delete_timer(struct rpc_task *task) { - if (timer_pending(&task->tk_timer)) { + if (del_timer_sync(&task->tk_timer)) dprintk("RPC: %4d deleting timer\n", task->tk_pid); - del_timer_sync(&task->tk_timer); - } } /* -- 2.53.0