Skip to content

Commit

Permalink
Add lock is blk alloced to fix assert.
Browse files Browse the repository at this point in the history
There seems a concurrency issue when is blk alloced fails
in test_data_service.
  • Loading branch information
sanebay committed Feb 8, 2024
1 parent 4bbea89 commit 0bdf000
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/device/virtual_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ folly::Future< std::error_code > VirtualDev::async_format() {
}

bool VirtualDev::is_blk_alloced(BlkId const& blkid) const {
return m_dmgr.get_chunk(blkid.chunk_num())->blk_allocator()->is_blk_alloced(blkid);
return m_dmgr.get_chunk(blkid.chunk_num())->blk_allocator()->is_blk_alloced(blkid, true /* lock */);
}

BlkAllocStatus VirtualDev::commit_blk(BlkId const& blkid) {
Expand Down

0 comments on commit 0bdf000

Please sign in to comment.