From 7868a18eb20dfb68fe40f27923898c09d177c7d2 Mon Sep 17 00:00:00 2001 From: "fang.yuxiang" Date: Tue, 23 May 2017 11:50:38 +0800 Subject: [PATCH] rgw: use get_data_extra_pool() when get data extra pool from RGWZonePlacementInfo use member data_extra_pool of RGWZonePlacementInfo isn't properly, because it maybe not configured. Fixes: http://tracker.ceph.com/issues/20064 Signed-off-by: fang yuxiang --- src/rgw/rgw_rados.cc | 2 +- src/rgw/rgw_rados.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 8480313e93173..41aafabf2580f 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -130,7 +130,7 @@ static bool rgw_get_obj_data_pool(const RGWZoneGroup& zonegroup, const RGWZonePa if (!obj.in_extra_data) { *pool = placement.data_pool; } else { - *pool = placement.data_extra_pool; + *pool = placement.get_data_extra_pool(); } } diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index e60ccbdf0be1f..6a33ee8c2d337 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1121,7 +1121,7 @@ struct RGWZonePlacementInfo { } DECODE_FINISH(bl); } - const rgw_pool& get_data_extra_pool() { + const rgw_pool& get_data_extra_pool() const { if (data_extra_pool.empty()) { return data_pool; } @@ -1293,7 +1293,7 @@ struct RGWZoneParams : RGWSystemMetaObj { if (!obj.in_extra_data) { *pool = iter->second.data_pool; } else { - *pool = iter->second.data_extra_pool; + *pool = iter->second.get_data_extra_pool(); } return true; } -- 2.39.5