From owner-svn-src-all@FreeBSD.ORG Mon Jun 28 17:45:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39CFC1065674; Mon, 28 Jun 2010 17:45:01 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 261EC8FC1B; Mon, 28 Jun 2010 17:45:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5SHj1xM072950; Mon, 28 Jun 2010 17:45:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5SHj1Ph072948; Mon, 28 Jun 2010 17:45:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201006281745.o5SHj1Ph072948@svn.freebsd.org> From: Attilio Rao Date: Mon, 28 Jun 2010 17:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209577 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2010 17:45:01 -0000 Author: attilio Date: Mon Jun 28 17:45:00 2010 New Revision: 209577 URL: http://svn.freebsd.org/changeset/base/209577 Log: Fix a lock leak in the deadlock resolver in case the ticks counter wrapped up. Sponsored by: Sandvine Incorporated Submitted by: pluknet Reported by: Anton Yuzhaninov Reviewed by: jhb MFC after: 3 days Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Mon Jun 28 17:06:19 2010 (r209576) +++ head/sys/kern/kern_clock.c Mon Jun 28 17:45:00 2010 (r209577) @@ -213,8 +213,10 @@ deadlkres(void) MPASS(td->td_blocked != NULL); /* Handle ticks wrap-up. */ - if (ticks < td->td_blktick) + if (ticks < td->td_blktick) { + thread_unlock(td); continue; + } tticks = ticks - td->td_blktick; thread_unlock(td); if (tticks > blkticks) { @@ -233,8 +235,10 @@ deadlkres(void) } else if (TD_IS_SLEEPING(td)) { /* Handle ticks wrap-up. */ - if (ticks < td->td_blktick) + if (ticks < td->td_blktick) { + thread_unlock(td); continue; + } /* * Check if the thread is sleeping on a