From patchwork Thu Jan 10 22:24:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 10757009 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 09EBA14E5 for ; Thu, 10 Jan 2019 22:25:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB14C29B6B for ; Thu, 10 Jan 2019 22:25:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF4DE29B94; Thu, 10 Jan 2019 22:25:11 +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 93CBE29B6B for ; Thu, 10 Jan 2019 22:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727733AbfAJWZL (ORCPT ); Thu, 10 Jan 2019 17:25:11 -0500 Received: from mail-pg1-f175.google.com ([209.85.215.175]:33198 "EHLO mail-pg1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728800AbfAJWZL (ORCPT ); Thu, 10 Jan 2019 17:25:11 -0500 Received: by mail-pg1-f175.google.com with SMTP id z11so5430718pgu.0 for ; Thu, 10 Jan 2019 14:25:10 -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:in-reply-to:references; bh=Yy1kzkUReLtCO4bKAAShZG0eJGrSq9RSrExy7M5jaIU=; b=uYrmD5qdrT4yvq1w24cyPKnZEx+jHnwKMn/KJLyMi5DxvfHpTx7UZf8qhjLxqFZkxc 51buuSGWCvzYVZ31OI6ByZ0og/5H6DwzNpSsDo14lhDEn73Zv4mvanJce9QJqFLHFPgp lprux9LBQdlDkL3d7wbJ30Zd4OrE9HKqIdtfG2A/XEmE3aW7EYLz9//pF4AVK/d4ofuj gJIf9DTmfVsZW+X6MHRtHvve6yqzT/4Hlr8wfQSv0s2V5pOXOwTROtd3GsFCaj/+5COv oZRlEt5cKrcpE//wHozoyEAS4GwxpCM3sMrIBcLm61cW/QF2df6M1qXnEOO4KkDB4mZ6 DeUA== 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:in-reply-to :references; bh=Yy1kzkUReLtCO4bKAAShZG0eJGrSq9RSrExy7M5jaIU=; b=CUQQ7uwCuV1NU+Lhf/m6Vtl+Z1+G6dgQloG6Ps88gkgrink34xd/plQR8JeaaBilf7 1yfzg4N6glwkovWNZTu+8zZiOu5Rc8LW2/kfsHPWGV6lySborg6ohbmu2FaUG+04tx81 QbWMvAVS6VYmKadGa7CqB7PAer7KLOPf9gLuI6op/cbBxWc8X7pMimARTkulBAtD0HVV wAhLeq/5+/2c2xECOEXdiXyAgSfboIte5pjkGw7+87W+8gn9JfvdPtSFngfrK9Q7tAkQ qdYFflubQIiVr1sy4Q7wqaygdGwFFgdQB73qBVmRlExNqQ67xbjsfKTzpSA0zhBIEFY5 Cjmg== X-Gm-Message-State: AJcUukcGdVRtjWU0atvhZcKm4R3j6ugiOL4tG3dvgR1fVoVYd/hr9bdt j6Hu9upmdM3LHMOWDi+GrGWT5cg= X-Google-Smtp-Source: ALg8bN7yexqczq/sMQomZk/v+UQbOBFQfOLRzH+dPDRE6qBgNNvIKq/XEIf/tlYfSuVnb3CIMrRyww== X-Received: by 2002:a63:4187:: with SMTP id o129mr877861pga.370.1547159109562; Thu, 10 Jan 2019 14:25:09 -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.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jan 2019 14:25:08 -0800 (PST) From: Pavel Shilovsky X-Google-Original-From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Cc: Steve French , Ronnie Sahlberg Subject: [PATCH 2/7] CIFS: Do not set credits to 1 if the server didn't grant anything Date: Thu, 10 Jan 2019 14:24:53 -0800 Message-Id: <1547159098-19011-3-git-send-email-pshilov@microsoft.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547159098-19011-1-git-send-email-pshilov@microsoft.com> References: <1547159098-19011-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 reset the number of total credits granted by the server to 1 if the server didn't grant us anything int the response. This violates the SMB3 protocol - we need to trust the server and use the credit values from the response. Fix this by removing the corresponding code. Cc: Signed-off-by: Pavel Shilovsky --- fs/cifs/transport.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 5be7302..8e75d68 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -894,8 +894,6 @@ compound_send_recv(const unsigned int xid, struct cifs_ses *ses, for (i = 0; i < num_rqst; i++) if (midQ[i]->resp_buf) credits += ses->server->ops->get_credits(midQ[i]); - if (!credits) - credits = 1; for (i = 0; i < num_rqst; i++) { if (rc < 0)