Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:27 +0100
committerJiri Slaby <jslaby@suse.cz>2019-01-18 07:53:32 +0100
commit96c020611ef9440054b32b94c239b643ff79c7ef (patch)
treef8cdd45f55aa6a5365b62c5d31ce8920a34fafe4
parenta5ad13ae6049a3a04262c637d433cd3ca67ae3f5 (diff)
CIFS: Fix adjustment of credits for MTU requests (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.3-012-CIFS-Fix-adjustment-of-credits-for-MTU-request.patch67
-rw-r--r--series.conf1
2 files changed, 68 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.3-012-CIFS-Fix-adjustment-of-credits-for-MTU-request.patch b/patches.kernel.org/4.20.3-012-CIFS-Fix-adjustment-of-credits-for-MTU-request.patch
new file mode 100644
index 0000000000..7dc7123702
--- /dev/null
+++ b/patches.kernel.org/4.20.3-012-CIFS-Fix-adjustment-of-credits-for-MTU-request.patch
@@ -0,0 +1,67 @@
+From: Pavel Shilovsky <pshilov@microsoft.com>
+Date: Wed, 19 Dec 2018 22:49:09 +0000
+Subject: [PATCH] CIFS: Fix adjustment of credits for MTU requests
+References: bnc#1012628
+Patch-mainline: 4.20.3
+Git-commit: b983f7e92348d7e7d091db1b78b7915e9dd3d63a
+
+commit b983f7e92348d7e7d091db1b78b7915e9dd3d63a upstream.
+
+Currently for MTU requests we allocate maximum possible credits
+in advance and then adjust them according to the request size.
+While we were adjusting the number of credits belonging to the
+server, we were skipping adjustment of credits belonging to the
+request. This patch fixes it by setting request credits to
+CreditCharge field value of SMB2 packet header.
+
+Also ask 1 credit more for async read and write operations to
+increase parallelism and match the behavior of other operations.
+
+Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+CC: Stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/cifs/smb2pdu.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
+index 27f86537a5d1..836c59fca049 100644
+--- a/fs/cifs/smb2pdu.c
++++ b/fs/cifs/smb2pdu.c
+@@ -3197,12 +3197,14 @@ smb2_async_readv(struct cifs_readdata *rdata)
+ if (rdata->credits) {
+ shdr->CreditCharge = cpu_to_le16(DIV_ROUND_UP(rdata->bytes,
+ SMB2_MAX_BUFFER_SIZE));
+- shdr->CreditRequest = shdr->CreditCharge;
++ shdr->CreditRequest =
++ cpu_to_le16(le16_to_cpu(shdr->CreditCharge) + 1);
+ spin_lock(&server->req_lock);
+ server->credits += rdata->credits -
+ le16_to_cpu(shdr->CreditCharge);
+ spin_unlock(&server->req_lock);
+ wake_up(&server->request_q);
++ rdata->credits = le16_to_cpu(shdr->CreditCharge);
+ flags |= CIFS_HAS_CREDITS;
+ }
+
+@@ -3474,12 +3476,14 @@ smb2_async_writev(struct cifs_writedata *wdata,
+ if (wdata->credits) {
+ shdr->CreditCharge = cpu_to_le16(DIV_ROUND_UP(wdata->bytes,
+ SMB2_MAX_BUFFER_SIZE));
+- shdr->CreditRequest = shdr->CreditCharge;
++ shdr->CreditRequest =
++ cpu_to_le16(le16_to_cpu(shdr->CreditCharge) + 1);
+ spin_lock(&server->req_lock);
+ server->credits += wdata->credits -
+ le16_to_cpu(shdr->CreditCharge);
+ spin_unlock(&server->req_lock);
+ wake_up(&server->request_q);
++ wdata->credits = le16_to_cpu(shdr->CreditCharge);
+ flags |= CIFS_HAS_CREDITS;
+ }
+
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 69aa06e9df..762086723c 100644
--- a/series.conf
+++ b/series.conf
@@ -249,6 +249,7 @@
patches.kernel.org/4.20.3-009-ALSA-hda-realtek-Support-Dell-headset-mode-for.patch
patches.kernel.org/4.20.3-010-ALSA-hda-realtek-Add-unplug-function-into-unpl.patch
patches.kernel.org/4.20.3-011-ALSA-hda-realtek-Disable-headset-Mic-VREF-for-.patch
+ patches.kernel.org/4.20.3-012-CIFS-Fix-adjustment-of-credits-for-MTU-request.patch
########################################################
# Build fixes that apply to the vanilla kernel too.