]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: adjust manifest head object 10866/head
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 8 Jul 2016 01:01:54 +0000 (18:01 -0700)
committerLoic Dachary <ldachary@redhat.com>
Thu, 25 Aug 2016 12:21:51 +0000 (14:21 +0200)
adjust the manifest head object:
 - when reading manifest, set the head object to the object
   we read the manifest from (and its size). Some manifests are
   broken and point at a different object
 - when copying multipart object, set the manifest head object to
   point at the new head object

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

src/rgw/rgw_rados.cc

index 0219cac708dc6acb01805544694787bf6605e2c6..00c5132323f32c1f72fd1feb76045261021962a8 100644 (file)
@@ -7052,6 +7052,8 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
     }
 
     pmanifest->set_head(dest_obj, first_chunk.length());
+  } else {
+    pmanifest->set_head(dest_obj, 0);
   }
 
   write_op.meta.data = &first_chunk;
@@ -7999,6 +8001,8 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, rgw_obj& obj, RGWObjState *
     try {
       ::decode(s->manifest, miter);
       s->has_manifest = true;
+      s->manifest.set_head(obj, s->size); /* patch manifest to reflect the head we just read, some manifests might be
+                                             broken due to old bugs */
       s->size = s->manifest.get_obj_size();
     } catch (buffer::error& err) {
       ldout(cct, 0) << "ERROR: couldn't decode manifest" << dendl;