]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: set multipart copy source object as atomic, prefetch 11269/head
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 30 Sep 2016 21:40:33 +0000 (14:40 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 30 Sep 2016 21:40:33 +0000 (14:40 -0700)
Object's head should only be read once.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_op.cc

index 16c6280a652e708715987f3c08633a9430c6dac1..f7774b3d9e28250e7a837190981faee449618938 100644 (file)
@@ -2491,6 +2491,11 @@ int RGWPutObj::verify_permission()
     rgw_bucket cs_bucket(copy_source_bucket_info.bucket);
     rgw_obj_key cs_object(copy_source_object_name, copy_source_version_id);
 
+    rgw_obj obj(cs_bucket, cs_object.name);
+    obj.set_instance(cs_object.instance);
+    store->set_atomic(s->obj_ctx, obj);
+    store->set_prefetch_data(s->obj_ctx, obj);
+
     /* check source object permissions */
     if (read_policy(store, s, copy_source_bucket_info, cs_attrs, &cs_policy, cs_bucket, cs_object) < 0) {
       return -EACCES;