diff mbox series

[2/7] CIFS: Do not set credits to 1 if the server didn't grant anything

Message ID 1547159098-19011-3-git-send-email-pshilov@microsoft.com (mailing list archive)
State New, archived
Headers show
Series SMB3 credit flow control handling and writeback fixes | expand

Commit Message

Pavel Shilovsky Jan. 10, 2019, 10:24 p.m. UTC
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: <stable@vger.kernel.org>
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
---
 fs/cifs/transport.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

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)