]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: diff-iterate reports incorrect offsets in fast-diff mode 44483/head
authorIlya Dryomov <idryomov@gmail.com>
Tue, 4 Jan 2022 19:38:35 +0000 (20:38 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 6 Jan 2022 12:15:17 +0000 (13:15 +0100)
commitea07d1e834018c693fc03637d338806f3c2f494f
treec07e1895e8683b51894b87efd939f7053e70723b
parent24df4a2e83c57788f5638aad0e88a738d80878ef
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>
src/librbd/api/DiffIterate.cc
src/test/librbd/test_librbd.cc