svn commit: r309669 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

George V. Neville-Neil gnn at FreeBSD.org
Wed Dec 7 07:27:48 UTC 2016


Author: gnn
Date: Wed Dec  7 07:27:47 2016
New Revision: 309669
URL: https://svnweb.freebsd.org/changeset/base/309669

Log:
  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

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Wed Dec  7 06:57:08 2016	(r309668)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Wed Dec  7 07:27:47 2016	(r309669)
@@ -4391,8 +4391,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
 			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, 
 			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 */
 


More information about the svn-src-head mailing list