aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorahenriksson <sausageboy@gmail.com>2012-07-17 21:23:22 +0200
committerAxel Dörfler <axeld@pinc-software.de>2012-07-20 01:02:05 +0200
commit02378956042046a9fc635820f73d2cbeb7a4b5df (patch)
treeaa7803c3e68c6e7b256ec69d192facd76d299eda
parentd9879eddbf9e4b01f07679af1769e9f439d4e0ef (diff)
CheckBlocks() calculated the group block incorrectlyhrev44359
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
-rw-r--r--src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp
index 8dc8f3f4b0..b0d446f75b 100644
--- a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp
+++ b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp
@@ -1699,9 +1699,11 @@ BlockAllocator::CheckBlocks(off_t start, off_t length, bool allocated)
if (start < 0 || start + length > fVolume->NumBlocks())
return B_BAD_VALUE;
- uint32 group = start >> fVolume->AllocationGroupShift();
- uint32 groupBlock = start / (fVolume->BlockSize() << 3);
- uint32 blockOffset = start % fVolume->BlockSize();
+ int32 group = start >> fVolume->AllocationGroupShift();
+ uint32 bitmapBlock = start / (fVolume->BlockSize() << 3);
+ uint32 blockOffset = start % (fVolume->BlockSize() << 3);
+
+ uint32 groupBlock = bitmapBlock % fBlocksPerGroup;
AllocationBlock cached(fVolume);