diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index d768a8ddc173..37fba001bdcf 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -436,6 +436,14 @@ void blk_put_queue(struct request_queue *q) | |||
436 | 436 | ||
437 | void blk_cleanup_queue(struct request_queue *q) | 437 | void blk_cleanup_queue(struct request_queue *q) |
438 | { | 438 | { |
439 | /* | ||
440 | * We know we have process context here, so we can be a little | ||
441 | * cautious and ensure that pending block actions on this device | ||
442 | * are done before moving on. Going into this function, we should | ||
443 | * not have processes doing IO to this device. | ||
444 | */ | ||
445 | blk_sync_queue(q); | ||
446 | |||
439 | mutex_lock(&q->sysfs_lock); | 447 | mutex_lock(&q->sysfs_lock); |
440 | queue_flag_set_unlocked(QUEUE_FLAG_DEAD, q); | 448 | queue_flag_set_unlocked(QUEUE_FLAG_DEAD, q); |
441 | mutex_unlock(&q->sysfs_lock); | 449 | mutex_unlock(&q->sysfs_lock); |