From owner-svn-src-all@FreeBSD.ORG Sat Oct 25 11:37:43 2008 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 45211106566B; Sat, 25 Oct 2008 11:37:43 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32BC68FC14; Sat, 25 Oct 2008 11:37:43 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PBbhjh031412; Sat, 25 Oct 2008 11:37:43 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PBbhnI031411; Sat, 25 Oct 2008 11:37:43 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200810251137.m9PBbhnI031411@svn.freebsd.org> From: David Xu Date: Sat, 25 Oct 2008 11:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184259 - in stable/7/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: Sat, 25 Oct 2008 11:37:43 -0000 Author: davidxu Date: Sat Oct 25 11:37:42 2008 New Revision: 184259 URL: http://svn.freebsd.org/changeset/base/184259 Log: Merge revision 184067 from head to stable/7: In realtimer_delete(), clear timer's value and interval to tell realtimer_expire() to not rearm the timer, otherwise there is a chance that a callout will be left there and be tiggered in future unexpectly. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/kern_time.c Modified: stable/7/sys/kern/kern_time.c ============================================================================== --- stable/7/sys/kern/kern_time.c Sat Oct 25 10:55:49 2008 (r184258) +++ stable/7/sys/kern/kern_time.c Sat Oct 25 11:37:42 2008 (r184259) @@ -1225,6 +1225,12 @@ realtimer_delete(struct itimer *it) { mtx_assert(&it->it_mtx, MA_OWNED); + /* + * clear timer's value and interval to tell realtimer_expire + * to not rearm the timer. + */ + timespecclear(&it->it_time.it_value); + timespecclear(&it->it_time.it_interval); ITIMER_UNLOCK(it); callout_drain(&it->it_callout); ITIMER_LOCK(it); @@ -1374,9 +1380,11 @@ realtimer_expire(void *arg) callout_reset(&it->it_callout, tvtohz(&tv), realtimer_expire, it); } + itimer_enter(it); ITIMER_UNLOCK(it); itimer_fire(it); ITIMER_LOCK(it); + itimer_leave(it); } else if (timespecisset(&it->it_time.it_value)) { ts = it->it_time.it_value; timespecsub(&ts, &cts);