Skip to content

Commit

Permalink
Revert "block: freeze the queue earlier in del_gendisk"
Browse files Browse the repository at this point in the history
commit 4c66a32 upstream.

This reverts commit a09b314.

Dusty Mabe reported consistent hang during CoreOS shutdown with a MD
RAID1 setup.  Although apparently similar hangs happened before,
and this patch most likely is not the root cause it made it much
more severe.  Revert it until we can figure out what is going on
with the md driver.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220919144049.978907-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Christoph Hellwig authored and gregkh committed Sep 28, 2022
1 parent 398a0fd commit 48a1296
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,6 @@ void del_gendisk(struct gendisk *disk)
* Prevent new I/O from crossing bio_queue_enter().
*/
blk_queue_start_drain(q);
blk_mq_freeze_queue_wait(q);

if (!(disk->flags & GENHD_FL_HIDDEN)) {
sysfs_remove_link(&disk_to_dev(disk)->kobj, "bdi");
Expand All @@ -649,6 +648,8 @@ void del_gendisk(struct gendisk *disk)
pm_runtime_set_memalloc_noio(disk_to_dev(disk), false);
device_del(disk_to_dev(disk));

blk_mq_freeze_queue_wait(q);

blk_throtl_cancel_bios(disk->queue);

blk_sync_queue(q);
Expand Down

0 comments on commit 48a1296

Please sign in to comment.