From patchwork Fri Apr 5 21:36:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 1078827 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 44bY8P2rdPz9sSV for ; Sat, 6 Apr 2019 08:38:13 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726545AbfDEViB (ORCPT ); Fri, 5 Apr 2019 17:38:01 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:57894 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbfDEViB (ORCPT ); Fri, 5 Apr 2019 17:38:01 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with ESMTP id CWWBhcj5QO8d9CWWBhwjnr; Fri, 05 Apr 2019 14:36:59 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.91) (envelope-from ) id 1hCWWB-0006N1-I9; Fri, 05 Apr 2019 14:36:59 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Cc: Long Li Subject: [Patch (resend) 4/5] cifs: smbd: Retry on memory registration failure Date: Fri, 5 Apr 2019 21:36:34 +0000 Message-Id: <20190405213635.24383-4-longli@linuxonhyperv.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190405213635.24383-1-longli@linuxonhyperv.com> References: <20190405213635.24383-1-longli@linuxonhyperv.com> MIME-Version: 1.0 Reply-To: longli@microsoft.com X-CMAE-Envelope: MS4wfN4uVF5QeKT9JM4yiBeZw23HjTXYTV+mWeg96W/LtbPnuQK64WIH7rtXSGyX6rkAXzgXxdxt9U1M//cpc3wUdgfnAdRxf2EI/v1eaz/LTItLYU31KYhM 6SehhJGGVbMX3EVrD6t+HUdzNSIlOhgk5yiUDy/oVHyb+qDMq1NUPLjBlOFWkbkaRqEzSkYmftzZhPWoVIQD365ElAaTzXhiCzgd0kB4Fbv/btjb0gZBaNNb 1ppjKtvOOkP2lp5vwczFn7CSgA/IhAgzxUu4xeTdfoyZXeQziZCnC4g6GgK+W+wsuYuUUpzrc5qGf4sLImdLxzZC5nt83aHNkz1sMpK4iQCRYyrjuyfOIdYZ FONcO+Sar6kAPAQaU0wEkT0S5I/j6Q== Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org 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 21ad01d..ff3b730 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3220,7 +3220,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len, rdata->nr_pages, rdata->page_offset, rdata->tailsz, true, need_invalidate); if (!rdata->mr) - return -ENOBUFS; + return -EAGAIN; req->Channel = SMB2_CHANNEL_RDMA_V1_INVALIDATE; if (need_invalidate) @@ -3624,7 +3624,7 @@ smb2_async_writev(struct cifs_writedata *wdata, wdata->nr_pages, wdata->page_offset, wdata->tailsz, false, need_invalidate); if (!wdata->mr) { - rc = -ENOBUFS; + rc = -EAGAIN; goto async_writev_out; } req->Length = 0;