From 843b4aad504b791eb1e8dfe6772a55d4da090b65 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Tue, 29 Apr 2014 20:47:47 -0400 Subject: [PATCH] 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 Signed-off-by: Brian Behlendorf Issue #2330 --- lib/libzpool/kernel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c index a1bb973b1..03fbe3dd0 100644 --- a/lib/libzpool/kernel.c +++ b/lib/libzpool/kernel.c @@ -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; }