]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/object_map: don't resize object map in handle_load_object_map()
authorIlya Dryomov <idryomov@gmail.com>
Thu, 4 Jan 2024 10:39:20 +0000 (11:39 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 2 Feb 2024 14:36:57 +0000 (15:36 +0100)
commit629acb7650e8123fabea6cce4ee7d44230efa04b
treea842c5a02c38d294626471e53c284f000b237492
parent4f0c52eab3e102721581f74107cad8bc002ce2b9
librbd/object_map: don't resize object map in handle_load_object_map()

Currently it's done in two cases:

- if the loaded object map is larger than expected based on byte size,
  it's truncated to expected number of objects
- in case of deep-copy, if the loaded object map is smaller than diff
  state, it's expanded to get "track the largest of all versions in the
  set" semantics

Both of these cases can be easily dealt with without modifying the
object map.  Being able to process a const object map is needed for
working on in-memory object map which is external to DiffRequest.

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