Skip to content

Commit ade3f10

Browse files
Christoph HellwigSasha Levin
authored andcommitted
block: don't use submit_bio_noacct_nocheck in blk_zone_wplug_bio_work
[ Upstream commit cf62501 ] 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 <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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7863c1d commit ade3f10

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
@@ -1306,16 +1306,19 @@ static void blk_zone_wplug_bio_work(struct work_struct *work)
13061306
spin_unlock_irqrestore(&zwplug->lock, flags);
13071307

13081308
bdev = bio->bi_bdev;
1309-
submit_bio_noacct_nocheck(bio);
13101309

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

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

0 commit comments

Comments
 (0)