Commit 1758bdf3 authored by Chuck Lever's avatar Chuck Lever Committed by Linus Torvalds

[PATCH] prevent oops in xprt_lock_write, against 2.5.32

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.
parent 44a05b3e
...@@ -147,7 +147,7 @@ __xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task) ...@@ -147,7 +147,7 @@ __xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
dprintk("RPC: %4d TCP write queue full\n", task->tk_pid); dprintk("RPC: %4d TCP write queue full\n", task->tk_pid);
task->tk_timeout = 0; task->tk_timeout = 0;
task->tk_status = -EAGAIN; 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); rpc_sleep_on(&xprt->resend, task, NULL, NULL);
else else
rpc_sleep_on(&xprt->sending, task, NULL, NULL); rpc_sleep_on(&xprt->sending, task, NULL, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment