]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
SimpleRADOSStriper: fix incorrect variable usage in allocation growth calculation
authorPatrick Donnelly <pdonnell@ibm.com>
Sat, 30 May 2026 16:16:19 +0000 (12:16 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Sun, 31 May 2026 22:00:54 +0000 (18:00 -0400)
In set_metadata(), the calculation for new_allocated was incorrectly
applying the base-2 rounding mask to the old size variable instead of
the requested new_size. This commit fixes the logic to use the correct
target size when determining the new boundaries.

Fixes: https://tracker.ceph.com/issues/77009
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/SimpleRADOSStriper.cc

index c0000a5d017b1666d768e1274e0a099c8ac43ae4..cc51b1537e6796806ffa00111a156bea4c92b597 100644 (file)
@@ -397,7 +397,7 @@ int SimpleRADOSStriper::set_metadata(uint64_t new_size, bool update_size)
   auto op = librados::ObjectWriteOperation();
   if (new_size > allocated) {
     uint64_t mask = (1<<object_size)-1;
-    new_allocated = min_growth + ((size + mask) & ~mask); /* round up base 2 */
+    new_allocated = min_growth + ((new_size + mask) & ~mask); /* round up base 2 */
     op.setxattr(XATTR_ALLOCATED, uint2bl(new_allocated));
     do_op = true;
     if (logger) logger->inc(P_UPDATE_ALLOCATED);