From 7704e363049ac7e11136adf119e8af18e1718ab1 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 14 Jul 2010 00:02:43 +0000 Subject: [PATCH] Use RETURN_ERROR() in the free paths, so we see where things go wrong. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37504 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/file_corruption/fs/BlockAllocator.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/tests/system/kernel/file_corruption/fs/BlockAllocator.cpp b/src/tests/system/kernel/file_corruption/fs/BlockAllocator.cpp index f2654035d3..94507014f9 100644 --- a/src/tests/system/kernel/file_corruption/fs/BlockAllocator.cpp +++ b/src/tests/system/kernel/file_corruption/fs/BlockAllocator.cpp @@ -14,6 +14,7 @@ #include "Block.h" #include "checksumfs.h" +#include "DebugSupport.h" #include "Volume.h" @@ -577,7 +578,7 @@ dprintf("BlockAllocator::_Free(%llu, %llu)\n", base, count); uint64 toFree = std::min(remaining, kBlocksPerGroup - groupOffset); status_t error = _FreeInGroup(base, toFree, transaction); if (error != B_OK) - return error; + RETURN_ERROR(error); fFreeBlocks += toFree; remaining -= toFree; @@ -603,7 +604,7 @@ dprintf("BlockAllocator::_FreeInGroup(%llu, %lu)\n", base, count); Block block; if (!block.GetWritable(fVolume, fAllocationGroupBlock + base / kBlocksPerGroup, transaction)) { - return B_ERROR; + RETURN_ERROR(B_ERROR); } uint16* counts = (uint16*)block.Data(); @@ -617,11 +618,11 @@ dprintf("BlockAllocator::_FreeInGroup(%llu, %lu)\n", base, count); kBlocksPerBitmapBlock - inBlockOffset); if (counts[blockIndex] + toFree > kBlocksPerBitmapBlock) - return B_BAD_VALUE; + RETURN_ERROR(B_BAD_VALUE); status_t error = _FreeInBitmapBlock(base, toFree, transaction); if (error != B_OK) - return error; + RETURN_ERROR(error); counts[blockIndex] += toFree; remaining -= toFree; @@ -645,7 +646,7 @@ dprintf("BlockAllocator::_FreeInBitmapBlock(%llu, %lu)\n", base, count); Block block; if (!block.GetWritable(fVolume, fBitmapBlock + base / kBlocksPerBitmapBlock, transaction)) { - return B_ERROR; + RETURN_ERROR(B_ERROR); } uint32* bits = (uint32*)block.Data() + base % kBlocksPerBitmapBlock / 32; @@ -662,7 +663,7 @@ dprintf("BlockAllocator::_FreeInBitmapBlock(%llu, %lu)\n", base, count); if ((*bits & mask) != mask) { block.Discard(); - return B_BAD_VALUE; + RETURN_ERROR(B_BAD_VALUE); } *bits &= ~mask; @@ -673,7 +674,7 @@ dprintf("BlockAllocator::_FreeInBitmapBlock(%llu, %lu)\n", base, count); while (remaining >= 32) { if (*bits != 0xffffffff) { block.Discard(); - return B_BUSY; + RETURN_ERROR(B_BUSY); } *bits = 0;