Skip to content

Commit 83c47d9

Browse files
Marios MakassikisSteve French
authored andcommitted
ksmbd: count all requests in req_running counter
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]> Acked-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 78d4f34 commit 83c47d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/smb/server/connection.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ void ksmbd_conn_enqueue_request(struct ksmbd_work *work)
120120
if (conn->ops->get_cmd_val(work) != SMB2_CANCEL_HE)
121121
requests_queue = &conn->requests;
122122

123+
atomic_inc(&conn->req_running);
123124
if (requests_queue) {
124-
atomic_inc(&conn->req_running);
125125
spin_lock(&conn->request_lock);
126126
list_add_tail(&work->request_entry, requests_queue);
127127
spin_unlock(&conn->request_lock);
@@ -132,11 +132,12 @@ void ksmbd_conn_try_dequeue_request(struct ksmbd_work *work)
132132
{
133133
struct ksmbd_conn *conn = work->conn;
134134

135+
atomic_dec(&conn->req_running);
136+
135137
if (list_empty(&work->request_entry) &&
136138
list_empty(&work->async_request_entry))
137139
return;
138140

139-
atomic_dec(&conn->req_running);
140141
spin_lock(&conn->request_lock);
141142
list_del_init(&work->request_entry);
142143
spin_unlock(&conn->request_lock);

0 commit comments

Comments
 (0)