]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
CIFS: Fix credit calculations in compound mid callback
authorPavel Shilovsky <pshilov@microsoft.com>
Wed, 23 Jan 2019 00:50:21 +0000 (16:50 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:29:08 +0000 (10:29 +0100)
commit7cb453e5a88169b2a5cec1e00778fc969efd1a77
treeb8a4c0cd2f1afaa2b9457d62b2f612b842e346f5
parentfe182af7767ae01c87b5673ddb7697723673063e
CIFS: Fix credit calculations in compound mid callback

[ Upstream commit 3d3003fce8e837acc4e3960fe3cbabebc356dcb5 ]

The current code doesn't do proper accounting for credits
in SMB1 case: it adds one credit per response only if we get
a complete response while it needs to return it unconditionally.
Fix this and also include malformed responses for SMB2+ into
accounting for credits because such responses have Credit
Granted field, thus nothing prevents to get a proper credit
value from them.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/smb2ops.c
fs/cifs/transport.c