Date: Thu, 1 Sep 2016 07:20:50 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r305184 - stable/10/sys/kern Message-ID: <201609010720.u817Ko8S041388@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Thu Sep 1 07:20:50 2016 New Revision: 305184 URL: https://svnweb.freebsd.org/changeset/base/305184 Log: MFC r304808: Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks. PR: 211947 Modified: stable/10/sys/kern/kern_umtx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_umtx.c ============================================================================== --- stable/10/sys/kern/kern_umtx.c Thu Sep 1 07:19:04 2016 (r305183) +++ stable/10/sys/kern/kern_umtx.c Thu Sep 1 07:20:50 2016 (r305184) @@ -2965,9 +2965,12 @@ sleep: suword32(&rwlock->rw_blocked_readers, blocked_readers-1); if (blocked_readers == 1) { rv = fueword32(&rwlock->rw_state, &state); - if (rv == -1) + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); error = EFAULT; - while (error == 0) { + break; + } + for (;;) { rv = casueword32(&rwlock->rw_state, state, &oldstate, state & ~URWLOCK_READ_WAITERS); if (rv == -1) { @@ -2978,6 +2981,8 @@ sleep: break; state = oldstate; error = umtxq_check_susp(td); + if (error != 0) + break; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609010720.u817Ko8S041388>