]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix incorrect bluefs_used accounting when releasing old extents 67420/head
authorJaya Prakash <jayaprakash@ibm.com>
Thu, 19 Feb 2026 14:17:05 +0000 (14:17 +0000)
committerJaya Prakash <jayaprakash@ibm.com>
Thu, 19 Feb 2026 14:29:24 +0000 (14:29 +0000)
`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>
src/os/bluestore/BlueFS.cc

index 0c173969d6b1407b261eba568a6669ccbb910740..31f98279d42213c6ff9dcd148f933cb77b697485 100644 (file)
@@ -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;
         }
       }