From owner-svn-src-head@freebsd.org Fri Jul 15 14:25:54 2016 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 9431CB99EE0; Fri, 15 Jul 2016 14:25:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (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 4CEF71306; Fri, 15 Jul 2016 14:25:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 31BF71FE024; Fri, 15 Jul 2016 16:25:51 +0200 (CEST) Subject: Re: svn commit: r302894 - head/sys/kern To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201607150928.u6F9SW3h065100@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <23f60f35-db99-ea20-837b-becd9c5c1887@selasky.org> Date: Fri, 15 Jul 2016 16:29:45 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201607150928.u6F9SW3h065100@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Fri, 15 Jul 2016 14:25:54 -0000 On 07/15/16 11:28, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Jul 15 09:28:32 2016 > New Revision: 302894 > URL: https://svnweb.freebsd.org/changeset/base/302894 > > Log: > Fix regression introduced by r302350. The change of return value for a > callout that wasn't scheduled at all was unintentional and yielded in > several panics. > > PR: 210884 > > Modified: > head/sys/kern/kern_timeout.c > > Modified: head/sys/kern/kern_timeout.c > ============================================================================== > --- head/sys/kern/kern_timeout.c Fri Jul 15 09:23:18 2016 (r302893) > +++ head/sys/kern/kern_timeout.c Fri Jul 15 09:28:32 2016 (r302894) > @@ -1381,7 +1381,7 @@ again: > CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p", > c, c->c_func, c->c_arg); > CC_UNLOCK(cc); > - return (cancelled); > + return (0); > } > > c->c_iflags &= ~CALLOUT_PENDING; > > Hi, I think r302894 and r302350 changes the return value of the following case, which is not described in the commit message? Is this also a regression? In this revision: > https://svnweb.freebsd.org/base/head/sys/kern/kern_timeout.c?view=markup&pathrev=296320 Assume we enter _callout_stop_safe() having the following assertions: (c->c_iflags & CALLOUT_PENDING) == 0 (satisfied) cc_exec_curr(cc, direct) != c (satisfied) Then we exit returning (-1). In this revision: > https://svnweb.freebsd.org/base/head/sys/kern/kern_timeout.c?view=markup&pathrev=296320#l1253 After your changes, entering the same function under the same conditions: cc_exec_curr(cc, direct) == c (not satisifed) (c->c_iflags & CALLOUT_PENDING) == 0 (satisfied) Then we exit returning (0). > https://svnweb.freebsd.org/base/head/sys/kern/kern_timeout.c?revision=302894&view=markup#l1384 If we call callout_stop() on a never scheduled callout, we now get a return value of 0 instead of -1, which by manual page definition is wrong ???? Am I wrong? Do others see this too? --HPS