scsi: Simplify removing LUN when no connection is for it

Both for vhost SCSI and iSCSI target, IO channel is allocated to
LUN before using it. Hence LUN is not used by anyone if IO channel
is not allocated to it. So we can call scsi_lun_remove in this
case.

Change-Id: I6881a5e075ed6ef11802e1b166dfb3f35531d100
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453968
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-05-10 15:45:05 +09:00 committed by Jim Harris
parent 497997bc60
commit 19182431c8

@ -301,7 +301,7 @@ scsi_lun_hot_remove(void *remove_ctx)
spdk_scsi_dev_delete_lun(lun->dev, lun);
if (lun->io_channel == NULL) {
_scsi_lun_hot_remove(lun);
scsi_lun_remove(lun);
return;
}