summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
authorTrond Myklebust2011-07-17 22:01:03 +0200
committerTrond Myklebust2011-07-17 22:01:03 +0200
commit43cedbf0e8dfb9c5610eb7985d5f21263e313802 (patch)
tree7758630292b6a276a3db72e63803ddc02c0a4444 /net/sunrpc/xprtsock.c
parentpnfs: simplify pnfs files module autoloading (diff)
downloadkernel-qcow2-linux-43cedbf0e8dfb9c5610eb7985d5f21263e313802.tar.gz
kernel-qcow2-linux-43cedbf0e8dfb9c5610eb7985d5f21263e313802.tar.xz
kernel-qcow2-linux-43cedbf0e8dfb9c5610eb7985d5f21263e313802.zip
SUNRPC: Ensure that we grab the XPRT_LOCK before calling xprt_alloc_slot
This throttles the allocation of new slots when the socket is busy reconnecting and/or is out of buffer space. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index cd6c410fa8fa..adaa54c6a09a 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -755,6 +755,8 @@ static void xs_tcp_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task)
if (task == NULL)
goto out_release;
req = task->tk_rqstp;
+ if (req == NULL)
+ goto out_release;
if (req->rq_bytes_sent == 0)
goto out_release;
if (req->rq_bytes_sent == req->rq_snd_buf.len)