From: Jason Dillaman Date: Tue, 25 Aug 2020 19:37:40 +0000 (-0400) Subject: librbd: abort image open if specified plugin failed to load X-Git-Tag: v16.1.0~1296^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e16fc42172e202b487426451dbd91472d71c1c2;p=ceph.git librbd: abort image open if specified plugin failed to load This will avoid silently failing to load a specified plugin. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/PluginRegistry.cc b/src/librbd/PluginRegistry.cc index c600c860ffdb..90ebdbb203eb 100644 --- a/src/librbd/PluginRegistry.cc +++ b/src/librbd/PluginRegistry.cc @@ -35,7 +35,7 @@ void PluginRegistry::init(const std::string& plugins, Context* on_finish) { plugin_registry->get_with_load("librbd", "librbd_" + token)); if (plugin == nullptr) { lderr(cct) << "failed to load plugin: " << token << dendl; - ctx->complete(-ENOENT); + ctx->complete(-ENOSYS); break; } diff --git a/src/librbd/image/OpenRequest.cc b/src/librbd/image/OpenRequest.cc index 2c19d5b930ed..046d37d4ba7c 100644 --- a/src/librbd/image/OpenRequest.cc +++ b/src/librbd/image/OpenRequest.cc @@ -549,6 +549,8 @@ Context* OpenRequest::handle_init_plugin_registry(int *result) { if (*result < 0) { lderr(cct) << "failed to initialize plugin registry: " << cpp_strerror(*result) << dendl; + send_close_image(*result); + return nullptr; } return send_init_cache(result);