]> 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)
committerNathan Cutler <ncutler@suse.com>
Sun, 13 Nov 2016 10:04:06 +0000 (11:04 +0100)
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 93077f8cc37fcca925ac90b16e9c1721d175e356..16ccfe0c09dfc96356235afa328b26fbd6e48f28 100644 (file)
@@ -335,6 +335,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);
     }