]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: cleanup virtual dtor decls and defns 42249/head
authorKaleb S. KEITHLEY <kkeithle@redhat.com>
Thu, 8 Jul 2021 17:15:08 +0000 (13:15 -0400)
committerKaleb S. KEITHLEY <kkeithle@redhat.com>
Fri, 9 Jul 2021 12:45:15 +0000 (08:45 -0400)
working on zipper loadable modules reveals issues with dtors in several classes.

These manifest as undefined references to vtable and typeinfo when linking librgw.so.

(Note: you won't see these until more zipper work is merged.)
This is due to:

    some classes don't declare a dtor at all
    some classes don't declare the dtor as virtual
    some classes define the dtor inline in the decl in the .h
    some classes don't have a defn at all
    etc.

https://tracker.ceph.com/issues/51599
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
21 files changed:
src/rgw/rgw_coroutine.cc
src/rgw/rgw_coroutine.h
src/rgw/rgw_cr_rados.h
src/rgw/rgw_multi.cc
src/rgw/rgw_multi.h
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_sal_rados.cc
src/rgw/rgw_sal_rados.h
src/rgw/rgw_service.cc
src/rgw/rgw_service.h
src/rgw/rgw_sync.cc
src/rgw/rgw_sync.h
src/rgw/rgw_zone.cc
src/rgw/rgw_zone.h
src/rgw/services/svc_config_key_rados.cc
src/rgw/services/svc_config_key_rados.h
src/rgw/services/svc_notify.cc
src/rgw/services/svc_notify.h
src/rgw/services/svc_tier_rados.cc
src/rgw/services/svc_tier_rados.h

index 98397655ee43528d9bc65890cb801950f656674a..1946ab1c0f43d6766a54335da913814fab0f3f7c 100644 (file)
@@ -191,6 +191,14 @@ stringstream& RGWCoroutine::Status::set_status()
   return status;
 }
 
+RGWCoroutinesManager::~RGWCoroutinesManager() {
+  stop();
+  completion_mgr->put();
+  if (cr_registry) {
+    cr_registry->remove(this);
+  }
+}
+
 int64_t RGWCoroutinesManager::get_next_io_id()
 {
   return (int64_t)++max_io_id;
index b3287e505bd440e959fa84537598e4cc7348a5a8..f77efe143a176cd73b019a7e6abc4dca8e7d9523 100644 (file)
@@ -276,7 +276,7 @@ protected:
   }
 public:
   RGWCoroutine(CephContext *_cct) : status(_cct), _yield_ret(false), cct(_cct), stack(NULL), retcode(0), state(RGWCoroutine_Run) {}
-  ~RGWCoroutine() override;
+  virtual ~RGWCoroutine() override;
 
   virtual int operate(const DoutPrefixProvider *dpp) = 0;
 
@@ -606,7 +606,7 @@ class RGWCoroutinesManagerRegistry : public RefCountedObject, public AdminSocket
 
 public:
   explicit RGWCoroutinesManagerRegistry(CephContext *_cct) : cct(_cct) {}
-  ~RGWCoroutinesManagerRegistry() override;
+  virtual ~RGWCoroutinesManagerRegistry() override;
 
   void add(RGWCoroutinesManager *mgr);
   void remove(RGWCoroutinesManager *mgr);
@@ -654,13 +654,7 @@ public:
       cr_registry->add(this);
     }
   }
-  virtual ~RGWCoroutinesManager() {
-    stop();
-    completion_mgr->put();
-    if (cr_registry) {
-      cr_registry->remove(this);
-    }
-  }
+  virtual ~RGWCoroutinesManager();
 
   int run(const DoutPrefixProvider *dpp, list<RGWCoroutinesStack *>& ops);
   int run(const DoutPrefixProvider *dpp, RGWCoroutine *op);
index fa94c6a1518f3a25631da81a837c692391978245..aa8d2d89aaa359deb3c162312bfac8d47ec1801c 100644 (file)
@@ -1320,6 +1320,8 @@ public:
     interval(_interval), caller(_caller)
   {}
 
+  virtual ~RGWContinuousLeaseCR() override;
+
   int operate(const DoutPrefixProvider *dpp) override;
 
   bool is_locked() const {
index e3369f64b641f86254776a237ea97d6b81c88d40..3f209b9934a4062964d4e7e62e246dfec42de80b 100644 (file)
@@ -53,6 +53,7 @@ bool RGWMultiCompleteUpload::xml_end(const char *el) {
   return true;
 }
 
+RGWMultiXMLParser::~RGWMultiXMLParser() {}
 
 XMLObj *RGWMultiXMLParser::alloc_obj(const char *el) {
   XMLObj *obj = NULL;
index ffafe3d05b6ccc0bb6f7d2c55b57fcdc70d8951c..aeb983e0009b146e46a38ae5e6b5c0da34b97aaa 100644 (file)
@@ -104,7 +104,7 @@ class RGWMultiXMLParser : public RGWXMLParser
   XMLObj *alloc_obj(const char *el) override;
 public:
   RGWMultiXMLParser() {}
-  ~RGWMultiXMLParser() override {}
+  virtual ~RGWMultiXMLParser() override;
 };
 
 extern bool is_v2_upload_id(const string& upload_id);
index 167ad3593e446542e84ef1f89c3999c82b180db4..8e37df18a33cfcf5ad127001cbfd94577c1e2a0c 100644 (file)
@@ -958,6 +958,8 @@ int RGWGetObj::verify_permission(optional_yield y)
   return 0;
 }
 
+RGWOp::~RGWOp(){};
+
 int RGWOp::verify_op_mask()
 {
   uint32_t required_mask = op_mask();
index 58303cbf0f9addf712051ba380b5c68b8d506f60..f77e16d01f7d76bdf243da40bd6d3383cf625d96 100644 (file)
@@ -215,7 +215,7 @@ public:
       op_ret(0) {
   }
 
-  virtual ~RGWOp() = default;
+  virtual ~RGWOp() override;
 
   int get_ret() const { return op_ret; }
 
index 4244c1585279e30c1ab7e06a628c5b56750ab429..d4515a1fa84b9153999b1674bf70e3e63eab0b61 100644 (file)
@@ -46,6 +46,8 @@
 
 namespace rgw::sal {
 
+RadosObject::~RadosObject() {}
+
 static int decode_policy(CephContext* cct,
                          bufferlist& bl,
                          RGWAccessControlPolicy* policy)
@@ -215,6 +217,8 @@ Object* RadosBucket::create_object(const rgw_obj_key &key)
   return nullptr;
 }
 
+RadosBucket::~RadosBucket() {}
+
 int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp,
                               bool delete_children,
                               std::string prefix,
index 22b3397b6132026c26eb2d508120ebf6e899c75a..4a417eca21978de6a0720a6725a6aa7dca7179f1 100644 (file)
@@ -151,6 +151,8 @@ class RadosObject : public Object {
     }
     RadosObject(RadosObject& _o) = default;
 
+    virtual ~RadosObject();
+
     virtual int delete_object(const DoutPrefixProvider* dpp, RGWObjectCtx* obj_ctx,
                              optional_yield y, bool prevent_versioning) override;
     virtual int delete_obj_aio(const DoutPrefixProvider* dpp, RGWObjState* astate, Completions* aio,
@@ -286,7 +288,7 @@ class RadosBucket : public Bucket {
         acls() {
     }
 
-    ~RadosBucket() { }
+    virtual ~RadosBucket();
 
     virtual std::unique_ptr<Object> get_object(const rgw_obj_key& k) override;
     virtual int list(const DoutPrefixProvider* dpp, ListParams&, int, ListResults&, optional_yield y) override;
index 7cb91e4771aa484d0410254bf5dc4bc5ae61a295..9bedbb23ad68eff51ebb7597cfe07ed1e4a5ca14 100644 (file)
@@ -315,6 +315,8 @@ int RGWServices::do_init(CephContext *_cct, bool have_cache, bool raw, bool run_
   return 0;
 }
 
+RGWServiceInstance::~RGWServiceInstance() {}
+
 int RGWServiceInstance::start(optional_yield y, const DoutPrefixProvider *dpp)
 {
   if (start_state != StateInit) {
index 883eeae10255c573ca9f5304b8c9eb60d11b5f99..b94f4cb28c09da0000d01548d51d1898d2dc69c7 100644 (file)
@@ -34,7 +34,7 @@ protected:
   }
 public:
   RGWServiceInstance(CephContext *_cct) : cct(_cct) {}
-  virtual ~RGWServiceInstance() {}
+  virtual ~RGWServiceInstance();
 
   int start(optional_yield y, const DoutPrefixProvider *dpp);
   bool is_started() {
index 5c652e07e8e5f32b286122803a7e935d0e4483be..52557b576817d8583270b900cb3bf576bc1fe307 100644 (file)
@@ -40,6 +40,8 @@ static string mdlog_sync_status_oid = "mdlog.sync-status";
 static string mdlog_sync_status_shard_prefix = "mdlog.sync-status.shard";
 static string mdlog_sync_full_sync_index_prefix = "meta.full-sync.index";
 
+RGWContinuousLeaseCR::~RGWContinuousLeaseCR() {}
+
 RGWSyncErrorLogger::RGWSyncErrorLogger(rgw::sal::RadosStore* _store, const string &oid_prefix, int _num_shards) : store(_store), num_shards(_num_shards) {
   for (int i = 0; i < num_shards; i++) {
     oids.push_back(get_shard_oid(oid_prefix, i));
@@ -233,11 +235,6 @@ public:
   bool spawn_next() override;
 };
 
-RGWRemoteMetaLog::~RGWRemoteMetaLog()
-{
-  delete error_logger;
-}
-
 int RGWRemoteMetaLog::read_log_info(const DoutPrefixProvider *dpp, rgw_mdlog_info *log_info)
 {
   rgw_http_param_pair pairs[] = { { "type", "metadata" },
index 84831c0988bccb1b953434947a1b4e4660a8a095..346232058b6f0a3a45d0e4c5f2a1dcec39d3772b 100644 (file)
@@ -225,7 +225,7 @@ public:
       http_manager(store->ctx(), completion_mgr),
       status_manager(_sm) {}
 
-  ~RGWRemoteMetaLog() override;
+  virtual ~RGWRemoteMetaLog() override;
 
   int init();
   void finish();
@@ -274,6 +274,9 @@ public:
   RGWMetaSyncStatusManager(rgw::sal::RadosStore* _store, RGWAsyncRadosProcessor *async_rados)
     : store(_store), master_log(this, store, async_rados, this)
   {}
+
+  virtual ~RGWMetaSyncStatusManager() override;
+
   int init(const DoutPrefixProvider *dpp);
 
   int read_sync_status(const DoutPrefixProvider *dpp, rgw_meta_sync_status *sync_status) {
index 476973a04a604daec2b7ac51f2b2c8680f1b7714..4e5e3e719c6944b66f67eab32fc74520fb7121b3 100644 (file)
@@ -43,6 +43,8 @@ std::string default_storage_pool_suffix = "rgw.buckets.data";
 
 using namespace rgw_zone_defaults;
 
+RGWMetaSyncStatusManager::~RGWMetaSyncStatusManager(){}
+
 #define FIRST_EPOCH 1
 
 void RGWDefaultZoneGroupInfo::dump(Formatter *f) const {
@@ -700,6 +702,13 @@ int RGWSystemMetaObj::write(const DoutPrefixProvider *dpp, bool exclusive, optio
 }
 
 
+RGWRealm::~RGWRealm() {}
+
+RGWRemoteMetaLog::~RGWRemoteMetaLog()
+{
+  delete error_logger;
+}
+
 const string& RGWRealm::get_predefined_name(CephContext *cct) const {
   return cct->_conf->rgw_realm;
 }
index 4f6e1f9b10cfd9ca0566d7430e5c897ce1b4b995..4fabd8e929b576ece0b30b498508b945a746dfa8 100644 (file)
@@ -953,6 +953,7 @@ public:
   RGWRealm(const std::string& _id, const std::string& _name = "") : RGWSystemMetaObj(_id, _name) {}
   RGWRealm(CephContext *_cct, RGWSI_SysObj *_sysobj_svc): RGWSystemMetaObj(_cct, _sysobj_svc) {}
   RGWRealm(const std::string& _name, CephContext *_cct, RGWSI_SysObj *_sysobj_svc): RGWSystemMetaObj(_name, _cct, _sysobj_svc){}
+  virtual ~RGWRealm() override;
 
   void encode(bufferlist& bl) const override {
     ENCODE_START(1, 1, bl);
index 3420e01d7f6bc2f9f95336b60dfd8b7bbc643fc6..7cc84ea80cb116dd8309277516f79fd603973328 100644 (file)
@@ -2,6 +2,8 @@
 #include "svc_rados.h"
 #include "svc_config_key_rados.h"
 
+RGWSI_ConfigKey_RADOS::~RGWSI_ConfigKey_RADOS(){}
+
 int RGWSI_ConfigKey_RADOS::do_start(optional_yield, const DoutPrefixProvider *dpp)
 {
   maybe_insecure_mon_conn = !svc.rados->check_secure_mon_conn(dpp);
index e0de60cac0113b2bb9d5763df7ca44663d939708..086da63889cf77232ef5a11173634444598e680b 100644 (file)
@@ -46,6 +46,8 @@ public:
 
   RGWSI_ConfigKey_RADOS(CephContext *cct) : RGWSI_ConfigKey(cct) {}
 
+  virtual ~RGWSI_ConfigKey_RADOS() override;
+
   int get(const string& key, bool secure, bufferlist *result) override;
 };
 
index 6a048f61b55d8ae2c4340873a7ba4ba48679bec1..14081e9a45f55942b17aef9a48d0bcaa22c9dd3b 100644 (file)
 
 static string notify_oid_prefix = "notify";
 
+RGWSI_Notify::~RGWSI_Notify()
+{
+  shutdown();
+}
+
+
 class RGWWatcher : public DoutPrefixProvider , public librados::WatchCtx2 {
   CephContext *cct;
   RGWSI_Notify *svc;
@@ -293,11 +299,6 @@ void RGWSI_Notify::shutdown()
   finalized = true;
 }
 
-RGWSI_Notify::~RGWSI_Notify()
-{
-  shutdown();
-}
-
 int RGWSI_Notify::unwatch(RGWSI_RADOS::Obj& obj, uint64_t watch_handle)
 {
   int r = obj.unwatch(watch_handle);
index 5b01d77b7bfc05c477fcfb5589ab3188a720bfc7..82683c452520afc4dd83bc843ba0b63adaa7abe9 100644 (file)
@@ -85,7 +85,8 @@ private:
   void schedule_context(Context *c);
 public:
   RGWSI_Notify(CephContext *cct): RGWServiceInstance(cct) {}
-  ~RGWSI_Notify();
+
+  virtual ~RGWSI_Notify() override;
 
   class CB {
     public:
index e977de7bb4ffd267fbbb3ea463f0e7ab9235f0fc..f9b57d5593db8aee2446ac93746dc07e4d19cd7f 100644 (file)
@@ -5,6 +5,8 @@
 
 const std::string MP_META_SUFFIX = ".meta";
 
+MultipartMetaFilter::~MultipartMetaFilter() {}
+
 bool MultipartMetaFilter::filter(const string& name, string& key) {
   // the length of the suffix so we can skip past it
   static const size_t MP_META_SUFFIX_LEN = MP_META_SUFFIX.length();
index f2424990e550a9b85e4115477214487df2341c67..e46868db225ece63be4be217ded282ed6a831b2a 100644 (file)
@@ -107,6 +107,8 @@ class MultipartMetaFilter : public RGWAccessListFilter {
 public:
   MultipartMetaFilter() {}
 
+  virtual ~MultipartMetaFilter() override;
+
   /**
    * @param name [in] The object name as it appears in the bucket index.
    * @param key [out] An output parameter that will contain the bucket