io_uring: fix 'sync' handling of io_fallback_tw() io_uring-6.15-20250424
authorJens Axboe <axboe@kernel.dk>
Thu, 24 Apr 2025 16:28:14 +0000 (10:28 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 24 Apr 2025 16:32:43 +0000 (10:32 -0600)
commitedd43f4d6f50ec3de55a0c9e9df6348d1da51965
tree6dbfa64b430fdfd1d597e17a79bdd24266c65d71
parent5e16f1a68d28965c12b6fa227a306fef8a680f84
io_uring: fix 'sync' handling of io_fallback_tw()

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>
io_uring/io_uring.c