]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: mark task TASK_RUNNING before handling resume/task work
authorJens Axboe <axboe@kernel.dk>
Mon, 6 Feb 2023 15:20:46 +0000 (08:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:07 +0000 (09:34 +0100)
commitf608965def57b07b9c9a7a2c09de0f4e1ce98285
treee92c2449b9d96b922ae1f4f1f5e1599f8e9f2267
parent5806b7918a35e073c29b11c4934db18132241a98
io_uring: mark task TASK_RUNNING before handling resume/task work

commit 6b1b9fefbcd1cd4f28f2a97db6cee30ce30e983d upstream.

Just like for task_work, set the task mode to TASK_RUNNING before doing
any potential resume work. We're not holding any locks at this point,
but we may have already set the task state to TASK_INTERRUPTIBLE in
preparation for going to sleep waiting for events. Ensure that we set it
back to TASK_RUNNING if we have work to process, to avoid warnings on
calling blocking operations with !TASK_RUNNING.

Fixes: 2f919963ae74 ("io_uring: handle TIF_NOTIFY_RESUME when checking for task_work")
Reported-by: kernel test robot <oliver.sang@intel.com>
Link: https://lore.kernel.org/oe-lkp/202302062208.24d3e563-oliver.sang@intel.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/io_uring.h