Skip to content

Commit cf62501

Browse files
Christoph Hellwigaxboe
authored andcommitted
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: 9b1ce7f ("block: Implement zone append emulation") Reported-by: Bart Van Assche <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Tested-by: Damien Le Moal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent f705d33 commit cf62501

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

block/blk-zoned.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,16 +1307,19 @@ static void blk_zone_wplug_bio_work(struct work_struct *work)
13071307
spin_unlock_irqrestore(&zwplug->lock, flags);
13081308

13091309
bdev = bio->bi_bdev;
1310-
submit_bio_noacct_nocheck(bio);
13111310

13121311
/*
13131312
* blk-mq devices will reuse the extra reference on the request queue
13141313
* usage counter we took when the BIO was plugged, but the submission
13151314
* path for BIO-based devices will not do that. So drop this extra
13161315
* reference here.
13171316
*/
1318-
if (bdev_test_flag(bdev, BD_HAS_SUBMIT_BIO))
1317+
if (bdev_test_flag(bdev, BD_HAS_SUBMIT_BIO)) {
1318+
bdev->bd_disk->fops->submit_bio(bio);
13191319
blk_queue_exit(bdev->bd_disk->queue);
1320+
} else {
1321+
blk_mq_submit_bio(bio);
1322+
}
13201323

13211324
put_zwplug:
13221325
/* Drop the reference we took in disk_zone_wplug_schedule_bio_work(). */

0 commit comments

Comments
 (0)