summaryrefslogtreecommitdiff
path: root/io_uring/uring_cmd.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2025-09-18 11:27:06 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-25 11:13:47 +0200
commitd7a38ee4f0be96737c39a931b7f9cdc7f42b6913 (patch)
tree464ea87e3fe7b032a50f2f142d9d53181269683d /io_uring/uring_cmd.c
parent9b71bfefc405100f91c08618a248a4dd64e41b2d (diff)
downloadlinux-d7a38ee4f0be96737c39a931b7f9cdc7f42b6913.tar.gz
linux-d7a38ee4f0be96737c39a931b7f9cdc7f42b6913.tar.bz2
linux-d7a38ee4f0be96737c39a931b7f9cdc7f42b6913.zip
io_uring: backport io_should_terminate_tw()
Parts of commit b6f58a3f4aa8dba424356c7a69388a81f4459300 upstream. Backport io_should_terminate_tw() helper to judge whether task_work should be run or terminated. Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring/uring_cmd.c')
-rw-r--r--io_uring/uring_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
index 13917967c52f..27edb8fd639c 100644
--- a/io_uring/uring_cmd.c
+++ b/io_uring/uring_cmd.c
@@ -118,7 +118,7 @@ static void io_uring_cmd_work(struct io_kiocb *req, struct io_tw_state *ts)
struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
unsigned int flags = IO_URING_F_COMPLETE_DEFER;
- if (current->flags & (PF_EXITING | PF_KTHREAD))
+ if (io_should_terminate_tw())
flags |= IO_URING_F_TASK_DEAD;
/* task_work executor checks the deffered list completion */