Commit 19182431 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

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: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453968


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 497997bc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}