libminixfs: fix assert

Came across this bug.

 . setcache assert should be when block currently isn't in use,
   as setcache happens when buf becomes unused
This commit is contained in:
Ben Gras 2014-05-21 19:32:39 +02:00 committed by Lionel Sambuc
parent a42c8f6c41
commit a65d06ef80

View file

@ -297,10 +297,10 @@ struct buf *lmfs_get_block_ino(dev_t dev, block_t block, int only_search,
bp->data = NULL; bp->data = NULL;
break; break;
} }
ASSERT(bp->lmfs_needsetcache == 0);
/* Block needed has been found. */ /* Block needed has been found. */
if (bp->lmfs_count == 0) { if (bp->lmfs_count == 0) {
rm_lru(bp); rm_lru(bp);
ASSERT(bp->lmfs_needsetcache == 0);
ASSERT(!(bp->lmfs_flags & VMMC_BLOCK_LOCKED)); ASSERT(!(bp->lmfs_flags & VMMC_BLOCK_LOCKED));
bp->lmfs_flags |= VMMC_BLOCK_LOCKED; bp->lmfs_flags |= VMMC_BLOCK_LOCKED;
} }