]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_lc: use a new bl while encoding RGW_ATTR_LC 29313/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 9 May 2019 17:38:43 +0000 (19:38 +0200)
committerNathan Cutler <ncutler@suse.com>
Thu, 25 Jul 2019 10:49:12 +0000 (12:49 +0200)
The current code seems to append the value to the bucket attr which isn't what
we want

Fixes: https://tracker.ceph.com/issues/39654
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit e23af175aff1d80a7857406f7c17f5a609ad7e5e)

src/rgw/rgw_lc.cc

index a66f2a3f3f0fc895c3fd6d3300ad7b0037cade7c..af7632ef44d930e60a1bff0399e4e773f9cddaad 100644 (file)
@@ -1357,7 +1357,11 @@ int RGWLC::set_bucket_config(RGWBucketInfo& bucket_info,
                          RGWLifecycleConfiguration *config)
 {
   map<string, bufferlist> attrs = bucket_attrs;
-  config->encode(attrs[RGW_ATTR_LC]);
+  bufferlist lc_bl;
+  config->encode(lc_bl);
+
+  attrs[RGW_ATTR_LC] = std::move(lc_bl);
+
   int ret = rgw_bucket_set_attrs(store, bucket_info, attrs, &bucket_info.objv_tracker);
   if (ret < 0)
     return ret;