From patchwork Mon May 7 22:20:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 10384893 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 A917960353 for ; Mon, 7 May 2018 22:21:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9066A28AA5 for ; Mon, 7 May 2018 22:21:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8536F28B79; Mon, 7 May 2018 22:21:40 +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=ham 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 1F2C428AA5 for ; Mon, 7 May 2018 22:21:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753303AbeEGWVi (ORCPT ); Mon, 7 May 2018 18:21:38 -0400 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:50196 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753061AbeEGWVe (ORCPT ); Mon, 7 May 2018 18:21:34 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id FoUZfIjvCEESaFoUZf0w4O; Mon, 07 May 2018 15:20:33 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.89_1) (envelope-from ) id 1fFoUZ-0005QA-L0; Mon, 07 May 2018 15:20:23 -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 3/7] cifs: smbd: Return EINTR when interrupted Date: Mon, 7 May 2018 15:20:02 -0700 Message-Id: <20180507222006.20781-3-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: MS4wfDn9jugCorh4uZqMVktUN0N+LQzhLctzy3THfzRDDhqZ5I8zUFXs/zETN63ZGbVa96bWLe2WCYU6VSPwukOVC4QUpkHwLVKPsieyIm4MU8naJV9f+C77 sNdUEEOzXxopLavAC4NhwVFUZjcWzz1NIkY1cisiG9J6QD2lDPxhdwmijVnhdE6qq8kRXA3peh+GjDFrNBzATYhrt8euL4tNPGopeXHTzT9REz04aNAQG/ib x77DiBMUMRMGMaP35DexGCrriI3nJ/pPh3MujSpqNSdUszvyotX9OWvAAhQie2AHPyNA9ZpOffDXVpGXuvAYwO0qDkA5vxvjqy78+OmlnG1F4BrFAXRG8Qjz 6k15djuMB/e21Vf0+JT52GERIkAYzNgXLvFbv5SjWsXyBm+OLWFo5gYILGXr5lTbZSsRsQun Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Long Li When packets are waiting for outbound I/O and interrupted, return the proper error code to user process. Signed-off-by: Long Li --- fs/cifs/smbdirect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 79b025e..b8dd493 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -1963,7 +1963,7 @@ static int smbd_recv_buf(struct smbd_connection *info, char *buf, info->transport_status != SMBD_CONNECTED); /* Don't return any data if interrupted */ if (rc) - return -ENODEV; + return rc; if (info->transport_status != SMBD_CONNECTED) { log_read(ERR, "disconnected\n"); @@ -1991,7 +1991,7 @@ static int smbd_recv_page(struct smbd_connection *info, info->reassembly_data_length >= to_read || info->transport_status != SMBD_CONNECTED); if (ret) - return 0; + return ret; /* now we can read from reassembly queue and not sleep */ to_address = kmap_atomic(page);