Spdk/lib/scsi
Shuhei Matsumoto c645cc69ab scsi: Reorder LUN hot removal to check outstanding tasks and then IO channel
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>
2018-07-02 21:29:50 +00:00
..
dev.c scsi: validate dev name length 2018-04-10 15:43:03 -04:00
lun.c scsi: Reorder LUN hot removal to check outstanding tasks and then IO channel 2018-07-02 21:29:50 +00:00
Makefile scsi: remove lun_db 2018-01-09 13:56:00 -05:00
port.c scsi: remove port from scsi_dev dynamically 2017-10-12 15:46:14 -04:00
scsi_bdev.c bdev: Rename spdk_internal/bdev.h to spdk/bdev_module.h 2018-05-25 16:02:22 +00:00
scsi_internal.h scsi: Use not pthread_self but spdk_get_thread for LUN affinity 2018-06-26 23:31:17 +00:00
scsi_rpc.c rpc: Add state_mask to each RPC method to make sets of RPCs 2018-05-03 19:48:15 +00:00
scsi.c log: rename SPDK_TRACE_* to SPDK_LOG_* 2017-12-07 12:23:19 -05:00
task.c iscsi: Factor out copy scsi status when it is not good 2018-06-11 22:23:55 +00:00