From patchwork Fri Feb 1 20:04:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 10793679 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 841E414E1 for ; Fri, 1 Feb 2019 20:04:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7721832C9E for ; Fri, 1 Feb 2019 20:04:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A511330BE; Fri, 1 Feb 2019 20:04:49 +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 96A81330C8 for ; Fri, 1 Feb 2019 20:04:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730802AbfBAUEr (ORCPT ); Fri, 1 Feb 2019 15:04:47 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36296 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730787AbfBAUEr (ORCPT ); Fri, 1 Feb 2019 15:04:47 -0500 Received: by mail-pl1-f196.google.com with SMTP id g9so3755749plo.3 for ; Fri, 01 Feb 2019 12:04:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=97zzKktc3udbeHhInQ+VvKJbp5abho+cFioCHTMeMXE=; b=od7fySbnFUR5ix/16AgIE7GP1ZsHpgpGF6mUjOv9T/4/aPvPf5F14CxnvR8qrUR5LF FlW8KdbJVKQ2B3CumQRlVlz1Lk1Vua7VquMpSgeFCx3LO4z9qGkWPfGN4BYSxILeLK76 kE5L+w1fXnHYlFDt1GUrE6RSPtdk5AXaAegrwZD2XNSFEMXSpl/ABgvAfVcUwrRbdM7k GEGgGmfhXaHrvUS2rv3COQVc3ebjMQF8bh4b9Smz3gK36GzMsnI/anskYB92bGHwij5w uJbEZggT7suD8VE6s49ALYY7fX0tjaDHamCWuof9TSTd7YHqMgk7seWc083DUzpIiEmY GP2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=97zzKktc3udbeHhInQ+VvKJbp5abho+cFioCHTMeMXE=; b=AIq1Pu2eN17MjXILsOiLkS8i6+JdPRRGqFGgIVaHNFTB8l67ymFasAn/TxnG5n86LT 13XEA75VVZ892DmhAFwHhBtPShXgZYlOQKrmP7VvBhzMvSDeqk1jA6V3uvGJg3IdYfH2 FmFnnMyGi9qHMw1YVwKHqPeN6tSroKcA5Jfuf7rFs0NhJaRuy2o97mEE7GZWR+W4Fn8s RlbTEta7LD/a/OChoxXnaaHHlzya9ki44QgdXcGqI3bNCTAidkL56HuU1xyQg0J8y6+D YZeXQuYIdBCTAZT1PlIAK6Iqw4ZVXyqara8lAsrN4NaubE4jRQyErkHZR4NJQFX7L9CD S0Fg== X-Gm-Message-State: AJcUukcninfR/XHv7ATs1Q4/u1qXYs2d6OTBzFEi4yVdQTR5QFAd1sn6 lN12pe+9OsfjCthHDeJ1E1/G1uU= X-Google-Smtp-Source: ALg8bN7YK1yQzrt2YgFFGdNMZtccaX3u/oY0byH/VCN/+hyGeEDy4qbaUxmrxnBwrNf0eAs1X+Wi1Q== X-Received: by 2002:a17:902:d911:: with SMTP id c17mr42190851plz.151.1549051486129; Fri, 01 Feb 2019 12:04:46 -0800 (PST) Received: from ubuntu-vm.corp.microsoft.com ([2001:4898:80e8:0:a18e:4e9f:6b7c:507d]) by smtp.gmail.com with ESMTPSA id x11sm24247451pfe.72.2019.02.01.12.04.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Feb 2019 12:04:45 -0800 (PST) From: Pavel Shilovsky X-Google-Original-From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 17/23] CIFS: Remove custom credit adjustments for SMB2 async IO Date: Fri, 1 Feb 2019 12:04:06 -0800 Message-Id: <1549051452-5968-19-git-send-email-pshilov@microsoft.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549051452-5968-1-git-send-email-pshilov@microsoft.com> References: <1549051452-5968-1-git-send-email-pshilov@microsoft.com> 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 Currently we do proper accounting for credits in regards to reconnects and error handling, thus we do not need custom credit adjustments when reconnect is detected developed previously. Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French --- fs/cifs/smb2pdu.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index ae558a4..03810b6 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3288,17 +3288,8 @@ smb2_async_readv(struct cifs_readdata *rdata) rc = smb2_new_read_req( (void **) &buf, &total_len, &io_parms, rdata, 0, 0); - if (rc) { - if (rc == -EAGAIN && rdata->credits.value) { - /* credits was reset by reconnect */ - rdata->credits.value = 0; - /* reduce in_flight value since we won't send the req */ - spin_lock(&server->req_lock); - server->in_flight--; - spin_unlock(&server->req_lock); - } + if (rc) return rc; - } if (smb3_encryption_required(io_parms.tcon)) flags |= CIFS_TRANSFORM_REQ; @@ -3506,17 +3497,8 @@ smb2_async_writev(struct cifs_writedata *wdata, unsigned int total_len; rc = smb2_plain_req_init(SMB2_WRITE, tcon, (void **) &req, &total_len); - if (rc) { - if (rc == -EAGAIN && wdata->credits.value) { - /* credits was reset by reconnect */ - wdata->credits.value = 0; - /* reduce in_flight value since we won't send the req */ - spin_lock(&server->req_lock); - server->in_flight--; - spin_unlock(&server->req_lock); - } - goto async_writev_out; - } + if (rc) + return rc; if (smb3_encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ;