Skip to content

Commit f7ed088

Browse files
committed
nit: Fixed review comment from Tiago
Address the review comment from Tiago to remove the race window of poller being unregistred Signed-off-by: Susobhan Dey <susobhan.dey@gmail.com>
1 parent c722180 commit f7ed088

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/nvmf/ctrlr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4859,7 +4859,7 @@ nvmf_check_subsystem_active(struct spdk_nvmf_request *req)
48594859
struct spdk_nvmf_subsystem_poll_group *sgroup = NULL;
48604860
struct spdk_nvmf_subsystem_pg_ns_info *ns_info;
48614861
uint32_t nsid;
4862-
struct spdk_nvmf_subsystem *subsystem = NULL;
4862+
struct spdk_nvmf_subsystem *subsystem;
48634863

48644864
if (spdk_likely(qpair->ctrlr)) {
48654865
sgroup = &qpair->group->sgroups[qpair->ctrlr->subsys->id];

lib/nvmf/subsystem.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -879,11 +879,6 @@ spdk_nvmf_subsystem_resume_ext(struct spdk_nvmf_subsystem *subsystem,
879879
spdk_nvmf_subsystem_state_change_done cb_fn,
880880
void *cb_arg)
881881
{
882-
subsystem->pause_flags = 0;
883-
if (subsystem->pause_timer) {
884-
spdk_poller_unregister(&subsystem->pause_timer);
885-
subsystem->pause_timer = NULL;
886-
}
887882
return spdk_nvmf_subsystem_resume(subsystem, cb_fn, cb_arg);
888883
}
889884

@@ -892,6 +887,11 @@ spdk_nvmf_subsystem_resume(struct spdk_nvmf_subsystem *subsystem,
892887
spdk_nvmf_subsystem_state_change_done cb_fn,
893888
void *cb_arg)
894889
{
890+
subsystem->pause_flags = 0;
891+
if (subsystem->pause_timer) {
892+
spdk_poller_unregister(&subsystem->pause_timer);
893+
subsystem->pause_timer = NULL;
894+
}
895895
return nvmf_subsystem_state_change(subsystem, 0, SPDK_NVMF_SUBSYSTEM_ACTIVE, cb_fn, cb_arg);
896896
}
897897

0 commit comments

Comments
 (0)