Skip to content
Commit c616cbee authored by Jens Axboe's avatar Jens Axboe
Browse files

blk-mq: punt failed direct issue to dispatch list

After the direct dispatch corruption fix, we permanently disallow direct
dispatch of non read/write requests. This works fine off the normal IO
path, as they will be retried like any other failed direct dispatch
request. But for the blk_insert_cloned_request() that only DM uses to
bypass the bottom level scheduler, we always first attempt direct
dispatch. For some types of requests, that's now a permanent failure,
and no amount of retrying will make that succeed. This results in a
livelock.

Instead of making special cases for what we can direct issue, and now
having to deal with DM solving the livelock while still retaining a BUSY
condition feedback loop, always just add a request that has been through
->queue_rq() to the hardware queue dispatch list. These are safe to use
as no merging can take place there. Additionally, if requests do have
prepped data from drivers, we aren't dependent on them not sharing space
in the request structure to safely add them to the IO scheduler lists.

This basically reverts ffe81d45 and is based on a patch from Ming,
but with the list insert case covered as well.

Fixes: ffe81d45

 ("blk-mq: fix corruption with direct issue")
Cc: stable@vger.kernel.org
Suggested-by: default avatarMing Lei <ming.lei@redhat.com>
Reported-by: default avatarBart Van Assche <bvanassche@acm.org>
Tested-by: default avatarMing Lei <ming.lei@redhat.com>
Acked-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent ba7aeae5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment