From: hare@suse.de (Hannes Reinecke)
Subject: [PATCH 2/2] nvme-multipath: do not select namespaces which are about to be removed
Date: Thu, 4 Jul 2019 08:10:47 +0200 [thread overview]
Message-ID: <20190704061047.94976-3-hare@suse.de> (raw)
In-Reply-To: <20190704061047.94976-1-hare@suse.de>
nvme_ns_remove() will first set the NVME_NS_REMOVING flag before removing
it from the list at the very last step.
So to avoid selecting a namespace in nvme_find_path() which is about to be
removed check the NVME_NS_REMOVING flag, too, when selecting a new path.
Signed-off-by: Hannes Reinecke <hare at suse.com>
---
drivers/nvme/host/multipath.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 9b6dc11fa559..a9a927677970 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -126,7 +126,8 @@ void nvme_mpath_clear_current_path(struct nvme_ns *ns)
static bool nvme_path_is_disabled(struct nvme_ns *ns)
{
return ns->ctrl->state != NVME_CTRL_LIVE ||
- test_bit(NVME_NS_ANA_PENDING, &ns->flags);
+ test_bit(NVME_NS_ANA_PENDING, &ns->flags) ||
+ test_bit(NVME_NS_REMOVING, &ns->flags);
}
static struct nvme_ns *__nvme_find_path(struct nvme_ns_head *head, int node)
--
2.16.4
next prev parent reply other threads:[~2019-07-04 6:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 6:10 [PATCHv2 0/2] nvme-multipath: path selection fixes Hannes Reinecke
2019-07-04 6:10 ` [PATCH 1/2] nvme-multipath: check singular list in vme_round_robin_path() Hannes Reinecke
2019-07-04 6:10 ` Hannes Reinecke [this message]
2019-07-09 21:19 ` [PATCHv2 0/2] nvme-multipath: path selection fixes Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2019-07-03 13:12 [PATCH " Hannes Reinecke
2019-07-03 13:12 ` [PATCH 2/2] nvme-multipath: do not select namespaces which are about to be removed Hannes Reinecke
2019-07-03 13:21 ` Christoph Hellwig
2019-07-03 20:33 ` Sagi Grimberg
2019-07-04 6:00 ` Hannes Reinecke
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=20190704061047.94976-3-hare@suse.de \
--to=hare@suse.de \
/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