On 11/4/24 16:15, Jens Axboe wrote:
On 11/4/24 9:12 AM, Pavel Begunkov wrote:
When the taks that submitted a request is dying, a task work for that
request might get run by a kernel thread or even worse by a half
dismantled task. We can't just cancel the task work without running the
callback as the cmd might need to do some clean up, so pass a flag
instead. If set, it's not safe to access any task resources and the
callback is expected to cancel the cmd ASAP.
Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
---
Made a bit fancier to avoid conflicts. Mark, as before I'd suggest you
to take it and send together with the fix.
That's fine, or we can just take it through the io_uring tree, it's not
like this matters as both will land before -rc1.
There should be a btrfs patch that depends on it and I would hope
it gets squashed into the main patchset or at least goes into the
same pull and not delayed to rc2.
But if it goes through the btrfs tree, we can adjust this to use
io_should_terminate_tw() after the fact.
Reviewed-by: Jens Axboe <axboe@xxxxxxxxx>
--
Pavel Begunkov