From: Guixin Liu <kanie@linux.alibaba.com>
To: Daniel Wagner <dwagner@suse.de>, John Garry <john.g.garry@oracle.com>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Nilay Shroff <nilay@linux.ibm.com>,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH v3] nvme-multipath: expose path_state via sysfs
Date: Wed, 24 Jun 2026 19:52:48 +0800 [thread overview]
Message-ID: <315b3fcf-a4ba-4f81-aa16-0d2f61a47b5f@linux.alibaba.com> (raw)
In-Reply-To: <c9b1d8fd-7012-44a0-a975-947fc0e16fac@flourine.local>
在 2026/6/24 17:55, Daniel Wagner 写道:
> On Wed, Jun 24, 2026 at 08:36:44AM +0100, John Garry wrote:
>> On 24/06/2026 06:48, Guixin Liu wrote:
>>> Add a read-only "path_state" sysfs attribute to each NVMe path namespace
>>> device (/sys/class/nvme/nvmeX/nvmeXcYnZ/path_state) that exposes the
>>> current path state, including whether the path is enabled or disabled
>>> with a specific reason.
>>>
>>> Factor the path disable checks from nvme_path_is_disabled() into a new
>>> nvme_path_get_state() helper that returns an enum nvme_path_state. This
>>> keeps the path selection logic and sysfs reporting in sync, so any future
>>> updates to the path disable criteria are automatically reflected in the
>>> sysfs output.
>>>
>>> Possible values:
>>> - "enabled (optimized)" : ANA state is optimized
>>> - "enabled (non-optimized)" : ANA state is not optimized
>>> - "disabled (ctrl_down)" : controller is not live
>>> - "disabled (ana_pending)" : ANA state change pending
>>> - "disabled (ns_not_ready)" : namespace is not ready
> I'd prefer to have a single string here instead of something we might need
> to parse again. The sysfs docs says
>
> Mixing types, expressing multiple lines of data, and doing fancy
> formatting of data is heavily frowned upon. Doing these things may get
> you publicly humiliated and your code rewritten without notice.
>
> Something like
>
> - optimized
> - non-optimized
> - ctrl-down
> - ana-pending
> - ns-no-ready
Would this be redundant with ana_state?
Is this OK?
- enabled
- ctrl-down
- ana-pending
- ns-not-ready
CC Keith, John, Nilay, what do you think?
>
> BTW, the docs on sysfs say, these interfaces should be documented also
> in Documentation/ABI. So far we haven't done this for the nvme
> subsystem. Should we start with it?
Sure, just like the nvme-multipath.rst file I worked on earlier,
I can do this later with the help of AI.
Best Regards,
Guixin Liu
next prev parent reply other threads:[~2026-06-24 11:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 5:48 [PATCH v3] nvme-multipath: expose path_state via sysfs Guixin Liu
2026-06-24 7:36 ` John Garry
2026-06-24 9:55 ` Daniel Wagner
2026-06-24 11:52 ` Guixin Liu [this message]
2026-06-24 13:21 ` Nilay Shroff
2026-07-07 1:47 ` Guixin Liu
2026-06-24 11:08 ` Guixin Liu
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=315b3fcf-a4ba-4f81-aa16-0d2f61a47b5f@linux.alibaba.com \
--to=kanie@linux.alibaba.com \
--cc=axboe@kernel.dk \
--cc=dwagner@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 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.