From patchwork Thu Jan 10 22:24:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 10757005 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 B90A314E5 for ; Thu, 10 Jan 2019 22:25:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97ABA29B6B for ; Thu, 10 Jan 2019 22:25:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 870A529B94; Thu, 10 Jan 2019 22:25:09 +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 2CAF729B6B for ; Thu, 10 Jan 2019 22:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728616AbfAJWZI (ORCPT ); Thu, 10 Jan 2019 17:25:08 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41371 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727733AbfAJWZI (ORCPT ); Thu, 10 Jan 2019 17:25:08 -0500 Received: by mail-pf1-f193.google.com with SMTP id b7so5948552pfi.8 for ; Thu, 10 Jan 2019 14:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=BJZgT2/chgpx8ZbnWOTh+RbUrCobx11YG3cQyGAR2oE=; b=OCDmqDogLAaJk/uUFjZcflMmgapH/UghSJC6hcpK04Ht9l17GVidMigc8gNTRqlrUS 8L8+/w5eIrt2aMOi2qqsZ2FuHv+ueQ7Hl40zkenKcWpXF+hrpfu9fH5hsPbOK7/0Hq7m xGq0KV2zyk5IjTjdk+NPgupa42tarmNrRoEW382o+LPYP0x0fqIdB58GTGldk30euDh7 FcVafrM19YSo7F9aSNex7+XB80vxN+UY1WMVLSG8yePZahZTFfzlnX6mNwZ9rysVeJ1t YCpXBblAUGyP0ry0o4amf6KmhUjdDUOCO/EsaTDp8For07PgJQyiiqwYZKiif8XLf0+Z bTlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BJZgT2/chgpx8ZbnWOTh+RbUrCobx11YG3cQyGAR2oE=; b=UrFk0kNAAHQxv37MeDrtlPfgFCW5Jpp6hUBX6QHfE0/cX9LzYVjuui9tDxtRju5fXg lQoVBsr4v+OawjgaMig9nJJP1LSzC7nA+bwdP724FeMo8N0NhphQFYCnjTyBpW7bzvfm 4QleAfVW0dcn1YKwfbrdO06i7CeRYFNxjLX4N1nbF5inubb2Z0M2wl0WbNN978rjXdPy GvJqLt7rpn3A0voJ+yNNE/vfwjeT98JXSrxwxH9JG5tOTlOvotB6CCqe7y5iui/yFbdI 6elbmKDsOCgTS0YAm3zwywHQB/85L29EPVR8ppoSb1yeA61zEwXFNX1YziUb13xoepN1 0zGA== X-Gm-Message-State: AJcUukdGCcoMmI2m6rgJo3Osy0AwbR4XQVCdK7Y90FEwIgV1kSy268pm Dc9BIYRvF0/g9mXOWGUrNVDYCpI= X-Google-Smtp-Source: ALg8bN74TELJi9ctjIawJkh03dyPcbyKANrfX2BvQ/HImgkmXq+hGXBY3EPEYCSKdT4pNPpSJz3PgA== X-Received: by 2002:a63:e74b:: with SMTP id j11mr4371665pgk.397.1547159106957; Thu, 10 Jan 2019 14:25:06 -0800 (PST) Received: from ubuntu-vm.corp.microsoft.com ([2001:4898:80e8:3:a18b:4e9f:6b7c:507d]) by smtp.gmail.com with ESMTPSA id z127sm118006755pfb.80.2019.01.10.14.25.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jan 2019 14:25:05 -0800 (PST) From: Pavel Shilovsky X-Google-Original-From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Cc: Steve French , Ronnie Sahlberg Subject: [PATCH 0/7] SMB3 credit flow control handling and writeback fixes Date: Thu, 10 Jan 2019 14:24:51 -0800 Message-Id: <1547159098-19011-1-git-send-email-pshilov@microsoft.com> X-Mailer: git-send-email 2.7.4 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 This is the series of patches that address few problems with the current code. Patch #1 adjusts credits properly for MTU credits if we didn't use all the credits taken for an operation. This prevents loosing credits in error paths. Patch #2 removes resetting credit number to 1 if server didn't grant us any credits for the compounding chain. The current code didn't follow the protocol correctly. Patch #3 fixes credits handling for compounded requests by taking one credit per part of the chain. All error paths that return credits back are fixed accordingly. Patch #4 fixes hiding EINTR error code returned after an interrupted attemp to send SMB packet through the network. Patch #5 removes wrong assumption that the server grants us one credit for a cancelled request and parse the actual response to get the credit number. Patch #6 moves process credits granted by the server in the demultiplex thread in order to avoid races with reconnects. Patch #7 addresses few problems in writeback code, in particular related to interrupted error code returned by the transport layer. Patches #1-4 as marked for stable. Reviews are welcome. Pavel Shilovsky (7): CIFS: Fix adjustment of credits for MTU requests CIFS: Do not set credits to 1 if the server didn't grant anything CIFS: Fix credit computation for compounded requests CIFS: Do not hide EINTR while sending network packets CIFS: Fix credits calculation for cancelled requests CIFS: Move credit processing to mid callbacks for SMB3 CIFS: Fix error paths in writeback code fs/cifs/cifsglob.h | 20 +++++++++ fs/cifs/cifssmb.c | 7 +-- fs/cifs/file.c | 29 ++++++++++--- fs/cifs/inode.c | 10 +++++ fs/cifs/smb2pdu.c | 8 +++- fs/cifs/transport.c | 122 +++++++++++++++++++++++++++++++++++++++------------- 6 files changed, 155 insertions(+), 41 deletions(-)