io_uring: fix 'sync' handling of io_fallback_tw()
authorJens Axboe <axboe@kernel.dk>
Thu, 24 Apr 2025 16:28:14 +0000 (10:28 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:59:08 +0000 (07:59 +0200)
commit7a8a6b627fded72e9e177730dc7e225d17c65c03
treee3d1eda49cbf8d3440938def5bc48bcd3f70d4be
parent74d9e2018789f95ea4e659b57ade15227daad36a
io_uring: fix 'sync' handling of io_fallback_tw()

commit edd43f4d6f50ec3de55a0c9e9df6348d1da51965 upstream.

A previous commit added a 'sync' parameter to io_fallback_tw(), which if
true, means the caller wants to wait on the fallback thread handling it.
But the logic is somewhat messed up, ensure that ctxs are swapped and
flushed appropriately.

Cc: stable@vger.kernel.org
Fixes: dfbe5561ae93 ("io_uring: flush offloaded and delayed task_work on exit")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/io_uring.c