`bluefs_used` was decremented using to_release.size(), which represents the number
of extents (always 1 in this case), instead of the actual extent length in bytes.
This resulted in incorrect BlueFS space accounting when using the shared allocator.
The fix updates the decrement to use `old_ext.length`, ensuring accurate tracking.
Fixes: https://tracker.ceph.com/issues/75028
Signed-off-by: Jaya Prakash <jayaprakash@ibm.com>
to_release.emplace_back(old_ext.offset, old_ext.length);
alloc[old_ext.bdev]->release(to_release);
if (is_shared_alloc(old_ext.bdev)) {
- shared_alloc->bluefs_used -= to_release.size();
+ shared_alloc->bluefs_used -= old_ext.length;
}
}
to_release.emplace_back(old_ext.offset, old_ext.length);
alloc[old_ext.bdev]->release(to_release);
if (is_shared_alloc(old_ext.bdev)) {
- shared_alloc->bluefs_used -= to_release.size();
+ shared_alloc->bluefs_used -= old_ext.length;
}
}