diff options
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r-- | net/sunrpc/xprtsock.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 75853cabf4c9..46c1a8798ed8 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -1746,7 +1746,6 @@ static inline void xs_reclassify_socketu(struct socket *sock) | |||
1746 | { | 1746 | { |
1747 | struct sock *sk = sock->sk; | 1747 | struct sock *sk = sock->sk; |
1748 | 1748 | ||
1749 | BUG_ON(sock_owned_by_user(sk)); | ||
1750 | sock_lock_init_class_and_name(sk, "slock-AF_LOCAL-RPC", | 1749 | sock_lock_init_class_and_name(sk, "slock-AF_LOCAL-RPC", |
1751 | &xs_slock_key[1], "sk_lock-AF_LOCAL-RPC", &xs_key[1]); | 1750 | &xs_slock_key[1], "sk_lock-AF_LOCAL-RPC", &xs_key[1]); |
1752 | } | 1751 | } |
@@ -1755,7 +1754,6 @@ static inline void xs_reclassify_socket4(struct socket *sock) | |||
1755 | { | 1754 | { |
1756 | struct sock *sk = sock->sk; | 1755 | struct sock *sk = sock->sk; |
1757 | 1756 | ||
1758 | BUG_ON(sock_owned_by_user(sk)); | ||
1759 | sock_lock_init_class_and_name(sk, "slock-AF_INET-RPC", | 1757 | sock_lock_init_class_and_name(sk, "slock-AF_INET-RPC", |
1760 | &xs_slock_key[0], "sk_lock-AF_INET-RPC", &xs_key[0]); | 1758 | &xs_slock_key[0], "sk_lock-AF_INET-RPC", &xs_key[0]); |
1761 | } | 1759 | } |
@@ -1764,13 +1762,16 @@ static inline void xs_reclassify_socket6(struct socket *sock) | |||
1764 | { | 1762 | { |
1765 | struct sock *sk = sock->sk; | 1763 | struct sock *sk = sock->sk; |
1766 | 1764 | ||
1767 | BUG_ON(sock_owned_by_user(sk)); | ||
1768 | sock_lock_init_class_and_name(sk, "slock-AF_INET6-RPC", | 1765 | sock_lock_init_class_and_name(sk, "slock-AF_INET6-RPC", |
1769 | &xs_slock_key[1], "sk_lock-AF_INET6-RPC", &xs_key[1]); | 1766 | &xs_slock_key[1], "sk_lock-AF_INET6-RPC", &xs_key[1]); |
1770 | } | 1767 | } |
1771 | 1768 | ||
1772 | static inline void xs_reclassify_socket(int family, struct socket *sock) | 1769 | static inline void xs_reclassify_socket(int family, struct socket *sock) |
1773 | { | 1770 | { |
1771 | WARN_ON_ONCE(sock_owned_by_user(sock->sk)); | ||
1772 | if (sock_owned_by_user(sock->sk)) | ||
1773 | return; | ||
1774 | |||
1774 | switch (family) { | 1775 | switch (family) { |
1775 | case AF_LOCAL: | 1776 | case AF_LOCAL: |
1776 | xs_reclassify_socketu(sock); | 1777 | xs_reclassify_socketu(sock); |