diff --git a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp index 257fb3d872..e4643667d4 100644 --- a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp @@ -1326,6 +1326,8 @@ BlockAllocator::StopChecking(check_control* control) int32 blocksInBitmap = fNumGroups * fBlocksPerGroup; size_t blockSize = fVolume->BlockSize(); + if (blocksInBitmap > (int32)fNumBlocks) + blocksInBitmap = fNumBlocks; for (int32 i = 0; i < blocksInBitmap; i += 512) { Transaction transaction(fVolume, 1 + i);