summaryrefslogtreecommitdiff
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2011-07-18 00:01:03 +0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-07-18 00:01:03 +0400
commit43cedbf0e8dfb9c5610eb7985d5f21263e313802 (patch)
tree7758630292b6a276a3db72e63803ddc02c0a4444 /net/sunrpc/xprtsock.c
parentf85ef69ce08bc2209858135328335f668ba35bdb (diff)
downloadlinux-43cedbf0e8dfb9c5610eb7985d5f21263e313802.tar.xz
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)