From c6aa9deb16d902e47d17cd507ab033efec853b23 Mon Sep 17 00:00:00 2001 From: Jaya Prakash Date: Thu, 19 Feb 2026 14:17:05 +0000 Subject: [PATCH] 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 --- src/os/bluestore/BlueFS.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } } -- 2.47.3