From: Weston Andros Adamson <dros@netapp.com>
To: Trond.Myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org, Weston Andros Adamson <dros@netapp.com>
Subject: [PATCH 02/25] SUNRPC: remove BUG_ON from rpc_bind_new_program
Date: Tue, 16 Oct 2012 12:30:20 -0400 [thread overview]
Message-ID: <1350405043-39316-2-git-send-email-dros@netapp.com> (raw)
In-Reply-To: <1350405043-39316-1-git-send-email-dros@netapp.com>
Instead of calling BUG_ON when rpc_bind_new_program gets an invalid
rpc program version, print a KERN_ERR message and return -EINVAL.
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
---
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 abb7f5e..eacdb15 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -700,7 +700,11 @@ struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *old,
const struct rpc_version *version;
int err;
- BUG_ON(vers >= program->nrvers || !program->version[vers]);
+ if (vers >= program->nrvers || !program->version[vers]) {
+ pr_err("RPC: invalid program version %u for program %s\n",
+ vers, program->name);
+ return ERR_PTR(-EINVAL);
+ }
version = program->version[vers];
clnt = rpc_clone_client(old);
if (IS_ERR(clnt))
--
1.7.9.6 (Apple Git-31.1)
next prev parent reply other threads:[~2012-10-16 16:30 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 16:30 [PATCH 01/25] SUNRPC: remove BUG_ON in __rpc_clnt_handle_event Weston Andros Adamson
2012-10-16 16:30 ` Weston Andros Adamson [this message]
2012-10-16 16:30 ` [PATCH 03/25] SUNRPC: remove BUG_ON() from rpc_run_bc_task Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 04/25] SUNRPC: remove BUG_ON() from call_transmit() Weston Andros Adamson
2012-10-18 18:49 ` Myklebust, Trond
2012-10-18 19:10 ` Myklebust, Trond
2012-10-16 16:30 ` [PATCH 05/25] SUNRPC: remove BUG_ON() from rpc_call_sync() Weston Andros Adamson
2012-10-18 18:48 ` Myklebust, Trond
2012-10-18 19:06 ` Myklebust, Trond
2012-10-16 16:30 ` [PATCH 06/25] SUNRPC: remove BUG_ON() from call_bc_transmit() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 07/25] " Weston Andros Adamson
2012-10-18 19:09 ` Myklebust, Trond
2012-10-16 16:30 ` [PATCH 08/25] SUNRPC: remove BUG_ON() from rpc_sleep_on*() Weston Andros Adamson
2012-10-18 18:54 ` Myklebust, Trond
2012-10-16 16:30 ` [PATCH 09/25] SUNRPC: remove two BUG_ON() asserts Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 10/25] SUNRPC: remove BUG_ON() from xprt_destroy_backchannel Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 11/25] SUNRPC: remove BUG_ON() from bc_send() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 12/25] SUNRPC: remove BUG_ON() calls from cache_read() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 13/25] SUNRPC: remove BUG_ON() in rpc_put_sb_net() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 14/25] SUNRPC: remove BUG_ON() from svc_pool_map_set_cpumask() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 15/25] SUNRPC: remove BUG_ON()s from *_reclassify_socket* Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 16/25] SUNRPC: remove BUG_ON() in svc_xprt_received() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 17/25] SUNRPC: remove BUG_ON()s checking RPCSVC_MAXPAGES Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 18/25] SUNRPC: remove BUG_ON() in xdr_shrink_bufhead() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 19/25] SUNRPC: remove BUG_ON() from bc_malloc() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 20/25] SUNRPC: remove BUG_ON() from encode_rpcb_string() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 21/25] SUNRPC: remove BUG_ON() in svc_register() Weston Andros Adamson
2012-10-18 19:00 ` Myklebust, Trond
2012-10-16 16:30 ` [PATCH 22/25] SUNRPC: remove BUG_ON() from __rpc_sleep_on_priority() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 23/25] SUNRPC: remove BUG_ON()s checking RPC_IS_QUEUED() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 24/25] SUNRPC: remove BUG_ON() in svc_delete_xprt() Weston Andros Adamson
2012-10-16 16:30 ` [PATCH 25/25] SUNRPC: remove BUG_ON() in rpc_release_task() Weston Andros Adamson
-- strict thread matches above, loose matches on Subject: below --
2012-10-23 14:43 [PATCH 00/25] SUNRPC: remove many BUG_ONs Weston Andros Adamson
2012-10-23 14:43 ` [PATCH 02/25] SUNRPC: remove BUG_ON from rpc_bind_new_program Weston Andros Adamson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350405043-39316-2-git-send-email-dros@netapp.com \
--to=dros@netapp.com \
--cc=Trond.Myklebust@netapp.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).