]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: fast diff of first snapshot loads incorrect object map 4593/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 6 May 2015 21:37:58 +0000 (17:37 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 6 May 2015 21:40:44 +0000 (17:40 -0400)
The ImageCtx::snaps collection is stored in newest->oldest order,
so the first snapshot id should be retrieved from the back of the
array.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/internal.cc

index 05be815b3b316c536706e80c2b5b1f95e22e1696..c197c88ff48d6036757349ee4611f37409d7d0cb 100644 (file)
@@ -72,7 +72,7 @@ int diff_object_map(ImageCtx* ictx, uint64_t from_snap_id, uint64_t to_snap_id,
   bool diff_from_start = (from_snap_id == 0);
   if (from_snap_id == 0) {
     if (!ictx->snaps.empty()) {
-      from_snap_id = ictx->snaps.front();
+      from_snap_id = ictx->snaps.back();
     } else {
       from_snap_id = CEPH_NOSNAP;
     }