diff options
author | Weston Andros Adamson <dros@netapp.com> | 2012-11-01 16:04:40 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-04 14:43:43 -0500 |
commit | 50d2bdb19734f9e9f21e63881a9b6c8db4cc0eb7 (patch) | |
tree | a4d8c39731654e5791a587e471193ca73f664720 /net | |
parent | 0a0c2a57bc9a47ae876077fdc4678eca33c26ae4 (diff) |
SUNRPC: remove BUG_ON from rpc_call_sync
Use WARN_ON_ONCE instead of calling BUG_ON and return -EINVAL when
RPC_TASK_ASYNC flag is passed to rpc_call_sync.
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/clnt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index a9dd1e835f70..50bc9db8762c 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -842,7 +842,12 @@ int rpc_call_sync(struct rpc_clnt *clnt, const struct rpc_message *msg, int flag | |||
842 | }; | 842 | }; |
843 | int status; | 843 | int status; |
844 | 844 | ||
845 | BUG_ON(flags & RPC_TASK_ASYNC); | 845 | WARN_ON_ONCE(flags & RPC_TASK_ASYNC); |
846 | if (flags & RPC_TASK_ASYNC) { | ||
847 | rpc_release_calldata(task_setup_data.callback_ops, | ||
848 | task_setup_data.callback_data); | ||
849 | return -EINVAL; | ||
850 | } | ||
846 | 851 | ||
847 | task = rpc_run_task(&task_setup_data); | 852 | task = rpc_run_task(&task_setup_data); |
848 | if (IS_ERR(task)) | 853 | if (IS_ERR(task)) |