FROMGIT: block: don't use submit_bio_noacct_nocheck in blk_zone_wplug_bio_work
Bios queued up in the zone write plug have already gone through all all
preparation in the submit_bio path, including the freeze protection.
Submitting them through submit_bio_noacct_nocheck duplicates the work
and can can cause deadlocks when freezing a queue with pending bio
write plugs.
Go straight to ->submit_bio or blk_mq_submit_bio to bypass the
superfluous extra freeze protection and checks.
Fixes: 9b1ce7f0c6 ("block: Implement zone append emulation")
Reported-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Tested-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20250611044416.2351850-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Bug: 415836627
Change-Id: I14b8f05f53ba446395e1aa93e60ad0aafe66b4d3
(cherry picked from commit cf625013d8741c01407bbb4a60c111b61b9fa69d https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/ for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
committed by
Bart Van Assche
parent
b1605a0473
commit
2c69381349
+5
-2
@@ -1318,7 +1318,6 @@ again:
|
|||||||
spin_unlock_irqrestore(&zwplug->lock, flags);
|
spin_unlock_irqrestore(&zwplug->lock, flags);
|
||||||
|
|
||||||
bdev = bio->bi_bdev;
|
bdev = bio->bi_bdev;
|
||||||
submit_bio_noacct_nocheck(bio);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* blk-mq devices will reuse the extra reference on the request queue
|
* blk-mq devices will reuse the extra reference on the request queue
|
||||||
@@ -1326,8 +1325,12 @@ again:
|
|||||||
* path for BIO-based devices will not do that. So drop this extra
|
* path for BIO-based devices will not do that. So drop this extra
|
||||||
* reference here.
|
* reference here.
|
||||||
*/
|
*/
|
||||||
if (bdev_test_flag(bdev, BD_HAS_SUBMIT_BIO))
|
if (bdev_test_flag(bdev, BD_HAS_SUBMIT_BIO)) {
|
||||||
|
bdev->bd_disk->fops->submit_bio(bio);
|
||||||
blk_queue_exit(bdev->bd_disk->queue);
|
blk_queue_exit(bdev->bd_disk->queue);
|
||||||
|
} else {
|
||||||
|
blk_mq_submit_bio(bio);
|
||||||
|
}
|
||||||
|
|
||||||
put_zwplug:
|
put_zwplug:
|
||||||
/* Drop the reference we took in disk_zone_wplug_schedule_bio_work(). */
|
/* Drop the reference we took in disk_zone_wplug_schedule_bio_work(). */
|
||||||
|
|||||||
Reference in New Issue
Block a user