From: myoungwon oh Date: Thu, 22 May 2025 06:41:01 +0000 (+0000) Subject: crimson/os/seastore: prevent incorrect space calculation at maximum capacity X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F63428%2Fhead;p=ceph.git crimson/os/seastore: prevent incorrect space calculation at maximum capacity This commit updates seastore to increment used_bytes only when allocation is successful. Without this commit, the seatore reports incorrect size if alloc_paddr fails (e.g., due to insufficient space) Signed-off-by: Myoungwon Oh --- diff --git a/src/crimson/os/seastore/async_cleaner.h b/src/crimson/os/seastore/async_cleaner.h index b17a4bd5be53..4f7bf8d7f8e5 100644 --- a/src/crimson/os/seastore/async_cleaner.h +++ b/src/crimson/os/seastore/async_cleaner.h @@ -1746,7 +1746,9 @@ public: // TODO: implement allocation strategy (dirty metadata and multiple devices) auto rbs = rb_group->get_rb_managers(); auto paddr = rbs[0]->alloc_extent(length); - stats.used_bytes += length; + if (paddr != P_ADDR_NULL) { + stats.used_bytes += length; + } return paddr; } @@ -1754,7 +1756,9 @@ public: // TODO: implement allocation strategy (dirty metadata and multiple devices) auto rbs = rb_group->get_rb_managers(); auto ret = rbs[0]->alloc_extents(length); - stats.used_bytes += length; + if (!ret.empty()) { + stats.used_bytes += length; + } return ret; }