From: Kautilya Tripathi Date: Tue, 10 Feb 2026 05:31:26 +0000 (+0530) Subject: cls/rgw_gc/cls_rgw_gc: read config via cls_get_config X-Git-Tag: testing/wip-vshankar-testing-20260224.100235~6^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5a274dd73c3247e93afa4936d7e0a06f7f1d10ae;p=ceph-ci.git cls/rgw_gc/cls_rgw_gc: read config via cls_get_config Commit https://github.com/ceph/ceph/commit/3877c1e37f2fa4e1574b57f05132288f210835a7 added new way to let CLS gain access to global configuration (`g_ceph_context`). `cls_rgw_gc_queue_init` method is not using the new CLS call of `cls_get_config` but instead directly uses `g_ceph_context`. Crimson OSD implementation does **not** support `g_ceph_context` which results in a (SIGSEGV) crash due to null access. Switching to `cls_get_config`, similarly to `cls_rgw.cc`, would allow both OSD implementations to access the conf safely. The above approach is well-defined due to the two orthogonal implementations of objclass.cc. Classical OSD uses `src/osd/objclass.cc` While Crimson OSD uses `src/crimson/osd/objclass.cc`. Fixes: https://tracker.ceph.com/issues/74844 Signed-off-by: Kautilya Tripathi --- diff --git a/src/cls/rgw_gc/cls_rgw_gc.cc b/src/cls/rgw_gc/cls_rgw_gc.cc index 7f24a647993..ecaba00cacf 100644 --- a/src/cls/rgw_gc/cls_rgw_gc.cc +++ b/src/cls/rgw_gc/cls_rgw_gc.cc @@ -14,10 +14,6 @@ #include "cls/rgw_gc/cls_rgw_gc_const.h" #include "cls/queue/cls_queue_src.h" -#include "common/ceph_context.h" -#include "global/global_context.h" - - #define GC_LIST_DEFAULT_MAX 128 using std::string; @@ -51,7 +47,8 @@ static int cls_rgw_gc_queue_init(cls_method_context_t hctx, bufferlist *in, buff CLS_LOG(10, "INFO: cls_rgw_gc_queue_init: queue size is %lu\n", op.size); init_op.queue_size = op.size; - init_op.max_urgent_data_size = g_ceph_context->_conf->rgw_gc_max_deferred_entries_size; + const auto& conf = cls_get_config(hctx); + init_op.max_urgent_data_size = conf->rgw_gc_max_deferred_entries_size; encode(urgent_data, init_op.bl_urgent_data); return queue_init(hctx, init_op);