]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/StupidAllocator: fix reservation release on allocate
authorSage Weil <sage@redhat.com>
Wed, 23 Dec 2015 15:19:17 +0000 (10:19 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jan 2016 18:07:29 +0000 (13:07 -0500)
Use up the amount we allocated, not the amount we asked for.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/StupidAllocator.cc

index 307c211583958e3399f7c3be950521a9de50bee6..be4d5633e454e366be7c592730797fcb1ad3ed45 100644 (file)
@@ -158,7 +158,7 @@ int StupidAllocator::allocate(
   }
 
   num_free -= *length;
-  num_reserved -= need_size;
+  num_reserved -= *length;
   assert(num_free >= 0);
   assert(num_reserved >= 0);
   last_alloc = *offset + *length;