]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: patch manifest to handle explicit objs copy issue
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 7 Jul 2016 22:36:33 +0000 (15:36 -0700)
committerLoic Dachary <ldachary@redhat.com>
Thu, 25 Aug 2016 12:21:42 +0000 (14:21 +0200)
Fixes: http://tracker.ceph.com/issues/16435
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit b51476466e5bb03bbaa6e428bb6bb189a259b9fd)

src/rgw/rgw_rados.h

index 041979a80698911207437269e04e0fcd1c98060d..c8f7c8a973be5206bf8e334368f78f4fc4d2451b 100644 (file)
@@ -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);
     }