]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: refresh full global config when applying metadata 37894/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 29 Oct 2020 14:10:56 +0000 (10:10 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 29 Oct 2020 18:15:05 +0000 (14:15 -0400)
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 <dillaman@redhat.com>
src/librbd/ImageCtx.cc

index ec54762ce01bdb1fe0dcd89a35ac30116b1168b6..c1856a0bf87b1921e022b41326d032aa36064e3f 100644 (file)
@@ -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) {