Skip to content

Commit d68a90e

Browse files
Max GurtuvoyChristoph Hellwig
authored andcommitted
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 <[email protected]> Signed-off-by: Sagi Grimberg <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 5e77d61 commit d68a90e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/nvme/target/core.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,14 @@ static void nvmet_start_ctrl(struct nvmet_ctrl *ctrl)
686686
}
687687

688688
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);
689697
}
690698

691699
static void nvmet_clear_ctrl(struct nvmet_ctrl *ctrl)

0 commit comments

Comments
 (0)