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
This commit is contained in:
George V. Neville-Neil 2016-12-07 07:27:47 +00:00
parent d0155f67a3
commit af463464cf

View File

@ -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 */