]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix segfault in UserAsyncRefreshHandler::init_fetch 44859/head
authorCory Snyder <csnyder@iland.com>
Wed, 2 Feb 2022 09:46:59 +0000 (04:46 -0500)
committerCory Snyder <csnyder@iland.com>
Wed, 2 Feb 2022 09:47:27 +0000 (04:47 -0500)
Fixes a segfault that was occuring in error handling code of UserAsyncRefreshHandler::init_fetch.
When ruser->read_stats_async returned an error code, the instance of UserAsyncRefreshHandler had
already been deallocated in RGWSI_User_RADOS::read_stats_async and a segmentation fault occurs
when attempting to print a member variable in error logs. This commit removes the extra ref count
drop since the ref is properly dropped upstream in RGWQuotaCache::async_refresh error handling
logic.

Fixes: https://tracker.ceph.com/issues/54112
Signed-off-by: Cory Snyder <csnyder@iland.com>
src/rgw/services/svc_user_rados.cc

index b2f8f9665e0929ce4d4560a3a4b37c9f5f5323d8..88dfca285a7c7bba346749d200ecbdf722ae1ae4 100644 (file)
@@ -973,7 +973,6 @@ int RGWSI_User_RADOS::read_stats_async(const DoutPrefixProvider *dpp, RGWSI_Meta
   RGWGetUserStatsContext *cb = new RGWGetUserStatsContext(_cb);
   int r = cls_user_get_header_async(dpp, user_str, cb);
   if (r < 0) {
-    _cb->put();
     delete cb;
     return r;
   }