@@ -728,14 +728,8 @@ static void rq_completed(struct mapped_device *md, int rw, int run_queue)
if (!md_in_flight(md))
wake_up(&md->wait);
- /*
- * Run this off this callpath, as drivers could invoke end_io while
- * inside their request_fn (and holding the queue lock). Calling
- * back into ->request_fn() could deadlock attempting to grab the
- * queue lock again.
- */
if (run_queue)
- blk_run_queue_async(md->queue);
+ blk_run_queue(md->queue);
/*
* dm_put() must be at the end of this function. See the comment above
At least in theory the mapped device can disappear after rq_completed() has invoked dm_put() and before the queue of the mapped device has been run. Avoid this by running the queue synchronously instead of asynchronously. Note: the previous patch makes invoking blk_run_queue() from inside dm_request_fn() safe. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Cc: Alasdair G Kergon <agk@redhat.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Mike Snitzer <snitzer@redhat.com> Cc: Tejun Heo <tj@kernel.org> Cc: James Bottomley <JBottomley@parallels.com> Cc: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> --- drivers/md/dm.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)