Reorder operations of LUN hot removal so that following are satisfied. Wait for completion of all outstanding tasks first. (After turning lun->removed on, there will be no new outstanding task.) Then wait for IO channel being freed. (For VHOST SCSI, IO channel is freed in the callback handler of hot removal. For iSCSI, IO channel is freed when the final connection exits. IO channel of LUN is freed only by the allocator.) Then free LUN finally. For VHOST SCSI, the callback handler of hot removal will call spdk_scsi_lun_destruct() in spdk_scsi_dev_destruct(). But lun->removed is already turned on and spdk_scsi_lun_hot_remove() will be NOP. Hence LUN is freed safely by the first caller of spdk_scsi_lun_hot_remove(). Change-Id: I276dfed1d4a7767e382003bd9bb389aaff920115 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/417196 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> |
||
---|---|---|
.. | ||
dev.c | ||
lun.c | ||
Makefile | ||
port.c | ||
scsi_bdev.c | ||
scsi_internal.h | ||
scsi_rpc.c | ||
scsi.c | ||
task.c |