From cb8b1890bed37e03dde71b8161e6329c6af66718 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Sat, 7 Dec 2024 13:23:00 +0900 Subject: [PATCH] ksmbd: fix3 Signed-off-by: Namjae Jeon --- connection.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/connection.c b/connection.c index 073a9300..7913f7e0 100644 --- a/connection.c +++ b/connection.c @@ -379,10 +379,12 @@ int ksmbd_conn_handler_loop(void *p) kvfree(conn->request_buf); conn->request_buf = NULL; - if (atomic_inc_return(&conn->req_running) >= max_req) { +recheck: + if (atomic_inc_return(&conn->req_running) > max_req) { + atomic_dec(&conn->req_running); wait_event_interruptible(conn->req_running_q, atomic_read(&conn->req_running) < max_req); - atomic_dec(&conn->req_running); + goto recheck; } size = t->ops->read(t, hdr_buf, sizeof(hdr_buf), -1);