SUNRPC: remove BUG_ONs from *_reclassify_socket*

Replace multiple BUG_ON() calls with WARN_ON_ONCE() and early return when
sanity checking socket ownership (lock). The bind call will fail if the
socket was unsuccessfully reclassified.

Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Weston Andros Adamson
2012-10-23 10:43:39 -04:00
committed by Trond Myklebust
parent 1bd58aaff4
commit 1b7a181907
2 changed files with 9 additions and 4 deletions

View File

@@ -84,7 +84,11 @@ static struct lock_class_key svc_slock_key[2];
static void svc_reclassify_socket(struct socket *sock)
{
struct sock *sk = sock->sk;
BUG_ON(sock_owned_by_user(sk));
WARN_ON_ONCE(sock_owned_by_user(sk));
if (sock_owned_by_user(sk))
return;
switch (sk->sk_family) {
case AF_INET:
sock_lock_init_class_and_name(sk, "slock-AF_INET-NFSD",