[ 20/61] tcp: fix a panic on UP machines in reqsk_fastopen_remove

From: Greg Kroah-Hartman
Date: Tue Feb 12 2013 - 15:35:57 EST

3.7-stable review patch. If anyone has any objections, please let me know.


From: Eric Dumazet <edumazet@xxxxxxxxxx>

[ Upstream commit cce894bb824429fd312706c7012acae43e725865 ]

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@xxxxxxxxx>
Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
Cc: Jerry Chu <hkchu@xxxxxxxxxx>
Cc: Yuchung Cheng <ycheng@xxxxxxxxxx>
Cc: Dave Taht <dave.taht@xxxxxxxxx>
Acked-by: H.K. Jerry Chu <hkchu@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
net/core/request_sock.c | 2 --
1 file changed, 2 deletions(-)

--- a/net/core/request_sock.c
+++ b/net/core/request_sock.c
@@ -186,8 +186,6 @@ void reqsk_fastopen_remove(struct sock *
struct fastopen_queue *fastopenq =

- BUG_ON(!spin_is_locked(&sk->sk_lock.slock) && !sock_owned_by_user(sk));
tcp_sk(sk)->fastopen_rsk = NULL;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/