From owner-svn-src-head@freebsd.org Thu Aug 27 08:15:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DB639C2BC2; Thu, 27 Aug 2015 08:15:33 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C9861105; Thu, 27 Aug 2015 08:15:33 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7R8FXHw029897; Thu, 27 Aug 2015 08:15:33 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7R8FXek029896; Thu, 27 Aug 2015 08:15:33 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201508270815.t7R8FXek029896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Thu, 27 Aug 2015 08:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287196 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2015 08:15:33 -0000 Author: jch Date: Thu Aug 27 08:15:32 2015 New Revision: 287196 URL: https://svnweb.freebsd.org/changeset/base/287196 Log: In callout_stop(), if a callout is both pending and currently being serviced return 0 (fail) but it is applicable only mpsafe callouts. Thanks to hselasky for finding this. Differential Revision: https://reviews.freebsd.org/D3078 (Updated) Submitted by: hselasky Reviewed by: jch Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Thu Aug 27 07:53:58 2015 (r287195) +++ head/sys/kern/kern_timeout.c Thu Aug 27 08:15:32 2015 (r287196) @@ -1379,11 +1379,13 @@ again: } callout_cc_del(c, cc); - /* - * If we are asked to stop a callout which is currently in progress - * and indeed impossible to stop then return 0. - */ - not_running = !(cc_exec_curr(cc, direct) == c); + if (!use_lock) { + /* + * If we are asked to stop a callout which is currently in progress + * and indeed impossible to stop then return 0. + */ + not_running = !(cc_exec_curr(cc, direct) == c); + } CC_UNLOCK(cc); return (not_running);