From owner-cvs-src@FreeBSD.ORG Mon Aug 16 15:01:22 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CEDAD16A4CE; Mon, 16 Aug 2004 15:01:22 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5AFC43D1D; Mon, 16 Aug 2004 15:01:22 +0000 (GMT) (envelope-from kan@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i7GF1MYp099898; Mon, 16 Aug 2004 15:01:22 GMT (envelope-from kan@repoman.freebsd.org) Received: (from kan@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i7GF1M6l099897; Mon, 16 Aug 2004 15:01:22 GMT (envelope-from kan) Message-Id: <200408161501.i7GF1M6l099897@repoman.freebsd.org> From: Alexander Kabaev Date: Mon, 16 Aug 2004 15:01:22 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern kern_lock.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2004 15:01:23 -0000 kan 2004-08-16 15:01:22 UTC FreeBSD src repository Modified files: sys/kern kern_lock.c Log: Upgrading a lock does not play well together with acquiring an exclusive lock and can lead to two threads being granted exclusive access. Check that no one has the same lock in exclusive mode before proceeding to acquire it. The LK_WANT_EXCL and LK_WANT_UPGRADE bits act as mini-locks and can block other threads. Normally this is not a problem since the mini locks are upgraded to full locks and the release of the locks will unblock the other threads. However if a thread reset the bits without obtaining a full lock other threads are not awoken. Add missing wakeups for these cases. PR: kern/69964 Submitted by: Stephan Uphoff Very good catch by: Stephan Uphoff Revision Changes Path 1.74 +12 -5 src/sys/kern/kern_lock.c