From: Yehuda Sadeh Date: Fri, 8 Jul 2016 01:01:54 +0000 (-0700) Subject: rgw: adjust manifest head object X-Git-Tag: v10.2.4~109^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10866%2Fhead;p=ceph.git rgw: adjust manifest head object 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 (cherry picked from commit 419264586fc46337322f0d60b0ffcdcce3bb5c5a) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 0219cac708dc..00c5132323f3 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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;