From: Cory Snyder Date: Wed, 2 Feb 2022 09:46:59 +0000 (-0500) Subject: rgw: fix segfault in UserAsyncRefreshHandler::init_fetch X-Git-Tag: v15.2.17~85^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a0148ec08480ce585548393c39ddc291fe453727;p=ceph.git rgw: fix segfault in UserAsyncRefreshHandler::init_fetch 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 (cherry picked from commit 71ef3af870e5789e71480682f11a883ff3a673e7) --- diff --git a/src/rgw/services/svc_user_rados.cc b/src/rgw/services/svc_user_rados.cc index 31d42588f683f..b6ba628889d37 100644 --- a/src/rgw/services/svc_user_rados.cc +++ b/src/rgw/services/svc_user_rados.cc @@ -940,7 +940,6 @@ int RGWSI_User_RADOS::read_stats_async(RGWSI_MetaBackend::Context *ctx, RGWGetUserStatsContext *cb = new RGWGetUserStatsContext(_cb); int r = cls_user_get_header_async(user_str, cb); if (r < 0) { - _cb->put(); delete cb; return r; }