scsi: use SOFT reset when reseting bdev

This fixes multiple SCSI reset issue.

Change-Id: Ie62e0c1850faff17d383bcea00071d63d6bfa7f4
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
This commit is contained in:
Pawel Wodkowski 2017-03-23 20:54:58 +01:00 committed by Jim Harris
parent c09faf35d9
commit 7fa7f91ee3
3 changed files with 1 additions and 7 deletions

View File

@ -1247,9 +1247,6 @@ spdk_bdev_scsi_task_complete(struct spdk_bdev_io *bdev_io, enum spdk_bdev_io_sta
} else if (task->type == SPDK_SCSI_TASK_TYPE_MANAGE) {
if (status == SPDK_BDEV_IO_STATUS_SUCCESS)
task->response = SPDK_SCSI_TASK_MGMT_RESP_SUCCESS;
if (task->function == SPDK_SCSI_TASK_FUNC_LUN_RESET) {
spdk_scsi_lun_clear_all(task->lun);
}
}
if (bdev_io->type == SPDK_BDEV_IO_TYPE_READ && task->iovs != bdev_io->u.read.iovs) {
assert(task->iovcnt == bdev_io->u.read.iovcnt);
@ -1966,6 +1963,6 @@ spdk_bdev_scsi_execute(struct spdk_bdev *bdev, struct spdk_scsi_task *task)
int
spdk_bdev_scsi_reset(struct spdk_bdev *bdev, struct spdk_scsi_task *task)
{
return spdk_bdev_reset(bdev, SPDK_BDEV_RESET_HARD,
return spdk_bdev_reset(bdev, SPDK_BDEV_RESET_SOFT,
spdk_bdev_scsi_task_complete, task);
}

View File

@ -67,11 +67,9 @@ trap "iscsicleanup; killprocess $pid; killprocess $fiopid; exit 1" SIGINT SIGTER
# Do 3 resets while making sure iscsi_tgt and fio are still running
for i in 1 2 3; do
sleep 1
kill -s 0 $pid
kill -s 0 $fiopid
sg_reset -d /dev/$dev
sleep 1
kill -s 0 $pid
kill -s 0 $fiopid
done

View File

@ -740,7 +740,6 @@ function vm_reset_scsi_devices()
for disk in "${@:2}"; do
echo "INFO: VM$1 Performing device reset on disk $disk"
vm_ssh $1 sg_reset /dev/$disk -vNd
sleep 2
done
}