]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: clean up January 23, 2023 coverity scan issues 49951/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Tue, 31 Jan 2023 19:49:53 +0000 (14:49 -0500)
committerJ. Eric Ivancich <ivancich@redhat.com>
Tue, 31 Jan 2023 21:23:08 +0000 (16:23 -0500)
There were:
  * two cases of a destructor encountering an unhandled exception and
  * one case of an instance variable in a coroutine not being
    initialized in the constructor.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/rgw/driver/rados/rgw_data_sync.cc
src/rgw/services/svc_mdlog.cc

index cae231965a30aeeab196e48bcedfe07ee807c8e3..df952ef08e646d57c9c7fb0de7a25e35eab8b5f6 100644 (file)
@@ -5624,7 +5624,7 @@ class RGWSyncBucketCR : public RGWCoroutine {
   rgw_raw_obj error_repo;
   rgw_bucket_shard source_bs;
   rgw_pool pool;
-  uint64_t current_gen;
+  uint64_t current_gen = 0;
 
   RGWSyncTraceNodeRef tn;
 
index 3ff306e97635455eefab901a635c3574b7b910bf..09a68d3d7132cb6105e0fa1cf2e918ebb8e5fb12 100644 (file)
@@ -133,8 +133,15 @@ public:
     : RGWSimpleCoroutine(_svc->ctx()), dpp(_dpp), async_rados(_async_rados), svc(_svc),
       obj(_obj), result(_result),
       empty_on_enoent(empty_on_enoent), objv_tracker(objv_tracker) {}
+
   ~SysObjReadCR() override {
-    request_cleanup();
+    try {
+      request_cleanup();
+    } catch (const boost::container::length_error_t& e) {
+      ldpp_dout(dpp, 0) << "ERROR: " << __func__ <<
+       ": reference counted object mismatched, \"" << e.what() <<
+       "\"" << dendl;
+    }
   }
 
   void request_cleanup() override {
@@ -209,7 +216,13 @@ public:
   }
 
   ~SysObjWriteCR() override {
-    request_cleanup();
+    try {
+      request_cleanup();
+    } catch (const boost::container::length_error_t& e) {
+      ldpp_dout(dpp, 0) << "ERROR: " << __func__ <<
+       ": reference counted object mismatched, \"" << e.what() <<
+       "\"" << dendl;
+    }
   }
 
   void request_cleanup() override {