From: Jaya Prakash Date: Thu, 19 Feb 2026 14:17:05 +0000 (+0000) Subject: os/bluestore: fix incorrect bluefs_used accounting when releasing old extents X-Git-Tag: v21.0.0~6^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6aa9deb16d902e47d17cd507ab033efec853b23;p=ceph.git os/bluestore: fix incorrect bluefs_used accounting when releasing old extents `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 --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 0c173969d6b1..31f98279d422 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -2065,7 +2065,7 @@ int BlueFS::device_migrate_to_existing( 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; } } @@ -2205,7 +2205,7 @@ int BlueFS::device_migrate_to_new( 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; } }