From b368258bb3e8aea2877725baa10c33b308c61ec2 Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Fri, 21 Jul 2017 21:19:57 +0200 Subject: [PATCH] vhost-blk: fix error reporting on bdev hot-removal blk_iovs_setup() error code was missinterpeted and no error returned for IO that was directed to removed bdev. Change-Id: Iec5ebef20734cca07f20f068b83b74b189cdcb66 Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/370711 Tested-by: SPDK Automated Test System Reviewed-by: Changpeng Liu Reviewed-by: Lukasz Galka Reviewed-by: Ben Walker Reviewed-by: Daniel Verkamp --- lib/vhost/vhost_blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/vhost_blk.c b/lib/vhost/vhost_blk.c index b7d4b85d9..682fe26d2 100644 --- a/lib/vhost/vhost_blk.c +++ b/lib/vhost/vhost_blk.c @@ -331,7 +331,7 @@ no_bdev_vdev_worker(void *arg) } iovcnt = SPDK_COUNTOF(iovs); - if (blk_iovs_setup(&bvdev->vdev, vq, req_idx, iovs, &iovcnt, &length) && iovcnt >= 2) { + if (blk_iovs_setup(&bvdev->vdev, vq, req_idx, iovs, &iovcnt, &length) == 0) { *(volatile uint8_t *)iovs[iovcnt - 1].iov_base = VIRTIO_BLK_S_IOERR; SPDK_TRACELOG(SPDK_TRACE_VHOST_BLK_DATA, "Aborting request %" PRIu16"\n", req_idx); }