From: Hannes Reinecke <hare@suse.de>
To: Minwoo Im <minwoo.im.dev@gmail.com>
Cc: Keith Busch <keith.busch@wdc.com>, Christoph Hellwig <hch@lst.de>,
linux-nvme@lists.infradead.org, Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCHv2] nvme: add 'fail_if_no_path' sysfs attribute
Date: Mon, 22 Feb 2021 13:37:14 +0100 [thread overview]
Message-ID: <6bf38292-c852-32a3-2ed8-4445321aefd7@suse.de> (raw)
In-Reply-To: <20210222101519.GA2856@localhost.localdomain>
On 2/22/21 11:15 AM, Minwoo Im wrote:
> On 21-02-22 07:41:55, Hannes Reinecke wrote:
>> In some setups like RAID we need to return an I/O error
>> once all paths are unavailable to allow the upper layers
>> to start their own error recovery (like redirecting I/O
>> to other mirrors).
>> This patch adds a sysfs attribute 'fail_if_no_path' to
>> allow the admin to enable that behaviour instead of the
>> current 'queue until a path becomes available' policy.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>> ---
>> drivers/nvme/host/core.c | 5 +++++
>> drivers/nvme/host/multipath.c | 38 +++++++++++++++++++++++++++++++++--
>> drivers/nvme/host/nvme.h | 2 ++
>> 3 files changed, 43 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index 5c1ec3bfb9d3..ef20029a46b2 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -3466,6 +3466,7 @@ static struct attribute *nvme_ns_id_attrs[] = {
>> #ifdef CONFIG_NVME_MULTIPATH
>> &dev_attr_ana_grpid.attr,
>> &dev_attr_ana_state.attr,
>> + &dev_attr_fail_if_no_path.attr,
>> #endif
>> NULL,
>> };
>> @@ -3496,6 +3497,10 @@ static umode_t nvme_ns_id_attrs_are_visible(struct kobject *kobj,
>> if (!nvme_ctrl_use_ana(nvme_get_ns_from_dev(dev)->ctrl))
>> return 0;
>> }
>> + if (a == &dev_attr_fail_if_no_path.attr) {
>> + if (dev_to_disk(dev)->fops == &nvme_bdev_ops)
>> + return 0;
>> + }
>> #endif
>> return a->mode;
>> }
>> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
>> index 0696319adaf6..35ed2f6d431b 100644
>> --- a/drivers/nvme/host/multipath.c
>> +++ b/drivers/nvme/host/multipath.c
>> @@ -283,10 +283,13 @@ static bool nvme_available_path(struct nvme_ns_head *head)
>> continue;
>> switch (ns->ctrl->state) {
>> case NVME_CTRL_LIVE:
>> + return true;
>
> Hello Hannes,
>
> May I ask there's any reason why LIVE state is not covered by the sysfs
> attribute that this patch introduced ? Wouldn't it be possible to have
> no available paths (inaccessible) in LIVE state ?
>
> Thanks! :)
>
Ah, you mean ANA inaccessible?
Hmm. Technically, yes, this might be the case.
I'll be updating the patch.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
prev parent reply other threads:[~2021-02-22 12:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-22 6:41 [PATCHv2] nvme: add 'fail_if_no_path' sysfs attribute Hannes Reinecke
2021-02-22 10:15 ` Minwoo Im
2021-02-22 12:37 ` Hannes Reinecke [this message]
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=6bf38292-c852-32a3-2ed8-4445321aefd7@suse.de \
--to=hare@suse.de \
--cc=hch@lst.de \
--cc=keith.busch@wdc.com \
--cc=linux-nvme@lists.infradead.org \
--cc=minwoo.im.dev@gmail.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