[haiku-commits] r42594 - haiku/trunk/src/add-ons/kernel/file_systems/bfs

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 7 Aug 2011 16:53:10 +0200 (CEST)

Author: korli
Date: 2011-08-07 16:53:10 +0200 (Sun, 07 Aug 2011)
New Revision: 42594
Changeset: https://dev.haiku-os.org/changeset/42594

Modified:
   haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp
Log:
When checkfs stop checking, the block allocator tries to write more blocks than 
present in fCheckBitmap, so we constrain it 
to fNumBlocks.


Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp  
2011-08-07 12:05:22 UTC (rev 42593)
+++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp  
2011-08-07 14:53:10 UTC (rev 42594)
@@ -1326,6 +1326,8 @@
 
                        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);


Other related posts: