]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/object_map: fix diff from snapshot when image is grown
authorIlya Dryomov <idryomov@gmail.com>
Fri, 22 Dec 2023 15:10:12 +0000 (16:10 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 2 Feb 2024 14:36:57 +0000 (15:36 +0100)
commitcb924241f76ca60f8ddc1152b3cf8bd16254ed66
treedc7f37120e97e578caaeabf6662cc05bf9253c93
parent69980516b191a98206e37aa39e3596955a5e9724
librbd/object_map: fix diff from snapshot when image is grown

Commit 399a45e11332 ("librbd/object_map: rbd diff between two
snapshots lists entire image content") fixed most of the damage caused
by commit b81cd2460de7 ("librbd/object_map: diff state machine should
track object existence"), but the case of a "resize diff" when diffing
from snapshot was missed.  An area that was freshly allocated in image
resize is the same in principle as a freshly created image and objects
marked OBJECT_EXISTS_CLEAN are no exception.  Diff for such objects in
such an area should be set to DIFF_STATE_DATA_UPDATED, however
currently when diffing from snapshot, it's set to DIFF_STATE_DATA.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 34386d29a8b96de79c38465062b8e93e7fc6e184)
src/librbd/object_map/DiffRequest.cc
src/librbd/object_map/DiffRequest.h
src/test/librbd/object_map/test_mock_DiffRequest.cc