Only check the magic number and clean the tk_task queue iff the task was active. Signed-off-by: Steve Dickson ------------------------------------------------- --- nfs-2.6/net/sunrpc/sched.c.orig 2006-12-23 07:03:31.000000000 -0500 +++ nfs-2.6/net/sunrpc/sched.c 2007-01-21 06:17:32.000000000 -0500 @@ -898,16 +898,18 @@ EXPORT_SYMBOL(rpc_put_task); void rpc_release_task(struct rpc_task *task) { -#ifdef RPC_DEBUG - BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID); -#endif dprintk("RPC: %4d release task\n", task->tk_pid); - /* Remove from global task list */ - spin_lock(&rpc_sched_lock); - list_del(&task->tk_task); - spin_unlock(&rpc_sched_lock); + if (test_bit(RPC_TASK_ACTIVE, &task->tk_runstate)) { +#ifdef RPC_DEBUG + BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID); +#endif + /* Remove from global task list */ + spin_lock(&rpc_sched_lock); + list_del(&task->tk_task); + spin_unlock(&rpc_sched_lock); + } BUG_ON (RPC_IS_QUEUED(task)); /* Synchronously delete any running timer */