]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix Allocator::allocate() int truncation 13010/head
authorSage Weil <sage@redhat.com>
Fri, 20 Jan 2017 01:51:45 +0000 (19:51 -0600)
committerSage Weil <sage@redhat.com>
Fri, 20 Jan 2017 01:51:45 +0000 (19:51 -0600)
An allocation of size 0x80000000 gets truncated to 0.  Larger values can
break things in similar ways.

Introduced in 5ab034345d7320fbc86a2133c0c29ec1aca4b71a.

Fixes: http://tracker.ceph.com/issues/18595
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/Allocator.h

index 63f8e02c5b7b7168e885c220b3e44aeb69489055..bdbdca406086675c67f9e14d8f75f1967a479e8c 100644 (file)
@@ -39,8 +39,8 @@ public:
                           uint64_t max_alloc_size, int64_t hint,
                           AllocExtentVector *extents) = 0;
 
-  int allocate(uint64_t want_size, uint64_t alloc_unit,
-               int64_t hint, AllocExtentVector *extents) {
+  int64_t allocate(uint64_t want_size, uint64_t alloc_unit,
+                  int64_t hint, AllocExtentVector *extents) {
     return allocate(want_size, alloc_unit, want_size, hint, extents);
   }