]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: fix schedule-under-preempt for blocking drivers
authorJens Axboe <axboe@fb.com>
Thu, 30 Mar 2017 18:30:39 +0000 (12:30 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 30 Mar 2017 18:30:39 +0000 (12:30 -0600)
commitc7b0da1a85656012714cf83127fd14b00da33929
treee63fd10fd38137403a56861e03bff6f1677d1ba7
parenta8d64bfa729f3f1d73909fac28aa16446412c86f
blk-mq: fix schedule-under-preempt for blocking drivers

Commit 2c81f5d95a21 unified the single and multi queue request handlers,
but in the process, it also screwed up the locking balance and calls
blk_mq_try_issue_directly() with the ctx preempt lock held. This is a
problem for drivers that have set BLK_MQ_F_BLOCKING, since now they
can't reliably sleep.

While in there, protect against similar issues in the future, by adding
a might_sleep() trigger in the BLOCKING path for direct issue or queue
run.

Reported-by: Josef Bacik <josef@toxicpanda.com>
Tested-by: Josef Bacik <josef@toxicpanda.com>
Fixes: 2c81f5d95a21 ("blk-mq: streamline blk_mq_make_request")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c