io-wq: fix queue stalling race
authorJens Axboe <axboe@kernel.dk>
Tue, 31 Aug 2021 19:53:00 +0000 (13:53 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 31 Aug 2021 19:53:00 +0000 (13:53 -0600)
commit0242f6426ea78fbe3933b44f8c55ae93ec37f6cc
tree80d4226ac1a2b1460900aea9d8e4e6d018410ad8
parentb8ce1b9d25ccf81e1bbabd45b963ed98b2222df8
io-wq: fix queue stalling race

We need to set the stalled bit early, before we drop the lock for adding
us to the stall hash queue. If not, then we can race with new work being
queued between adding us to the stall hash and io_worker_handle_work()
marking us stalled.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c