netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcp: fix a panic on UP machines in reqsk_fastopen_remove
@ 2013-01-14  4:21 Eric Dumazet
  2013-01-14  8:26 ` Jerry Chu
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2013-01-14  4:21 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ketan Kulkarni, Jerry Chu, Yuchung Cheng

From: Eric Dumazet <edumazet@google.com>

spin_is_locked() on a non !SMP build is kind of useless.

BUG_ON(!spin_is_locked(xx)) is guaranteed to crash.

Just remove this check in reqsk_fastopen_remove() as
the callers do hold the socket lock.

Reported-by: Ketan Kulkarni <ketkulka@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jerry Chu <hkchu@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Dave Taht <dave.taht@gmail.com>
---
 net/core/request_sock.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/net/core/request_sock.c b/net/core/request_sock.c
index c31d9e8..4425148 100644
--- a/net/core/request_sock.c
+++ b/net/core/request_sock.c
@@ -186,8 +186,6 @@ void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
 	struct fastopen_queue *fastopenq =
 	    inet_csk(lsk)->icsk_accept_queue.fastopenq;
 
-	BUG_ON(!spin_is_locked(&sk->sk_lock.slock) && !sock_owned_by_user(sk));
-
 	tcp_sk(sk)->fastopen_rsk = NULL;
 	spin_lock_bh(&fastopenq->lock);
 	fastopenq->qlen--;

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

* Re: [PATCH] tcp: fix a panic on UP machines in reqsk_fastopen_remove
  2013-01-14  4:21 [PATCH] tcp: fix a panic on UP machines in reqsk_fastopen_remove Eric Dumazet
@ 2013-01-14  8:26 ` Jerry Chu
  2013-01-14 23:10   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Jerry Chu @ 2013-01-14  8:26 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev, Ketan Kulkarni, Yuchung Cheng

On Sun, Jan 13, 2013 at 8:21 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> spin_is_locked() on a non !SMP build is kind of useless.
>
> BUG_ON(!spin_is_locked(xx)) is guaranteed to crash.
>
> Just remove this check in reqsk_fastopen_remove() as
> the callers do hold the socket lock.
>
> Reported-by: Ketan Kulkarni <ketkulka@gmail.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Jerry Chu <hkchu@google.com>
> Cc: Yuchung Cheng <ycheng@google.com>
> Cc: Dave Taht <dave.taht@gmail.com>
> ---
>  net/core/request_sock.c |    2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/net/core/request_sock.c b/net/core/request_sock.c
> index c31d9e8..4425148 100644
> --- a/net/core/request_sock.c
> +++ b/net/core/request_sock.c
> @@ -186,8 +186,6 @@ void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
>         struct fastopen_queue *fastopenq =
>             inet_csk(lsk)->icsk_accept_queue.fastopenq;
>
> -       BUG_ON(!spin_is_locked(&sk->sk_lock.slock) && !sock_owned_by_user(sk));
> -
>         tcp_sk(sk)->fastopen_rsk = NULL;
>         spin_lock_bh(&fastopenq->lock);
>         fastopenq->qlen--;
>
>

Thanks, Eric. (I thought the assertion would be transparent to UP...)

Acked-by: H.K. Jerry Chu <hkchu@google.com>

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

* Re: [PATCH] tcp: fix a panic on UP machines in reqsk_fastopen_remove
  2013-01-14  8:26 ` Jerry Chu
@ 2013-01-14 23:10   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-01-14 23:10 UTC (permalink / raw)
  To: hkchu; +Cc: eric.dumazet, netdev, ketkulka, ycheng

From: Jerry Chu <hkchu@google.com>
Date: Mon, 14 Jan 2013 00:26:26 -0800

> On Sun, Jan 13, 2013 at 8:21 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> spin_is_locked() on a non !SMP build is kind of useless.
>>
>> BUG_ON(!spin_is_locked(xx)) is guaranteed to crash.
>>
>> Just remove this check in reqsk_fastopen_remove() as
>> the callers do hold the socket lock.
>>
>> Reported-by: Ketan Kulkarni <ketkulka@gmail.com>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
 ...
> Thanks, Eric. (I thought the assertion would be transparent to UP...)
> 
> Acked-by: H.K. Jerry Chu <hkchu@google.com>
> 

Applied, thanks.

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

end of thread, other threads:[~2013-01-14 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-14  4:21 [PATCH] tcp: fix a panic on UP machines in reqsk_fastopen_remove Eric Dumazet
2013-01-14  8:26 ` Jerry Chu
2013-01-14 23:10   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).