From: Ben Gras Date: Wed, 21 May 2014 17:32:39 +0000 (+0200) Subject: libminixfs: fix assert X-Git-Tag: v3.3.0~256 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/openssl_button.gif?a=commitdiff_plain;h=a65d06ef804ec4141f34f8309cb2d9d921d920c3;p=minix.git 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 --- diff --git a/lib/libminixfs/cache.c b/lib/libminixfs/cache.c index f503f8cc3..3f7a2c5da 100644 --- a/lib/libminixfs/cache.c +++ b/lib/libminixfs/cache.c @@ -297,10 +297,10 @@ struct buf *lmfs_get_block_ino(dev_t dev, block_t block, int only_search, bp->data = NULL; break; } - ASSERT(bp->lmfs_needsetcache == 0); /* Block needed has been found. */ if (bp->lmfs_count == 0) { rm_lru(bp); + ASSERT(bp->lmfs_needsetcache == 0); ASSERT(!(bp->lmfs_flags & VMMC_BLOCK_LOCKED)); bp->lmfs_flags |= VMMC_BLOCK_LOCKED; }