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 <paul.e.luse@intel.com> Change-Id: I6c4cf32016935a20eafd565e5688ffc43b1d9533 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/790 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
a95a92208d
commit
7b16d58b1f
@ -215,13 +215,15 @@ static void
|
|||||||
vbdev_passthru_queue_io(struct spdk_bdev_io *bdev_io)
|
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 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;
|
int rc;
|
||||||
|
|
||||||
io_ctx->bdev_io_wait.bdev = bdev_io->bdev;
|
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_fn = vbdev_passthru_resubmit_io;
|
||||||
io_ctx->bdev_io_wait.cb_arg = bdev_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) {
|
if (rc != 0) {
|
||||||
SPDK_ERRLOG("Queue io failed in vbdev_passthru_queue_io, rc=%d.\n", rc);
|
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);
|
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
||||||
|
Loading…
Reference in New Issue
Block a user