CIFS: Fix credits calculation for cancelled requests
authorPavel Shilovsky <pshilov@microsoft.com>
Fri, 4 Jan 2019 00:45:27 +0000 (16:45 -0800)
committerSteve French <stfrench@microsoft.com>
Fri, 11 Jan 2019 13:14:40 +0000 (07:14 -0600)
commit8a26f0f781f56d3016b34a2217e346973d067e7b
treebde15d0af3ad8c84e5a539a4d5ed2dc28d3317fa
parentb9a74cde94957d82003fb9f7ab4777938ca851cd
CIFS: Fix credits calculation for cancelled requests

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>
fs/cifs/cifsglob.h
fs/cifs/transport.c