]> git-server-git.apps.pok.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)
committerLoic Dachary <ldachary@redhat.com>
Thu, 25 Aug 2016 12:21:46 +0000 (14:21 +0200)
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 a45eae97424e1c47f8f1ce85c9b9fd4d491992f1..0219cac708dc6acb01805544694787bf6605e2c6 100644 (file)
@@ -1881,7 +1881,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()) {
@@ -7051,8 +7051,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 c8f7c8a973be5206bf8e334368f78f4fc4d2451b..3a10bff6d10bf9d17d213e9f158b9ebf83240b63 100644 (file)
@@ -400,8 +400,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() {