From c31fb325a7009b87ea4c43a6b10a01858a76728f Mon Sep 17 00:00:00 2001 From: Pawel Niedzwiecki Date: Wed, 11 Oct 2017 19:45:51 +0200 Subject: [PATCH] vhost_scsi: fail requests to device marked for removal Change-Id: Ie9eea844a64653cf9c016eb3ad96c80546600762 Signed-off-by: Pawel Niedzwiecki Reviewed-on: https://review.gerrithub.io/382170 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Pawel Wodkowski --- lib/vhost/vhost_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/vhost_scsi.c b/lib/vhost/vhost_scsi.c index 8496c384f..35176263c 100644 --- a/lib/vhost/vhost_scsi.c +++ b/lib/vhost/vhost_scsi.c @@ -299,7 +299,7 @@ spdk_vhost_scsi_task_init_target(struct spdk_vhost_scsi_task *task, const __u8 * dev = task->svdev->scsi_dev[lun[1]]; task->scsi_dev = dev; - if (dev == NULL) { + if (dev == NULL || task->svdev->scsi_dev_state[lun[1]].removed) { /* If dev has been hotdetached, return 0 to allow sending * additional hotremove event via sense codes. */