]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BitAllocator: fix is_allocated() may return false positive
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 17 May 2016 12:35:16 +0000 (20:35 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 1 Jun 2016 05:25:49 +0000 (13:25 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BitAllocator.cc

index f88bae7468c7a04aa877032b61c793fc9660fd43..bc19fd43dadd2facccb36f69445e5135a8d6b221 100644 (file)
@@ -935,7 +935,8 @@ bool BitAllocator::is_allocated(int64_t start_block, int64_t num_blocks)
 bool BitAllocator::is_allocated(int64_t *alloc_blocks, int64_t num_blocks)
 {
   for (int64_t i = 0; i < num_blocks; i++) {
-    return is_allocated(alloc_blocks[i], 1);
+    if (!is_allocated(alloc_blocks[i], 1))
+      return false;
   }
 
   return true;