From ba98fada3f89e41a48d6d36c4c758b47ebeebb30 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Thu, 9 May 2019 19:38:43 +0200 Subject: [PATCH] rgw_lc: use a new bl while encoding RGW_ATTR_LC 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 (cherry picked from commit e23af175aff1d80a7857406f7c17f5a609ad7e5e) --- src/rgw/rgw_lc.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index a66f2a3f3f0fc..af7632ef44d93 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -1357,7 +1357,11 @@ int RGWLC::set_bucket_config(RGWBucketInfo& bucket_info, RGWLifecycleConfiguration *config) { map 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; -- 2.39.5