From: Yehuda Sadeh Date: Mon, 31 Oct 2016 17:47:15 +0000 (-0700) Subject: rgw: json encode/decode index_type, allow modification X-Git-Tag: v11.1.0~452^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11707%2Fhead;p=ceph.git 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 --- 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