diff --git a/module/bdev/crypto/vbdev_crypto.c b/module/bdev/crypto/vbdev_crypto.c index 7ffbd1cf5..7dbe5d032 100644 --- a/module/bdev/crypto/vbdev_crypto.c +++ b/module/bdev/crypto/vbdev_crypto.c @@ -1438,6 +1438,8 @@ _device_unregister_cb(void *io_device) _cryptodev_sym_session_free(crypto_bdev, crypto_bdev->session_decrypt); _cryptodev_sym_session_free(crypto_bdev, crypto_bdev->session_encrypt); crypto_bdev->opts = NULL; + + spdk_bdev_destruct_done(&crypto_bdev->crypto_bdev, 0); free(crypto_bdev->crypto_bdev.name); free(crypto_bdev); } @@ -1477,7 +1479,7 @@ vbdev_crypto_destruct(void *ctx) g_number_of_claimed_volumes--; - return 0; + return 1; } /* We supplied this as an entry point for upper layers who want to communicate to this diff --git a/test/unit/lib/bdev/crypto.c/crypto_ut.c b/test/unit/lib/bdev/crypto.c/crypto_ut.c index aca77e64e..c999b6c65 100644 --- a/test/unit/lib/bdev/crypto.c/crypto_ut.c +++ b/test/unit/lib/bdev/crypto.c/crypto_ut.c @@ -246,6 +246,7 @@ DEFINE_STUB(spdk_bdev_module_claim_bdev, int, (struct spdk_bdev *bdev, struct sp struct spdk_bdev_module *module), 0); DEFINE_STUB_V(spdk_bdev_module_examine_done, (struct spdk_bdev_module *module)); DEFINE_STUB(spdk_bdev_register, int, (struct spdk_bdev *vbdev), 0); +DEFINE_STUB_V(spdk_bdev_destruct_done, (struct spdk_bdev *bdev, int bdeverrno)); /* DPDK stubs */ #define DPDK_DYNFIELD_OFFSET offsetof(struct rte_mbuf, dynfield1[1])