[PATCH] 2.5.27 fix potential spinlocking race.

From: Trond Myklebust (trond.myklebust@fys.uio.no)
Date: Tue Jul 23 2002 - 15:34:41 EST


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)) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 23 2002 - 22:00:44 EST