Skip to content

Commit

Permalink
ksmbd: count all requests in req_running counter
Browse files Browse the repository at this point in the history
This changes the semantics of req_running to count all in-flight
requests on a given connection, rather than the number of elements
in the conn->request list. The latter is used only in smb2_cancel,
and the counter is not used

Signed-off-by: Marios Makassikis <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
Marios Makassikis authored and namjaejeon committed Dec 17, 2024
1 parent b1b27b3 commit f6c0d50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ void ksmbd_conn_enqueue_request(struct ksmbd_work *work)
requests_queue = &conn->requests;
#endif

atomic_inc(&conn->req_running);
if (requests_queue) {
atomic_inc(&conn->req_running);
spin_lock(&conn->request_lock);
list_add_tail(&work->request_entry, requests_queue);
spin_unlock(&conn->request_lock);
Expand All @@ -150,11 +150,12 @@ void ksmbd_conn_try_dequeue_request(struct ksmbd_work *work)
{
struct ksmbd_conn *conn = work->conn;

atomic_dec(&conn->req_running);

if (list_empty(&work->request_entry) &&
list_empty(&work->async_request_entry))
return;

atomic_dec(&conn->req_running);
spin_lock(&conn->request_lock);
list_del_init(&work->request_entry);
spin_unlock(&conn->request_lock);
Expand Down

0 comments on commit f6c0d50

Please sign in to comment.