]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: fix set_attrs operation 11159/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 20 Sep 2016 21:32:03 +0000 (17:32 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 23 Sep 2016 01:48:47 +0000 (21:48 -0400)
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 <mbenjamin@redhat.com>
src/rgw/rgw_file.cc
src/rgw/rgw_op.cc

index b24060b39c8448e39cd3e6590671fc8b66a83d9d..dd0f241b88e21d25680a272e1d43790e677319cb 100644 (file)
@@ -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);
index 6152363c3ceb94930aaa8265e48c1ff680a5ca3b..1188820d7b0107aeea3106aef397754b180038f2 100644 (file)
@@ -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);