From b8fa2ed60b6cce51701df972dbb6f5e02e0d84ba Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 25 Aug 2014 10:38:42 -0700 Subject: [PATCH] rgw: fix test to identify whether object has tail Fixes: #9226 Reported-by: Sylvain Munaut Backport: firefly We need to identify whether an object is just composed of a head, or also has a tail. Test for pre-firefly objects ("explicit objs") was broken as it was just looking at the number of explicit objs in the manifest. However, this is insufficient, as we might have empty head, and in this case it wouldn't appear, so we need to check whether the sole object is actually pointing at the head. Signed-off-by: Yehuda Sadeh (cherry picked from commit 751b3e26532932a42ca34f9c062a0a3e29a58cff) --- src/rgw/rgw_rados.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index eea113769e9..dcaec8384a9 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -298,6 +298,11 @@ public: bool has_tail() { if (explicit_objs) { + if (objs.size() == 1) { + map::iterator iter = objs.begin(); + rgw_obj& obj = iter->second.loc; + return head_obj.object != obj.object; + } return (objs.size() >= 2); } return (obj_size > head_size); -- 2.47.3