]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: adjust manifest head object 10193/head
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 8 Jul 2016 01:01:54 +0000 (18:01 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 8 Jul 2016 01:58:52 +0000 (18:58 -0700)
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>
src/rgw/rgw_rados.cc

index c92cda538cd08ef309daec7f1dd1b6a926fe87ed..2bea8525fb591dcc6ac64062f71510805133854e 100644 (file)
@@ -7071,6 +7071,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;
@@ -8015,6 +8017,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;