Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp2070936img; Wed, 27 Feb 2019 09:56:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IZy6sjYRBEFLYafLszNOm4O34m1RjcaljcDueHU5pi9Rj/1ajiMUEIJiq+eXDfZekOjYCj/ X-Received: by 2002:a62:13da:: with SMTP id 87mr2848396pft.173.1551290175321; Wed, 27 Feb 2019 09:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551290175; cv=none; d=google.com; s=arc-20160816; b=k0h+9Agc3BTo+ynYHk9shz1hcr7PD9VvsEnjUElmGYmiPy7BlWvTD41yXeHoRpQgyZ +eULoUmBeXveoovPASBP/YNJ5CPXd8RitoCEG8BGnmJO2+jhG/TVjRXBaxKjQ1oiStka 0nGEi+IK47eh0Oaei2XmkmSmYauafM4UZlstB9Jt+QlStmgYAEaZ+8ueC4oFSikVAENW jEGGMg/9hp9d73RK0E6ZfJcg8Xit9O6IvK/Gkn4wLjwnLIPiwTt4x0d47FIBt3Qvr4EP rLXlKzQ0EMAazArcNUWcC1ahKCHPqfx5ooZS0ic1WlTom4RT+9ALRE9KXzut1x3gV38l EzVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zwUxm3IKJ1IfwvlQOmvpzrRHXaiVjJG5HjBO51bQJAU=; b=WPsDPko2XTPsPP261C1etXFbPSlNlL3OUHCz9V+YJ5tzsNxophN83CIfBRunHAfyHk hPvcFeKf8I6dv0QXn71yIEBjIw6QGZX5GolZ8M4dTAWgKgIqoVgqYiIbBbAEb4LbnMAY KH3PsFCk2zJtCmRfJIwkUL6uhjU64CyYxVb1CiJ+TktueUo0t/w3FIigkODEdo0+WBg0 0C1205P2LZugdSOf3UN72AtIak8dxbJPSMnz3uZFLtyUFgU+oLB7RM+y7WD5++3pCiO/ 95qybzVv/gRBGlWBUpiGHNCufZXgRDIbmtHxV/dI1AoJD8ErsVJymfZynX4Tu84wVn+v dbpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="P+/Qarot"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si14993494pfa.121.2019.02.27.09.56.01; Wed, 27 Feb 2019 09:56:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="P+/Qarot"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729893AbfB0RyJ (ORCPT + 99 others); Wed, 27 Feb 2019 12:54:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:45836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbfB0RyJ (ORCPT ); Wed, 27 Feb 2019 12:54:09 -0500 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F829217F5; Wed, 27 Feb 2019 17:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551290048; bh=kspwMt9uaWNH65FXb/F0LswvVhq/mPDrL03nKO/y62o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P+/QarotcjOYrS1c5ACqk5a4yTg3rH4ARtRNlldK5a8IdtKcn7Qe6an75N+hubHCW 7DMJzyNcOmZQZ7DF3YIlMidZpbHJjEHGw3UwBlSP23cfmy3mD+BxgyaE3kuusXh/sp D9akQN8CkirNA2A573NTy0XWo2ZANDD54sP4AbwA= Date: Wed, 27 Feb 2019 12:54:06 -0500 From: Sasha Levin To: Pavel Shilovskiy Cc: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Steven French , "linux-cifs@vger.kernel.org" Subject: Re: [PATCH AUTOSEL 4.20 65/77] CIFS: Do not assume one credit for async responses Message-ID: <20190227175406.GM10616@sasha-vm> References: <20190215020855.176727-1-sashal@kernel.org> <20190215020855.176727-65-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 15, 2019 at 08:10:47PM +0000, Pavel Shilovskiy wrote: >чт, 14 февр. 2019 г. в 18:40, Sasha Levin : >> >> From: Pavel Shilovsky >> >> [ Upstream commit 0fd1d37b0501efc6e295f56ab55cdaff784aa50c ] >> >> If we don't receive a response we can't assume that the server >> granted one credit. Assume zero credits in such cases. >> >> Signed-off-by: Pavel Shilovsky >> Reviewed-by: Ronnie Sahlberg >> Signed-off-by: Steve French >> Signed-off-by: Sasha Levin >> --- >> fs/cifs/smb2pdu.c | 15 +++++++++++---- >> 1 file changed, 11 insertions(+), 4 deletions(-) >> >> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c >> index d1ae7cdb236d..3c44c51310c4 100644 >> --- a/fs/cifs/smb2pdu.c >> +++ b/fs/cifs/smb2pdu.c >> @@ -2834,9 +2834,10 @@ smb2_echo_callback(struct mid_q_entry *mid) >> { >> struct TCP_Server_Info *server = mid->callback_data; >> struct smb2_echo_rsp *rsp = (struct smb2_echo_rsp *)mid->resp_buf; >> - unsigned int credits_received = 1; >> + unsigned int credits_received = 0; >> >> - if (mid->mid_state == MID_RESPONSE_RECEIVED) >> + if (mid->mid_state == MID_RESPONSE_RECEIVED >> + || mid->mid_state == MID_RESPONSE_MALFORMED) >> credits_received = le16_to_cpu(rsp->sync_hdr.CreditRequest); >> >> DeleteMidQEntry(mid); >> @@ -3093,7 +3094,7 @@ smb2_readv_callback(struct mid_q_entry *mid) >> struct TCP_Server_Info *server = tcon->ses->server; >> struct smb2_sync_hdr *shdr = >> (struct smb2_sync_hdr *)rdata->iov[0].iov_base; >> - unsigned int credits_received = 1; >> + unsigned int credits_received = 0; >> struct smb_rqst rqst = { .rq_iov = rdata->iov, >> .rq_nvec = 2, >> .rq_pages = rdata->pages, >> @@ -3132,6 +3133,9 @@ smb2_readv_callback(struct mid_q_entry *mid) >> task_io_account_read(rdata->got_bytes); >> cifs_stats_bytes_read(tcon, rdata->got_bytes); >> break; >> + case MID_RESPONSE_MALFORMED: >> + credits_received = le16_to_cpu(shdr->CreditRequest); >> + /* fall through */ >> default: >> if (rdata->result != -ENODATA) >> rdata->result = -EIO; >> @@ -3325,7 +3329,7 @@ smb2_writev_callback(struct mid_q_entry *mid) >> struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); >> unsigned int written; >> struct smb2_write_rsp *rsp = (struct smb2_write_rsp *)mid->resp_buf; >> - unsigned int credits_received = 1; >> + unsigned int credits_received = 0; >> >> switch (mid->mid_state) { >> case MID_RESPONSE_RECEIVED: >> @@ -3353,6 +3357,9 @@ smb2_writev_callback(struct mid_q_entry *mid) >> case MID_RETRY_NEEDED: >> wdata->result = -EAGAIN; >> break; >> + case MID_RESPONSE_MALFORMED: >> + credits_received = le16_to_cpu(rsp->sync_hdr.CreditRequest); >> + /* fall through */ >> default: >> wdata->result = -EIO; >> break; >> -- >> 2.19.1 >> > >Can you also apply the following patch to 4.20.y and 4.19.y, please? > >https://patchwork.ozlabs.org/patch/1030180/ I'll queue it up for the next cycle as it has dependencies on stable@ commits that didn't make it in yet and I don't want to mess up with Greg's flow. Thanks you! -- Thanks, Sasha