Re: [PATCH 2/2] btrfs: zoned: skip reporting zone for new block group

Damien Le Moal
2025-03-12T01:42:35Z

On 3/12/25 10:31, Naohiro Aota wrote:
> There is a potential deadlock if we do report zones in an IO context. When one
> process do a report zones and another process freezes the block device, the
> report zones side cannot allocate a tag because the freeze is already started.
> This can thus result in new block group creation to hang forever, blocking the
> write path.

+Shin'ichiro

blktest has a failing test case due to a lockdep splat triggered by this. Would
be good to add that information (with the splat) here.

>
> Thankfully, a new block group should be created on empty zones. So, reporting
> the zones is not necessary and we can set the write pointer = 0 and load the
> zone capacity from the block layer using bdev_zone_capacity() helper.
>
> CC: stable@vger.kernel.org # 6.13+
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>

With that fixed, looks good to me.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

--
Damien Le Moal
Western Digital Research