lib/libzpool/kernel.c: Assert no owners in rw_destroy()

This is intended to cause ztest to fail when rw_destroy() is called on a
rwlock that has owners.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2330
This commit is contained in:
Richard Yao 2014-04-29 20:47:47 -04:00 committed by Brian Behlendorf
parent 485c581c41
commit 843b4aad50

View File

@ -366,7 +366,7 @@ void
rw_destroy(krwlock_t *rwlp)
{
ASSERT3U(rwlp->rw_magic, ==, RW_MAGIC);
ASSERT(rwlp->rw_readers == 0 && rwlp->rw_wr_owner == RW_INIT);
VERIFY3S(pthread_rwlock_destroy(&rwlp->rw_lock), ==, 0);
rwlp->rw_magic = 0;
}