RPC: Don't kill timers when calling rpc_restart_call() after rpc_delay() Currently, if we restart an RPC call after having set an RPC delay (for instance in the case where an NFS EJUKEBOX error has occurred) the call to rpc_delete_timer() at the top of the rpc_execute() loop will kill off our timer. This patch causes rpc_delete_timer() to detect if the rpc_task is still queued on a wait queue, and refuse to delete the timer if this is the case. Problem diagnosed by Jan Sanislo and Olaf Kirch. Signed-off-by: Trond Myklebust --- sched.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6.11-rc4/net/sunrpc/sched.c =================================================================== --- linux-2.6.11-rc4.orig/net/sunrpc/sched.c +++ linux-2.6.11-rc4/net/sunrpc/sched.c @@ -132,9 +132,11 @@ __rpc_add_timer(struct rpc_task *task, r * Delete any timer for the current task. Because we use del_timer_sync(), * this function should never be called while holding queue->lock. */ -static inline void +static void rpc_delete_timer(struct rpc_task *task) { + if (RPC_IS_QUEUED(task)) + return; if (test_and_clear_bit(RPC_TASK_HAS_TIMER, &task->tk_runstate)) { del_singleshot_timer_sync(&task->tk_timer); dprintk("RPC: %4d deleting timer\n", task->tk_pid);