From: Pavel Shilovsky Date: Fri, 4 Jan 2019 00:45:13 +0000 (-0800) Subject: CIFS: Do not set credits to 1 if the server didn't grant anything X-Git-Tag: v4.19.16~41 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c3606c64678369dc108f397109569cfa0ce0c101;p=users%2Fdwmw2%2Flinux.git CIFS: Do not set credits to 1 if the server didn't grant anything commit 33fa5c8b8a7dbe6353a56eaa654b790348890d42 upstream. 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. Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French CC: Stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 333729cf46cdb..a610381f81405 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -885,8 +885,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)