From patchwork Fri Jan 11 06:29:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 10757465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 915821399 for ; Fri, 11 Jan 2019 06:29:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F39929ACE for ; Fri, 11 Jan 2019 06:29:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7091F29AD3; Fri, 11 Jan 2019 06:29: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 2147429ACE for ; Fri, 11 Jan 2019 06:29:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730454AbfAKG3T (ORCPT ); Fri, 11 Jan 2019 01:29:19 -0500 Received: from mail-pl1-f178.google.com ([209.85.214.178]:34739 "EHLO mail-pl1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730368AbfAKG3S (ORCPT ); Fri, 11 Jan 2019 01:29:18 -0500 Received: by mail-pl1-f178.google.com with SMTP id w4so6322652plz.1; Thu, 10 Jan 2019 22:29:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=OdodkZXE/tn4FSNB0NpaxXBP5rBK66K7xUvRbQ3QQps=; b=G8t9+leX/R+b0ea637u0vaiVTBYH/thNk4j8J2YXFUfoDOIgML7QaQJLJa17tZvJ96 0zpSXmjPSAoVMX7vC6b8e+Wi/tG/3Wq375t2irMV4ZgIVSlrQW4y5eNhT1GdY1/8Idtj Qg7uVlR2alC0mzFDOaTHB5bW2IYuGA3KcuX3i7Wct6/4PhQi1ldCNs+2NqKMYxvClvTY Kw++50Mlkb5h8v3hMRS1biZjrdi/as+njR0LAhHE+qV+JtNOodzwzlxoTwA+KY4NvJ7L ySGq6h9WcrtBwp+6+hGy5Qq3G6P1jdC0EIPKSB3tEIzFiX23JAAjey89VNBfcDPLmxd+ tknQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=OdodkZXE/tn4FSNB0NpaxXBP5rBK66K7xUvRbQ3QQps=; b=V5V/TVm2j/rfPth4Mtrfkl80CYAQCzjFnVeB8QM7trCi54wmbPIMif9qh0MdOXljaL eoizENJMvgOG0aj49iahN1YpnVLz2zFjGiSNvDo+an6CXRvu9Z/GlDqQAaAURYahsqxv dFfPecvtJX7p0RzSxhKBmHeTe/fo2ZqkOP66d10nl1PhfDIqRgmVuYSyohSpsja95SJ7 mJX2powohiYBwZmaUOu8Y94I3LEWH5Bh1X3INRjy66mX0jqCPAJ2F7K+i9ojgYiWIsNr 333olmrtyCbCo7b+G0V94FSs/tNMeb0DG2w3Ime0PRIc90y1AmBqtWFo3pBMYqr+nB0e tQFw== X-Gm-Message-State: AJcUukelZzHZcOJK6+r6R9ARrdNVU8D3xDrjPTswsGQRbdluezaDjCNF hoTpoe9WZPlQTwOa3bqcDRoXxnWB1/C6O1nT6zr8mg== X-Google-Smtp-Source: ALg8bN6xDNakegZu5VO6zYghKXQP1Fybl0Cs/tbckQHCGLzY5SIhE+zYpSmJlCCVcGebE67V5BXbUchc1wYHxesUWX8= X-Received: by 2002:a17:902:e085:: with SMTP id cb5mr13277448plb.24.1547188156884; Thu, 10 Jan 2019 22:29:16 -0800 (PST) MIME-Version: 1.0 References: <1547159098-19011-1-git-send-email-pshilov@microsoft.com> <1547159098-19011-5-git-send-email-pshilov@microsoft.com> In-Reply-To: <1547159098-19011-5-git-send-email-pshilov@microsoft.com> From: Steve French Date: Fri, 11 Jan 2019 00:29:04 -0600 Message-ID: Subject: Fwd: [PATCH 4/7] CIFS: Do not hide EINTR after sending network packets To: linux-fsdevel , LKML Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Pavel's patch looks correct to me, but since this may be a common issue, how to better handle unexpected EINTR on sock_sendmsg, others outside cifs/smb3 world may have run into this before and have additional comments. ---------- Forwarded message --------- From: Pavel Shilovsky Date: Thu, Jan 10, 2019 at 4:25 PM Subject: [PATCH 4/7] CIFS: Do not hide EINTR after sending network packets To: Cc: Steve French , Ronnie Sahlberg Currently we hide EINTR code returned from sock_sendmsg() and return 0 instead. This makes a caller think that we have successfully completed the network operation which is not true. Fix this by properly returning EINTR to callers. Cc: Signed-off-by: Pavel Shilovsky --- fs/cifs/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) return rc; -- 2.7.4 diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index e047f06..aaff9c5 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -387,7 +387,7 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, if (rc < 0 && rc != -EINTR) cifs_dbg(VFS, "Error %d sending data on socket to server\n", rc); - else + else if (rc > 0) rc = 0;