All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] X.25 remove bkl in listen
@ 2010-09-14 23:31 Andrew Hendry
  2010-09-15  3:40 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Hendry @ 2010-09-14 23:31 UTC (permalink / raw)
  To: netdev

Listen updates socket values and needs lock_sock.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>

---
 net/x25/af_x25.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 5e86d4e..f6a8f17 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -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;
 }
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/4] X.25 remove bkl in listen
  2010-09-14 23:31 [PATCH 1/4] X.25 remove bkl in listen Andrew Hendry
@ 2010-09-15  3:40 ` David Miller
  2010-09-15  3:43   ` Andrew Hendry
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2010-09-15  3:40 UTC (permalink / raw)
  To: andrew.hendry; +Cc: netdev

From: Andrew Hendry <andrew.hendry@gmail.com>
Date: Wed, 15 Sep 2010 09:31:16 +1000

> Listen updates socket values and needs lock_sock.
> 
> Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/4] X.25 remove bkl in listen
  2010-09-15  3:40 ` David Miller
@ 2010-09-15  3:43   ` Andrew Hendry
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Hendry @ 2010-09-15  3:43 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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

On Wed, Sep 15, 2010 at 1:40 PM, David Miller <davem@davemloft.net> wrote:
> From: Andrew Hendry <andrew.hendry@gmail.com>
> Date: Wed, 15 Sep 2010 09:31:16 +1000
>
>> Listen updates socket values and needs lock_sock.
>>
>> Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
>
> 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.
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-15  3:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-14 23:31 [PATCH 1/4] X.25 remove bkl in listen Andrew Hendry
2010-09-15  3:40 ` David Miller
2010-09-15  3:43   ` Andrew Hendry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.