get_cached_block(): Remove the newly allocated block from the
hashtable in case of a read error (NewBlock() also adds the block, but FreeBlock() only frees it). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20365 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+1
@@ -505,6 +505,7 @@ get_cached_block(block_cache *cache, off_t blockNumber, bool *allocated, bool re
|
||||
int32 blockSize = cache->block_size;
|
||||
|
||||
if (read_pos(cache->fd, blockNumber * blockSize, block->current_data, blockSize) < blockSize) {
|
||||
hash_remove(cache->hash, block);
|
||||
cache->FreeBlock(block);
|
||||
FATAL(("could not read block %Ld\n", blockNumber));
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user