[PATCH] prevent oops in xprt_lock_write, against 2.5.32

From: Chuck Lever (cel@citi.umich.edu)
Date: Fri Aug 30 2002 - 13:13:47 EST


hi linus-

when several RPC requests want to reconnect a TCP transport socket at
once, xprt_lock_write serializes the tasks to prevent multiple socket
connects. however, TCP connects are always done by a RPC child task that
has no request slot. xprt_lock_write can oops if there is no request slot
allocated to the invoking RPC task. reviewed and accepted by Trond.

the xprt_lock_write changes are not yet in 2.4, so this patch does not
apply to 2.4.

diff -drN -U2 00-stock/net/sunrpc/xprt.c 01-lock_write/net/sunrpc/xprt.c
--- 00-stock/net/sunrpc/xprt.c Tue Aug 27 15:26:35 2002
+++ 01-lock_write/net/sunrpc/xprt.c Thu Aug 29 10:10:00 2002
@@ -148,5 +148,5 @@
                 task->tk_timeout = 0;
                 task->tk_status = -EAGAIN;
- if (task->tk_rqstp->rq_nresend)
+ if (task->tk_rqstp && task->tk_rqstp->rq_nresend)
                         rpc_sleep_on(&xprt->resend, task, NULL, NULL);
                 else

-- 

corporate: <cel at netapp dot com> personal: <chucklever at bigfoot dot com>

- 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 : Sat Aug 31 2002 - 22:00:31 EST