From: Jirong Feng <jirong.feng@easystack.cn>
To: Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@fb.com>, Sagi Grimberg <sagi@grimberg.me>,
linux-nvme@lists.infradead.org, peng.xiao@easystack.cn
Subject: Re: Should NVME_SC_INVALID_NS be translated to BLK_STS_IOERR instead of BLK_STS_NOTSUPP so that multipath(both native and dm) can failover on the failure?
Date: Tue, 5 Dec 2023 15:06:27 +0800 [thread overview]
Message-ID: <8d53e40d-a725-4fb4-805e-1d1e009f83c4@easystack.cn> (raw)
In-Reply-To: <ZW6yskpdzy8uAp3u@kbusch-mbp>
As far as I know, according to current implementation of function
nvmet_parse_io_cmd() in drivers/nvme/target/core.c, nvmet_req_find_ns()
is called before nvmet_check_ana_state(), so I believe currently nvmet
is returning NVME_SC_INVALID_NS once namespace is disabled no matter if
ANA is supported. In nvmet, a disabled namespace acts like it does not
exist. nvmet_check_ana_state() requires req->ns, which is assigned in
nvmet_req_find_ns(). If namespace is unknown, nvmet can't know the state
of its ana group either.
So, to be better up to the specification, nvmet does need to
differentiate a namespace is disabled or non-existent?
Moreover, even if nvmet returns NVME_SC_INVALID_FIELD to the host, the
status code is still translated to BLK_STS_NOTSUPP, multipath won't
retry either...
在 2023/12/5 13:18, Keith Busch 写道:
> On Tue, Dec 05, 2023 at 05:40:35AM +0100, Christoph Hellwig wrote:
>> On Mon, Dec 04, 2023 at 09:37:56PM -0700, Keith Busch wrote:
>>> So the controller through that path used to be able to access the
>>> Namespace, then suddenly lost ability to do so, but some other path can
>>> still access it if we retry on a failover/alternate path? I think your
>>> target is returning the wrong error code. It should be SCT/SC 303h,
>>> Asymmetric Access Persistent Loss (NVME_SC_ANA_TRANSITION), for what
>>> you're describing.
>> Yes, assuming ANA is actually supported by the controllers..
> Even without ANA, "Invalid Namespace" is still the wrong status code
> when dynamic namespace attachement is supported. If the namespace still
> exists in the subsystem but not attached to the controller processing a
> command (i.e. "inactive"), the return needs be Invalid Field in Command:
>
> Specifying an inactive namespace identifier (refer to section 3.2.1.4)
> in a command that uses the namespace identifier shall cause the
> controller to abort the command with a status code of Invalid Field in
> Command
>
next prev parent reply other threads:[~2023-12-05 7:07 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 7:58 Should NVME_SC_INVALID_NS be translated to BLK_STS_IOERR instead of BLK_STS_NOTSUPP so that multipath(both native and dm) can failover on the failure? Jirong Feng
2023-12-04 8:47 ` Sagi Grimberg
2023-12-05 3:54 ` Jirong Feng
2023-12-05 4:37 ` Keith Busch
2023-12-05 4:40 ` Christoph Hellwig
2023-12-05 5:18 ` Keith Busch
2023-12-05 7:06 ` Jirong Feng [this message]
2023-12-05 8:50 ` Sagi Grimberg
2023-12-25 11:25 ` Jirong Feng
2023-12-25 11:40 ` Sagi Grimberg
2023-12-25 12:14 ` Jirong Feng
2023-12-26 13:27 ` Jirong Feng
2024-01-01 9:51 ` Sagi Grimberg
2024-01-02 10:33 ` Jirong Feng
2024-01-02 12:46 ` Sagi Grimberg
2024-01-03 10:24 ` Jirong Feng
2024-01-04 11:56 ` Sagi Grimberg
2024-01-30 9:36 ` Jirong Feng
2024-01-30 11:29 ` Sagi Grimberg
2024-01-31 6:25 ` Christoph Hellwig
2024-03-20 3:17 ` Jirong Feng
2024-03-20 8:51 ` Sagi Grimberg
2024-03-21 3:06 ` Jirong Feng
2024-04-07 22:28 ` Sagi Grimberg
2024-04-12 7:52 ` Jirong Feng
2024-04-12 8:57 ` Sagi Grimberg
2024-04-22 9:47 ` Sagi Grimberg
2024-04-23 3:15 ` Jirong Feng
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=8d53e40d-a725-4fb4-805e-1d1e009f83c4@easystack.cn \
--to=jirong.feng@easystack.cn \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=peng.xiao@easystack.cn \
--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