]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: fix set_attrs operation
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 20 Sep 2016 21:32:03 +0000 (17:32 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 5 Oct 2016 18:26:09 +0000 (14:26 -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>
(cherry picked from commit 08afb40b2812270a6af3cd1965e8c03c10392ace)

Fixes: http://tracker.ceph.com/issues/17393
src/rgw/rgw_file.cc
src/rgw/rgw_op.cc

index bb470c5475a05943e2ff03028c1dcef2b0ea945f..4f513c9152a14a900408b6ef4c9b62bf731f4d3c 100644 (file)
@@ -592,6 +592,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 b6fbe67a6408c41f4e690dcfa2ea95ec9d399cdd..b4a09d7fcda6f08f08afd1c9cf7810ffcc4c3214 100644 (file)
@@ -4688,7 +4688,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);