Skip to content

Commit

Permalink
ksmbd: fix4
Browse files Browse the repository at this point in the history
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
namjaejeon committed Dec 9, 2024
1 parent cb8b189 commit 412dc2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ void ksmbd_conn_enqueue_request(struct ksmbd_work *work)
requests_queue = &conn->requests;
#endif

atomic_inc(&conn->req_running);
if (requests_queue) {
spin_lock(&conn->request_lock);
list_add_tail(&work->request_entry, requests_queue);
Expand Down Expand Up @@ -380,8 +381,7 @@ int ksmbd_conn_handler_loop(void *p)
conn->request_buf = NULL;

recheck:
if (atomic_inc_return(&conn->req_running) > max_req) {
atomic_dec(&conn->req_running);
if (atomic_read(&conn->req_running) + 1 > max_req) {
wait_event_interruptible(conn->req_running_q,
atomic_read(&conn->req_running) < max_req);
goto recheck;
Expand Down

0 comments on commit 412dc2f

Please sign in to comment.