diff --git a/lib/nvmf/ctrlr.c b/lib/nvmf/ctrlr.c index c0b691aea..31ed06670 100644 --- a/lib/nvmf/ctrlr.c +++ b/lib/nvmf/ctrlr.c @@ -814,6 +814,10 @@ nvmf_ctrlr_cc_shn_done(struct spdk_io_channel_iter *i, int status) /* After CC.EN transitions to 0 (due to shutdown or reset), the association * between the host and controller shall be preserved for at least 2 minutes */ + if (ctrlr->association_timer) { + SPDK_DEBUGLOG(nvmf, "Association timer already set\n"); + nvmf_ctrlr_stop_association_timer(ctrlr); + } ctrlr->association_timer = SPDK_POLLER_REGISTER(nvmf_ctrlr_association_remove, ctrlr, ctrlr->admin_qpair->transport->opts.association_timeout * 1000); } @@ -834,6 +838,10 @@ nvmf_ctrlr_cc_reset_done(struct spdk_io_channel_iter *i, int status) /* After CC.EN transitions to 0 (due to shutdown or reset), the association * between the host and controller shall be preserved for at least 2 minutes */ + if (ctrlr->association_timer) { + SPDK_DEBUGLOG(nvmf, "Association timer already set\n"); + nvmf_ctrlr_stop_association_timer(ctrlr); + } ctrlr->association_timer = SPDK_POLLER_REGISTER(nvmf_ctrlr_association_remove, ctrlr, ctrlr->admin_qpair->transport->opts.association_timeout * 1000); }