From cac5022e618faf4726832826fa4f222c1c847960 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Fri, 17 Apr 2020 06:22:07 +0900 Subject: [PATCH] bdev/crypto: Stop access bdev_io->internal from bdev module and fix an issue crypto_dev_poller() had set IO error to bdev_io->internal.status but _crypto_operation_complete() checked io_ctx->bdev_io_status and overwritten bdev_io->internal.status by spdk_bdev_io_complete(). On the other hand, internal fields of struct spdk_bdev_io should have been avoided. This patch fixes both. Signed-off-by: Shuhei Matsumoto Change-Id: Ia3d4887f34fdecc765b88246c3e66ce1871ff30f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1907 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Tomasz Zawadzki Reviewed-by: Paul Luse --- module/bdev/crypto/vbdev_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bdev/crypto/vbdev_crypto.c b/module/bdev/crypto/vbdev_crypto.c index 7bdf153c3..f5dd0f814 100644 --- a/module/bdev/crypto/vbdev_crypto.c +++ b/module/bdev/crypto/vbdev_crypto.c @@ -619,7 +619,7 @@ crypto_dev_poller(void *args) * to fail it. */ if (crypto_ch->iter) { - bdev_io->internal.status = SPDK_BDEV_IO_STATUS_FAILED; + io_ctx->bdev_io_status = SPDK_BDEV_IO_STATUS_FAILED; } /* Complete the IO */