aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-02-22 14:57:57 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-02-22 15:17:17 -0500
commita9a6b52ee1baa865283a91eb8d443ee91adfca56 (patch)
treedb49569dc70d2a9d95d9d5b0d54371cba9f305d6 /net/sunrpc/xprt.c
parent5a7a613a47a715711b3f2d3322a0eac21d459166 (diff)
SUNRPC: Don't start the retransmission timer when out of socket space
If the socket is full, we're better off just waiting until it empties, or until the connection is broken. The reason why we generally don't want to time out is that the call to xprt->ops->release_xprt() will trigger a connection reset, which isn't helpful... Let's make an exception for soft RPC calls, since they have to provide timeout guarantees. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 846c34fdee9f..b7478d5e7ffd 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -487,13 +487,17 @@ EXPORT_SYMBOL_GPL(xprt_wake_pending_tasks);
487 * xprt_wait_for_buffer_space - wait for transport output buffer to clear 487 * xprt_wait_for_buffer_space - wait for transport output buffer to clear
488 * @task: task to be put to sleep 488 * @task: task to be put to sleep
489 * @action: function pointer to be executed after wait 489 * @action: function pointer to be executed after wait
490 *
491 * Note that we only set the timer for the case of RPC_IS_SOFT(), since
492 * we don't in general want to force a socket disconnection due to
493 * an incomplete RPC call transmission.
490 */ 494 */
491void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action) 495void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action)
492{ 496{
493 struct rpc_rqst *req = task->tk_rqstp; 497 struct rpc_rqst *req = task->tk_rqstp;
494 struct rpc_xprt *xprt = req->rq_xprt; 498 struct rpc_xprt *xprt = req->rq_xprt;
495 499
496 task->tk_timeout = req->rq_timeout; 500 task->tk_timeout = RPC_IS_SOFT(task) ? req->rq_timeout : 0;
497 rpc_sleep_on(&xprt->pending, task, action); 501 rpc_sleep_on(&xprt->pending, task, action);
498} 502}
499EXPORT_SYMBOL_GPL(xprt_wait_for_buffer_space); 503EXPORT_SYMBOL_GPL(xprt_wait_for_buffer_space);