* [PATCH] nvme: allow duplicate controller if prior controller being deleted
@ 2018-05-25 21:02 James Smart
2018-05-30 6:06 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: James Smart @ 2018-05-25 21:02 UTC (permalink / raw)
The current checks for whether a new controller request "matches"
an existing controller ignores controller state and checks identity
strings. There are cases where an existing controller may be in its
last steps of deletion when they are "matched" by a new connection.
Change the behavior so that the new connection ignores controllers
that are deleted.
Signed-off-by: James Smart <james.smart at broadcom.com>
---
drivers/nvme/host/fabrics.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h
index ef46c915b7b5..0cf0460a5c92 100644
--- a/drivers/nvme/host/fabrics.h
+++ b/drivers/nvme/host/fabrics.h
@@ -139,7 +139,9 @@ static inline bool
nvmf_ctlr_matches_baseopts(struct nvme_ctrl *ctrl,
struct nvmf_ctrl_options *opts)
{
- if (strcmp(opts->subsysnqn, ctrl->opts->subsysnqn) ||
+ if (ctrl->state == NVME_CTRL_DELETING ||
+ ctrl->state == NVME_CTRL_DEAD ||
+ strcmp(opts->subsysnqn, ctrl->opts->subsysnqn) ||
strcmp(opts->host->nqn, ctrl->opts->host->nqn) ||
memcmp(&opts->host->id, &ctrl->opts->host->id, sizeof(uuid_t)))
return false;
--
2.13.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] nvme: allow duplicate controller if prior controller being deleted
2018-05-25 21:02 [PATCH] nvme: allow duplicate controller if prior controller being deleted James Smart
@ 2018-05-30 6:06 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2018-05-30 6:06 UTC (permalink / raw)
On Fri, May 25, 2018@02:02:23PM -0700, James Smart wrote:
> The current checks for whether a new controller request "matches"
> an existing controller ignores controller state and checks identity
> strings. There are cases where an existing controller may be in its
> last steps of deletion when they are "matched" by a new connection.
>
> Change the behavior so that the new connection ignores controllers
> that are deleted.
>
> Signed-off-by: James Smart <james.smart at broadcom.com>
Applied to nvme-4.18.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-30 6:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-25 21:02 [PATCH] nvme: allow duplicate controller if prior controller being deleted James Smart
2018-05-30 6:06 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).