* We need to reset the blockNumber, or else we'll discard the wrong blocks

which has rather desastrous consequences - thanks to Stippi for the heads
  up :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38242 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-08-18 16:44:51 +00:00
parent 64bd6d9651
commit 4af303359b
+3
View File
@@ -3406,6 +3406,9 @@ block_cache_discard(void* _cache, off_t blockNumber, size_t numBlocks)
writer.Write();
// TODO: this can fail, too!
blockNumber -= numBlocks;
// reset blockNumber to its original value
for (size_t i = 0; i < numBlocks; i++, blockNumber++) {
cached_block* block = (cached_block*)hash_lookup(cache->hash,
&blockNumber);