CIFS: Do not skip SMB2 message IDs on send failures
authorPavel Shilovsky <piastryyy@gmail.com>
Mon, 4 Mar 2019 22:02:50 +0000 (14:02 -0800)
committerSteve French <stfrench@microsoft.com>
Tue, 5 Mar 2019 02:06:12 +0000 (20:06 -0600)
commitc781af7e0c1fed9f1d0e0ec31b86f5b21a8dca17
tree1712a2e7f7e5be3fdf63b77ddbeeb41925c6ef03
parent4fe75c4e4bc2caeb4159573e26cf3075e2c0fd9b
CIFS: Do not skip SMB2 message IDs on send failures

When we hit failures during constructing MIDs or sending PDUs
through the network, we end up not using message IDs assigned
to the packet. The next SMB packet will skip those message IDs
and continue with the next one. This behavior may lead to a server
not granting us credits until we use the skipped IDs. Fix this by
reverting the current ID to the original value if any errors occur
before we push the packet through the network stack.

This patch fixes the generic/310 test from the xfs-tests.

Cc: <stable@vger.kernel.org> # 4.19.x
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsglob.h
fs/cifs/smb2ops.c
fs/cifs/smb2transport.c
fs/cifs/transport.c