Commit bb13f3d0 authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent c85f50f0
......@@ -132,9 +132,11 @@ __rpc_add_timer(struct rpc_task *task, rpc_action timer)
* 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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment