]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
SUNRPC: remove BUG_ON from rpc_sleep_on*
authorWeston Andros Adamson <dros@netapp.com>
Tue, 23 Oct 2012 14:43:32 +0000 (10:43 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 4 Nov 2012 19:43:40 +0000 (14:43 -0500)
Replace BUG_ON() with WARN_ON_ONCE() and clean up after inactive task.

Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/sched.c

index 6357fcb00c7e2046f8acb901d7005429d23158cd..f494b356e87678ee8ea745a60c4a0eefabd12bf2 100644 (file)
@@ -343,7 +343,12 @@ void rpc_sleep_on(struct rpc_wait_queue *q, struct rpc_task *task,
                                rpc_action action)
 {
        /* We shouldn't ever put an inactive task to sleep */
-       BUG_ON(!RPC_IS_ACTIVATED(task));
+       WARN_ON_ONCE(!RPC_IS_ACTIVATED(task));
+       if (!RPC_IS_ACTIVATED(task)) {
+               task->tk_status = -EIO;
+               rpc_put_task_async(task);
+               return;
+       }
 
        /*
         * Protect the queue operations.
@@ -358,7 +363,12 @@ void rpc_sleep_on_priority(struct rpc_wait_queue *q, struct rpc_task *task,
                rpc_action action, int priority)
 {
        /* We shouldn't ever put an inactive task to sleep */
-       BUG_ON(!RPC_IS_ACTIVATED(task));
+       WARN_ON_ONCE(!RPC_IS_ACTIVATED(task));
+       if (!RPC_IS_ACTIVATED(task)) {
+               task->tk_status = -EIO;
+               rpc_put_task_async(task);
+               return;
+       }
 
        /*
         * Protect the queue operations.