OSDN Git Service

blk-mq: don't handle non-flush requests in blk_insert_flush
authorChristoph Hellwig <hch@lst.de>
Tue, 19 Oct 2021 12:25:53 +0000 (14:25 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Oct 2021 17:10:09 +0000 (11:10 -0600)
commitd92ca9d8348fb12c89eac5928bd651c3a485d7b9
tree05d9098b647cd912977e1f87fa297fd9c543ffde
parentdc5fc361d891e089dfd9c0a975dc78041036b906
blk-mq: don't handle non-flush requests in blk_insert_flush

Return to the normal blk_mq_submit_bio flow if the bio did not end up
actually being a flush because the device didn't support it.  Note that
this is basically impossible to hit without special instrumentation given
that submit_bio_checks already clears these flags usually, so we'd need a
tight race to actually hit this code path.

With this the call to blk_mq_run_hw_queue for the flush requests can be
removed given that the actual flush requests are always issued via the
requeue workqueue which runs the queue unconditionally.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211019122553.2467817-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-flush.c
block/blk-mq.c
block/blk.h