On Tue, 2012-10-23 at 10:43 -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@xxxxxxxxxx> > --- > net/sunrpc/clnt.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c > index dd16e52..0c0035f 100644 > --- a/net/sunrpc/clnt.c > +++ b/net/sunrpc/clnt.c > @@ -839,7 +839,11 @@ 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) { This definitely needs a WARN_ON_ONCE: it's a programmer error, not an application error... > + rpc_release_calldata(task_setup_data.callback_ops, > + task_setup_data.callback_data); > + return -EINVAL; > + } > > task = rpc_run_task(&task_setup_data); > if (IS_ERR(task)) -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust@xxxxxxxxxx www.netapp.com ��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥