]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/os/bluestore/StupidAllocator.cc
import 14.2.4 nautilus point release
[ceph.git] / ceph / src / os / bluestore / StupidAllocator.cc
index 13f38d692e9fa9838d68c1d66e3b5d78c82a0a1b..db2e9e3634c2d84108f87d6dbf8fa68bcda98ad7 100644 (file)
@@ -206,10 +206,13 @@ int64_t StupidAllocator::allocate(
     bool can_append = true;
     if (!extents->empty()) {
       bluestore_pextent_t &last_extent  = extents->back();
-      if ((last_extent.end() == offset) &&
-         ((last_extent.length + length) <= max_alloc_size)) {
-       can_append = false;
-       last_extent.length += length;
+      if (last_extent.end() == offset) {
+        uint64_t l64 = last_extent.length;
+        l64 += length;
+        if (l64 < 0x100000000 && l64 <= max_alloc_size) {
+         can_append = false;
+         last_extent.length += length;
+        }
       }
     }
     if (can_append) {