From e8f26c035b3486beb89285f55465c7b156a5fc23 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 31 Oct 2016 10:47:15 -0700 Subject: [PATCH] rgw: json encode/decode index_type, allow modification Fixes: http://tracker.ceph.com/issues/17755 We didn't dump the index_type field of RGWBucketInfo, also didn't allow modifying it via metadata api. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_bucket.cc | 1 - src/rgw/rgw_json_enc.cc | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 199dc1a4041..979326fdd3e 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -2150,7 +2150,6 @@ public: bci.info.bucket.data_pool = old_bci.info.bucket.data_pool; bci.info.bucket.index_pool = old_bci.info.bucket.index_pool; bci.info.bucket.data_extra_pool = old_bci.info.bucket.data_extra_pool; - bci.info.index_type = old_bci.info.index_type; } // are we actually going to perform this put, or is it too old? diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index 225adbd10a2..62e702f0216 100644 --- a/src/rgw/rgw_json_enc.cc +++ b/src/rgw/rgw_json_enc.cc @@ -694,6 +694,7 @@ void RGWBucketInfo::dump(Formatter *f) const } encode_json("swift_versioning", swift_versioning, f); encode_json("swift_ver_location", swift_ver_location, f); + encode_json("index_type", (uint32_t)index_type, f); } void RGWBucketInfo::decode_json(JSONObj *obj) { @@ -722,6 +723,9 @@ void RGWBucketInfo::decode_json(JSONObj *obj) { } JSONDecoder::decode_json("swift_versioning", swift_versioning, obj); JSONDecoder::decode_json("swift_ver_location", swift_ver_location, obj); + uint32_t it; + JSONDecoder::decode_json("index_type", it, obj); + index_type = (RGWBucketIndexType)it; } void rgw_obj_key::dump(Formatter *f) const -- 2.47.3