blk-mq: fix for flush deadlock
authorChristoph Hellwig <hch@lst.de>
Fri, 24 Jan 2014 21:05:56 +0000 (13:05 -0800)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:39 +0000 (12:54 -0600)
commit5b289940e3cc2a33b23b3cef715086f0a52bb90e
tree2c971e2dd6efaaff7a735b8cec39da1299788518
parentfd66ecb469f05e211dde69c5841296f1c46dd9a8
blk-mq: fix for flush deadlock

The flush state machine takes in a struct request, which then is
submitted multiple times to the underling driver.  The old block code
requeses the same request for each of those, so it does not have an
issue with tapping into the request pool.  The new one on the other hand
allocates a new request for each of the actualy steps of the flush
sequence. If have already allocated all of the tags for IO, we will
fail allocating the flush request.

Set aside a reserved request just for flushes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
block/blk-flush.c
block/blk-mq.c
include/linux/blk-mq.h