]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix test to identify whether object has tail 2321/head
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 25 Aug 2014 17:38:42 +0000 (10:38 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 25 Aug 2014 17:38:42 +0000 (10:38 -0700)
Fixes: #9226
Reported-by: Sylvain Munaut <s.munaut@whatever-company.com>
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 <yehuda@redhat.com>
src/rgw/rgw_rados.h

index ed8f02dfc2f595e540295b056a6379afea8db4a0..0042df2f4a4e42625a3a5d57b2a1b5ce8e66271c 100644 (file)
@@ -306,6 +306,11 @@ public:
 
   bool has_tail() {
     if (explicit_objs) {
+      if (objs.size() == 1) {
+        map<uint64_t, RGWObjManifestPart>::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);