From 6ac535c5c5ab54de29e1837de4efbc2201189fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 26 May 2003 01:50:34 +0000 Subject: [PATCH] Fixed another bad bug in the block allocator: the size of the last block of the block bitmap could be computed wrong - this could cause all sorts of errors like: overwriting data, creating the "new_vnode with different cookie" problem, etc. Should really be the last bug in that piece of code ;-P git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3331 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp index 7f26392816..7ebfad76fa 100644 --- a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp @@ -99,7 +99,7 @@ AllocationBlock::SetTo(AllocationGroup &group, uint16 block) // 8 blocks per byte fNumBits = fVolume->BlockSize() << 3; // the last group may have less bits in the last block - if (block * fNumBits > group.fNumBits) + if ((block + 1) * fNumBits > group.fNumBits) fNumBits = group.fNumBits % fNumBits; return CachedBlock::SetTo(group.fStart + block) != NULL ? B_OK : B_ERROR;