From: Daniel Gryniewicz Date: Tue, 8 Jun 2021 16:59:56 +0000 (-0400) Subject: RGW - Don't move attrs before setting them X-Git-Tag: v17.1.0~1698^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41761%2Fhead;p=ceph.git RGW - Don't move attrs before setting them Moving the attrs into s->bucket_attrs before setting them results in setting empty attrs into the bucket. This means that reading them back later gets empty attrs, which can cause a segfault. Signed-off-by: Daniel Gryniewicz --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index ad1b0a82c9b..5c8a9b6cd56 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -7356,9 +7356,6 @@ void RGWSetAttrs::execute(optional_yield y) rgw::sal::Attrs a(attrs); op_ret = s->object->set_obj_attrs(this, s->obj_ctx, &a, nullptr, y); } else { - for (auto& iter : attrs) { - s->bucket_attrs[iter.first] = std::move(iter.second); - } op_ret = s->bucket->set_instance_attrs(this, attrs, y); }