Loading
vhost: fix memory issue when spdk exit
When spdk exit, if stop session timeout, vhost memory will be
unmapped, we cannot access vring anymore.
The funciton call path is:
vhost_scsi_subsystem_fini
-> spdk_vhost_scsi_fini
-> vhost_user_fini
-> vhost_user_session_shutdown
-> _stop_session (timeout)
-> vhost_driver_unregister (unmap vhost memory)
-> vhost_fini
-> spdk_vhost_dev_remove
-> spdk_vhost_scsi_dev_remove_tgt
-> vhost_scsi_session_remove_tgt
-> eventq_enqueue (access vring and crash)
So We can skip calling vhost_driver_unregister when _stop_session
return error.
Change-Id: I250cfbc1edb288babea7658d005c2e7292ce68e5
Signed-off-by:
Haoqian He <haoqian.he@smartx.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20452
Community-CI: Mellanox Build Bot
Reviewed-by:
Jim Harris <jim.harris@samsung.com>
Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by:
Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by:
Shuhei Matsumoto <smatsumoto@nvidia.com>