Skip to content

Commit e5dc480

Browse files
isilenceaxboe
authored andcommitted
io_uring: remove not needed PF_EXITING check
Since cancellation got moved before exit_signals(), there is no one left who can call io_run_task_work() with PF_EXIING set, so remove the check. Note that __io_req_task_submit() still needs a similar check. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/f7f305ececb1e6044ea649fb983ca754805bb884.1624739600.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent dd432ea commit e5dc480

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

fs/io_uring.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,12 +2235,6 @@ static inline unsigned int io_put_rw_kbuf(struct io_kiocb *req)
22352235

22362236
static inline bool io_run_task_work(void)
22372237
{
2238-
/*
2239-
* Not safe to run on exiting task, and the task_work handling will
2240-
* not add work to such a task.
2241-
*/
2242-
if (unlikely(current->flags & PF_EXITING))
2243-
return false;
22442238
if (current->task_works) {
22452239
__set_current_state(TASK_RUNNING);
22462240
task_work_run();
@@ -9020,7 +9014,8 @@ static void io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
90209014
ret |= io_cancel_defer_files(ctx, task, cancel_all);
90219015
ret |= io_poll_remove_all(ctx, task, cancel_all);
90229016
ret |= io_kill_timeouts(ctx, task, cancel_all);
9023-
ret |= io_run_task_work();
9017+
if (task)
9018+
ret |= io_run_task_work();
90249019
ret |= io_run_ctx_fallback(ctx);
90259020
if (!ret)
90269021
break;

0 commit comments

Comments
 (0)