]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_lc: use a new bl while encoding RGW_ATTR_LC 28049/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 9 May 2019 17:38:43 +0000 (19:38 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Thu, 9 May 2019 17:38:43 +0000 (19:38 +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>
src/rgw/rgw_lc.cc

index bea92b2b18bd25f0629b0c5d65075ad26c5fd70e..03a87758e99628814c9da203c61d263e601d896a 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;