All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Christoph Hellwig <hch@lst.de>, Damien Le Moal <dlemoal@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Yu Kuai <yukuai1@huaweicloud.com>,
	Ming Lei <ming.lei@redhat.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] block: Fix a deadlock related freezing zoned storage devices
Date: Tue, 27 May 2025 14:49:11 -0700	[thread overview]
Message-ID: <df240ef1-d794-45af-a3cf-cdec06731103@acm.org> (raw)
In-Reply-To: <20250523082048.GA15587@lst.de>

On 5/23/25 1:20 AM, Christoph Hellwig wrote:
> Something like this completely untested patch:
> 
> diff --git a/block/blk-zoned.c b/block/blk-zoned.c
> index 8f15d1aa6eb8..6841af8a989c 100644
> --- a/block/blk-zoned.c
> +++ b/block/blk-zoned.c
> @@ -1306,16 +1306,18 @@ static void blk_zone_wplug_bio_work(struct work_struct *work)
>   	spin_unlock_irqrestore(&zwplug->lock, flags);
>   
>   	bdev = bio->bi_bdev;
> -	submit_bio_noacct_nocheck(bio);
> -
>   	/*
>   	 * blk-mq devices will reuse the extra reference on the request queue
>   	 * usage counter we took when the BIO was plugged, but the submission
>   	 * path for BIO-based devices will not do that. So drop this extra
>   	 * 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);
> +	} else {
> +		blk_mq_submit_bio(bio);
> +	}
>   
>   put_zwplug:
>   	/* Drop the reference we took in disk_zone_wplug_schedule_bio_work(). */

This patch works fine on my test setup.

Thanks,

Bart.

  parent reply	other threads:[~2025-05-27 21:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-22 17:14 [PATCH] block: Fix a deadlock related freezing zoned storage devices Bart Van Assche
2025-05-22 17:38 ` Jens Axboe
2025-05-22 18:32   ` Bart Van Assche
2025-05-23  2:10     ` Ming Lei
2025-05-23  6:06       ` Damien Le Moal
2025-05-23  5:53     ` Damien Le Moal
2025-05-23  8:10   ` Damien Le Moal
2025-05-23  8:20     ` Damien Le Moal
2025-05-23  8:22       ` Christoph Hellwig
2025-05-23  8:20     ` Christoph Hellwig
2025-05-23 11:00       ` Damien Le Moal
2025-05-26  7:41       ` Damien Le Moal
2025-05-27 21:49       ` Bart Van Assche [this message]
2025-05-23 12:36     ` Jens Axboe
2025-05-23  3:10 ` Christoph Hellwig
2025-05-23 16:08   ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df240ef1-d794-45af-a3cf-cdec06731103@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=yukuai1@huaweicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.