public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.5.27 fix potential spinlocking race.
@ 2002-07-23 20:34 Trond Myklebust
  2002-07-24  2:09 ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Trond Myklebust @ 2002-07-23 20:34 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel


In case of socket transmission errors etc. kfree_skb(), and hence
xprt_write_space() can potentially get called outside of a bh-safe
context.

Cheers,
  Trond

diff -u --recursive --new-file linux-2.5.27/net/sunrpc/xprt.c linux-2.5.27-fix_wspace/net/sunrpc/xprt.c
--- linux-2.5.27/net/sunrpc/xprt.c	Sat Jul 20 21:11:08 2002
+++ linux-2.5.27-fix_wspace/net/sunrpc/xprt.c	Tue Jul 23 22:20:48 2002
@@ -966,10 +966,10 @@
 		return;
 
 	if (!xprt_test_and_set_wspace(xprt)) {
-		spin_lock(&xprt->sock_lock);
+		spin_lock_bh(&xprt->sock_lock);
 		if (xprt->snd_task && xprt->snd_task->tk_rpcwait == &xprt->pending)
 			rpc_wake_up_task(xprt->snd_task);
-		spin_unlock(&xprt->sock_lock);
+		spin_unlock_bh(&xprt->sock_lock);
 	}
 
 	if (test_bit(SOCK_NOSPACE, &sock->flags)) {

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

end of thread, other threads:[~2002-07-24 13:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-23 20:34 [PATCH] 2.5.27 fix potential spinlocking race Trond Myklebust
2002-07-24  2:09 ` David S. Miller
2002-07-24  2:24   ` Linus Torvalds
2002-07-24 13:05     ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox