]> 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>
Sat, 20 Jan 2024 18:00:24 +0000 (19:00 +0100)
commit3da43517a7a79ffc52e6e0aa4f4729e1fc79fd07
treed7fc5f2b3c5601ded8d3d5ea9f287dc4a1d2f6ae
parent98e75b1e1e64df6ac9f70c0a40af29702812c1fc
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