tcp: fix inet_twsk_deschedule()
authorEric Dumazet <[email protected]>
Fri, 18 Feb 2011 22:35:56 +0000 (22:35 +0000)
committerDavid S. Miller <[email protected]>
Sun, 20 Feb 2011 02:59:04 +0000 (18:59 -0800)
Eric W. Biederman reported a lockdep splat in inet_twsk_deschedule()

This is caused by inet_twsk_purge(), run from process context,
and commit 575f4cd5a5b6394577 (net: Use rcu lookups in inet_twsk_purge.)
removed the BH disabling that was necessary.

Add the BH disabling but fine grained, right before calling
inet_twsk_deschedule(), instead of whole function.

With help from Linus Torvalds and Eric W. Biederman

Reported-by: Eric W. Biederman <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
CC: Daniel Lezcano <[email protected]>
CC: Pavel Emelyanov <[email protected]>
CC: Arnaldo Carvalho de Melo <[email protected]>
CC: stable <[email protected]> (# 2.6.33+)
Signed-off-by: David S. Miller <[email protected]>
net/ipv4/inet_timewait_sock.c

index c5af909cf701c37dfb2afecf078de854349c2950..3c8dfa16614d4213823e3a03d7cf528324f42f88 100644 (file)
@@ -505,7 +505,9 @@ restart:
                        }
 
                        rcu_read_unlock();
+                       local_bh_disable();
                        inet_twsk_deschedule(tw, twdr);
+                       local_bh_enable();
                        inet_twsk_put(tw);
                        goto restart_rcu;
                }