]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
CIFS: Do not set credits to 1 if the server didn't grant anything
authorPavel Shilovsky <pshilov@microsoft.com>
Fri, 4 Jan 2019 00:45:13 +0000 (16:45 -0800)
committerSteve French <stfrench@microsoft.com>
Thu, 10 Jan 2019 20:32:36 +0000 (14:32 -0600)
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 <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
fs/cifs/transport.c

index 5be7302853b6c55fe97b04339c39fd4d13567db6..8e75d689be46da91bb07a82fcab592ddaedf66ae 100644 (file)
@@ -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)