Skip to content

Commit bab4b2c

Browse files
isilenceaxboe
authored andcommitted
io_uring: reuse io_should_terminate_tw() for cmds
io_uring_cmd_work() rolled a hard coded version of io_should_terminate_tw() to avoid conflicts, but now it's time to converge them. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/8a88dd6e4ed8e6c00c6552af0c20c9de02e458de.1736955455.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 5374510 commit bab4b2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/uring_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static void io_uring_cmd_work(struct io_kiocb *req, struct io_tw_state *ts)
105105
struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
106106
unsigned int flags = IO_URING_F_COMPLETE_DEFER;
107107

108-
if (current->flags & (PF_EXITING | PF_KTHREAD))
108+
if (io_should_terminate_tw())
109109
flags |= IO_URING_F_TASK_DEAD;
110110

111111
/* task_work executor checks the deffered list completion */

0 commit comments

Comments
 (0)