Message ID | 1350405043-39316-5-git-send-email-dros@netapp.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, 2012-10-16 at 12:30 -0400, Weston Andros Adamson wrote: > Return -EINVAL instead of calling BUG_ON() when RPC_TASK_ASYNC flag is passed > to rpc_call_sync(). > > Signed-off-by: Weston Andros Adamson <dros@netapp.com> > --- > net/sunrpc/clnt.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c > index 76d1730..a8a6bcf 100644 > --- a/net/sunrpc/clnt.c > +++ b/net/sunrpc/clnt.c > @@ -839,7 +839,8 @@ int rpc_call_sync(struct rpc_clnt *clnt, const struct rpc_message *msg, int flag > }; > int status; > > - BUG_ON(flags & RPC_TASK_ASYNC); > + if (flags & RPC_TASK_ASYNC) > + return -EINVAL; Needs a WARN_ON_ONCE(). This isn't a condition that the user can fix, so they need to know that it needs reporting. > > task = rpc_run_task(&task_setup_data); > if (IS_ERR(task)) -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust@netapp.com www.netapp.com
On Tue, 2012-10-16 at 12:30 -0400, Weston Andros Adamson wrote: > Return -EINVAL instead of calling BUG_ON() when RPC_TASK_ASYNC flag is passed > to rpc_call_sync(). > > Signed-off-by: Weston Andros Adamson <dros@netapp.com> > --- > net/sunrpc/clnt.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c > index 76d1730..a8a6bcf 100644 > --- a/net/sunrpc/clnt.c > +++ b/net/sunrpc/clnt.c > @@ -839,7 +839,8 @@ int rpc_call_sync(struct rpc_clnt *clnt, const struct rpc_message *msg, int flag > }; > int status; > > - BUG_ON(flags & RPC_TASK_ASYNC); > + if (flags & RPC_TASK_ASYNC) > + return -EINVAL; BTW: This needs to call rpc_release_calldata() before exiting. > > task = rpc_run_task(&task_setup_data); > if (IS_ERR(task)) -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust@netapp.com www.netapp.com
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 76d1730..a8a6bcf 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -839,7 +839,8 @@ int rpc_call_sync(struct rpc_clnt *clnt, const struct rpc_message *msg, int flag }; int status; - BUG_ON(flags & RPC_TASK_ASYNC); + if (flags & RPC_TASK_ASYNC) + return -EINVAL; task = rpc_run_task(&task_setup_data); if (IS_ERR(task))
Return -EINVAL instead of calling BUG_ON() when RPC_TASK_ASYNC flag is passed to rpc_call_sync(). Signed-off-by: Weston Andros Adamson <dros@netapp.com> --- net/sunrpc/clnt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)