From owner-svn-src-head@FreeBSD.ORG Fri Jun 19 19:39:26 2015 Return-Path: Delivered-To: svn-src-head@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E3A6BB5; Fri, 19 Jun 2015 19:39:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [IPv6:2a00:1450:400c:c00::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9CC325F; Fri, 19 Jun 2015 19:39:25 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by wgez8 with SMTP id z8so97391465wge.0; Fri, 19 Jun 2015 12:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=J66M0prIWUazUa7EWTocuwSBwJe08gd+3kb2Lj9OU7c=; b=QPs0Moi97pOaRU1LOqATC0rhQJiswSPc6bCpWwUEjEBd17BEFVX4ZBubV2Gq0Iquvr LxLcwmnlpZKEwpHSpK05O9NMH/b/6n6BTTens0viTt4s8zHd67GuN1v2Gq8uxCEpRagZ 2oXvZu7u+GECtneg+1lPh8gQ+y/YXS4QeeB0V0tgAbvNL7o3c+MkYotXzS3VoISNMYyk oo8+w++/w1ofyDBIw/cbDuqunnZchvZ7uDj9rLDMwcBfL/YDNnpD0gqdJTtGbLo/ZFjS jOdbe5gbTq/xjcoH5hDUYiJrda9En9qMKAbqaGadCQxbHCi6tP9P3pOlandvJvjCf8zI LlJA== X-Received: by 10.181.13.5 with SMTP id eu5mr9171767wid.37.1434742764277; Fri, 19 Jun 2015 12:39:24 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id gj7sm5062816wib.4.2015.06.19.12.39.21 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 19 Jun 2015 12:39:22 -0700 (PDT) Date: Fri, 19 Jun 2015 21:39:19 +0200 From: Mateusz Guzik To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284602 - head/sys/kern Message-ID: <20150619193919.GA24989@dft-labs.eu> References: <201506191857.t5JIvbdP094203@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201506191857.t5JIvbdP094203@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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: Fri, 19 Jun 2015 19:39:26 -0000 On Fri, Jun 19, 2015 at 06:57:37PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Fri Jun 19 18:57:36 2015 > New Revision: 284602 > URL: https://svnweb.freebsd.org/changeset/base/284602 > > Log: > Feedback from commit r284535 > > davide: imgact_binmisc_clear_entry() needs to use atomic ops to remove > the enable bit. > > kib: M_NOWAIT is not warranted and comment is invalid. > > Modified: > head/sys/kern/imgact_binmisc.c > > Modified: head/sys/kern/imgact_binmisc.c > ============================================================================== > --- head/sys/kern/imgact_binmisc.c Fri Jun 19 17:34:59 2015 (r284601) > +++ head/sys/kern/imgact_binmisc.c Fri Jun 19 18:57:36 2015 (r284602) > @@ -317,7 +317,7 @@ imgact_binmisc_disable_entry(char *name) > return (ENOENT); > } > > - ibe->ibe_flags &= ~IBF_ENABLED; > + atomic_clear_32(&ibe->ibe_flags, IBF_ENABLED); > sx_sunlock(&interp_list_sx); > > return (0); > @@ -406,8 +406,7 @@ imgact_binmisc_get_all_entries(struct sy > > sx_slock(&interp_list_sx); > count = interp_list_entry_count; > - /* Don't block in malloc() while holding lock. */ > - xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_NOWAIT|M_ZERO); > + xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_ZERO); You can't just remove M_NOWAIT. You have to put M_WAITOK in its place. Once you do that, malloc cannot fail and null check below can be removed. > if (!xbe) { > sx_sunlock(&interp_list_sx); > return (ENOMEM); > -- Mateusz Guzik