]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
CIFS: Move credit processing to mid callbacks for SMB3
authorPavel Shilovsky <pshilov@microsoft.com>
Thu, 3 Jan 2019 23:53:10 +0000 (15:53 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:29:07 +0000 (10:29 +0100)
commit3c57a0be487088b08d9c88998f911eb4a7ba36e4
tree3942617977ea819e891236a13bd9f1c855124b56
parent75d8ed18255ee379e7441812b5a8e7e28a452d21
CIFS: Move credit processing to mid callbacks for SMB3

[ Upstream commit ee258d79159afed52ca9372aeb9c1a51e89b32ee ]

Currently we account for credits in the thread initiating a request
and waiting for a response. The demultiplex thread receives the response,
wakes up the thread and the latter collects credits from the response
buffer and add them to the server structure on the client. This approach
is not accurate, because it may race with reconnect events in the
demultiplex thread which resets the number of credits.

Fix this by moving credit processing to new mid callbacks that collect
credits granted by the server from the response in the demultiplex thread.

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/transport.c