From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 19:54:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C26CD868; Fri, 5 Sep 2014 19:54:16 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E15F41585; Fri, 5 Sep 2014 19:54:15 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id n3so6260wiv.17 for ; Fri, 05 Sep 2014 12:54:14 -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:content-transfer-encoding :in-reply-to:user-agent; bh=hDFR6r9y0rFBk3W1/TNVeiLEgXbpDeej96bmlhRt/sk=; b=LquAuxI1YISnqigX5sM0Bc9+GfVvLjxxYtwsaK9jrkne7MAo584o9X6Qhdjqmf4BHT Jf7fr4z7h/0yUnJfLza/hDMKp/pKDuq4v4c8ttd5w74F6E126ohxWsUZ0wQp5++txtb1 RSJk+S4UAUOr0VSPswa8PorfSjR0a2otNJg9SJHLgjmgv51qUeNs0JxgMPjOc3v9X0EP M3bwxlrYtMnUPdAgCblW+v/nrQjDtRSFSDVcTPx9JPrBp3+F4vGjCdJAjTzAyQ9mbZLx Zg02Qxy0Nm3mC+7tiSToQkOKviKC2iJW7vUu8z94kux6CXHay7iMxRUedEAUA03HzfZi BV3w== X-Received: by 10.194.191.132 with SMTP id gy4mr6992450wjc.35.1409946854211; Fri, 05 Sep 2014 12:54:14 -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 g8sm2844675wiy.19.2014.09.05.12.54.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 05 Sep 2014 12:54:13 -0700 (PDT) Date: Fri, 5 Sep 2014 21:54:11 +0200 From: Mateusz Guzik To: Gleb Smirnoff Subject: Re: svn commit: r271182 - head/sys/kern Message-ID: <20140905195410.GA722@dft-labs.eu> References: <201409051950.s85JoI3r000416@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201409051950.s85JoI3r000416@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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, 05 Sep 2014 19:54:16 -0000 On Fri, Sep 05, 2014 at 07:50:18PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Sep 5 19:50:18 2014 > New Revision: 271182 > URL: http://svnweb.freebsd.org/changeset/base/271182 > > Log: > Set vnet context before accessing V_socket_hhh[]. > > Submitted by: "Hiroo Ono (小野寛生)" > > Modified: > head/sys/kern/uipc_socket.c > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Fri Sep 5 19:00:30 2014 (r271181) > +++ head/sys/kern/uipc_socket.c Fri Sep 5 19:50:18 2014 (r271182) > @@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint) > return 1; > } > > + CURVNET_SET(so->so_vnet); > if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) > /* This hook returning non-zero indicates an event, not error */ > return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); > + CURVNET_RESTORE(); > should not this be something like: error = hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD); CURVNET_RESTORE(); return (error); ? > return (0); > } > @@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint > SOCKBUF_LOCK_ASSERT(&so->so_snd); > kn->kn_data = sbspace(&so->so_snd); > > + CURVNET_SET(so->so_vnet); > if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0) > hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE); > + CURVNET_RESTORE(); > > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > kn->kn_flags |= EV_EOF; > -- Mateusz Guzik