From: Ilya Dryomov Date: Wed, 19 Jan 2022 20:08:01 +0000 (+0100) Subject: librbd: diff-iterate reports incorrect offsets if whole_object=true X-Git-Tag: v15.2.16~32^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=65fdca18c221fc1a3f1851b060c51a76a0991b2e;p=ceph.git librbd: diff-iterate reports incorrect offsets if whole_object=true 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 --- diff --git a/src/librbd/api/DiffIterate.cc b/src/librbd/api/DiffIterate.cc index 4318116732d..ac884e69247 100644 --- a/src/librbd/api/DiffIterate.cc +++ b/src/librbd/api/DiffIterate.cc @@ -150,8 +150,12 @@ private: // provide the full object extents to the callback for (vector::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 >::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; }