io_uring/io-wq: clear current->worker_private on exit
Changes
1 files changed · +6 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| io_uring/io-wq.c | modified | +6 | −1 | View file |
io_uring/io-wq.c
View filediff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index fe38eb0..399e9a1 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -220,7 +220,12 @@ static void io_worker_exit(struct io_worker *worker)
list_del_rcu(&worker->all_list);
raw_spin_unlock(&wq->lock);
io_wq_dec_running(worker);
- worker->flags = 0;
+ /*
+ * this worker is a goner, clear ->worker_private to avoid any
+ * inc/dec running calls that could happen as part of exit from
+ * touching 'worker'.
+ */
+ current->worker_private = NULL;
kfree_rcu(worker, rcu);
io_worker_ref_put(wq);