Date: Wed, 4 Mar 2015 09:31:11 +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: r279585 - stable/10/sys/kern Message-ID: <201503040931.t249VBHl048742@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Mar 4 09:31:10 2015 New Revision: 279585 URL: https://svnweb.freebsd.org/changeset/base/279585 Log: MFC r279283: When failing to claim ownership of a umtx_pi, restore the umutex owner to its previous, unowned state. 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 Wed Mar 4 09:30:03 2015 (r279584) +++ stable/10/sys/kern/kern_umtx.c Wed Mar 4 09:31:10 2015 (r279585) @@ -2106,6 +2106,17 @@ do_lock_pi(struct thread *td, struct umu error = umtx_pi_claim(pi, td); umtxq_unbusy(&uq->uq_key); umtxq_unlock(&uq->uq_key); + if (error != 0) { + /* + * Since we're going to return an + * error, restore the m_owner to its + * previous, unowned state to avoid + * compounding the problem. + */ + (void)casuword32(&m->m_owner, + id | UMUTEX_CONTESTED, + UMUTEX_CONTESTED); + } break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503040931.t249VBHl048742>