CIFS: Fix adjustment of credits for MTU requests
authorPavel Shilovsky <pshilov@microsoft.com>
Wed, 19 Dec 2018 22:49:09 +0000 (22:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jan 2019 21:07:10 +0000 (22:07 +0100)
commitedc8099b54ec5c465987b4f6bcd44a0130ed2ffd
tree299c99089576faa3420abf4262acfa715df9d4d9
parente1008331ce7a1033d70ef3e6559eaf5e072b8218
CIFS: Fix adjustment of credits for MTU requests

commit b983f7e92348d7e7d091db1b78b7915e9dd3d63a upstream.

Currently for MTU requests we allocate maximum possible credits
in advance and then adjust them according to the request size.
While we were adjusting the number of credits belonging to the
server, we were skipping adjustment of credits belonging to the
request. This patch fixes it by setting request credits to
CreditCharge field value of SMB2 packet header.

Also ask 1 credit more for async read and write operations to
increase parallelism and match the behavior of other operations.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2pdu.c