diff mbox

[07/25] SUNRPC: remove BUG_ON() from call_bc_transmit()

Message ID 1350405043-39316-7-git-send-email-dros@netapp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Weston Andros Adamson Oct. 16, 2012, 4:30 p.m. UTC
Replace BUG_ON() with WARN_ON_ONCE() and handle error condition by
calling rpc_exit().

Signed-off-by: Weston Andros Adamson <dros@netapp.com>
---
 net/sunrpc/clnt.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Trond Myklebust Oct. 18, 2012, 7:09 p.m. UTC | #1
On Tue, 2012-10-16 at 12:30 -0400, Weston Andros Adamson wrote:
> Replace BUG_ON() with WARN_ON_ONCE() and handle error condition by

> calling rpc_exit().

> 

> Signed-off-by: Weston Andros Adamson <dros@netapp.com>

> ---

>  net/sunrpc/clnt.c |    7 ++++++-

>  1 file changed, 6 insertions(+), 1 deletion(-)

> 

> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c

> index ced0f36..bff6438 100644

> --- a/net/sunrpc/clnt.c

> +++ b/net/sunrpc/clnt.c

> @@ -1750,7 +1750,12 @@ call_bc_transmit(struct rpc_task *task)

>  {

>  	struct rpc_rqst *req = task->tk_rqstp;

>  

> -	BUG_ON(task->tk_status != 0);

> +	WARN_ON_ONCE(task->tk_status != 0);

> +	if (task->tk_status != 0) {

> +		rpc_exit(task, task->tk_status);

> +		return;

> +	}

> +


Let's just get rid of this. Given the current use of call_bc_transmit,
it looks completely redundant.

>  	task->tk_status = xprt_prepare_transmit(task);

>  	if (task->tk_status == -EAGAIN) {

>  		/*


-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com
diff mbox

Patch

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index ced0f36..bff6438 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1750,7 +1750,12 @@  call_bc_transmit(struct rpc_task *task)
 {
 	struct rpc_rqst *req = task->tk_rqstp;
 
-	BUG_ON(task->tk_status != 0);
+	WARN_ON_ONCE(task->tk_status != 0);
+	if (task->tk_status != 0) {
+		rpc_exit(task, task->tk_status);
+		return;
+	}
+
 	task->tk_status = xprt_prepare_transmit(task);
 	if (task->tk_status == -EAGAIN) {
 		/*