]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
CIFS: Fix credits calculation for cancelled requests
authorPavel Shilovsky <pshilov@microsoft.com>
Fri, 4 Jan 2019 00:45:27 +0000 (16:45 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:29:07 +0000 (10:29 +0100)
commit75d8ed18255ee379e7441812b5a8e7e28a452d21
tree7c24f232d1af3e6bc98a133e25ad8b169e8d81d4
parentf3c42f9b10ce13bd52b167c045399df1619b5080
CIFS: Fix credits calculation for cancelled requests

[ Upstream commit 8a26f0f781f56d3016b34a2217e346973d067e7b ]

If a request is cancelled, we can't assume that the server returns
1 credit back. Instead we need to wait for a response and process
the number of credits granted by the server.

Create a separate mid callback for cancelled request, parse the number
of credits in a response buffer and add them to the client's credits.
If the didn't get a response (no response buffer available) assume
0 credits granted. The latter most probably happens together with
session reconnect, so the client's credits are adjusted anyway.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/cifsglob.h
fs/cifs/transport.c