]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd: fix ASAN ODR violations in denc-mod-osd 68084/head
authorKefu Chai <k.chai@proxmox.com>
Wed, 25 Feb 2026 07:55:25 +0000 (15:55 +0800)
committerKefu Chai <k.chai@proxmox.com>
Sun, 29 Mar 2026 05:40:40 +0000 (13:40 +0800)
commitaa859508bd8a912475fc78a3287ae7c1ad46f285
treed0baee9bc44a834c3e9485f4184255e02f275012
parent0e10249fcafeca4c140b27c0c9ee841d8db8bb35
osd: fix ASAN ODR violations in denc-mod-osd

When building ceph-dencoder with ASAN (-DWITH_ASAN=ON), loading
denc-mod-osd.so triggered ODR (One Definition Rule) violations because
several static class members were defined both in libceph-common.so and
denc-mod-osd.so.

Fix each case appropriately:

- pg_pool_t::APPLICATION_NAME_{CEPHFS,RBD,RGW}: used across many
  translation units; convert to inline static constexpr in the header
  and remove the out-of-line definitions from osd_types.cc.

- ObjectCleanRegions::max_num_intervals: used in osd_types.cc and
  OSD.cc; convert to inline static in the header and remove the
  out-of-line definition from osd_types.cc.

- SnapMapper::{MAPPING_PREFIX,OBJECT_PREFIX,PURGED_SNAP_PREFIX}: only
  used within SnapMapper.cc; remove from the class entirely and move
  to file-local static constants in SnapMapper.cc.

- SnapMapper::{LEGACY_MAPPING_PREFIX,PURGED_SNAP_EPOCH_PREFIX}: never
  used anywhere; remove the dead declarations from SnapMapper.h.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
src/osd/SnapMapper.cc
src/osd/SnapMapper.h
src/osd/osd_types.cc
src/osd/osd_types.h