From 352dec753ead8b61e19b46d096255e06393b740f Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 29 Oct 2020 10:10:56 -0400 Subject: [PATCH] librbd: refresh full global config when applying metadata The ConfigProxy contains a point-in-time copy of the global config that is dynamically updated in CephContext::_conf. Upon an image refresh, pull the latest version of the global config from the CephContext and apply it to the config stored within the ImageCtx. Fixes: https://tracker.ceph.com/issues/48035 Signed-off-by: Jason Dillaman --- src/librbd/ImageCtx.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index ec54762ce01b..c1856a0bf87b 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -729,14 +729,8 @@ librados::IoCtx duplicate_io_ctx(librados::IoCtx& io_ctx) { std::unique_lock image_locker(image_lock); // reset settings back to global defaults - for (auto& key : config_overrides) { - std::string value; - int r = cct->_conf.get_val(key, &value); - ceph_assert(r == 0); - - config.set_val(key, value); - } config_overrides.clear(); + config.set_config_values(cct->_conf.get_config_values()); // extract config overrides for (auto meta_pair : meta) { -- 2.47.3