svn commit: r315393 - stable/11/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Thu Mar 16 08:00:04 UTC 2017


Author: mjg
Date: Thu Mar 16 08:00:02 2017
New Revision: 315393
URL: https://svnweb.freebsd.org/changeset/base/315393

Log:
  MFC r313472:
  
  The runlock slow path would update wrong variable before restarting the
  loop, in effect corrupting the state.
  
  Something was botched in the previous mfc attempt in r315380.

Modified:
  stable/11/sys/kern/kern_rwlock.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_rwlock.c
==============================================================================
--- stable/11/sys/kern/kern_rwlock.c	Thu Mar 16 07:51:34 2017	(r315392)
+++ stable/11/sys/kern/kern_rwlock.c	Thu Mar 16 08:00:02 2017	(r315393)
@@ -749,7 +749,7 @@ __rw_runlock_hard(volatile uintptr_t *c,
 		if (!atomic_cmpset_rel_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v,
 		    x)) {
 			turnstile_chain_unlock(&rw->lock_object);
-			x = RW_READ_VALUE(rw);
+			v = RW_READ_VALUE(rw);
 			continue;
 		}
 		if (LOCK_LOG_TEST(&rw->lock_object, 0))


More information about the svn-src-all mailing list