SCSI: Stop I/O flooding to hot-removing LUN from iSCSI target

We have observed unexpcted timeout when we remove LUNs from the
active iSCSI target dynamically during FIO workload.

By making destroy_raid_bdev RPC wait for its completion, we could know
the destroy_raid_bdev RPC caused timeout because LUN hot removal didn't
complete.

By investigating the log, incoming I/Os from the host had not stopped
even after hot removal process was started.

The reason was that iSCSI target had continued to accept incoming I/Os
from the host.

By removing LUN from the SCSI device at the start of the LUN hot removal
process, iSCSI target will be able to stop incoming I/Os and LUN hot removal
will complete in finite time.

LUN itself can be accessible even after it is removed from the SCSI device.

LUN hot removal is for not I_T nexus but I_T_L nexus and so we cannot
start connection exiting in this case because connection can have multiple
LUNs. So this fix requires few changes and will be practical.

  Fixes #715

Change-Id: I17d7a1f6c6557297289c3bd148a62db46da48ec5
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453959
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:32:54 +09:00 committed by Jim Harris
parent cd02f1cda5
commit 497997bc60

View File

@ -216,7 +216,6 @@ scsi_lun_remove(struct spdk_scsi_lun *lun)
{
spdk_bdev_close(lun->bdev_desc);
spdk_scsi_dev_delete_lun(lun->dev, lun);
free(lun);
}
@ -299,6 +298,8 @@ scsi_lun_hot_remove(void *remove_ctx)
}
lun->removed = true;
spdk_scsi_dev_delete_lun(lun->dev, lun);
if (lun->io_channel == NULL) {
_scsi_lun_hot_remove(lun);
return;