From 849161602978d6749194b080566fa42548874908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 21 Jun 2007 12:35:39 +0000 Subject: [PATCH] Putting an unused block will now trigger a panic. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21481 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/cache/block_cache.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/system/kernel/cache/block_cache.cpp b/src/system/kernel/cache/block_cache.cpp index 79141c4163..78d69cdb25 100644 --- a/src/system/kernel/cache/block_cache.cpp +++ b/src/system/kernel/cache/block_cache.cpp @@ -446,6 +446,11 @@ put_cached_block(block_cache *cache, cached_block *block) } #endif + if (block->ref_count < 1) { + panic("Invalid ref_count for block %p, cache %p\n", block, cache); + return; + } + if (--block->ref_count == 0 && block->transaction == NULL && block->previous_transaction == NULL) {