From 19182431c86aa904e40c411a9897898b3e8224f0 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Fri, 10 May 2019 15:45:05 +0900 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453968 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu --- lib/scsi/lun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scsi/lun.c b/lib/scsi/lun.c index d64a4b522..c457fbbf0 100644 --- a/lib/scsi/lun.c +++ b/lib/scsi/lun.c @@ -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; }