From 7b16d58b1f02dbea1c194f3b29a75d5ae3e7b674 Mon Sep 17 00:00:00 2001 From: paul luse Date: Tue, 11 Feb 2020 20:02:01 +0000 Subject: [PATCH] module/passthru: fix bug with queueing IO to bdev layer The PT channel was used as a parameter for spdk_bdev_queue_io_wait() when it should have been the underlying base bdev's channel. Signed-off-by: paul luse Change-Id: I6c4cf32016935a20eafd565e5688ffc43b1d9533 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/790 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- module/bdev/passthru/vbdev_passthru.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/bdev/passthru/vbdev_passthru.c b/module/bdev/passthru/vbdev_passthru.c index 69b1c8b18..e553bd81e 100644 --- a/module/bdev/passthru/vbdev_passthru.c +++ b/module/bdev/passthru/vbdev_passthru.c @@ -215,13 +215,15 @@ static void vbdev_passthru_queue_io(struct spdk_bdev_io *bdev_io) { struct passthru_bdev_io *io_ctx = (struct passthru_bdev_io *)bdev_io->driver_ctx; + struct pt_io_channel *pt_ch = spdk_io_channel_get_ctx(io_ctx->ch); int rc; io_ctx->bdev_io_wait.bdev = bdev_io->bdev; io_ctx->bdev_io_wait.cb_fn = vbdev_passthru_resubmit_io; io_ctx->bdev_io_wait.cb_arg = bdev_io; - rc = spdk_bdev_queue_io_wait(bdev_io->bdev, io_ctx->ch, &io_ctx->bdev_io_wait); + /* Queue the IO using the channel of the base device. */ + rc = spdk_bdev_queue_io_wait(bdev_io->bdev, pt_ch->base_ch, &io_ctx->bdev_io_wait); if (rc != 0) { SPDK_ERRLOG("Queue io failed in vbdev_passthru_queue_io, rc=%d.\n", rc); spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);