From 421dd2ea28baeacfabee8a4e6def667406b4cff7 Mon Sep 17 00:00:00 2001 From: Paul Luse Date: Mon, 12 Nov 2018 16:59:23 -0700 Subject: [PATCH] bdev/crypto: unregister io_device on failure in RPC create In create_crypto_disk() we were failing to unregsiter the io_device in the event that spdk_vbdev_register() call failed. Found via inspection looking into a CI failure however this potentially could have caused that failure as well (I don't think so though, there were no prints in the log that it followed this path). Change-Id: I7085c4e25665a5a15def38d6726d519731b7e44e Signed-off-by: Paul Luse Reviewed-on: https://review.gerrithub.io/432932 (master) Reviewed-on: https://review.gerrithub.io/435676 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Chandler-Test-Pool: SPDK Automated Test System --- lib/bdev/crypto/vbdev_crypto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/bdev/crypto/vbdev_crypto.c b/lib/bdev/crypto/vbdev_crypto.c index 6a77b225f..93563d775 100644 --- a/lib/bdev/crypto/vbdev_crypto.c +++ b/lib/bdev/crypto/vbdev_crypto.c @@ -1242,6 +1242,7 @@ create_crypto_disk(const char *bdev_name, const char *vbdev_name, SPDK_ERRLOG("could not register crypto_bdev\n"); spdk_bdev_close(crypto_bdev->base_desc); TAILQ_REMOVE(&g_vbdev_crypto, crypto_bdev, link); + spdk_io_device_unregister(crypto_bdev, NULL); free(crypto_bdev->crypto_bdev.name); free(crypto_bdev->key); free(crypto_bdev);