]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: fix split() for SparseExtent and SparseBufferlistExtent
authorIlya Dryomov <idryomov@gmail.com>
Mon, 12 Feb 2024 10:00:45 +0000 (11:00 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 20 Feb 2024 10:24:46 +0000 (11:24 +0100)
commit971aefce1dd38b71a3ff7998ae3492e871b1d217
tree2fae4c6473db072b7626d5a96f5f4036a6aa8c4f
parentbb2b5a32fc53d75aa463fb74c73b7d0b0ada6320
librbd: fix split() for SparseExtent and SparseBufferlistExtent

SparseExtents and SparseBufferlist are typedefs for interval_map.  In
both cases, split() handler is broken: for the former the extent isn't
actually split and for the latter incorrect bufferlist is attached to
the split extent.

Fortunately, both SnapshotDelta as produced by ObjectListSnapsRequest
and SparseBufferlist used in a couple of places seem to be collections
where only disjoint intervals are inserted and splitting doesn't occur
(at least in the common case).  But still, this is a landmine waiting
for someone to step on it.

Fixes: https://tracker.ceph.com/issues/64423
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 746cb28449903ceec2fe3ffcfa5e925eb78eb7b2)
src/librbd/io/Types.h
src/test/librbd/io/test_mock_ObjectRequest.cc