aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2019-07-10 12:31:31 -0400
committerChristoph Hellwig <hch@lst.de>2019-07-10 12:36:16 -0400
commit420dc733f980246f2179e0144f9cedab9ad4a91e (patch)
treebc7212cd4ffbe70e7226b432ff12816f7ac7f478
parent4c73cbdff1119d088ed16d63def59ad32b11b18f (diff)
nvme: fix regression upon hot device removal and insertion
When we validate the new controller id, we want to skip controllers that are either deleting or dead. Fix the check to do that and not on the newly added controller. Fixes: 1b1031ca63b2 ("nvme: validate cntlid during controller initialisation") Reported-by: Jon Derrick <jonathan.derrick@intel.com> Tested-by: Jon Derrick <jonathan.derrick@intel.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/nvme/host/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index f4340dc1d399..3077cd4d75bf 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2416,8 +2416,8 @@ static bool nvme_validate_cntlid(struct nvme_subsystem *subsys,
2416 lockdep_assert_held(&nvme_subsystems_lock); 2416 lockdep_assert_held(&nvme_subsystems_lock);
2417 2417
2418 list_for_each_entry(tmp, &subsys->ctrls, subsys_entry) { 2418 list_for_each_entry(tmp, &subsys->ctrls, subsys_entry) {
2419 if (ctrl->state == NVME_CTRL_DELETING || 2419 if (tmp->state == NVME_CTRL_DELETING ||
2420 ctrl->state == NVME_CTRL_DEAD) 2420 tmp->state == NVME_CTRL_DEAD)
2421 continue; 2421 continue;
2422 2422
2423 if (tmp->cntlid == ctrl->cntlid) { 2423 if (tmp->cntlid == ctrl->cntlid) {