From: Guixin Liu <kanie@linux.alibaba.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Sagi Grimberg <sagi@grimberg.me>,
Nilay Shroff <nilay@linux.ibm.com>,
Daniel Wagner <dwagner@suse.de>,
John Garry <john.g.garry@oracle.com>,
Hannes Reinecke <hare@suse.de>,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme-multipath: set BLK_FEAT_ZONED only after the zone info is known
Date: Tue, 15 Sep 2026 16:51:59 +0800 [thread overview]
Message-ID: <709f43ca-b93f-407b-8d64-fe78f6090488@linux.alibaba.com> (raw)
In-Reply-To: <20260915063651.GA13293@lst.de>
在 2026/9/15 14:36, Christoph Hellwig 写道:
> On Mon, Sep 14, 2026 at 06:57:13PM +0800, Guixin Liu wrote:
>> The namespace head is marked zoned at allocation time based only on
>> the command set identifier, before any zone information has been
>> queried. If the zone info query fails on the first scan, the path
>> namespace is registered without zoned limits while the head still
>> advertises the zoned capability with a zone size of zero. Reporting
>> zones or writing to the head then shifts by ilog2(0), triggering the
>> UBSAN shift-out-of-bounds report in the report-zones and write paths.
>>
>> Drop the zoned feature from the head allocation and inherit it from
>> the path namespace: the head limits refresh already stacks the zoned
>> feature, the zone size and the zone resource limits from the path
>> queue, so the head matches the path namespace and becomes zoned once a
>> revalidation succeeds. This also stops marking the head zoned when
>> CONFIG_BLK_DEV_ZONED is off, which used to fail the head allocation
>> with a WARN.
> Where do we actually stack it right now?
The head stacks it in nvme_update_ns_info(): after the path namespace
update it's own limits, queue_limits_stack_bdev() stacks the path
queue into the head, and blk_stack_limits() inherits the BLK_FEAT_ZONED
through BLK_FEAT_INHERIT_MASK, along with chunk_sectors and the zone
resource limits. That happens before the head is registered, so
blk_revalidate_disk_zones() see the zoned feature in place.
Best Regards,
Guixin Liu
next prev parent reply other threads:[~2026-09-15 8:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 10:57 [PATCH] nvme-multipath: set BLK_FEAT_ZONED only after the zone info is known Guixin Liu
2026-09-15 6:36 ` Christoph Hellwig
2026-09-15 8:51 ` Guixin Liu [this message]
2026-09-22 8:17 ` Guixin Liu
2026-09-22 15:13 ` Keith Busch
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=709f43ca-b93f-407b-8d64-fe78f6090488@linux.alibaba.com \
--to=kanie@linux.alibaba.com \
--cc=axboe@kernel.dk \
--cc=dwagner@suse.de \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=john.g.garry@oracle.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=nilay@linux.ibm.com \
--cc=sagi@grimberg.me \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox