]> 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)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 8 Jul 2016 01:58:26 +0000 (18:58 -0700)
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>
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index fa38e08222729910d8d26f24888bab719fbc1af5..c92cda538cd08ef309daec7f1dd1b6a926fe87ed 100644 (file)
@@ -1911,7 +1911,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()) {
@@ -7070,8 +7070,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 77bf91e36cdf6d58b8c9d622f64452c6ff7d93ac..059fd3be4568110ff7820575d337df84c0e1ba17 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() {