]> git.itanic.dy.fi Git - linux-stable/commitdiff
Revert "block: freeze the queue earlier in del_gendisk"
authorChristoph Hellwig <hch@lst.de>
Mon, 19 Sep 2022 14:40:49 +0000 (16:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:32:28 +0000 (11:32 +0200)
commit 4c66a326b5ab784cddd72de07ac5b6210e9e1b06 upstream.

This reverts commit a09b314005f3a0956ebf56e01b3b80339df577cc.

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>
block/genhd.c

index e7ab9f3b869cba6c4a5e441397b6ba276d7e6adf..a39c416d658fd39bd51ee89b6b53634402a91547 100644 (file)
@@ -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");
@@ -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);