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
This commit is contained in:
parent
e40e5ebf8c
commit
7704e36304
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "Block.h"
|
#include "Block.h"
|
||||||
#include "checksumfs.h"
|
#include "checksumfs.h"
|
||||||
|
#include "DebugSupport.h"
|
||||||
#include "Volume.h"
|
#include "Volume.h"
|
||||||
|
|
||||||
|
|
||||||
@ -577,7 +578,7 @@ dprintf("BlockAllocator::_Free(%llu, %llu)\n", base, count);
|
|||||||
uint64 toFree = std::min(remaining, kBlocksPerGroup - groupOffset);
|
uint64 toFree = std::min(remaining, kBlocksPerGroup - groupOffset);
|
||||||
status_t error = _FreeInGroup(base, toFree, transaction);
|
status_t error = _FreeInGroup(base, toFree, transaction);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
RETURN_ERROR(error);
|
||||||
|
|
||||||
fFreeBlocks += toFree;
|
fFreeBlocks += toFree;
|
||||||
remaining -= toFree;
|
remaining -= toFree;
|
||||||
@ -603,7 +604,7 @@ dprintf("BlockAllocator::_FreeInGroup(%llu, %lu)\n", base, count);
|
|||||||
Block block;
|
Block block;
|
||||||
if (!block.GetWritable(fVolume,
|
if (!block.GetWritable(fVolume,
|
||||||
fAllocationGroupBlock + base / kBlocksPerGroup, transaction)) {
|
fAllocationGroupBlock + base / kBlocksPerGroup, transaction)) {
|
||||||
return B_ERROR;
|
RETURN_ERROR(B_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16* counts = (uint16*)block.Data();
|
uint16* counts = (uint16*)block.Data();
|
||||||
@ -617,11 +618,11 @@ dprintf("BlockAllocator::_FreeInGroup(%llu, %lu)\n", base, count);
|
|||||||
kBlocksPerBitmapBlock - inBlockOffset);
|
kBlocksPerBitmapBlock - inBlockOffset);
|
||||||
|
|
||||||
if (counts[blockIndex] + toFree > kBlocksPerBitmapBlock)
|
if (counts[blockIndex] + toFree > kBlocksPerBitmapBlock)
|
||||||
return B_BAD_VALUE;
|
RETURN_ERROR(B_BAD_VALUE);
|
||||||
|
|
||||||
status_t error = _FreeInBitmapBlock(base, toFree, transaction);
|
status_t error = _FreeInBitmapBlock(base, toFree, transaction);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
RETURN_ERROR(error);
|
||||||
|
|
||||||
counts[blockIndex] += toFree;
|
counts[blockIndex] += toFree;
|
||||||
remaining -= toFree;
|
remaining -= toFree;
|
||||||
@ -645,7 +646,7 @@ dprintf("BlockAllocator::_FreeInBitmapBlock(%llu, %lu)\n", base, count);
|
|||||||
Block block;
|
Block block;
|
||||||
if (!block.GetWritable(fVolume,
|
if (!block.GetWritable(fVolume,
|
||||||
fBitmapBlock + base / kBlocksPerBitmapBlock, transaction)) {
|
fBitmapBlock + base / kBlocksPerBitmapBlock, transaction)) {
|
||||||
return B_ERROR;
|
RETURN_ERROR(B_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32* bits = (uint32*)block.Data() + base % kBlocksPerBitmapBlock / 32;
|
uint32* bits = (uint32*)block.Data() + base % kBlocksPerBitmapBlock / 32;
|
||||||
@ -662,7 +663,7 @@ dprintf("BlockAllocator::_FreeInBitmapBlock(%llu, %lu)\n", base, count);
|
|||||||
|
|
||||||
if ((*bits & mask) != mask) {
|
if ((*bits & mask) != mask) {
|
||||||
block.Discard();
|
block.Discard();
|
||||||
return B_BAD_VALUE;
|
RETURN_ERROR(B_BAD_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
*bits &= ~mask;
|
*bits &= ~mask;
|
||||||
@ -673,7 +674,7 @@ dprintf("BlockAllocator::_FreeInBitmapBlock(%llu, %lu)\n", base, count);
|
|||||||
while (remaining >= 32) {
|
while (remaining >= 32) {
|
||||||
if (*bits != 0xffffffff) {
|
if (*bits != 0xffffffff) {
|
||||||
block.Discard();
|
block.Discard();
|
||||||
return B_BUSY;
|
RETURN_ERROR(B_BUSY);
|
||||||
}
|
}
|
||||||
|
|
||||||
*bits = 0;
|
*bits = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user