From patchwork Mon May 7 22:20:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 909971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linuxonhyperv.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40fxw46xFpz9s27 for ; Tue, 8 May 2018 08:23:16 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753191AbeEGWVa (ORCPT ); Mon, 7 May 2018 18:21:30 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:44442 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753061AbeEGWV3 (ORCPT ); Mon, 7 May 2018 18:21:29 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id FoUefRYtIGqYmFoUefcJHV; Mon, 07 May 2018 15:20:28 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.89_1) (envelope-from ) id 1fFoUe-0005QG-4E; Mon, 07 May 2018 15:20:28 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Cc: Long Li Subject: [PATCH 4/7] cifs: smbd: Indicate to retry on transport sending failure Date: Mon, 7 May 2018 15:20:03 -0700 Message-Id: <20180507222006.20781-4-longli@linuxonhyperv.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180507222006.20781-1-longli@linuxonhyperv.com> References: <20180507222006.20781-1-longli@linuxonhyperv.com> Reply-To: longli@microsoft.com X-CMAE-Envelope: MS4wfEJVHCaXpk0Kz5Wn9Pm3DOBlvfoZ6nUhJxwZm6sxI33iHjr5W6a4E2AQTqgqx/TDn1RKifI5HfY+nRT7n5wTwYOBXfR+UnTBxNjjTBM4+Bi8oPp77oof ToUQfwUlv54WNwSM64oDscUVFf1zRVuitaVAQjzI0Y0OsMdWcsWGQIgu9aInhS+LcjtCvCuXai9yAjBoGm9elOgyNqOnB8Luzfg4l2HLa18kZll1i9k6dmXt pVtJta6PACJCLeX9QsEDZHIsHhJmWC4WFdJW5GapMgun7wCtNUlb+lqsq2vEUmoz3H687tyB6aE6uQUN4iG/1Ah+Y2eEcQVTsD+s/LN6+9DdLUcf5k1+nE1j 2mX5ZBCBywMrRDPy1siSdoapa07RMzlcviMKxhDfy5KGyFPFgmbmzJLQrtaO7KG+DXG9BbI3 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org From: Long Li Failure to send a packet doesn't mean it's a permanent failure, it can't be returned to user process. This I/O should be retried or failed based on server packet response and transport health. This logic is handled by the upper layer. Give this decision to upper layer. Signed-off-by: Long Li --- fs/cifs/smbdirect.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index b8dd493..74620f5 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -851,7 +851,7 @@ static int smbd_create_header(struct smbd_connection *info, if (info->transport_status != SMBD_CONNECTED) { log_outgoing(ERR, "disconnected not sending\n"); - return -ENOENT; + return -EAGAIN; } atomic_dec(&info->send_credits); @@ -977,6 +977,7 @@ static int smbd_post_send(struct smbd_connection *info, wake_up(&info->wait_send_pending); } smbd_disconnect_rdma_connection(info); + rc = -EAGAIN; } else /* Reset timer for idle connection after packet is sent */ mod_delayed_work(info->workqueue, &info->idle_timer_work, @@ -2062,7 +2063,7 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) int rc; if (info->transport_status != SMBD_CONNECTED) { - rc = -ENODEV; + rc = -EAGAIN; goto done; }