aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ksmbd/connection.c
diff options
context:
space:
mode:
authorHyunchul Lee <hyc.lee@gmail.com>2022-05-20 14:35:47 +0900
committerSteve French <stfrench@microsoft.com>2022-05-21 15:01:43 -0500
commit376b9133826865568167b4091ef92a68c4622b87 (patch)
treee73600c8088b056ae689bbd7c2eacd419dd02aec /fs/ksmbd/connection.c
parentksmbd: smbd: fix connection dropped issue (diff)
downloadlinux-dev-376b9133826865568167b4091ef92a68c4622b87.tar.xz
linux-dev-376b9133826865568167b4091ef92a68c4622b87.zip
ksmbd: fix outstanding credits related bugs
outstanding credits must be initialized to 0, because it means the sum of credits consumed by in-flight requests. And outstanding credits must be compared with total credits in smb2_validate_credit_charge(), because total credits are the sum of credits granted by ksmbd. This patch fix the following error, while frametest with Windows clients: Limits exceeding the maximum allowable outstanding requests, given : 128, pending : 8065 Fixes: b589f5db6d4a ("ksmbd: limits exceeding the maximum allowable outstanding requests") Cc: stable@vger.kernel.org Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com> Reported-by: Yufan Chen <wiz.chen@gmail.com> Tested-by: Yufan Chen <wiz.chen@gmail.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/connection.c')
-rw-r--r--fs/ksmbd/connection.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ksmbd/connection.c b/fs/ksmbd/connection.c
index 7db87771884a..e8f476c5f189 100644
--- a/fs/ksmbd/connection.c
+++ b/fs/ksmbd/connection.c
@@ -62,7 +62,7 @@ struct ksmbd_conn *ksmbd_conn_alloc(void)
atomic_set(&conn->req_running, 0);
atomic_set(&conn->r_count, 0);
conn->total_credits = 1;
- conn->outstanding_credits = 1;
+ conn->outstanding_credits = 0;
init_waitqueue_head(&conn->req_running_q);
INIT_LIST_HEAD(&conn->conns_list);