diff options
author | James Smart <jsmart2021@gmail.com> | 2018-05-26 00:02:23 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-30 09:03:23 +0300 |
commit | ab4f47a9f4a12603a1806230d44ead2e54158f85 (patch) | |
tree | 83ed5fc851782bfd59ccdff8c310aaedb1a7f2ad /drivers/nvme/host | |
parent | 5de815a7eedfacf593817ef34634eaa9b75a1482 (diff) | |
download | linux-ab4f47a9f4a12603a1806230d44ead2e54158f85.tar.xz |
nvme: allow duplicate controller if prior controller being deleted
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@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host')
-rw-r--r-- | drivers/nvme/host/fabrics.h | 4 |
1 files changed, 3 insertions, 1 deletions
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; |