Skip to content

Commit

Permalink
os/bluestore/BitAllocator: fix bug of checking required blocks
Browse files Browse the repository at this point in the history
Signed-off-by: wangzhengyong@cmss.chinamobile.com
  • Loading branch information
wangzhengyong committed Feb 17, 2017
1 parent c6113d7 commit cdc72cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/os/bluestore/BitAllocator.cc
Expand Up @@ -1338,6 +1338,10 @@ bool BitAllocator::child_check_n_lock(BitMapArea *child, int64_t required)
return false;
}

if ((m_total_blocks - m_used_blocks) < required) {
child->unlock();
return false;
}

return true;
}
Expand Down

0 comments on commit cdc72cf

Please sign in to comment.