]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't init rgw_obj from rgw_obj_key when it's incorrect to do so 13842/head
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 27 Feb 2017 18:35:01 +0000 (10:35 -0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 7 Mar 2017 21:16:12 +0000 (22:16 +0100)
Fixes: http://tracker.ceph.com/issues/19096
rgw_obj_key currently deals with the bucket index key, and not
representing a (name, instance, ns) tupple. Need to initialize
it in two steps.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 392c5d9dae6ba699014ffe6e1e67818fa62d7e41)

src/rgw/rgw_op.cc

index d1431f5b3d3d8cda1715d29d65f456a8f9138492..34fa91c7ad1d19005d2ef7c7c4a663463a76aee9 100644 (file)
@@ -411,7 +411,8 @@ int rgw_build_object_policies(RGWRados *store, struct req_state *s,
     }
     s->object_acl = new RGWAccessControlPolicy(s->cct);
 
-    rgw_obj obj(s->bucket, s->object);
+    rgw_obj obj(s->bucket, s->object.name);
+    obj.set_instance(s->object.instance);
       
     store->set_atomic(s->obj_ctx, obj);
     if (prefetch_data) {
@@ -4722,7 +4723,8 @@ void RGWSetAttrs::execute()
   if (op_ret < 0)
     return;
 
-  rgw_obj obj(s->bucket, s->object);
+  rgw_obj obj(s->bucket, s->object.name);
+  obj.set_instance(s->object.instance);
 
   store->set_atomic(s->obj_ctx, obj);