Skip to contentSkip to conversation

X.25 remove bkl in listen

PATCH Applied Andrew Hendry 2 participants 3 messages Sep 14, 2010 – Sep 15, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 X.25 remove bkl in listen

Listen updates socket values and needs lock_sock.

---
 net/x25/af_x25.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/x25/af_x25.c +2 -2
index 5e86d4e..f6a8f17 100644
@@ -507,14 +507,14 @@ static int x25_listen(struct socket *sock, int backlog)
 	struct sock *sk = sock->sk;
 	int rc = -EOPNOTSUPP;
 
-	lock_kernel();
+	lock_sock(sk);
 	if (sk->sk_state != TCP_LISTEN) {
 		memset(&x25_sk(sk)->dest_addr, 0, X25_ADDR_LEN);
 		sk->sk_max_ack_backlog = backlog;
 		sk->sk_state           = TCP_LISTEN;
 		rc = 0;
 	}
-	unlock_kernel();
+	release_sock(sk);
 
 	return rc;
 }
Signature · 1 line
1.7.0.4
maintainer Applied
#1 lore raw

From: Andrew Hendry <[email protected]>
Date: Wed, 15 Sep 2010 09:31:16 +1000

Quoted 3 lines

Listen updates socket values and needs lock_sock.

Applied.

Although you may want to think about whether we need to also hold the x25_list_lock as a writer here so that scanners of the socket list see consistent state changes.

#2 lore raw

Thanks, I'll test that and have a close look at it for the next round.

Quoted 13 lines · David Miller

From: Andrew Hendry <[email protected]>
Date: Wed, 15 Sep 2010 09:31:16 +1000

Quoted 3 lines

Listen updates socket values and needs lock_sock.

Applied.

Although you may want to think about whether we need to also hold the x25_list_lock as a writer here so that scanners of the socket list see consistent state changes.