aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index f65871116404..f43c8a5840ae 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -407,8 +407,13 @@ void blk_cleanup_queue(struct request_queue *q)
407 spin_unlock_irq(lock); 407 spin_unlock_irq(lock);
408 mutex_unlock(&q->sysfs_lock); 408 mutex_unlock(&q->sysfs_lock);
409 409
410 /* drain all requests queued before DEAD marking */ 410 /*
411 blk_drain_queue(q, true); 411 * Drain all requests queued before DEAD marking. The caller might
412 * be trying to tear down @q before its elevator is initialized, in
413 * which case we don't want to call into draining.
414 */
415 if (q->elevator)
416 blk_drain_queue(q, true);
412 417
413 /* @q won't process any more request, flush async actions */ 418 /* @q won't process any more request, flush async actions */
414 del_timer_sync(&q->backing_dev_info.laptop_mode_wb_timer); 419 del_timer_sync(&q->backing_dev_info.laptop_mode_wb_timer);