From patchwork Mon May 7 22:20:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 10384911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AB3B260318 for ; Mon, 7 May 2018 22:22:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93D9328B7A for ; Mon, 7 May 2018 22:22:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87F5928B7C; Mon, 7 May 2018 22:22:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CA3528B7A for ; Mon, 7 May 2018 22:22:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753074AbeEGWWK (ORCPT ); Mon, 7 May 2018 18:22:10 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:60958 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753356AbeEGWVo (ORCPT ); Mon, 7 May 2018 18:21:44 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id FoUtfFkf7HUQCFoUtfKVj2; Mon, 07 May 2018 15:20:43 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.89_1) (envelope-from ) id 1fFoUt-0005QS-N3; Mon, 07 May 2018 15:20:43 -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 6/7] cifs: smbd: Retry on memory registration failure Date: Mon, 7 May 2018 15:20:05 -0700 Message-Id: <20180507222006.20781-6-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: MS4wfBrIcZMnqS/l2sKVMJ8vd7oBENXuW8KQjEx/MllsKb9nN3rD58lYkss48R/aICJ5cqFS950xOkIID+IyNv2j48nJlb7NwJy6g2CfD5vhrhpOFnMn7oNd GUxbBnBxxvjuT98UK+q4v7m6kfH6dgJ75H88sBp0CTYZdYxkeVZtGjj23eRtuioCBzJrW6nf1cMcg1f7udSLx4jn0cyWdwaq+dw6CbzVmoP0sAQh7p9AaYko a0cG0q8iVQvsWC17pcCiiEuEfN2HeURdeUVG4yAcPqwHHrhHCbTr6oJ4BAeFDT63KNB8BXHiPeRmfa5gniaQBhBfkfw9tfrTmdd2/IcpvMae1OuaYjA+zM3N hFR3EBCLKK7hvN/MJtPen6PLZfNrzZztZYnXZ8ZGN/VxludGznFtoV5mHckhuZ9XSYjvLAZ9 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Long Li Memory registration failure doesn't mean this I/O has failed, it means the transport is hitting I/O error or needs reconnect. This error is not from the server. Indicate this error to upper layer, and let upper layer decide how to reconnect and proceed with this I/O. Signed-off-by: Long Li --- fs/cifs/smb2pdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 09ca098..c72d1fa 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2617,7 +2617,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len, true, need_invalidate); rcu_read_unlock(); if (!rdata->mr) - return -ENOBUFS; + return -EAGAIN; req->Channel = SMB2_CHANNEL_RDMA_V1_INVALIDATE; if (need_invalidate) @@ -2997,7 +2997,7 @@ smb2_async_writev(struct cifs_writedata *wdata, false, need_invalidate); rcu_read_unlock(); if (!wdata->mr) { - rc = -ENOBUFS; + rc = -EAGAIN; goto async_writev_out; } req->Length = 0;