diff options
author | pjd <pjd@FreeBSD.org> | 2010-07-14 06:37:43 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-07-14 06:37:43 +0000 |
commit | c63bb46f5bb647bea5a24f7e2452c00bd837693b (patch) | |
tree | c6d0900147cbdc88dbd07be96a12a721ebfd0279 | |
parent | e7cf927faa1c9623fc61121de11dbb694baf5122 (diff) | |
download | FreeBSD-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
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzpool/common/kernel.c | 2 |
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; |