]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: json encode/decode index_type, allow modification 11759/head
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 31 Oct 2016 17:47:15 +0000 (10:47 -0700)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Thu, 3 Nov 2016 08:58:36 +0000 (14:28 +0530)
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 <yehuda@redhat.com>
(cherry picked from commit e8f26c035b3486beb89285f55465c7b156a5fc23)

src/rgw/rgw_bucket.cc
src/rgw/rgw_json_enc.cc

index daf18f5051bb6c4b2866715c70accb31d9dabfe8..b91732bcc22cbfdaceb071148aeab3adb4aeba8c 100644 (file)
@@ -1972,7 +1972,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?
index 0062dc5ea11209b1520f92b637fd8da051e3a16b..13af8d23136d23f6e93d537d454d3f74ad984269 100644 (file)
@@ -646,6 +646,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) {
@@ -673,6 +674,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