From af463464cf02b9640d7bc68d76912bd05a1be3f9 Mon Sep 17 00:00:00 2001 From: "George V. Neville-Neil" Date: Wed, 7 Dec 2016 07:27:47 +0000 Subject: Fix a kernel panic in DTrace's rw_iswriter subroutine. On FreeBSD the sense of rw_write_held() and rw_iswriter() were reversed, probably due to a cut and paste error. Using rw_iswriter() would cause the kernel to panic. Reviewed by: markj MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8718 --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index c035e79abcb5..c47fb9b65398 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -4391,8 +4391,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uint64_t *regs, break; } l.lx = dtrace_loadptr(tupregs[0].dttk_value); - LOCK_CLASS(l.li)->lc_owner(l.li, &lowner); - regs[rd] = (lowner == curthread); + regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, &lowner) && + lowner != NULL; break; case DIF_SUBR_RW_ISWRITER: @@ -4403,8 +4403,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uint64_t *regs, break; } l.lx = dtrace_loadptr(tupregs[0].dttk_value); - regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, &lowner) && - lowner != NULL; + LOCK_CLASS(l.li)->lc_owner(l.li, &lowner); + regs[rd] = (lowner == curthread); break; #endif /* illumos */ -- cgit v1.2.3