From 08afb40b2812270a6af3cd1965e8c03c10392ace Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Tue, 20 Sep 2016 17:32:03 -0400 Subject: [PATCH] rgw_file: fix set_attrs operation The effective part of this change is to always set a value for RGW_ATTR_UNIX_KEY1 (because it is expected later). Secondarily, do not pass the address of the to-set attributes buffer::list as remove attrs--this is confusing. Signed-off-by: Matt Benjamin --- src/rgw/rgw_file.cc | 1 + src/rgw/rgw_op.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index b24060b39c8..dd0f241b88e 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -604,6 +604,7 @@ namespace rgw { rgw_fh->encode_attrs(ux_key, ux_attrs); /* save attrs */ + req.emplace_attr(RGW_ATTR_UNIX_KEY1, std::move(ux_key)); req.emplace_attr(RGW_ATTR_UNIX1, std::move(ux_attrs)); rc = rgwlib.get_fe()->execute_req(&req); diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 6152363c3ce..1188820d7b0 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -5178,7 +5178,7 @@ void RGWSetAttrs::execute() store->set_atomic(s->obj_ctx, obj); if (!s->object.empty()) { - op_ret = store->set_attrs(s->obj_ctx, obj, attrs, &attrs); + op_ret = store->set_attrs(s->obj_ctx, obj, attrs, nullptr); } else { for (auto& iter : attrs) { s->bucket_attrs[iter.first] = std::move(iter.second);