Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reef: librbd: fix split() for SparseExtent and SparseBufferlistExtent #55665

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

idryomov
Copy link
Contributor

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 746cb28)
- pass left.length + right.length instead of bl.length()
  for consistency and to avoid circumventing the assert in
  SparseBufferlistExtent constructor
- claim_append() takes an lvalue reference, no need to move
- follow the pattern used in split()

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 69c18cf)
@idryomov idryomov added this to the v18.2.2 milestone Feb 20, 2024
@idryomov idryomov requested a review from a team as a code owner February 20, 2024 10:29
@yuriw yuriw merged commit a2082d9 into ceph:reef Feb 28, 2024
11 of 12 checks passed
@idryomov idryomov deleted the wip-64423-reef branch February 28, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants