Skip to content

Commit 9cdbf64

Browse files
committed
Merge tag 'io_uring-5.12-2021-04-16' of git://git.kernel.dk/linux-block
Pull io_uring fix from Jens Axboe: "Fix for a potential hang at exit with SQPOLL from Pavel" * tag 'io_uring-5.12-2021-04-16' of git://git.kernel.dk/linux-block: io_uring: fix early sqd_list removal sqpoll hangs
2 parents 1515011 + c7d9561 commit 9cdbf64

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/io_uring.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6754,6 +6754,9 @@ static int io_sq_thread(void *data)
67546754
current->flags |= PF_NO_SETAFFINITY;
67556755

67566756
mutex_lock(&sqd->lock);
6757+
/* a user may had exited before the thread started */
6758+
io_run_task_work_head(&sqd->park_task_work);
6759+
67576760
while (!test_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state)) {
67586761
int ret;
67596762
bool cap_entries, sqt_spin, needs_sched;
@@ -6770,10 +6773,10 @@ static int io_sq_thread(void *data)
67706773
}
67716774
cond_resched();
67726775
mutex_lock(&sqd->lock);
6773-
if (did_sig)
6774-
break;
67756776
io_run_task_work();
67766777
io_run_task_work_head(&sqd->park_task_work);
6778+
if (did_sig)
6779+
break;
67776780
timeout = jiffies + sqd->sq_thread_idle;
67786781
continue;
67796782
}

0 commit comments

Comments
 (0)