From c1250ee6cbc4a7710399e603ff3ee0e46aa92d49 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 7 Jul 2016 15:36:33 -0700 Subject: [PATCH] rgw: patch manifest to handle explicit objs copy issue Fixes: http://tracker.ceph.com/issues/16435 Signed-off-by: Yehuda Sadeh (cherry picked from commit b51476466e5bb03bbaa6e428bb6bb189a259b9fd) --- src/rgw/rgw_rados.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 041979a806989..c8f7c8a973be5 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -349,6 +349,20 @@ public: } } + if (explicit_objs && head_size > 0 && !objs.empty()) { + /* patch up manifest due to issue 16435: + * the first object in the explicit objs list might not be the one we need to access, use the + * head object instead if set. This would happen if we had an old object that was created + * when the explicit objs manifest was around, and it got copied. + */ + rgw_obj& obj_0 = objs[0].loc; + + if (!obj_0.get_object().empty() && obj_0.ns.empty()) { + objs[0].loc = head_obj; + objs[0].size = head_size; + } + } + if (struct_v >= 4) { ::decode(tail_bucket, bl); } -- 2.39.5