Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346559
b: refs/heads/master
c: 1b7a181
h: refs/heads/master
i:
  346557: e368958
  346555: c0d60a5
  346551: a77faa6
  346543: 97e0442
  346527: 1e9245a
  346495: 8fe7baf
v: v3
  • Loading branch information
Weston Andros Adamson authored and Trond Myklebust committed Nov 4, 2012
1 parent f334db3 commit 23d1d70
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1bd58aaff44485ec9e3640af350f6ba1b33e2bec
refs/heads/master: 1b7a1819078c68c4df4bba90f76b8113a08460de
6 changes: 5 additions & 1 deletion trunk/net/sunrpc/svcsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 4 additions & 3 deletions trunk/net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,6 @@ static inline void xs_reclassify_socketu(struct socket *sock)
{
struct sock *sk = sock->sk;

BUG_ON(sock_owned_by_user(sk));
sock_lock_init_class_and_name(sk, "slock-AF_LOCAL-RPC",
&xs_slock_key[1], "sk_lock-AF_LOCAL-RPC", &xs_key[1]);
}
Expand All @@ -1755,7 +1754,6 @@ static inline void xs_reclassify_socket4(struct socket *sock)
{
struct sock *sk = sock->sk;

BUG_ON(sock_owned_by_user(sk));
sock_lock_init_class_and_name(sk, "slock-AF_INET-RPC",
&xs_slock_key[0], "sk_lock-AF_INET-RPC", &xs_key[0]);
}
Expand All @@ -1764,13 +1762,16 @@ static inline void xs_reclassify_socket6(struct socket *sock)
{
struct sock *sk = sock->sk;

BUG_ON(sock_owned_by_user(sk));
sock_lock_init_class_and_name(sk, "slock-AF_INET6-RPC",
&xs_slock_key[1], "sk_lock-AF_INET6-RPC", &xs_key[1]);
}

static inline void xs_reclassify_socket(int family, struct socket *sock)
{
WARN_ON_ONCE(sock_owned_by_user(sock->sk));
if (sock_owned_by_user(sock->sk))
return;

switch (family) {
case AF_LOCAL:
xs_reclassify_socketu(sock);
Expand Down

0 comments on commit 23d1d70

Please sign in to comment.