]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/ImageCtx.cc
import 15.2.5
[ceph.git] / ceph / src / librbd / ImageCtx.cc
index 74bd121bad7df3b650ef189d57e7404e0cdc9d17..23beddedb88ff4b272166ddc1abc087e5643604f 100644 (file)
@@ -122,7 +122,6 @@ public:
       operations(new Operations<>(*this)),
       exclusive_lock(nullptr), object_map(nullptr),
       io_work_queue(nullptr), op_work_queue(nullptr),
-      external_callback_completions(32),
       event_socket_completions(32),
       asok_hook(nullptr),
       trace_endpoint("librbd")
@@ -158,6 +157,7 @@ public:
   }
 
   ImageCtx::~ImageCtx() {
+    ceph_assert(config_watcher == nullptr);
     ceph_assert(image_watcher == NULL);
     ceph_assert(exclusive_lock == NULL);
     ceph_assert(object_map == NULL);
@@ -727,6 +727,8 @@ public:
                                 bool thread_safe) {
     ldout(cct, 20) << __func__ << dendl;
 
+    std::unique_lock image_locker(image_lock);
+
     // reset settings back to global defaults
     for (auto& key : config_overrides) {
       std::string value;
@@ -765,6 +767,8 @@ public:
       }
     }
 
+    image_locker.unlock();
+
 #define ASSIGN_OPTION(param, type)              \
     param = config.get_val<type>("rbd_"#param)