RPC: More aggressive RPC debugging code. People are worrying about spinlock deadlocks in the debugging code, without actually worrying about the bugs that triggered the debugging code in the first place. Convert to BUG_ON() in order to ensure that bugs are reported. Signed-off-by: Trond Myklebust --- sched.c | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-) Index: linux-2.6.10/net/sunrpc/sched.c =================================================================== --- linux-2.6.10.orig/net/sunrpc/sched.c 2004-12-29 07:09:32.127091821 +0100 +++ linux-2.6.10/net/sunrpc/sched.c 2004-12-29 07:14:15.555791682 +0100 @@ -25,6 +25,7 @@ #ifdef RPC_DEBUG #define RPCDBG_FACILITY RPCDBG_SCHED +#define RPC_TASK_MAGIC_ID 0xf00baa static int rpc_task_id; #endif @@ -346,12 +347,7 @@ static void __rpc_do_wake_up_task(struct dprintk("RPC: %4d __rpc_wake_up_task (now %ld)\n", task->tk_pid, jiffies); #ifdef RPC_DEBUG - if (task->tk_magic != 0xf00baa) { - printk(KERN_ERR "RPC: attempt to wake up non-existing task!\n"); - rpc_debug = ~0; - rpc_show_tasks(); - return; - } + BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID); #endif /* Has the task been executed yet? If not, we cannot wake it up! */ if (!RPC_IS_ACTIVATED(task)) { @@ -769,7 +765,7 @@ void rpc_init_task(struct rpc_task *task } #ifdef RPC_DEBUG - task->tk_magic = 0xf00baa; + task->tk_magic = RPC_TASK_MAGIC_ID; task->tk_pid = rpc_task_id++; #endif /* Add to global list of all tasks */ @@ -834,12 +830,7 @@ void rpc_release_task(struct rpc_task *t dprintk("RPC: %4d release task\n", task->tk_pid); #ifdef RPC_DEBUG - if (task->tk_magic != 0xf00baa) { - printk(KERN_ERR "RPC: attempt to release a non-existing task!\n"); - rpc_debug = ~0; - rpc_show_tasks(); - return; - } + BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID); #endif /* Remove from global task list */