]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: adjust manifest head object 11950/head
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 8 Jul 2016 01:01:54 +0000 (18:01 -0700)
committerNathan Cutler <ncutler@suse.com>
Sun, 13 Nov 2016 10:04:16 +0000 (11:04 +0100)
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 9056eee7d330e1097722c3a305349f07266cdf65..68d3345546105ac8f7fd7ca013d5133a311d4c59 100644 (file)
@@ -4244,6 +4244,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;
@@ -5047,6 +5049,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, 20) << "ERROR: couldn't decode manifest" << dendl;