]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: diff-iterate reports incorrect offsets if whole_object=true 44548/head
authorIlya Dryomov <idryomov@gmail.com>
Wed, 19 Jan 2022 20:08:01 +0000 (21:08 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 19 Jan 2022 20:51:43 +0000 (21:51 +0100)
It turns out that in octopus both fast-diff and list-snaps (slow)
modes were broken.  As long as whole_object=true, the same incorrect
offset was reported in both modes.  The fast-diff mode is fixed in
in previous commit.

This is an octopus-only patch for list-snaps mode.  In pacific this
issue was addressed with 4429ed4f3f4c ("librbd: switch diff iterate
API to use new snaps list dispatch methods").

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/librbd/api/DiffIterate.cc

index 4318116732dfcf908d455600e4d68885f567c540..ac884e692473279e7bcea69644e1a4589f73eca3 100644 (file)
@@ -150,8 +150,12 @@ private:
       // provide the full object extents to the callback
       for (vector<ObjectExtent>::iterator q = m_object_extents.begin();
            q != m_object_extents.end(); ++q) {
-        diffs->push_back(boost::make_tuple(m_offset + q->offset, q->length,
-                                           end_exists));
+        for (vector<pair<uint64_t,uint64_t> >::iterator r =
+               q->buffer_extents.begin();
+             r != q->buffer_extents.end(); ++r) {
+          diffs->push_back(boost::make_tuple(m_offset + r->first, r->second,
+                                             end_exists));
+        }
       }
       return;
     }