summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-07-14 06:37:43 +0000
committerpjd <pjd@FreeBSD.org>2010-07-14 06:37:43 +0000
commitc63bb46f5bb647bea5a24f7e2452c00bd837693b (patch)
treec6d0900147cbdc88dbd07be96a12a721ebfd0279 /cddl
parente7cf927faa1c9623fc61121de11dbb694baf5122 (diff)
downloadFreeBSD-src-c63bb46f5bb647bea5a24f7e2452c00bd837693b.zip
FreeBSD-src-c63bb46f5bb647bea5a24f7e2452c00bd837693b.tar.gz
MFp4 180933:
Initialize rw_count properly so that zdb(8) doesn't trigger assertion in rw_enter(): ASSERT(rwlp->rw_count == 0); While here, assert that rw_count is 0 when destroying the lock. MFC after: 1 week
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libzpool/common/kernel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
index 6365c6c..e0f6422 100644
--- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
+++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
@@ -174,11 +174,13 @@ rw_init(krwlock_t *rwlp, char *name, int type, void *arg)
rwlock_init(&rwlp->rw_lock, USYNC_THREAD, NULL);
rwlp->rw_owner = NULL;
rwlp->initialized = B_TRUE;
+ rwlp->rw_count = 0;
}
void
rw_destroy(krwlock_t *rwlp)
{
+ ASSERT(rwlp->rw_count == 0);
rwlock_destroy(&rwlp->rw_lock);
rwlp->rw_owner = (void *)-1UL;
rwlp->initialized = B_FALSE;
OpenPOWER on IntegriCloud