nvme: hold ctrlr_lock when setting timeout callback
The per-process controller data may only be touched while holding the ctrlr_lock. Change-Id: I18c8c4e43db4d58e6b86f0c0fd222f6d30830b85 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/410952 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
cbd9c241dc
commit
943c7c69c3
@ -1986,12 +1986,16 @@ spdk_nvme_ctrlr_register_timeout_callback(struct spdk_nvme_ctrlr *ctrlr,
|
||||
{
|
||||
struct spdk_nvme_ctrlr_process *active_proc;
|
||||
|
||||
nvme_robust_mutex_lock(&ctrlr->ctrlr_lock);
|
||||
|
||||
active_proc = spdk_nvme_ctrlr_get_current_process(ctrlr);
|
||||
if (active_proc) {
|
||||
active_proc->timeout_ticks = nvme_timeout * spdk_get_ticks_hz();
|
||||
active_proc->timeout_cb_fn = cb_fn;
|
||||
active_proc->timeout_cb_arg = cb_arg;
|
||||
}
|
||||
|
||||
nvme_robust_mutex_unlock(&ctrlr->ctrlr_lock);
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user