From 122cc72cd960abc2649cbf1c789b2cc4b9b25267 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Fri, 17 May 2019 06:57:40 +0200 Subject: [PATCH] Revert "scsi: Simplify removing LUN when no connection is for it" The new, simplified scsi lun hotremove path doesn't call lun->hotremove_cb if there's no io_channel allocated for that lun. Vhost still depends on that callback and currently, when the underlying bdev is removed, vhost is left completely unnotified. It keeps a dangling pointer to a scsi lun and will eventually crash. The vhost scsi controller also can't be removed in this case. This reverts commit 19182431c86aa904e40c411a9897898b3e8224f0. Change-Id: I330330fdd7d6941db070d972192481f535f62977 Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454836 Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- 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 c457fbbf0..d64a4b522 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_remove(lun); + _scsi_lun_hot_remove(lun); return; }