From patchwork Thu Jun 4 21:26:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 6550031 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6CA8A9F3D1 for ; Thu, 4 Jun 2015 21:27:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90FCA2076E for ; Thu, 4 Jun 2015 21:27:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B180A20771 for ; Thu, 4 Jun 2015 21:26:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753430AbbFDV06 (ORCPT ); Thu, 4 Jun 2015 17:26:58 -0400 Received: from mail-ig0-f171.google.com ([209.85.213.171]:35436 "EHLO mail-ig0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752374AbbFDV05 (ORCPT ); Thu, 4 Jun 2015 17:26:57 -0400 Received: by igbzc4 with SMTP id zc4so1249279igb.0 for ; Thu, 04 Jun 2015 14:26:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=ksWqVwuie9M4yTWRlcfBqMnyFBudPo0tDCd5dCPdb3I=; b=eW45+hUzAWuycE1k3Cg0mo/DpAA/RznBR42/QaDW7Qf0L/thUG7EmGA1dPGpBOdzpt F2XQ8CTZMdnc/wIgxRZ+MP+MIvtkXXr+gSNZQBd3Kt8idSEagBIfFAnUNLHkK3DkSY9t OZ9z6WVhvLuVYjN1kM6nLCt8MVIDPAALU+ToWnl/O38XbVzAMdUXwXIsTUoubS8XR50Y j9L/un0Lk+5HJBEy5HYN9bpITfPHtOqN+L9THzRIayILbYaRITMXQTJR8MYXkPpLSphY BGp1nYp0RBIbmyupxrskENk5QSgUAM3T9OtnOve0/rHj5FoxCelL0Pyl2+8xFeF6e6SH LgXw== X-Gm-Message-State: ALoCoQnWaX5ePN9jcQGKiFVLmLQ0RQk06fOnFcKYzWb5iduozBHCpULsiGtIVVPvwhFTQoGqO8AC X-Received: by 10.43.66.5 with SMTP id xo5mr6569217icb.57.1433453217245; Thu, 04 Jun 2015 14:26:57 -0700 (PDT) Received: from leira.trondhjem.org.localdomain (c-68-56-142-232.hsd1.mi.comcast.net. [68.56.142.232]) by mx.google.com with ESMTPSA id d81sm1962659ioe.12.2015.06.04.14.26.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jun 2015 14:26:56 -0700 (PDT) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 2/6] SUNRPC: Backchannel handle socket nospace Date: Thu, 4 Jun 2015 17:26:49 -0400 Message-Id: <1433453213-13466-2-git-send-email-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.4.2 In-Reply-To: <1433453213-13466-1-git-send-email-trond.myklebust@primarydata.com> References: <1433453213-13466-1-git-send-email-trond.myklebust@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the socket was busy due to a socket nospace error, then we should retry the send. Signed-off-by: Trond Myklebust --- net/sunrpc/clnt.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index e6ce1517367f..fa70f663eb92 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1951,24 +1951,22 @@ call_bc_transmit(struct rpc_task *task) { struct rpc_rqst *req = task->tk_rqstp; - if (!xprt_prepare_transmit(task)) { - /* - * Could not reserve the transport. Try again after the - * transport is released. - */ - task->tk_status = 0; - task->tk_action = call_bc_transmit; - return; - } + if (!xprt_prepare_transmit(task)) + goto out_retry; - task->tk_action = rpc_exit_task; if (task->tk_status < 0) { printk(KERN_NOTICE "RPC: Could not send backchannel reply " "error: %d\n", task->tk_status); - return; + goto out_done; } + if (req->rq_connect_cookie != req->rq_xprt->connect_cookie) + req->rq_bytes_sent = 0; xprt_transmit(task); + + if (task->tk_status == -EAGAIN) + goto out_nospace; + xprt_end_transmit(task); dprint_status(task); switch (task->tk_status) { @@ -2002,6 +2000,13 @@ call_bc_transmit(struct rpc_task *task) break; } rpc_wake_up_queued_task(&req->rq_xprt->pending, task); +out_done: + task->tk_action = rpc_exit_task; + return; +out_nospace: + req->rq_connect_cookie = req->rq_xprt->connect_cookie; +out_retry: + task->tk_status = 0; } #endif /* CONFIG_SUNRPC_BACKCHANNEL */