The alignment of extents might not reflect current alloc_unit[bdev].
It might be caused be either fallback to alternate AU size for SLOW,
or change of allocation unit in DB or WAL.
In such cases, truncation just leaves extent untouched.
Fixes: https://tracker.ceph.com/issues/71533
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit
0da7a2a58c207b97c9bcf4a1dfcd9d09f0e9b954)
changed_extents = true;
++p;
} else {
- // cut_off > p->length means that we misaligned the extent
- ceph_assert(cut_off == p->length);
+ // Usually cut_off == p->length.
+ // Case cut_off > p->length means that we misaligned the extent
+ // or alloc size changed in the meantime.
+ // In both cases just leave extent untouched.
fnode.allocated = (offset - x_off) + p->length;
- ++p; // leave extent untouched
+ ++p;
}
while (p != fnode.extents.end()) {
dirty.pending_release[p->bdev].insert(p->offset, p->length);