aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Gurtuvoy <maxg@mellanox.com>2018-06-19 08:45:33 -0400
committerChristoph Hellwig <hch@lst.de>2018-06-20 08:20:51 -0400
commitd68a90e148f5a82aa67654c5012071e31c0e4baa (patch)
tree2fbfdcb67c6c4385655209184b43d6676ea91476
parent5e77d61cbc7e766778037127dab69e6410a8fc48 (diff)
nvmet: reset keep alive timer in controller enable
Controllers that are not yet enabled should not really enforce keep alive timeouts, but we still want to track a timeout and cleanup in case a host died before it enabled the controller. Hence, simply reset the keep alive timer when the controller is enabled. Suggested-by: Max Gurtovoy <maxg@mellanox.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/nvme/target/core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index a03da764ecae..74d4b785d2da 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -686,6 +686,14 @@ static void nvmet_start_ctrl(struct nvmet_ctrl *ctrl)
686 } 686 }
687 687
688 ctrl->csts = NVME_CSTS_RDY; 688 ctrl->csts = NVME_CSTS_RDY;
689
690 /*
691 * Controllers that are not yet enabled should not really enforce the
692 * keep alive timeout, but we still want to track a timeout and cleanup
693 * in case a host died before it enabled the controller. Hence, simply
694 * reset the keep alive timer when the controller is enabled.
695 */
696 mod_delayed_work(system_wq, &ctrl->ka_work, ctrl->kato * HZ);
689} 697}
690 698
691static void nvmet_clear_ctrl(struct nvmet_ctrl *ctrl) 699static void nvmet_clear_ctrl(struct nvmet_ctrl *ctrl)