]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: adjust objs when copying obj with explicit_objs set
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 7 Jul 2016 22:49:07 +0000 (15:49 -0700)
committerNathan Cutler <ncutler@suse.com>
Sun, 13 Nov 2016 10:04:11 +0000 (11:04 +0100)
If the head object contains data, need to set it in the list of
objs (in addition to being pointed at by head_obj).

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

src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 5854c64dbf86d61a9e0fb47b65060312ca518f99..9056eee7d330e1097722c3a305349f07266cdf65 100644 (file)
@@ -645,7 +645,7 @@ int RGWObjManifest::generator::create_begin(CephContext *cct, RGWObjManifest *_m
 
   bucket = _b;
   manifest->set_tail_bucket(_b);
-  manifest->set_head(_h);
+  manifest->set_head(_h, 0);
   last_ofs = 0;
 
   if (manifest->get_prefix().empty()) {
@@ -4243,8 +4243,7 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
       goto done_ret;
     }
 
-    pmanifest->set_head(dest_obj);
-    pmanifest->set_head_size(first_chunk.length());
+    pmanifest->set_head(dest_obj, first_chunk.length());
   }
 
   write_op.meta.data = &first_chunk;
index 16ccfe0c09dfc96356235afa328b26fbd6e48f28..6679056fe613d6392126bc82adb6bf044be30694 100644 (file)
@@ -386,8 +386,14 @@ public:
     return (obj_size > head_size);
   }
 
-  void set_head(const rgw_obj& _o) {
+  void set_head(const rgw_obj& _o, uint64_t _s) {
     head_obj = _o;
+    head_size = _s;
+
+    if (explicit_objs && head_size > 0) {
+      objs[0].loc = head_obj;
+      objs[0].size = head_size;
+    }
   }
 
   const rgw_obj& get_head() {