]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: diff-iterate reports incorrect offsets in fast-diff mode 44547/head
authorIlya Dryomov <idryomov@gmail.com>
Tue, 4 Jan 2022 19:38:35 +0000 (20:38 +0100)
committerCory Snyder <csnyder@iland.com>
Tue, 11 Jan 2022 20:49:42 +0000 (15:49 -0500)
commit7b250589228a0b72fae5604005d27beeeefa84a1
treee18cb69c243e19aaeba223fa3f894fe445503e55
parent24e18cd04eeb9a4d111bcb1511987420e029bd3c
librbd: diff-iterate reports incorrect offsets in fast-diff mode

If rbd_diff_iterate2() is called on an image offset that doesn't
correspond to an object boundary, the callback is invoked with an
incorrect image offset.  For example, assuming a fully allocated
image, a diff request for 806354944~57344 results in offs=807403520,
len=57344, exists=true invocation, which is ahead by 1048576 bytes.
This occurs only in fast-diff mode, for a diff request on an image
with the fast-diff feature disabled or if whole_object parameter is
set to false the invocation is correct.

This bug goes back to the introduction of fast-diff mode in commit
6d5b969d4206 ("librbd: add diff_iterate2 to API").

Fixes: https://tracker.ceph.com/issues/53784
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit ea07d1e834018c693fc03637d338806f3c2f494f)
src/librbd/api/DiffIterate.cc
src/test/librbd/test_librbd.cc