cifs: fix max_credits implementation
authorShyam Prasad N <sprasad@microsoft.com>
Fri, 9 Jun 2023 17:46:58 +0000 (17:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:25 +0000 (09:42 +0200)
commitfbd3ae6997fb97d8bb23e6674240f4c3856a4744
treeac58ac7fba8028bcb0ba4839680675e12f09c2fb
parent8a424afa08c54670192f4b0c5351207ff6f8cdc4
cifs: fix max_credits implementation

[ Upstream commit 5e90aa21eb1372736e08cee0c0bf47735c5c4b95 ]

The current implementation of max_credits on the client does
not work because the CreditRequest logic for several commands
does not take max_credits into account.

Still, we can end up asking the server for more credits, depending
on the number of credits in flight. For this, we need to
limit the credits while parsing the responses too.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/smb2ops.c
fs/smb/client/smb2pdu.c