cifs: fix credit accounting for extra channel
authorAurelien Aptel <aaptel@suse.com>
Thu, 4 Mar 2021 17:42:21 +0000 (17:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 16:06:20 +0000 (17:06 +0100)
commit3370a84d781ca5227682bd6e747aaefb6dcc8e21
tree37113a9e568aa68f08ce8295ca6a7a58d903de2e
parent83ff4f644de4c2a38ff3a7d8eea1c0d5dc5e06d5
cifs: fix credit accounting for extra channel

commit a249cc8bc2e2fed680047d326eb9a50756724198 upstream.

With multichannel, operations like the queries
from "ls -lR" can cause all credits to be used and
errors to be returned since max_credits was not
being set correctly on the secondary channels and
thus the client was requesting 0 credits incorrectly
in some cases (which can lead to not having
enough credits to perform any operation on that
channel).

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
CC: <stable@vger.kernel.org> # v5.8+
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/connect.c
fs/cifs/sess.c