From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 03:00:08 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A6076DE; Sun, 18 Nov 2012 03:00:08 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mouf.net (mouf.net [IPv6:2607:fc50:0:4400:216:3eff:fe69:33b3]) by mx1.freebsd.org (Postfix) with ESMTP id 137488FC0C; Sun, 18 Nov 2012 03:00:07 +0000 (UTC) Received: from meatwad.mouf.net (cpe-024-162-230-236.nc.res.rr.com [24.162.230.236]) (authenticated bits=0) by mouf.net (8.14.5/8.14.5) with ESMTP id qAI2xtYu050084 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NOT); Sat, 17 Nov 2012 22:00:01 -0500 (EST) (envelope-from swills@FreeBSD.org) Message-ID: <50A84F2A.3090407@FreeBSD.org> Date: Sat, 17 Nov 2012 21:59:54 -0500 From: Steve Wills User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121110 Thunderbird/16.0.2 MIME-Version: 1.0 To: "Greg 'groggy' Lehey" Subject: Re: svn commit: r242743 - head/usr.bin/locale References: <201211080255.qA82tUQc088806@svn.freebsd.org> <50A7B84B.5080909@FreeBSD.org> <20121117235144.GW85693@eureka.lemis.com> In-Reply-To: <20121117235144.GW85693@eureka.lemis.com> X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mouf.net [199.48.129.64]); Sat, 17 Nov 2012 22:00:02 -0500 (EST) X-Spam-Status: No, score=0.0 required=4.5 tests=none autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mouf.net X-Virus-Scanned: clamav-milter 0.97.5 at mouf.net X-Virus-Status: Clean Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 03:00:08 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/17/12 18:51, Greg 'groggy' Lehey wrote: > > Sorry, my bad. Revision 243201 should fix it. > Thanks! Steve -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBAgAGBQJQqE8qAAoJEPXPYrMgexuh6Z8H/AjAjh+hJn15576w6hgPJWud WiNYcGsmECgr0kw/Ek7/kolC2f8hrlCgyuUloPWIbQFGFpIM3NCT3WzKReBZBDvW IRR6FT+y7Fyf3ufyJ9Psd4y17x16/20pKYdC6Vtg8nT+xuHaHx3yo09ETZeGt0Vf e/5KPGJDpg0uZVNcBu4Ffk6E1Q66ggFFB1S6l1ZeoRN/PNUgRMpWdzWWqiRi39c+ k5S66qCOiUkgCGZJ9YKzIl9X30Ca27YEE0/QY1Xo/c9aNWjqsPNuUTL0zt/NtUWj O6k+vfjNd8XLpCY2JQTGxpcHc2q7VmV8kVTuHTT48fMwCy+erRIqHTXeTEkx8J4= =wPdx -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 04:51:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D41D3625; Sun, 18 Nov 2012 04:51:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B27778FC08; Sun, 18 Nov 2012 04:51:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAI4pkko054272; Sun, 18 Nov 2012 04:51:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAI4pkMc054271; Sun, 18 Nov 2012 04:51:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211180451.qAI4pkMc054271@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 Nov 2012 04:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243208 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 04:51:47 -0000 Author: adrian Date: Sun Nov 18 04:51:46 2012 New Revision: 243208 URL: http://svnweb.freebsd.org/changeset/base/243208 Log: Fix up a compile time warning if INET6 isn't defined. Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Nov 18 04:12:31 2012 (r243207) +++ head/sys/net/rtsock.c Sun Nov 18 04:51:46 2012 (r243208) @@ -1573,8 +1573,8 @@ sysctl_dumpentry(struct radix_node *rn, #ifdef INET6 struct sockaddr_storage ss[RTAX_MAX]; struct sockaddr_in6 *sin6; -#endif int i; +#endif if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg)) return 0; From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 06:21:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4DA34DF4; Sun, 18 Nov 2012 06:21:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3204D8FC14; Sun, 18 Nov 2012 06:21:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAI6LkQB068558; Sun, 18 Nov 2012 06:21:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAI6LkxT068557; Sun, 18 Nov 2012 06:21:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211180621.qAI6LkxT068557@svn.freebsd.org> From: Eitan Adler Date: Sun, 18 Nov 2012 06:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243210 - stable/9/usr.sbin/ndiscvt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 06:21:46 -0000 Author: eadler Date: Sun Nov 18 06:21:45 2012 New Revision: 243210 URL: http://svnweb.freebsd.org/changeset/base/243210 Log: MFC r243074: Add a missing check for fread Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/ndiscvt/ndiscvt.c Directory Properties: stable/9/usr.sbin/ndiscvt/ (props changed) Modified: stable/9/usr.sbin/ndiscvt/ndiscvt.c ============================================================================== --- stable/9/usr.sbin/ndiscvt/ndiscvt.c Sun Nov 18 05:19:08 2012 (r243209) +++ stable/9/usr.sbin/ndiscvt/ndiscvt.c Sun Nov 18 06:21:45 2012 (r243210) @@ -325,6 +325,8 @@ main(int argc, char *argv[]) rewind (fp); img = calloc(fsize, 1); n = fread (img, fsize, 1, fp); + if (n == 0) + err(1, "reading .SYS file '%s' failed", sysfile); fclose(fp); From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 06:25:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44278F73; Sun, 18 Nov 2012 06:25:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 284FB8FC12; Sun, 18 Nov 2012 06:25:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAI6Pc4S069155; Sun, 18 Nov 2012 06:25:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAI6PcYX069154; Sun, 18 Nov 2012 06:25:38 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211180625.qAI6PcYX069154@svn.freebsd.org> From: Eitan Adler Date: Sun, 18 Nov 2012 06:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243211 - stable/9/usr.bin/bc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 06:25:38 -0000 Author: eadler Date: Sun Nov 18 06:25:37 2012 New Revision: 243211 URL: http://svnweb.freebsd.org/changeset/base/243211 Log: MFC r243075: Make definition match declaration Approved by: cperciva (implicit) Modified: stable/9/usr.bin/bc/bc.y Directory Properties: stable/9/usr.bin/bc/ (props changed) Modified: stable/9/usr.bin/bc/bc.y ============================================================================== --- stable/9/usr.bin/bc/bc.y Sun Nov 18 06:21:45 2012 (r243210) +++ stable/9/usr.bin/bc/bc.y Sun Nov 18 06:25:37 2012 (r243211) @@ -1085,7 +1085,7 @@ escape(const char *str) } /* ARGSUSED */ -void +static void sigchld(int signo) { pid_t pid; From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 07:08:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8EAD3D7; Sun, 18 Nov 2012 07:08:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 467E08FC08; Sun, 18 Nov 2012 07:08:56 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qAI78la8033279; Sun, 18 Nov 2012 09:08:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qAI78la8033279 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qAI78l2T033278; Sun, 18 Nov 2012 09:08:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 18 Nov 2012 09:08:47 +0200 From: Konstantin Belousov To: Eitan Adler Subject: Re: svn commit: r243210 - stable/9/usr.sbin/ndiscvt Message-ID: <20121118070847.GF73505@kib.kiev.ua> References: <201211180621.qAI6LkxT068557@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="c2/+NrNR1GxQl8IM" Content-Disposition: inline In-Reply-To: <201211180621.qAI6LkxT068557@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 07:08:56 -0000 --c2/+NrNR1GxQl8IM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 18, 2012 at 06:21:46AM +0000, Eitan Adler wrote: > Author: eadler > Date: Sun Nov 18 06:21:45 2012 > New Revision: 243210 > URL: http://svnweb.freebsd.org/changeset/base/243210 >=20 > Log: > MFC r243074: > Add a missing check for fread > =20 > Approved by: cperciva (implicit) >=20 > Modified: > stable/9/usr.sbin/ndiscvt/ndiscvt.c > Directory Properties: > stable/9/usr.sbin/ndiscvt/ (props changed) >=20 > Modified: stable/9/usr.sbin/ndiscvt/ndiscvt.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/9/usr.sbin/ndiscvt/ndiscvt.c Sun Nov 18 05:19:08 2012 (r243209) > +++ stable/9/usr.sbin/ndiscvt/ndiscvt.c Sun Nov 18 06:21:45 2012 (r243210) > @@ -325,6 +325,8 @@ main(int argc, char *argv[]) > rewind (fp); > img =3D calloc(fsize, 1); > n =3D fread (img, fsize, 1, fp); > + if (n =3D=3D 0) > + err(1, "reading .SYS file '%s' failed", sysfile); > =20 AFAIR fread(3) can return 0 both for error and EOF. In the later case, errno is meaningless. Is the short read case fatal ? --c2/+NrNR1GxQl8IM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQqIl/AAoJEJDCuSvBvK1BNisP/iLBDmFpziiVTU8dGl+cSQ5J VV7XKVr5Njf157JMbE8oFoylc1xGosj3pEJDi4KAnjsRwT244AaMqexeN5WyJ1Gx tL2xr+cM/oz8VGUnhdgVf+fZOg04o4l2nxMNDCI5y5GMrHMuO4nvJ9kZ81rO2JX8 ZH11HdHcbT/IVVHfEl90e+XRpqF0O8i1mf2HB9TOHQJolRLJqF/XUE+PAvqS5rQb E+xGTeOgw3dbUgkY8Jteg0T6iDSLaxmHBfkVkOCKQWfVjfIAWJ35tg5SYMIVzy7q Wjwo9PmNm8N8RKP9VTf3GupbHXU2C1fjWtcNNjLuj5aLm++EQpMp66mS3/eZCGkU ZfwVjVCd37Oq0jHmYrtFm0MVg3ZuiU7xaqtCJnDn8d8vmoh5mqhxzCjslcitiQ4V 7hizRE8gXF8npj4RiYo7DeeKV03Vh0XTIZq5UHzv6P0ldHLQq6X6yZT+GWDk202s iqu5eK6Drsd8YcKyBAfvsxj1hs6KWEbhbkuIL7jLhRGDwuER1iEKR1bL1M26ssmy 0aWrWa7TzSTXYgP221hQjQfQEK7MTJSCjGSnlzHj00rjfh+mXvXDN4u2IWwnYup+ UaFTafyLG3njNrKK2GyTWTiG/27yVs9aq3nIbqPEj+qooT18s1boinT/ED8Sz8bD EWvREYpCvfmtIuhZ/z1S =gwVz -----END PGP SIGNATURE----- --c2/+NrNR1GxQl8IM-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 11:22:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBFE947D; Sun, 18 Nov 2012 11:22:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEAA58FC15; Sun, 18 Nov 2012 11:22:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIBMFSJ012973; Sun, 18 Nov 2012 11:22:15 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIBMFhl012972; Sun, 18 Nov 2012 11:22:15 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211181122.qAIBMFhl012972@svn.freebsd.org> From: Hiroki Sato Date: Sun, 18 Nov 2012 11:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243212 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 11:22:16 -0000 Author: hrs Date: Sun Nov 18 11:22:15 2012 New Revision: 243212 URL: http://svnweb.freebsd.org/changeset/base/243212 Log: Fix condition to check if the maximum number of FIBs is greater than 0 or not. Spotted by: zont Modified: head/etc/rc.d/routing Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Sun Nov 18 06:25:37 2012 (r243211) +++ head/etc/rc.d/routing Sun Nov 18 11:22:15 2012 (r243212) @@ -144,7 +144,7 @@ static_inet6() # get the number of FIBs supported. fibs=$((`${SYSCTL_N} net.fibs` - 1)) - if [ -n "$fibs" ]; then + if [ "$fibs" -gt 0 ]; then fibmod="-fib 0-$fibs" else fibmod= From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 11:47:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77F48967; Sun, 18 Nov 2012 11:47:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D51B8FC08; Sun, 18 Nov 2012 11:47:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIBlQGD016440; Sun, 18 Nov 2012 11:47:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIBlQut016439; Sun, 18 Nov 2012 11:47:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181147.qAIBlQut016439@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 11:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243213 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 11:47:26 -0000 Author: avg Date: Sun Nov 18 11:47:25 2012 New Revision: 243213 URL: http://svnweb.freebsd.org/changeset/base/243213 Log: spa_import_rootpool: fall back to use configuration from zpool.cache... if we fail to generate a proper root pool configuration based on disk probing. Currently we can not properly generate the configuration for multi-vdev pools. Make that explicit. Reported by: madpilot, Bartosz Stec Tested by: madpilot, Bartosz Stec MFC after: 4 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 18 11:22:15 2012 (r243212) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Nov 18 11:47:25 2012 (r243213) @@ -3763,12 +3763,23 @@ spa_generate_rootconf(const char *name) { nvlist_t *config; nvlist_t *nvtop, *nvroot; + uint64_t nchildren; uint64_t pgid; if (vdev_geom_read_pool_label(name, &config) != 0) return (NULL); /* + * Multi-vdev root pool configuration discovery is not supported yet. + */ + nchildren = 0; + nvlist_lookup_uint64(config, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); + if (nchildren != 1) { + nvlist_free(config); + return (NULL); + } + + /* * Add this top-level vdev to the child array. */ VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, @@ -3810,25 +3821,30 @@ spa_import_rootpool(const char *name) * Read the label from the boot device and generate a configuration. */ config = spa_generate_rootconf(name); - if (config == NULL) { + + mutex_enter(&spa_namespace_lock); + if (config != NULL) { + VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, + &pname) == 0 && strcmp(name, pname) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) + == 0); + + if ((spa = spa_lookup(pname)) != NULL) { + /* + * Remove the existing root pool from the namespace so + * that we can replace it with the correct config + * we just read in. + */ + spa_remove(spa); + } + spa = spa_add(pname, config, NULL); + } else if ((spa = spa_lookup(name)) == NULL) { cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); return (EIO); + } else { + VERIFY(nvlist_dup(spa->spa_config, &config, KM_SLEEP) == 0); } - - VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, - &pname) == 0 && strcmp(name, pname) == 0); - VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) == 0); - - mutex_enter(&spa_namespace_lock); - if ((spa = spa_lookup(pname)) != NULL) { - /* - * Remove the existing root pool from the namespace so that we - * can replace it with the correct config we just read in. - */ - spa_remove(spa); - } - spa = spa_add(pname, config, NULL); spa->spa_is_root = B_TRUE; spa->spa_import_flags = ZFS_IMPORT_VERBATIM; @@ -3849,15 +3865,15 @@ spa_import_rootpool(const char *name) return (error); } - error = 0; spa_history_log_version(spa, LOG_POOL_IMPORT); -out: + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_free(rvd); spa_config_exit(spa, SCL_ALL, FTAG); mutex_exit(&spa_namespace_lock); - return (error); + nvlist_free(config); + return (0); } #endif /* sun */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 11:54:18 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47AF2D2E; Sun, 18 Nov 2012 11:54:18 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id CB5798FC12; Sun, 18 Nov 2012 11:54:17 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.5/8.14.5) with ESMTP id qAIBsGvn078562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 18 Nov 2012 12:54:16 +0100 (CET) (envelope-from uqs@FreeBSD.org) Date: Sun, 18 Nov 2012 12:54:15 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Jilles Tjoelker Subject: Re: svn commit: r242767 - in head/tools/regression/bin/sh: builtins parser Message-ID: <20121118115413.GB28199@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Jilles Tjoelker , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201211081336.qA8DaJ1D081507@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201211081336.qA8DaJ1D081507@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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 11:54:18 -0000 On Thu, 2012-11-08 at 13:36:19 +0000, Jilles Tjoelker wrote: > Author: jilles > Date: Thu Nov 8 13:36:19 2012 > New Revision: 242767 > URL: http://svnweb.freebsd.org/changeset/base/242767 > > Log: > sh: Add tests for modifying an alias (r242766). > > Note: parser/alias10.0 will eat a lot of memory/cpu time when it fails (with > the old sh). Can't you run it with reduced ulimits to have it fail fast? Cheers, Uli From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 12:16:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D203665; Sun, 18 Nov 2012 12:16:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C8438FC12; Sun, 18 Nov 2012 12:16:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICGpoH021406; Sun, 18 Nov 2012 12:16:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICGpmO021405; Sun, 18 Nov 2012 12:16:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181216.qAICGpmO021405@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243214 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 12:16:51 -0000 Author: avg Date: Sun Nov 18 12:16:50 2012 New Revision: 243214 URL: http://svnweb.freebsd.org/changeset/base/243214 Log: MFC r242566: zfs_freebsd_close: call zfs_close with count=1 instead of count=0 Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 18 11:47:25 2012 (r243213) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 18 12:16:50 2012 (r243214) @@ -5660,7 +5660,7 @@ zfs_freebsd_close(ap) } */ *ap; { - return (zfs_close(ap->a_vp, ap->a_fflag, 0, 0, ap->a_cred, NULL)); + return (zfs_close(ap->a_vp, ap->a_fflag, 1, 0, ap->a_cred, NULL)); } static int From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 12:17:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC9AF8BC; Sun, 18 Nov 2012 12:17:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 909AC8FC08; Sun, 18 Nov 2012 12:17:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICHDsm021547; Sun, 18 Nov 2012 12:17:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICHDUH021545; Sun, 18 Nov 2012 12:17:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181217.qAICHDUH021545@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243216 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 12:17:14 -0000 Author: avg Date: Sun Nov 18 12:17:13 2012 New Revision: 243216 URL: http://svnweb.freebsd.org/changeset/base/243216 Log: MFC r242566: zfs_freebsd_close: call zfs_close with count=1 instead of count=0 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 18 12:17:07 2012 (r243215) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 18 12:17:13 2012 (r243216) @@ -5660,7 +5660,7 @@ zfs_freebsd_close(ap) } */ *ap; { - return (zfs_close(ap->a_vp, ap->a_fflag, 0, 0, ap->a_cred, NULL)); + return (zfs_close(ap->a_vp, ap->a_fflag, 1, 0, ap->a_cred, NULL)); } static int From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 12:20:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04E08C20; Sun, 18 Nov 2012 12:20:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DCB818FC08; Sun, 18 Nov 2012 12:20:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICKBJm022077; Sun, 18 Nov 2012 12:20:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICKBhE022076; Sun, 18 Nov 2012 12:20:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181220.qAICKBhE022076@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243217 - stable/9/sys/boot/i386/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 12:20:12 -0000 Author: avg Date: Sun Nov 18 12:20:11 2012 New Revision: 243217 URL: http://svnweb.freebsd.org/changeset/base/243217 Log: MFC r243025: boot: use packed attribute for edd_params* structures Modified: stable/9/sys/boot/i386/common/edd.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/common/edd.h ============================================================================== --- stable/9/sys/boot/i386/common/edd.h Sun Nov 18 12:17:13 2012 (r243216) +++ stable/9/sys/boot/i386/common/edd.h Sun Nov 18 12:20:11 2012 (r243217) @@ -62,7 +62,7 @@ struct edd_params { uint16_t sector_size; uint16_t edd_params_seg; uint16_t edd_params_off; -}; +} __packed; struct edd_device_path_v3 { uint16_t key; @@ -74,12 +74,12 @@ struct edd_device_path_v3 { uint64_t device_path; uint8_t reserved2[1]; uint8_t checksum; -}; +} __packed; struct edd_params_v3 { struct edd_params params; struct edd_device_path_v3 device_path; -}; +} __packed; struct edd_device_path_v4 { uint16_t key; @@ -91,12 +91,12 @@ struct edd_device_path_v4 { uint64_t device_path[2]; uint8_t reserved2[1]; uint8_t checksum; -}; +} __packed; struct edd_params_v4 { struct edd_params params; struct edd_device_path_v4 device_path; -}; +} __packed; #define EDD_FLAGS_DMA_BOUNDARY_HANDLING 0x0001 #define EDD_FLAGS_REMOVABLE_MEDIA 0x0002 From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 12:20:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6CBCDEB; Sun, 18 Nov 2012 12:20:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC2CE8FC14; Sun, 18 Nov 2012 12:20:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICKN6d022202; Sun, 18 Nov 2012 12:20:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICKNTI022201; Sun, 18 Nov 2012 12:20:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181220.qAICKNTI022201@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243218 - stable/8/sys/boot/i386/common X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 12:20:23 -0000 Author: avg Date: Sun Nov 18 12:20:23 2012 New Revision: 243218 URL: http://svnweb.freebsd.org/changeset/base/243218 Log: MFC r243025: boot: use packed attribute for edd_params* structures Modified: stable/8/sys/boot/i386/common/edd.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/i386/common/edd.h ============================================================================== --- stable/8/sys/boot/i386/common/edd.h Sun Nov 18 12:20:11 2012 (r243217) +++ stable/8/sys/boot/i386/common/edd.h Sun Nov 18 12:20:23 2012 (r243218) @@ -62,7 +62,7 @@ struct edd_params { uint16_t sector_size; uint16_t edd_params_seg; uint16_t edd_params_off; -}; +} __packed; struct edd_device_path_v3 { uint16_t key; @@ -74,12 +74,12 @@ struct edd_device_path_v3 { uint64_t device_path; uint8_t reserved2[1]; uint8_t checksum; -}; +} __packed; struct edd_params_v3 { struct edd_params params; struct edd_device_path_v3 device_path; -}; +} __packed; struct edd_device_path_v4 { uint16_t key; @@ -91,12 +91,12 @@ struct edd_device_path_v4 { uint64_t device_path[2]; uint8_t reserved2[1]; uint8_t checksum; -}; +} __packed; struct edd_params_v4 { struct edd_params params; struct edd_device_path_v4 device_path; -}; +} __packed; #define EDD_FLAGS_DMA_BOUNDARY_HANDLING 0x0001 #define EDD_FLAGS_REMOVABLE_MEDIA 0x0002 From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 12:28:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7D46181; Sun, 18 Nov 2012 12:28:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9C3098FC08; Sun, 18 Nov 2012 12:28:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICSTF0023518; Sun, 18 Nov 2012 12:28:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICSTHS023514; Sun, 18 Nov 2012 12:28:29 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181228.qAICSTHS023514@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243219 - in stable/9/sys/boot: ficl i386 userboot/ficl zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 12:28:29 -0000 Author: avg Date: Sun Nov 18 12:28:29 2012 New Revision: 243219 URL: http://svnweb.freebsd.org/changeset/base/243219 Log: MFC r241785: boot: use -march=i386 for both i386 and amd64 builds Modified: stable/9/sys/boot/ficl/Makefile stable/9/sys/boot/i386/Makefile.inc stable/9/sys/boot/userboot/ficl/Makefile stable/9/sys/boot/zfs/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/ficl/Makefile ============================================================================== --- stable/9/sys/boot/ficl/Makefile Sun Nov 18 12:20:23 2012 (r243218) +++ stable/9/sys/boot/ficl/Makefile Sun Nov 18 12:28:29 2012 (r243219) @@ -8,6 +8,7 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif @@ -39,7 +40,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker #SOFTWORDS+= oo.fr classes.fr .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 -I. +CFLAGS+= -m32 -I. .endif .if ${MACHINE_ARCH} == "powerpc64" Modified: stable/9/sys/boot/i386/Makefile.inc ============================================================================== --- stable/9/sys/boot/i386/Makefile.inc Sun Nov 18 12:20:23 2012 (r243218) +++ stable/9/sys/boot/i386/Makefile.inc Sun Nov 18 12:28:29 2012 (r243219) @@ -5,12 +5,12 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float LDFLAGS+= -nostdlib .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 ACFLAGS+= -m32 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 Modified: stable/9/sys/boot/userboot/ficl/Makefile ============================================================================== --- stable/9/sys/boot/userboot/ficl/Makefile Sun Nov 18 12:20:23 2012 (r243218) +++ stable/9/sys/boot/userboot/ficl/Makefile Sun Nov 18 12:28:29 2012 (r243219) @@ -12,6 +12,7 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding -fPIC .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +#CFLAGS+= -march=i386 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif .if ${MACHINE_CPUARCH} == "i386" @@ -46,7 +47,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker #SOFTWORDS+= oo.fr classes.fr #.if ${MACHINE_CPUARCH} == "amd64" -#CFLAGS+= -m32 -march=i386 -I. +#CFLAGS+= -m32 -I. #.endif .if ${MACHINE_ARCH} == "powerpc64" Modified: stable/9/sys/boot/zfs/Makefile ============================================================================== --- stable/9/sys/boot/zfs/Makefile Sun Nov 18 12:20:23 2012 (r243218) +++ stable/9/sys/boot/zfs/Makefile Sun Nov 18 12:28:29 2012 (r243219) @@ -12,6 +12,7 @@ CFLAGS+= -I${.CURDIR}/../../cddl/boot/zf CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif @@ -19,7 +20,7 @@ CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -m CFLAGS+= -msoft-float .endif .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 .endif CFLAGS+= -Wformat -Wall From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 12:30:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92FF32EC; Sun, 18 Nov 2012 12:30:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DF068FC0C; Sun, 18 Nov 2012 12:30:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICU5Y6023808; Sun, 18 Nov 2012 12:30:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICU55p023804; Sun, 18 Nov 2012 12:30:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181230.qAICU55p023804@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243220 - in stable/8/sys/boot: ficl i386 zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 12:30:05 -0000 Author: avg Date: Sun Nov 18 12:30:04 2012 New Revision: 243220 URL: http://svnweb.freebsd.org/changeset/base/243220 Log: MFC r241785: boot: use -march=i386 for both i386 and amd64 builds Modified: stable/8/sys/boot/ficl/Makefile stable/8/sys/boot/i386/Makefile.inc stable/8/sys/boot/zfs/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/ficl/Makefile ============================================================================== --- stable/8/sys/boot/ficl/Makefile Sun Nov 18 12:28:29 2012 (r243219) +++ stable/8/sys/boot/ficl/Makefile Sun Nov 18 12:30:04 2012 (r243220) @@ -8,6 +8,7 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif @@ -42,7 +43,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker #SOFTWORDS+= oo.fr classes.fr .if ${MACHINE_ARCH} == "amd64" -CFLAGS+= -m32 -march=i386 -I. +CFLAGS+= -m32 -I. .endif CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/} \ Modified: stable/8/sys/boot/i386/Makefile.inc ============================================================================== --- stable/8/sys/boot/i386/Makefile.inc Sun Nov 18 12:28:29 2012 (r243219) +++ stable/8/sys/boot/i386/Makefile.inc Sun Nov 18 12:30:04 2012 (r243220) @@ -5,12 +5,12 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 LDFLAGS+= -nostdlib .if ${MACHINE_ARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 .endif Modified: stable/8/sys/boot/zfs/Makefile ============================================================================== --- stable/8/sys/boot/zfs/Makefile Sun Nov 18 12:28:29 2012 (r243219) +++ stable/8/sys/boot/zfs/Makefile Sun Nov 18 12:30:04 2012 (r243220) @@ -12,6 +12,7 @@ CFLAGS+= -I${.CURDIR}/../../cddl/boot/zf CFLAGS+= -ffreestanding .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif @@ -22,7 +23,7 @@ CFLAGS+= -mno-sse3 CFLAGS+= -msoft-float .endif .if ${MACHINE_ARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 .endif CFLAGS+= -Wformat -Wall From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 12:57:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22581C44; Sun, 18 Nov 2012 12:57:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 073788FC0C; Sun, 18 Nov 2012 12:57:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICvWBL028307; Sun, 18 Nov 2012 12:57:32 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICvWUx028305; Sun, 18 Nov 2012 12:57:32 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211181257.qAICvWUx028305@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Nov 2012 12:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r243224 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 12:57:33 -0000 Author: pjd Date: Sun Nov 18 12:57:32 2012 New Revision: 243224 URL: http://svnweb.freebsd.org/changeset/base/243224 Log: Welcome Steven Hartland (smh) as a new src committer. I'll be Steven's mentor with avg@ as co-mentor. Steven is (and hopefully will be:)) working on storage-related projects (including ZFS). Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sun Nov 18 12:45:53 2012 (r243223) +++ svnadmin/conf/access Sun Nov 18 12:57:32 2012 (r243224) @@ -231,6 +231,7 @@ silby simokawa simon sjg +smh sobomax sos commit@deepcore.dk sson Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun Nov 18 12:45:53 2012 (r243223) +++ svnadmin/conf/mentors Sun Nov 18 12:57:32 2012 (r243224) @@ -32,6 +32,7 @@ nork imp peterj jhb Co-mentor: grog ray adrian sjg marcel +smh pjd Co-mentor: avg snb dwmalone versus gavin Co-mentor: fjoe will ken From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 14:05:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 53164128; Sun, 18 Nov 2012 14:05:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 38BC58FC14; Sun, 18 Nov 2012 14:05:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIE5TAG039142; Sun, 18 Nov 2012 14:05:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIE5TXW039141; Sun, 18 Nov 2012 14:05:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211181405.qAIE5TXW039141@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 Nov 2012 14:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243227 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 14:05:29 -0000 Author: adrian Date: Sun Nov 18 14:05:28 2012 New Revision: 243227 URL: http://svnweb.freebsd.org/changeset/base/243227 Log: Correctly use spaces here. Pointed out by: pjd Modified: head/sys/arm/conf/CAMBRIA Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Sun Nov 18 14:00:03 2012 (r243226) +++ head/sys/arm/conf/CAMBRIA Sun Nov 18 14:05:28 2012 (r243227) @@ -126,8 +126,8 @@ device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI -options ATH_ENABLE_DFS -options ATH_ENABLE_11N +options ATH_ENABLE_DFS +options ATH_ENABLE_11N #options ATH_TX99_DIAG device ath_rate_sample # SampleRate tx rate control for ath From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 14:05:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A889F131 for ; Sun, 18 Nov 2012 14:05:34 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 070288FC19 for ; Sun, 18 Nov 2012 14:05:33 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so3871425lah.13 for ; Sun, 18 Nov 2012 06:05:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=8m/5JBYF0TM+VlylNfNys6NkdKDS647qgLfr7oZTOBs=; b=nKWC2WuOWQsmAMbV+uCX6KdRcPMXj8eJoVMiCDWM1czmYOBzHcHjklzR/d/BMShZwG ADJOuWlBxqPflEsIojxrZ3v1Ta4p02jvgsWll/W9fLKcTMI5F1O+jbLu34odHdc+rLaS JOFSn2OcoLQTGGnvt3x4cgZKfwWjVCo8pGTg+/gSGkSXMZxIUbgL2FfpIVA2zJkjdceH e/mrnVzsIqSCKUKzHOw1bBQraYtpO31Dqums5pH31w2Ic6TTj4RrQgIMZ77jnX1WLStf /9Iq0buwD9o9rxaGxQXkj+XDGC4k5FiLOnrpcDkanqXn8vmBWIB8vIc3DXPwjuNsHIoU PHBQ== Received: by 10.112.25.168 with SMTP id d8mr4001990lbg.61.1353247532575; Sun, 18 Nov 2012 06:05:32 -0800 (PST) Received: from zont-osx.local (ppp95-165-129-155.pppoe.spdop.ru. [95.165.129.155]) by mx.google.com with ESMTPS id g5sm2543164lbk.7.2012.11.18.06.05.30 (version=SSLv3 cipher=OTHER); Sun, 18 Nov 2012 06:05:31 -0800 (PST) Sender: Andrey Zonov Message-ID: <50A8EB3E.6060807@FreeBSD.org> Date: Sun, 18 Nov 2012 18:05:50 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> <509EA869.6030407@freebsd.org> <509ED439.8090607@mu.org> <509EDD93.3020001@freebsd.org> In-Reply-To: <509EDD93.3020001@freebsd.org> X-Enigmail-Version: 1.4.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5432546BFB618862B9771CC5" X-Gm-Message-State: ALoCoQnHk+2g1XLjyXmHMwLhxUXBXZnkmcyMHzFu6OhUW+yPMgNSszGBThyuutSXGYQlcQygkHrt Cc: src-committers@freebsd.org, Eitan Adler , Peter Wemm , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 14:05:34 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5432546BFB618862B9771CC5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 11/11/12 3:04 AM, Andre Oppermann wrote: > On 10.11.2012 23:24, Alfred Perlstein wrote: >> On 11/10/12 11:18 AM, Andre Oppermann wrote: >>> On 10.11.2012 19:04, Peter Wemm wrote: >>>> This is complicated but we need a simple user visible view of it. I= t >>>> really needs to be something like "nmbclusters defaults to 6% of >>>> physical ram, with machine dependent limits". The MD limits are bad= >>>> enough, and using bogo-units like "maxusers" just makes it worse. >>> >>> Yes, that would be optimal. >>> >> No it would not. >> >> I used to be able to tell people "hey just try increasing maxusers" >> and they would and suddenly the >> box would be OK. >> >> Now I'll have to remember 3,4,5,10,20x tunable to increase? >=20 > No. The whole mbuf and cluster stuff isn't allocated or reserved > at boot time. We simply need a limit to prevent it from exhausting > all available kvm / physical memory whichever is less. >=20 For now, we have limit which does not allow to run even one igb(4) NIC in 9k jumbo configuration. > Other than that there is no relation to maxusers except historic > behavior. >=20 > So the ideal mbuf limit is just short of keeling the kernel over > no matter what maxusers says. There also isn't much to tune then > as the only fix would be to add more physical ram. >=20 --=20 Andrey Zonov --------------enig5432546BFB618862B9771CC5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJQqOtBAAoJEBWLemxX/CvTiZgIALl+03GzL3LGauhLb9x5QpBr F+XHMonHE9AqggQtpy9BWzrq88NkLYaHi9rF6iCpd/lvPan6RUs5EuO25ZPkYlhO 0OTQ3KEDvAJ0ylwmER9kr2uuu7m9aj8JhX+N4Xb9PDKdeVt/m2kNGW6xbeEbtf1z gCec2E2i2NPuI0xGYILABY4RZTYOBYnd0/OQrpDMtCMyUfBHXx0VoI1HGA8hlgQn hus9qm+4BORFG3UJuX4NS0483Rn+41YT/Pf/tZ2HT8MVQ7buSV8yGYBsWDy/nf+B AOfWEcNBjiKpH9s+gxSdM1n0DGEowDEPJaLdoi5Y3hPOrGnBfftOT/vOlrSLC6s= =jwZO -----END PGP SIGNATURE----- --------------enig5432546BFB618862B9771CC5-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 14:13:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D85AD5F8 for ; Sun, 18 Nov 2012 14:13:04 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2F9908FC17 for ; Sun, 18 Nov 2012 14:13:04 +0000 (UTC) Received: (qmail 67399 invoked from network); 18 Nov 2012 15:46:20 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 18 Nov 2012 15:46:20 -0000 Message-ID: <50A8ECEE.9020908@freebsd.org> Date: Sun, 18 Nov 2012 15:13:02 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andrey Zonov Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> <509EA869.6030407@freebsd.org> <509ED439.8090607@mu.org> <509EDD93.3020001@freebsd.org> <50A8EB3E.6060807@FreeBSD.org> In-Reply-To: <50A8EB3E.6060807@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Eitan Adler , Peter Wemm , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 14:13:04 -0000 On 18.11.2012 15:05, Andrey Zonov wrote: > On 11/11/12 3:04 AM, Andre Oppermann wrote: >> On 10.11.2012 23:24, Alfred Perlstein wrote: >>> On 11/10/12 11:18 AM, Andre Oppermann wrote: >>>> On 10.11.2012 19:04, Peter Wemm wrote: >>>>> This is complicated but we need a simple user visible view of it. It >>>>> really needs to be something like "nmbclusters defaults to 6% of >>>>> physical ram, with machine dependent limits". The MD limits are bad >>>>> enough, and using bogo-units like "maxusers" just makes it worse. >>>> >>>> Yes, that would be optimal. >>>> >>> No it would not. >>> >>> I used to be able to tell people "hey just try increasing maxusers" >>> and they would and suddenly the >>> box would be OK. >>> >>> Now I'll have to remember 3,4,5,10,20x tunable to increase? >> >> No. The whole mbuf and cluster stuff isn't allocated or reserved >> at boot time. We simply need a limit to prevent it from exhausting >> all available kvm / physical memory whichever is less. >> > > For now, we have limit which does not allow to run even one igb(4) NIC > in 9k jumbo configuration. My patch for mbuf* zone auto-sizing does fix that, or not? -- Andre From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 14:21:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0331CE6F; Sun, 18 Nov 2012 14:21:06 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD4AB8FC12; Sun, 18 Nov 2012 14:21:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIEL5OR042020; Sun, 18 Nov 2012 14:21:05 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIEL5KT042019; Sun, 18 Nov 2012 14:21:05 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201211181421.qAIEL5KT042019@svn.freebsd.org> From: Chris Rees Date: Sun, 18 Nov 2012 14:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243228 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 14:21:06 -0000 Author: crees (ports committer) Date: Sun Nov 18 14:21:05 2012 New Revision: 243228 URL: http://svnweb.freebsd.org/changeset/base/243228 Log: cp -R misses out dotfiles; use pax instead to copy file hierarchies PR: conf/99721 (based on) Submitted by: Florian Zavatzki Approved by: hrs MFC after: 1 month Modified: head/etc/rc.initdiskless Modified: head/etc/rc.initdiskless ============================================================================== --- head/etc/rc.initdiskless Sun Nov 18 14:05:28 2012 (r243227) +++ head/etc/rc.initdiskless Sun Nov 18 14:21:05 2012 (r243228) @@ -354,7 +354,7 @@ for i in ${templates} ; do subdir=${j##*/} if [ -d $j -a ! -f $j.cpio.gz ]; then create_md $subdir - cp -Rp $j/ /$subdir + (cd $j && pax -rw . /$subdir) fi done for j in /conf/$i/*.cpio.gz ; do From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 15:11:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8BF44E43; Sun, 18 Nov 2012 15:11:47 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7274F8FC0C; Sun, 18 Nov 2012 15:11:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIFBlSj050893; Sun, 18 Nov 2012 15:11:47 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIFBla1050892; Sun, 18 Nov 2012 15:11:47 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211181511.qAIFBla1050892@svn.freebsd.org> From: Hiroki Sato Date: Sun, 18 Nov 2012 15:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243231 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 15:11:47 -0000 Author: hrs Date: Sun Nov 18 15:11:47 2012 New Revision: 243231 URL: http://svnweb.freebsd.org/changeset/base/243231 Log: Use sin6_scope_id instead of KAME-specific embedded scope id. Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Sun Nov 18 14:58:50 2012 (r243230) +++ head/usr.sbin/route6d/route6d.c Sun Nov 18 15:11:47 2012 (r243231) @@ -90,18 +90,6 @@ static char _rcsid[] = "$KAME: route6d.c ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) -/* - * Following two macros are highly depending on KAME Release - */ -#define IN6_LINKLOCAL_IFINDEX(addr) \ - ((addr).s6_addr[2] << 8 | (addr).s6_addr[3]) - -#define SET_IN6_LINKLOCAL_IFINDEX(addr, index) \ - do { \ - (addr).s6_addr[2] = ((index) >> 8) & 0xff; \ - (addr).s6_addr[3] = (index) & 0xff; \ - } while (0) - struct ifc { /* Configuration of an interface */ char *ifc_name; /* if name */ struct ifc *ifc_next; @@ -122,6 +110,7 @@ struct ifac { /* Adddress associated t struct ifac *ifa_next; struct in6_addr ifa_addr; /* address */ struct in6_addr ifa_raddr; /* remote address, valid in p2p */ + int ifa_scope_id; /* scope id */ int ifa_plen; /* prefix length */ }; @@ -883,8 +872,6 @@ ripsend(ifcp, sin6, flag) if (nrt == maxrte - 2) ripflush(ifcp, sin6); np->rip6_dest = rrt->rrt_gw; - if (IN6_IS_ADDR_LINKLOCAL(&np->rip6_dest)) - SET_IN6_LINKLOCAL_IFINDEX(np->rip6_dest, 0); np->rip6_plen = 0; np->rip6_tag = 0; np->rip6_metric = NEXTHOP_METRIC; @@ -1036,12 +1023,9 @@ sendpacket(sin6, len) sin6 = &sincopy; if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) || - IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { - /* XXX: do not mix the interface index and link index */ - idx = IN6_LINKLOCAL_IFINDEX(sin6->sin6_addr); - SET_IN6_LINKLOCAL_IFINDEX(sin6->sin6_addr, 0); - sin6->sin6_scope_id = idx; - } else + IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) + idx = sin6->sin6_scope_id; + else idx = 0; m.msg_name = (caddr_t)sin6; @@ -1144,8 +1128,6 @@ riprecv() break; } } - if (idx && IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr)) - SET_IN6_LINKLOCAL_IFINDEX(fsock.sin6_addr, idx); if (len < sizeof(struct rip6)) { trace(1, "Packet too short\n"); @@ -1221,7 +1203,7 @@ riprecv() return; } - idx = IN6_LINKLOCAL_IFINDEX(fsock.sin6_addr); + idx = fsock.sin6_scope_id; ifcp = (idx < nindex2ifc) ? index2ifc[idx] : NULL; if (!ifcp) { trace(1, "Packets to unknown interface index %d\n", idx); @@ -1248,7 +1230,6 @@ riprecv() /* modify neighbor address */ if (IN6_IS_ADDR_LINKLOCAL(&np->rip6_dest)) { nh = np->rip6_dest; - SET_IN6_LINKLOCAL_IFINDEX(nh, idx); trace(1, "\tNexthop: %s\n", inet6_n2p(&nh)); } else if (IN6_IS_ADDR_UNSPECIFIED(&np->rip6_dest)) { nh = fsock.sin6_addr; @@ -1603,6 +1584,7 @@ ifconfig1(name, sa, ifcp, s) ifcp->ifc_addr = ifa; ifa->ifa_addr = sin6->sin6_addr; ifa->ifa_plen = plen; + ifa->ifa_scope_id= sin6->sin6_scope_id; if (ifcp->ifc_flags & IFF_POINTOPOINT) { ifr.ifr_addr = *sin6; if (ioctl(s, SIOCGIFDSTADDR_IN6, (char *)&ifr) < 0) { @@ -1619,10 +1601,9 @@ ifconfig1(name, sa, ifcp, s) } if (ifcp->ifc_index < 0 && IN6_IS_ADDR_LINKLOCAL(&ifa->ifa_addr)) { ifcp->ifc_mylladdr = ifa->ifa_addr; - ifcp->ifc_index = IN6_LINKLOCAL_IFINDEX(ifa->ifa_addr); + ifcp->ifc_index = ifa->ifa_scope_id; memcpy(&ifcp->ifc_ripsin, &ripsin, ripsin.ss_len); - SET_IN6_LINKLOCAL_IFINDEX(ifcp->ifc_ripsin.sin6_addr, - ifcp->ifc_index); + ifcp->ifc_ripsin.sin6_scope_id = ifcp->ifc_index; setindex2ifc(ifcp->ifc_index, ifcp); ifcp->ifc_mtu = getifmtu(ifcp->ifc_index); if (ifcp->ifc_mtu > RIP6_MAXMTU) From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 15:37:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B924D395; Sun, 18 Nov 2012 15:37:27 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9B1DD8FC14; Sun, 18 Nov 2012 15:37:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIFbRBZ055087; Sun, 18 Nov 2012 15:37:27 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIFbRs1055086; Sun, 18 Nov 2012 15:37:27 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211181537.qAIFbRs1055086@svn.freebsd.org> From: Hiroki Sato Date: Sun, 18 Nov 2012 15:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243232 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 15:37:28 -0000 Author: hrs Date: Sun Nov 18 15:37:27 2012 New Revision: 243232 URL: http://svnweb.freebsd.org/changeset/base/243232 Log: Overhaul of route6d(8): - Use queue(3) for linked-list. - Use a consistent naming scheme for struct members. - Use ANSI C style function declaration. - Add check of RTM_VERSION mismatch. There is no functional change. Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Sun Nov 18 15:11:47 2012 (r243231) +++ head/usr.sbin/route6d/route6d.c Sun Nov 18 15:37:27 2012 (r243232) @@ -31,7 +31,7 @@ */ #ifndef lint -static char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itojun Exp $"; +static const char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itojun Exp $"; #endif #include @@ -90,9 +90,10 @@ static char _rcsid[] = "$KAME: route6d.c ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) -struct ifc { /* Configuration of an interface */ - char *ifc_name; /* if name */ - struct ifc *ifc_next; +struct ifc { /* Configuration of an interface */ + TAILQ_ENTRY(ifc) ifc_next; + + char ifc_name[IFNAMSIZ]; /* if name */ int ifc_index; /* if index */ int ifc_mtu; /* if mtu */ int ifc_metric; /* if metric */ @@ -100,31 +101,32 @@ struct ifc { /* Configuration of an in short ifc_cflags; /* IFC_XXX */ struct in6_addr ifc_mylladdr; /* my link-local address */ struct sockaddr_in6 ifc_ripsin; /* rip multicast address */ - struct iff *ifc_filter; /* filter structure */ - struct ifac *ifc_addr; /* list of AF_INET6 addresses */ + TAILQ_HEAD(, ifac) ifc_ifac_head; /* list of AF_INET6 addrs */ + TAILQ_HEAD(, iff) ifc_iff_head; /* list of filters */ int ifc_joined; /* joined to ff02::9 */ }; +TAILQ_HEAD(, ifc) ifc_head = TAILQ_HEAD_INITIALIZER(ifc_head); + +struct ifac { /* Adddress associated to an interface */ + TAILQ_ENTRY(ifac) ifac_next; -struct ifac { /* Adddress associated to an interface */ - struct ifc *ifa_conf; /* back pointer */ - struct ifac *ifa_next; - struct in6_addr ifa_addr; /* address */ - struct in6_addr ifa_raddr; /* remote address, valid in p2p */ - int ifa_scope_id; /* scope id */ - int ifa_plen; /* prefix length */ + struct ifc *ifac_ifc; /* back pointer */ + struct in6_addr ifac_addr; /* address */ + struct in6_addr ifac_raddr; /* remote address, valid in p2p */ + int ifac_scope_id; /* scope id */ + int ifac_plen; /* prefix length */ }; -struct iff { +struct iff { /* Filters for an interface */ + TAILQ_ENTRY(iff) iff_next; + int iff_type; struct in6_addr iff_addr; int iff_plen; - struct iff *iff_next; }; -struct ifc *ifc; -int nifc; /* number of valid ifc's */ struct ifc **index2ifc; -int nindex2ifc; +unsigned int nindex2ifc; struct ifc *loopifcp = NULL; /* pointing to loopback */ #ifdef HAVE_POLL_H struct pollfd set[2]; @@ -151,8 +153,9 @@ struct rip6 *ripbuf; /* packet buffer fo * suppressing the specifics covered by the aggregate. */ -struct riprt { - struct riprt *rrt_next; /* next destination */ +struct riprt { + TAILQ_ENTRY(riprt) rrt_next; /* next destination */ + struct riprt *rrt_same; /* same destination - future use */ struct netinfo6 rrt_info; /* network info */ struct in6_addr rrt_gw; /* gateway */ @@ -161,8 +164,7 @@ struct riprt { time_t rrt_t; /* when the route validated */ int rrt_index; /* ifindex from which this route got */ }; - -struct riprt *riprt = 0; +TAILQ_HEAD(, riprt) riprt_head = TAILQ_HEAD_INITIALIZER(riprt_head); int dflag = 0; /* debug flag */ int qflag = 0; /* quiet flag */ @@ -211,7 +213,7 @@ int out_filter(struct riprt *, struct if void init(void); void sockopt(struct ifc *); void ifconfig(void); -void ifconfig1(const char *, const struct sockaddr *, struct ifc *, int); +int ifconfig1(const char *, const struct sockaddr *, struct ifc *, int); void rtrecv(void); int rt_del(const struct sockaddr_in6 *, const struct sockaddr_in6 *, const struct sockaddr_in6 *); @@ -234,7 +236,7 @@ void rt_entry(struct rt_msghdr *, int); void rtdexit(void); void riprequest(struct ifc *, struct netinfo6 *, int, struct sockaddr_in6 *); -void ripflush(struct ifc *, struct sockaddr_in6 *); +void ripflush(struct ifc *, struct sockaddr_in6 *, int, struct netinfo6 *np); void sendrequest(struct ifc *); int sin6mask2len(const struct sockaddr_in6 *); int mask2len(const struct in6_addr *, int); @@ -249,7 +251,7 @@ char *hms(void); const char *inet6_n2p(const struct in6_addr *); struct ifac *ifa_match(const struct ifc *, const struct in6_addr *, int); struct in6_addr *plen2mask(int); -struct riprt *rtsearch(struct netinfo6 *, struct riprt **); +struct riprt *rtsearch(struct netinfo6 *); int ripinterval(int); time_t ripsuptrig(void); void fatal(const char *, ...) @@ -265,10 +267,15 @@ void setindex2ifc(int, struct ifc *); #define MALLOC(type) ((type *)malloc(sizeof(type))) +#define IFIL_TYPE_ANY 0x0 +#define IFIL_TYPE_A 'A' +#define IFIL_TYPE_N 'N' +#define IFIL_TYPE_T 'T' +#define IFIL_TYPE_O 'O' +#define IFIL_TYPE_L 'L' + int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { int ch; int error = 0; @@ -361,11 +368,10 @@ main(argc, argv) init(); ifconfig(); - for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) { + TAILQ_FOREACH(ifcp, &ifc_head, ifc_next) { if (ifcp->ifc_index < 0) { - fprintf(stderr, -"No ifindex found at %s (no link-local address?)\n", - ifcp->ifc_name); + fprintf(stderr, "No ifindex found at %s " + "(no link-local address?)\n", ifcp->ifc_name); error++; } } @@ -375,20 +381,19 @@ main(argc, argv) fatal("No loopback found"); /*NOTREACHED*/ } - for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) + TAILQ_FOREACH(ifcp, &ifc_head, ifc_next) { ifrt(ifcp, 0); + } filterconfig(); krtread(0); if (dflag) ifrtdump(0); -#if 1 pid = getpid(); if ((pidfile = fopen(ROUTE6D_PID, "w")) != NULL) { fprintf(pidfile, "%d\n", pid); fclose(pidfile); } -#endif if ((ripbuf = (struct rip6 *)malloc(RIP6_MAXMTU)) == NULL) { fatal("malloc"); @@ -416,8 +421,8 @@ main(argc, argv) */ alarm(ripinterval(INIT_INTERVAL6)); - for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) { - if (iff_find(ifcp, 'N')) + TAILQ_FOREACH(ifcp, &ifc_head, ifc_next) { + if (iff_find(ifcp, IFIL_TYPE_N) != NULL) continue; if (ifcp->ifc_index > 0 && (ifcp->ifc_flags & IFF_UP)) sendrequest(ifcp); @@ -484,8 +489,7 @@ main(argc, argv) } void -sighandler(signo) - int signo; +sighandler(int signo) { switch (signo) { @@ -509,12 +513,12 @@ sighandler(signo) */ /* ARGSUSED */ void -rtdexit() +rtdexit(void) { struct riprt *rrt; alarm(0); - for (rrt = riprt; rrt; rrt = rrt->rrt_next) { + TAILQ_FOREACH(rrt, &riprt_head, rrt_next) { if (rrt->rrt_rflags & RRTF_AGGREGATE) { delroute(&rrt->rrt_info, &rrt->rrt_gw); } @@ -536,39 +540,27 @@ rtdexit() */ /* ARGSUSED */ void -ripalarm() +ripalarm(void) { struct ifc *ifcp; - struct riprt *rrt, *rrt_prev, *rrt_next; + struct riprt *rrt, *rrt_tmp; time_t t_lifetime, t_holddown; /* age the RIP routes */ - rrt_prev = 0; t_lifetime = time(NULL) - RIP_LIFETIME; t_holddown = t_lifetime - RIP_HOLDDOWN; - for (rrt = riprt; rrt; rrt = rrt_next) { - rrt_next = rrt->rrt_next; - - if (rrt->rrt_t == 0) { - rrt_prev = rrt; + TAILQ_FOREACH_SAFE(rrt, &riprt_head, rrt_next, rrt_tmp) { + if (rrt->rrt_t == 0) continue; - } - if (rrt->rrt_t < t_holddown) { - if (rrt_prev) { - rrt_prev->rrt_next = rrt->rrt_next; - } else { - riprt = rrt->rrt_next; - } + else if (rrt->rrt_t < t_holddown) { + TAILQ_REMOVE(&riprt_head, rrt, rrt_next); delroute(&rrt->rrt_info, &rrt->rrt_gw); free(rrt); - continue; - } - if (rrt->rrt_t < t_lifetime) + } else if (rrt->rrt_t < t_lifetime) rrt->rrt_info.rip6_metric = HOPCNT_INFINITY6; - rrt_prev = rrt; } /* Supply updates */ - for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) { + TAILQ_FOREACH(ifcp, &ifc_head, ifc_next) { if (ifcp->ifc_index > 0 && (ifcp->ifc_flags & IFF_UP)) ripsend(ifcp, &ifcp->ifc_ripsin, 0); } @@ -576,15 +568,14 @@ ripalarm() } void -init() +init(void) { int error; const int int0 = 0, int1 = 1, int255 = 255; struct addrinfo hints, *res; char port[NI_MAXSERV]; - ifc = (struct ifc *)NULL; - nifc = 0; + TAILQ_INIT(&ifc_head); nindex2ifc = 0; /*initial guess*/ index2ifc = NULL; snprintf(port, sizeof(port), "%u", RIP6_PORT); @@ -724,13 +715,8 @@ init() /* * ripflush flushes the rip datagram stored in the rip buffer */ -static int nrt; -static struct netinfo6 *np; - void -ripflush(ifcp, sin6) - struct ifc *ifcp; - struct sockaddr_in6 *sin6; +ripflush(struct ifc *ifcp, struct sockaddr_in6 *sin6, int nrt, struct netinfo6 *np) { int i; int error; @@ -772,21 +758,19 @@ ripflush(ifcp, sin6) ifcp->ifc_name, inet6_n2p(&ifcp->ifc_ripsin.sin6_addr)); ifcp->ifc_flags &= ~IFF_UP; /* As if down for AF_INET6 */ } - nrt = 0; np = ripbuf->rip6_nets; } /* * Generate RIP6_RESPONSE packets and send them. */ void -ripsend(ifcp, sin6, flag) - struct ifc *ifcp; - struct sockaddr_in6 *sin6; - int flag; +ripsend(struct ifc *ifcp, struct sockaddr_in6 *sin6, int flag) { struct riprt *rrt; struct in6_addr *nh; /* next hop */ + struct netinfo6 *np; int maxrte; + int nrt; if (qflag) return; @@ -800,20 +784,24 @@ ripsend(ifcp, sin6, flag) sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); - nrt = 0; np = ripbuf->rip6_nets; nh = NULL; - for (rrt = riprt; rrt; rrt = rrt->rrt_next) { + nh = NULL; + nrt = 0; + np = ripbuf->rip6_nets; + TAILQ_FOREACH(rrt, &riprt_head, rrt_next) { if (rrt->rrt_rflags & RRTF_NOADVERTISE) continue; /* Put the route to the buffer */ *np = rrt->rrt_info; np++; nrt++; if (nrt == maxrte) { - ripflush(NULL, sin6); + ripflush(NULL, sin6, nrt, np); nh = NULL; + nrt = 0; + np = ripbuf->rip6_nets; } } if (nrt) /* Send last packet */ - ripflush(NULL, sin6); + ripflush(NULL, sin6, nrt, np); return; } @@ -822,11 +810,11 @@ ripsend(ifcp, sin6, flag) return; /* -N: no use */ - if (iff_find(ifcp, 'N') != NULL) + if (iff_find(ifcp, IFIL_TYPE_N) != NULL) return; /* -T: generate default route only */ - if (iff_find(ifcp, 'T') != NULL) { + if (iff_find(ifcp, IFIL_TYPE_T) != NULL) { struct netinfo6 rrt_info; memset(&rrt_info, 0, sizeof(struct netinfo6)); rrt_info.rip6_dest = in6addr_any; @@ -837,7 +825,7 @@ ripsend(ifcp, sin6, flag) np = ripbuf->rip6_nets; *np = rrt_info; nrt = 1; - ripflush(ifcp, sin6); + ripflush(ifcp, sin6, nrt, np); return; } @@ -847,7 +835,7 @@ ripsend(ifcp, sin6, flag) sizeof(struct netinfo6); nrt = 0; np = ripbuf->rip6_nets; nh = NULL; - for (rrt = riprt; rrt; rrt = rrt->rrt_next) { + TAILQ_FOREACH(rrt, &riprt_head, rrt_next) { if (rrt->rrt_rflags & RRTF_NOADVERTISE) continue; @@ -869,8 +857,13 @@ ripsend(ifcp, sin6, flag) !IN6_IS_ADDR_UNSPECIFIED(&rrt->rrt_gw) && (rrt->rrt_rflags & RRTF_NH_NOT_LLADDR) == 0) { if (nh == NULL || !IN6_ARE_ADDR_EQUAL(nh, &rrt->rrt_gw)) { - if (nrt == maxrte - 2) - ripflush(ifcp, sin6); + if (nrt == maxrte - 2) { + ripflush(ifcp, sin6, nrt, np); + nh = NULL; + nrt = 0; + np = ripbuf->rip6_nets; + } + np->rip6_dest = rrt->rrt_gw; np->rip6_plen = 0; np->rip6_tag = 0; @@ -882,8 +875,12 @@ ripsend(ifcp, sin6, flag) !IN6_ARE_ADDR_EQUAL(nh, &rrt->rrt_gw) || rrt->rrt_rflags & RRTF_NH_NOT_LLADDR)) { /* Reset nexthop */ - if (nrt == maxrte - 2) - ripflush(ifcp, sin6); + if (nrt == maxrte - 2) { + ripflush(ifcp, sin6, nrt, np); + nh = NULL; + nrt = 0; + np = ripbuf->rip6_nets; + } memset(np, 0, sizeof(struct netinfo6)); np->rip6_metric = NEXTHOP_METRIC; nh = NULL; @@ -894,21 +891,21 @@ ripsend(ifcp, sin6, flag) *np = rrt->rrt_info; np++; nrt++; if (nrt == maxrte) { - ripflush(ifcp, sin6); + ripflush(ifcp, sin6, nrt, np); nh = NULL; + nrt = 0; + np = ripbuf->rip6_nets; } } if (nrt) /* Send last packet */ - ripflush(ifcp, sin6); + ripflush(ifcp, sin6, nrt, np); } /* * outbound filter logic, per-route/interface. */ int -out_filter(rrt, ifcp) - struct riprt *rrt; - struct ifc *ifcp; +out_filter(struct riprt *rrt, struct ifc *ifcp) { struct iff *iffp; struct in6_addr ia; @@ -918,7 +915,7 @@ out_filter(rrt, ifcp) * -A: filter out less specific routes, if we have aggregated * route configured. */ - for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) { + TAILQ_FOREACH(iffp, &ifcp->ifc_iff_head, iff_next) { if (iffp->iff_type != 'A') continue; if (rrt->rrt_info.rip6_plen <= iffp->iff_plen) @@ -935,7 +932,7 @@ out_filter(rrt, ifcp) */ if ((rrt->rrt_rflags & RRTF_AGGREGATE) != 0) { ok = 0; - for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) { + TAILQ_FOREACH(iffp, &ifcp->ifc_iff_head, iff_next) { if (iffp->iff_type != 'A') continue; if (rrt->rrt_info.rip6_plen == iffp->iff_plen && @@ -952,9 +949,9 @@ out_filter(rrt, ifcp) /* * -O: advertise only if prefix matches the configured prefix. */ - if (iff_find(ifcp, 'O')) { + if (iff_find(ifcp, IFIL_TYPE_O) != NULL) { ok = 0; - for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) { + TAILQ_FOREACH(iffp, &ifcp->ifc_iff_head, iff_next) { if (iffp->iff_type != 'O') continue; if (rrt->rrt_info.rip6_plen < iffp->iff_plen) @@ -979,9 +976,7 @@ out_filter(rrt, ifcp) * It checks options specified in the arguments and the split horizon rule. */ int -tobeadv(rrt, ifcp) - struct riprt *rrt; - struct ifc *ifcp; +tobeadv(struct riprt *rrt, struct ifc *ifcp) { /* Special care for static routes */ @@ -1006,9 +1001,7 @@ tobeadv(rrt, ifcp) * Send a rip packet actually. */ int -sendpacket(sin6, len) - struct sockaddr_in6 *sin6; - int len; +sendpacket(struct sockaddr_in6 *sin6, int len) { struct msghdr m; struct cmsghdr *cm; @@ -1064,7 +1057,7 @@ sendpacket(sin6, len) * table if necessary. */ void -riprecv() +riprecv(void) { struct ifc *ifcp, *ic; struct sockaddr_in6 fsock; @@ -1129,7 +1122,7 @@ riprecv() } } - if (len < sizeof(struct rip6)) { + if ((size_t)len < sizeof(struct rip6)) { trace(1, "Packet too short\n"); return; } @@ -1217,7 +1210,7 @@ riprecv() } /* -N: no use */ - if (iff_find(ifcp, 'N') != NULL) + if (iff_find(ifcp, IFIL_TYPE_N) != NULL) return; tracet(1, "Recv(%s): from %s.%d info(%zd)\n", @@ -1281,23 +1274,23 @@ riprecv() /* * -L: listen only if the prefix matches the configuration */ - ok = 1; /* if there's no L filter, it is ok */ - for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) { - if (iffp->iff_type != 'L') - continue; - ok = 0; - if (np->rip6_plen < iffp->iff_plen) - continue; - /* special rule: ::/0 means default, not "in /0" */ - if (iffp->iff_plen == 0 && np->rip6_plen > 0) - continue; - ia = np->rip6_dest; - applyplen(&ia, iffp->iff_plen); - if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) { - ok = 1; - break; - } - } + ok = 1; /* if there's no L filter, it is ok */ + TAILQ_FOREACH(iffp, &ifcp->ifc_iff_head, iff_next) { + if (iffp->iff_type != IFIL_TYPE_L) + continue; + ok = 0; + if (np->rip6_plen < iffp->iff_plen) + continue; + /* special rule: ::/0 means default, not "in /0" */ + if (iffp->iff_plen == 0 && np->rip6_plen > 0) + continue; + ia = np->rip6_dest; + applyplen(&ia, iffp->iff_plen); + if (IN6_ARE_ADDR_EQUAL(&ia, &iffp->iff_addr)) { + ok = 1; + break; + } + } if (!ok) { trace(2, " (filtered)\n"); continue; @@ -1310,7 +1303,7 @@ riprecv() np->rip6_metric = HOPCNT_INFINITY6; applyplen(&np->rip6_dest, np->rip6_plen); - if ((rrt = rtsearch(np, NULL)) != NULL) { + if ((rrt = rtsearch(np)) != NULL) { if (rrt->rrt_t == 0) continue; /* Intf route has priority */ nq = &rrt->rrt_info; @@ -1379,20 +1372,20 @@ riprecv() if (nq->rip6_plen == sizeof(struct in6_addr) * 8) rrt->rrt_flags |= RTF_HOST; - /* Put the route to the list */ - rrt->rrt_next = riprt; - riprt = rrt; /* Update routing table */ addroute(rrt, &nh, ifcp); rrt->rrt_rflags |= RRTF_CHANGED; need_trigger = 1; rrt->rrt_t = t; + + /* Put the route to the list */ + TAILQ_INSERT_HEAD(&riprt_head, rrt, rrt_next); } } /* XXX need to care the interval between triggered updates */ if (need_trigger) { if (nextalarm > time(NULL) + RIP_TRIG_INT6_MAX) { - for (ic = ifc; ic; ic = ic->ifc_next) { + TAILQ_FOREACH(ic, &ifc_head, ifc_next) { if (ifcp->ifc_index == ic->ifc_index) continue; if (ic->ifc_flags & IFF_UP) @@ -1401,8 +1394,9 @@ riprecv() } } /* Reset the flag */ - for (rrt = riprt; rrt; rrt = rrt->rrt_next) + TAILQ_FOREACH(rrt, &riprt_head, rrt_next) { rrt->rrt_rflags &= ~RRTF_CHANGED; + } } } @@ -1410,8 +1404,7 @@ riprecv() * Send all routes request packet to the specified interface. */ void -sendrequest(ifcp) - struct ifc *ifcp; +sendrequest(struct ifc *ifcp) { struct netinfo6 *np; int error; @@ -1439,11 +1432,10 @@ sendrequest(ifcp) * Process a RIP6_REQUEST packet. */ void -riprequest(ifcp, np, nn, sin6) - struct ifc *ifcp; - struct netinfo6 *np; - int nn; - struct sockaddr_in6 *sin6; +riprequest(struct ifc *ifcp, + struct netinfo6 *np, + int nn, + struct sockaddr_in6 *sin6) { int i; struct riprt *rrt; @@ -1453,7 +1445,7 @@ riprequest(ifcp, np, nn, sin6) /* Specific response, don't split-horizon */ trace(1, "\tRIP Request\n"); for (i = 0; i < nn; i++, np++) { - rrt = rtsearch(np, NULL); + rrt = rtsearch(np); if (rrt) np->rip6_metric = rrt->rrt_info.rip6_metric; else @@ -1471,7 +1463,7 @@ riprequest(ifcp, np, nn, sin6) * Get information of each interface. */ void -ifconfig() +ifconfig(void) { struct ifaddrs *ifap, *ifa; struct ifc *ifcp; @@ -1502,14 +1494,14 @@ ifconfig() /*NOTREACHED*/ } memset(ifcp, 0, sizeof(*ifcp)); + ifcp->ifc_index = -1; - ifcp->ifc_next = ifc; - ifc = ifcp; - nifc++; - ifcp->ifc_name = allocopy(ifa->ifa_name); - ifcp->ifc_addr = 0; - ifcp->ifc_filter = 0; + strlcpy(ifcp->ifc_name, ifa->ifa_name, + sizeof(ifcp->ifc_name)); + TAILQ_INIT(&ifcp->ifc_ifac_head); + TAILQ_INIT(&ifcp->ifc_iff_head); ifcp->ifc_flags = ifa->ifa_flags; + TAILQ_INSERT_HEAD(&ifc_head, ifcp, ifc_next); trace(1, "newif %s <%s>\n", ifcp->ifc_name, ifflags(ifcp->ifc_flags)); if (!strcmp(ifcp->ifc_name, LOOPBACK_IF)) @@ -1524,7 +1516,10 @@ ifconfig() } ifcp->ifc_flags = ifa->ifa_flags; } - ifconfig1(ifa->ifa_name, ifa->ifa_addr, ifcp, s); + if (ifconfig1(ifa->ifa_name, ifa->ifa_addr, ifcp, s) < 0) { + /* maybe temporary failure */ + continue; + } if ((ifcp->ifc_flags & (IFF_LOOPBACK | IFF_UP)) == IFF_UP && 0 < ifcp->ifc_index && !ifcp->ifc_joined) { mreq.ipv6mr_multiaddr = ifcp->ifc_ripsin.sin6_addr; @@ -1542,66 +1537,65 @@ ifconfig() freeifaddrs(ifap); } -void -ifconfig1(name, sa, ifcp, s) - const char *name; - const struct sockaddr *sa; - struct ifc *ifcp; - int s; +int +ifconfig1(const char *name, + const struct sockaddr *sa, + struct ifc *ifcp, + int s) { struct in6_ifreq ifr; const struct sockaddr_in6 *sin6; - struct ifac *ifa; + struct ifac *ifac; int plen; char buf[BUFSIZ]; sin6 = (const struct sockaddr_in6 *)sa; if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && !lflag) - return; + return (-1); ifr.ifr_addr = *sin6; strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGIFNETMASK_IN6, (char *)&ifr) < 0) { - fatal("ioctl: SIOCGIFNETMASK_IN6"); - /*NOTREACHED*/ + syslog(LOG_INFO, "ioctl: SIOCGIFNETMASK_IN6"); + return (-1); } plen = sin6mask2len(&ifr.ifr_addr); - if ((ifa = ifa_match(ifcp, &sin6->sin6_addr, plen)) != NULL) { + if ((ifac = ifa_match(ifcp, &sin6->sin6_addr, plen)) != NULL) { /* same interface found */ /* need check if something changed */ /* XXX not yet implemented */ - return; + return (-1); } /* * New address is found */ - if ((ifa = MALLOC(struct ifac)) == NULL) { + if ((ifac = MALLOC(struct ifac)) == NULL) { fatal("malloc: struct ifac"); /*NOTREACHED*/ } - memset(ifa, 0, sizeof(*ifa)); - ifa->ifa_conf = ifcp; - ifa->ifa_next = ifcp->ifc_addr; - ifcp->ifc_addr = ifa; - ifa->ifa_addr = sin6->sin6_addr; - ifa->ifa_plen = plen; - ifa->ifa_scope_id= sin6->sin6_scope_id; + memset(ifac, 0, sizeof(*ifac)); + + ifac->ifac_ifc = ifcp; + ifac->ifac_addr = sin6->sin6_addr; + ifac->ifac_plen = plen; + ifac->ifac_scope_id = sin6->sin6_scope_id; if (ifcp->ifc_flags & IFF_POINTOPOINT) { ifr.ifr_addr = *sin6; if (ioctl(s, SIOCGIFDSTADDR_IN6, (char *)&ifr) < 0) { fatal("ioctl: SIOCGIFDSTADDR_IN6"); /*NOTREACHED*/ } - ifa->ifa_raddr = ifr.ifr_dstaddr.sin6_addr; - inet_ntop(AF_INET6, (void *)&ifa->ifa_raddr, buf, sizeof(buf)); + ifac->ifac_raddr = ifr.ifr_dstaddr.sin6_addr; + inet_ntop(AF_INET6, (void *)&ifac->ifac_raddr, buf, + sizeof(buf)); trace(1, "found address %s/%d -- %s\n", - inet6_n2p(&ifa->ifa_addr), ifa->ifa_plen, buf); + inet6_n2p(&ifac->ifac_addr), ifac->ifac_plen, buf); } else { trace(1, "found address %s/%d\n", - inet6_n2p(&ifa->ifa_addr), ifa->ifa_plen); + inet6_n2p(&ifac->ifac_addr), ifac->ifac_plen); } - if (ifcp->ifc_index < 0 && IN6_IS_ADDR_LINKLOCAL(&ifa->ifa_addr)) { - ifcp->ifc_mylladdr = ifa->ifa_addr; - ifcp->ifc_index = ifa->ifa_scope_id; + if (ifcp->ifc_index < 0 && IN6_IS_ADDR_LINKLOCAL(&ifac->ifac_addr)) { + ifcp->ifc_mylladdr = ifac->ifac_addr; + ifcp->ifc_index = ifac->ifac_scope_id; memcpy(&ifcp->ifc_ripsin, &ripsin, ripsin.ss_len); ifcp->ifc_ripsin.sin6_scope_id = ifcp->ifc_index; setindex2ifc(ifcp->ifc_index, ifcp); @@ -1617,6 +1611,10 @@ ifconfig1(name, sa, ifcp, s) ifcp->ifc_index, ifcp->ifc_mtu, ifcp->ifc_metric); } else ifcp->ifc_cflags |= IFC_CHANGED; + + TAILQ_INSERT_HEAD(&ifcp->ifc_ifac_head, ifac, ifac_next); + + return 0; } /* @@ -1624,10 +1622,10 @@ ifconfig1(name, sa, ifcp, s) * Update interface information as necesssary. */ void -rtrecv() +rtrecv(void) { char buf[BUFSIZ]; - char *p, *q; + char *p, *q = NULL; struct rt_msghdr *rtm; struct ifa_msghdr *ifam; struct if_msghdr *ifm; @@ -1636,18 +1634,22 @@ rtrecv() int iface = 0, rtable = 0; struct sockaddr_in6 *rta[RTAX_MAX]; struct sockaddr_in6 mask; - int i, addrs; + int i, addrs = 0; struct riprt *rrt; if ((len = read(rtsock, buf, sizeof(buf))) < 0) { perror("read from rtsock"); exit(1); } + if (len == 0) + return; +#if 0 if (len < sizeof(*rtm)) { trace(1, "short read from rtsock: %d (should be > %lu)\n", len, (u_long)sizeof(*rtm)); return; } +#endif if (dflag >= 2) { fprintf(stderr, "rtmsg:\n"); for (i = 0; i < len; i++) { @@ -1658,6 +1660,9 @@ rtrecv() } for (p = buf; p - buf < len; p += ((struct rt_msghdr *)p)->rtm_msglen) { + if (((struct rt_msghdr *)p)->rtm_version != RTM_VERSION) + continue; + /* safety against bogus message */ if (((struct rt_msghdr *)p)->rtm_msglen <= 0) { trace(1, "bogus rtmsg: length=%d\n", @@ -1828,10 +1833,10 @@ rtrecv() if (iface) { trace(1, "rtsock: reconfigure interfaces, refresh interface routes\n"); ifconfig(); - for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) + TAILQ_FOREACH(ifcp, &ifc_head, ifc_next) { if (ifcp->ifc_cflags & IFC_CHANGED) { if (ifrt(ifcp, 1)) { - for (ic = ifc; ic; ic = ic->ifc_next) { + TAILQ_FOREACH(ic, &ifc_head, ifc_next) { if (ifcp->ifc_index == ic->ifc_index) continue; if (ic->ifc_flags & IFF_UP) @@ -1839,11 +1844,13 @@ rtrecv() RRTF_CHANGED); } /* Reset the flag */ - for (rrt = riprt; rrt; rrt = rrt->rrt_next) + TAILQ_FOREACH(rrt, &riprt_head, rrt_next) { rrt->rrt_rflags &= ~RRTF_CHANGED; + } } ifcp->ifc_cflags &= ~IFC_CHANGED; } + } } if (rtable) { trace(1, "rtsock: read routing table again\n"); @@ -1855,10 +1862,9 @@ rtrecv() * remove specified route from the internal routing table. */ int -rt_del(sdst, sgw, smask) - const struct sockaddr_in6 *sdst; - const struct sockaddr_in6 *sgw; - const struct sockaddr_in6 *smask; +rt_del(const struct sockaddr_in6 *sdst, + const struct sockaddr_in6 *sgw, + const struct sockaddr_in6 *smask) { const struct in6_addr *dst = NULL; const struct in6_addr *gw = NULL; @@ -1894,7 +1900,7 @@ rt_del(sdst, sgw, smask) trace(1, "\t%s is an interface route, guessing prefixlen\n", inet6_n2p(dst)); longest = NULL; - for (rrt = riprt; rrt; rrt = rrt->rrt_next) { + TAILQ_FOREACH(rrt, &riprt_head, rrt_next) { if (IN6_ARE_ADDR_EQUAL(&rrt->rrt_info.rip6_dest, &sdst->sin6_addr) && IN6_IS_ADDR_LOOPBACK(&rrt->rrt_gw)) { @@ -1927,7 +1933,7 @@ rt_del(sdst, sgw, smask) applyplen(&ni6.rip6_dest, ni6.rip6_plen); /*to be sure*/ trace(1, "\tfind route %s/%d\n", inet6_n2p(&ni6.rip6_dest), ni6.rip6_plen); - if (!rrt && (rrt = rtsearch(&ni6, NULL)) == NULL) { + if (!rrt && (rrt = rtsearch(&ni6)) == NULL) { trace(1, "\tno route found\n"); return -1; } @@ -1954,14 +1960,13 @@ rt_del(sdst, sgw, smask) * remove specified address from internal interface/routing table. */ int -rt_deladdr(ifcp, sifa, smask) - struct ifc *ifcp; - const struct sockaddr_in6 *sifa; - const struct sockaddr_in6 *smask; +rt_deladdr(struct ifc *ifcp, + const struct sockaddr_in6 *sifa, + const struct sockaddr_in6 *smask) { const struct in6_addr *addr = NULL; int prefix; - struct ifac *ifa = NULL; + struct ifac *ifac = NULL; struct netinfo6 ni6; struct riprt *rrt = NULL; time_t t_lifetime; @@ -1976,41 +1981,28 @@ rt_deladdr(ifcp, sifa, smask) trace(1, "\tdeleting %s/%d from %s\n", inet6_n2p(addr), prefix, ifcp->ifc_name); - ifa = ifa_match(ifcp, addr, prefix); - if (!ifa) { + ifac = ifa_match(ifcp, addr, prefix); + if (!ifac) { trace(1, "\tno matching ifa found for %s/%d on %s\n", inet6_n2p(addr), prefix, ifcp->ifc_name); return -1; } - if (ifa->ifa_conf != ifcp) { + if (ifac->ifac_ifc != ifcp) { trace(1, "\taddress table corrupt: back pointer does not match " "(%s != %s)\n", - ifcp->ifc_name, ifa->ifa_conf->ifc_name); + ifcp->ifc_name, ifac->ifac_ifc->ifc_name); return -1; } - /* remove ifa from interface */ - if (ifcp->ifc_addr == ifa) - ifcp->ifc_addr = ifa->ifa_next; - else { - struct ifac *p; - for (p = ifcp->ifc_addr; p; p = p->ifa_next) { - if (p->ifa_next == ifa) { - p->ifa_next = ifa->ifa_next; - break; - } - } - } - ifa->ifa_next = NULL; - ifa->ifa_conf = NULL; + TAILQ_REMOVE(&ifcp->ifc_ifac_head, ifac, ifac_next); t_lifetime = time(NULL) - RIP_LIFETIME; /* age route for interface address */ memset(&ni6, 0, sizeof(ni6)); - ni6.rip6_dest = ifa->ifa_addr; - ni6.rip6_plen = ifa->ifa_plen; + ni6.rip6_dest = ifac->ifac_addr; + ni6.rip6_plen = ifac->ifac_plen; applyplen(&ni6.rip6_dest, ni6.rip6_plen); trace(1, "\tfind interface route %s/%d on %d\n", inet6_n2p(&ni6.rip6_dest), ni6.rip6_plen, ifcp->ifc_index); - if ((rrt = rtsearch(&ni6, NULL)) != NULL) { + if ((rrt = rtsearch(&ni6)) != NULL) { struct in6_addr none; memset(&none, 0, sizeof(none)); if (rrt->rrt_index == ifcp->ifc_index && @@ -2033,15 +2025,16 @@ rt_deladdr(ifcp, sifa, smask) /* age route for p2p destination */ if (ifcp->ifc_flags & IFF_POINTOPOINT) { memset(&ni6, 0, sizeof(ni6)); - ni6.rip6_dest = ifa->ifa_raddr; + ni6.rip6_dest = ifac->ifac_raddr; ni6.rip6_plen = 128; applyplen(&ni6.rip6_dest, ni6.rip6_plen); /*to be sure*/ trace(1, "\tfind p2p route %s/%d on %d\n", inet6_n2p(&ni6.rip6_dest), ni6.rip6_plen, ifcp->ifc_index); - if ((rrt = rtsearch(&ni6, NULL)) != NULL) { + if ((rrt = rtsearch(&ni6)) != NULL) { if (rrt->rrt_index == ifcp->ifc_index && - IN6_ARE_ADDR_EQUAL(&rrt->rrt_gw, &ifa->ifa_addr)) { + IN6_ARE_ADDR_EQUAL(&rrt->rrt_gw, + &ifac->ifac_addr)) { trace(1, "\troute found, age it\n"); if (rrt->rrt_t == 0 || rrt->rrt_t > t_lifetime) { rrt->rrt_t = t_lifetime; @@ -2058,7 +2051,9 @@ rt_deladdr(ifcp, sifa, smask) } else trace(1, "\tno p2p route found\n"); } - return updated ? 0 : -1; + free(ifac); + + return ((updated) ? 0 : -1); } /* @@ -2066,12 +2061,10 @@ rt_deladdr(ifcp, sifa, smask) * list. */ int -ifrt(ifcp, again) - struct ifc *ifcp; - int again; +ifrt(struct ifc *ifcp, int again) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 15:46:15 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB634918; Sun, 18 Nov 2012 15:46:15 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 334E38FC17; Sun, 18 Nov 2012 15:46:15 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.5/8.14.5) with ESMTP id qAIFkDth089018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 18 Nov 2012 16:46:13 +0100 (CET) (envelope-from uqs@FreeBSD.org) Date: Sun, 18 Nov 2012 16:46:10 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Eitan Adler Subject: Re: svn commit: r243130 - head/etc/root Message-ID: <20121118154610.GC28199@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201211160425.qAG4PZ8I016575@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201211160425.qAG4PZ8I016575@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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 15:46:15 -0000 On Fri, 2012-11-16 at 04:25:35 +0000, Eitan Adler wrote: > Author: eadler > Date: Fri Nov 16 04:25:35 2012 > New Revision: 243130 > URL: http://svnweb.freebsd.org/changeset/base/243130 > > Log: > dot.login is supposed to be for bourne shell, not csh > > Pointyhat to: me > Approved by: cperciva (implicit) > > Modified: > head/etc/root/dot.login > > Modified: head/etc/root/dot.login > ============================================================================== > --- head/etc/root/dot.login Fri Nov 16 03:33:34 2012 (r243129) > +++ head/etc/root/dot.login Fri Nov 16 04:25:35 2012 (r243130) > @@ -6,4 +6,4 @@ > # > > # Uncomment to display a random cookie each login: > -# if ( -x /usr/games/fortune ) /usr/games/fortune -s > +# [ -x /usr/games/fortune ] && /usr/games/fortune -s Please add || true to that line, so that when it is enabled and /usr/games/fortune doesn't exist or is not executable, the shell startup doesn't return with $? set to something non-zero. This is especially annoying if you have $? somewhere in your prompt. Thanks Uli From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 15:48:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8333BCC2; Sun, 18 Nov 2012 15:48:03 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 693FF8FC08; Sun, 18 Nov 2012 15:48:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIFm3Mm056750; Sun, 18 Nov 2012 15:48:03 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIFm35I056747; Sun, 18 Nov 2012 15:48:03 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211181548.qAIFm35I056747@svn.freebsd.org> From: Hiroki Sato Date: Sun, 18 Nov 2012 15:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243233 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 15:48:03 -0000 Author: hrs Date: Sun Nov 18 15:48:02 2012 New Revision: 243233 URL: http://svnweb.freebsd.org/changeset/base/243233 Log: - Increase the number of retry for NET_RT_DUMP from 5 to 15. - Use 2001:db8:: as an example instead of deprecated 3ffe:: address block. - Add check for connected routes. - Add support of RTM_IFANNOUNCE for dyanmically-added/removed interfaces. - Add support of *, ?, and [ in the interface list. - Add -P number to specify route flag which will never expire. - Add -Q number to specify route flag which route6d will add to routes via RIP. - Add -p pidfile to specify the process ID file. Modified: head/usr.sbin/route6d/route6d.8 head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.8 ============================================================================== --- head/usr.sbin/route6d/route6d.8 Sun Nov 18 15:37:27 2012 (r243232) +++ head/usr.sbin/route6d/route6d.8 Sun Nov 18 15:48:02 2012 (r243233) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 1997 +.Dd November 18, 2012 .Dt ROUTE6D 8 .Os .Sh NAME @@ -41,6 +41,15 @@ .Op Fl O Ar prefix/preflen,if1[,if2...\&] .Ek .Bk -words +.Op Fl P Ar number +.Ek +.Bk -words +.Op Fl p Ar pidfile +.Ek +.Bk -words +.Op Fl Q Ar number +.Ek +.Bk -words .Op Fl T Ar if1[,if2...\&] .Ek .Bk -words @@ -80,6 +89,12 @@ and advertises the aggregated route .Ar prefix/preflen , to the interfaces specified in the comma-separated interface list, .Ar if1[,if2...] . +The characters +.Qq Li * , +.Qq Li \&? , +and +.Qq Li [ +in the interface list will be interpreted as shell-style pattern. The .Nm utility creates a static route to @@ -143,7 +158,7 @@ option. For example, with .Do .Fl L -.Li 3ffe::/16,if1 +.Li 2001:db8::/16,if1 .Fl L .Li ::/0,if1 .Dc @@ -164,6 +179,33 @@ With this option .Nm will only advertise routes that matches .Ar prefix/preflen . +.It Fl P Ar number +Specifies routes to be ignored in calculation of expiration timer. +The +.Ar number +must be +.Li 1 , +.Li 2 , +or +.Li 3 +and it means route flags of +.Li RTF_PROTO1 , +.Li RTF_PROTO2 , +or +.Li RTF_PROTO3 . +When +.Li 1 +is specified, routes with +.Li RTF_PROTO1 +will never expire. +.It Fl p Ar pidfile +Specifies an alternative file in which to store the process ID. +The default is +.Pa /var/run/route6d.pid . +.It Fl Q Ar number +Specifies flag which will be used for routes added by RIP protocol. +The default is +.Li 2 Pq Li RTF_PROTO2 . .\" .It Fl q Makes Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Sun Nov 18 15:37:27 2012 (r243232) +++ head/usr.sbin/route6d/route6d.c Sun Nov 18 15:48:02 2012 (r243233) @@ -38,6 +38,7 @@ static const char _rcsid[] = "$KAME: rou #include #include +#include #include #include #include @@ -78,6 +79,7 @@ static const char _rcsid[] = "$KAME: rou #include "route6d.h" #define MAXFILTER 40 +#define RT_DUMP_MAXRETRY 15 #ifdef DEBUG #define INIT_INTERVAL6 6 @@ -172,6 +174,8 @@ int nflag = 0; /* don't update kernel ro int aflag = 0; /* age out even the statically defined routes */ int hflag = 0; /* don't split horizon */ int lflag = 0; /* exchange site local routes */ +int Pflag = 0; /* don't age out routes with RTF_PROTO[123] */ +int Qflag = RTF_PROTO2; /* set RTF_PROTO[123] flag to routes by RIPng */ int sflag = 0; /* announce static routes w/ split horizon */ int Sflag = 0; /* announce static routes to every interface */ unsigned long routetag = 0; /* route tag attached on originating case */ @@ -231,6 +235,7 @@ void applyplen(struct in6_addr *, int); void ifrtdump(int); void ifdump(int); void ifdump0(FILE *, const struct ifc *); +void ifremove(int); void rtdump(int); void rt_entry(struct rt_msghdr *, int); void rtdexit(void); @@ -279,9 +284,11 @@ main(int argc, char *argv[]) { int ch; int error = 0; + unsigned long proto; struct ifc *ifcp; sigset_t mask, omask; - FILE *pidfile; + const char *pidfile = ROUTE6D_PID; + FILE *pidfh; char *progname; char *ep; @@ -292,7 +299,7 @@ main(int argc, char *argv[]) progname = *argv; pid = getpid(); - while ((ch = getopt(argc, argv, "A:N:O:R:T:L:t:adDhlnqsS")) != -1) { + while ((ch = getopt(argc, argv, "A:N:O:R:T:L:t:adDhlnp:P:Q:qsS")) != -1) { switch (ch) { case 'A': case 'N': @@ -314,6 +321,41 @@ main(int argc, char *argv[]) /*NOTREACHED*/ } break; + case 'p': + pidfile = optarg; + break; + case 'P': + ep = NULL; + proto = strtoul(optarg, &ep, 0); + if (!ep || *ep != '\0' || 3 < proto) { + fatal("invalid P flag"); + /*NOTREACHED*/ + } + if (proto == 0) + Pflag = 0; + if (proto == 1) + Pflag |= RTF_PROTO1; + if (proto == 2) + Pflag |= RTF_PROTO2; + if (proto == 3) + Pflag |= RTF_PROTO3; + break; + case 'Q': + ep = NULL; + proto = strtoul(optarg, &ep, 0); + if (!ep || *ep != '\0' || 3 < proto) { + fatal("invalid Q flag"); + /*NOTREACHED*/ + } + if (proto == 0) + Qflag = 0; + if (proto == 1) + Qflag |= RTF_PROTO1; + if (proto == 2) + Qflag |= RTF_PROTO2; + if (proto == 3) + Qflag |= RTF_PROTO3; + break; case 'R': if ((rtlog = fopen(optarg, "w")) == NULL) { fatal("Can not write to routelog"); @@ -390,9 +432,9 @@ main(int argc, char *argv[]) ifrtdump(0); pid = getpid(); - if ((pidfile = fopen(ROUTE6D_PID, "w")) != NULL) { - fprintf(pidfile, "%d\n", pid); - fclose(pidfile); + if ((pidfh = fopen(pidfile, "w")) != NULL) { + fprintf(pidfh, "%d\n", pid); + fclose(pidfh); } if ((ripbuf = (struct rip6 *)malloc(RIP6_MAXMTU)) == NULL) { @@ -1617,6 +1659,30 @@ ifconfig1(const char *name, return 0; } +void +ifremove(int ifindex) +{ + struct ifc *ifcp; + struct riprt *rrt; + + TAILQ_FOREACH(ifcp, &ifc_head, ifc_next) { + if (ifcp->ifc_index == ifindex) + break; + } + if (ifcp == NULL) + return; + + tracet(1, "ifremove: %s is departed.\n", ifcp->ifc_name); + TAILQ_REMOVE(&ifc_head, ifcp, ifc_next); + + TAILQ_FOREACH(rrt, &riprt_head, rrt_next) { + if (rrt->rrt_index == ifcp->ifc_index && + rrt->rrt_rflags & RRTF_AGGREGATE) + delroute(&rrt->rrt_info, &rrt->rrt_gw); + } + free(ifcp); +} + /* * Receive and process routing messages. * Update interface information as necesssary. @@ -1629,6 +1695,7 @@ rtrecv(void) struct rt_msghdr *rtm; struct ifa_msghdr *ifam; struct if_msghdr *ifm; + struct if_announcemsghdr *ifan; int len; struct ifc *ifcp, *ic; int iface = 0, rtable = 0; @@ -1684,6 +1751,18 @@ rtrecv(void) addrs = ifm->ifm_addrs; q = (char *)(ifm + 1); break; + case RTM_IFANNOUNCE: + ifan = (struct if_announcemsghdr *)p; + switch (ifan->ifan_what) { + case IFAN_ARRIVAL: + iface++; + break; + case IFAN_DEPARTURE: + ifremove(ifan->ifan_index); + iface++; + break; + } + break; default: rtm = (struct rt_msghdr *)p; addrs = rtm->rtm_addrs; @@ -2560,7 +2639,7 @@ krtread(int again) errmsg = "sysctl NET_RT_DUMP"; continue; } - } while (retry < 5 && errmsg != NULL); + } while (retry < RT_DUMP_MAXRETRY && errmsg != NULL); if (errmsg) { fatal("%s (with %d retries, msize=%lu)", errmsg, retry, (u_long)msize); @@ -2600,6 +2679,9 @@ rt_entry(struct rt_msghdr *rtm, int agai if (rtm->rtm_flags & RTF_CLONED) return; #endif + /* XXX: Ignore connected routes. */ + if (!(rtm->rtm_flags & (RTF_GATEWAY|RTF_HOST|RTF_STATIC))) + return; /* * do not look at dynamic routes. * netbsd/openbsd cloned routes have UGHD. @@ -2649,6 +2731,8 @@ rt_entry(struct rt_msghdr *rtm, int agai rrt->rrt_t = time(NULL); if (aflag == 0 && (rtm->rtm_flags & RTF_STATIC)) rrt->rrt_t = 0; /* Don't age static routes */ + if (rtm->rtm_flags & Pflag) + rrt->rrt_t = 0; /* Don't age PROTO[123] routes */ if ((rtm->rtm_flags & (RTF_HOST|RTF_GATEWAY)) == RTF_HOST) rrt->rrt_t = 0; /* Don't age non-gateway host routes */ np->rip6_tag = 0; @@ -2763,6 +2847,7 @@ addroute(struct riprt *rrt, rtm->rtm_seq = ++seq; rtm->rtm_pid = pid; rtm->rtm_flags = rrt->rrt_flags; + rtm->rtm_flags |= Qflag; rtm->rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK; rtm->rtm_rmx.rmx_hopcount = np->rip6_metric - 1; rtm->rtm_inits = RTV_HOPCOUNT; @@ -2828,6 +2913,7 @@ delroute(struct netinfo6 *np, struct in6 rtm->rtm_seq = ++seq; rtm->rtm_pid = pid; rtm->rtm_flags = RTF_UP | RTF_GATEWAY; + rtm->rtm_flags |= Qflag; if (np->rip6_plen == sizeof(struct in6_addr) * 8) rtm->rtm_flags |= RTF_HOST; rtm->rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK; @@ -3133,7 +3219,7 @@ ifonly: *iflp++ = '\0'; TAILQ_FOREACH(ifcp, &ifc_head, ifc_next) { - if (strcmp(ifname, ifcp->ifc_name) != 0) + if (fnmatch(ifname, ifcp->ifc_name, 0) != 0) continue; iffp = malloc(sizeof(*iffp)); @@ -3142,6 +3228,9 @@ ifonly: /*NOTREACHED*/ } memcpy(iffp, &iff, sizeof(*iffp)); +#if 0 + syslog(LOG_INFO, "Add filter: type %d, ifname %s.", iffp->iff_type, ifname); +#endif TAILQ_INSERT_HEAD(&ifcp->ifc_iff_head, iffp, iff_next); } } From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 15:48:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9863E37; Sun, 18 Nov 2012 15:48:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDDD18FC08; Sun, 18 Nov 2012 15:48:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIFmYUL056862; Sun, 18 Nov 2012 15:48:34 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIFmYKS056861; Sun, 18 Nov 2012 15:48:34 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211181548.qAIFmYKS056861@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 18 Nov 2012 15:48:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243234 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 15:48:35 -0000 Author: mjg Date: Sun Nov 18 15:48:34 2012 New Revision: 243234 URL: http://svnweb.freebsd.org/changeset/base/243234 Log: Fix possible fp reference leak in posix_openpt Reviewed by: ed Approved by: trasz (mentor) MFC after: 3 days Modified: head/sys/kern/tty_pts.c Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Sun Nov 18 15:48:02 2012 (r243233) +++ head/sys/kern/tty_pts.c Sun Nov 18 15:48:34 2012 (r243234) @@ -836,6 +836,7 @@ sys_posix_openpt(struct thread *td, stru error = pts_alloc(FFLAGS(uap->flags & O_ACCMODE), td, fp); if (error != 0) { fdclose(td->td_proc->p_fd, fp, fd, td); + fdrop(fp, td); return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 16:06:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 056FD253; Sun, 18 Nov 2012 16:06:52 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D734F8FC13; Sun, 18 Nov 2012 16:06:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIG6pw2060152; Sun, 18 Nov 2012 16:06:51 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIG6pWO060151; Sun, 18 Nov 2012 16:06:51 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211181606.qAIG6pWO060151@svn.freebsd.org> From: Hiroki Sato Date: Sun, 18 Nov 2012 16:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243235 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 16:06:52 -0000 Author: hrs Date: Sun Nov 18 16:06:51 2012 New Revision: 243235 URL: http://svnweb.freebsd.org/changeset/base/243235 Log: Check if an extracted zoneid is equal to the non-zero sin6_scope_id only when it is link-local or MC interface-local. Modified: head/sys/netinet6/scope6.c Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Sun Nov 18 15:48:34 2012 (r243234) +++ head/sys/netinet6/scope6.c Sun Nov 18 16:06:51 2012 (r243235) @@ -369,12 +369,6 @@ sa6_recoverscope(struct sockaddr_in6 *si char ip6buf[INET6_ADDRSTRLEN]; u_int32_t zoneid; - if (sin6->sin6_scope_id != 0) { - log(LOG_NOTICE, - "sa6_recoverscope: assumption failure (non 0 ID): %s%%%d\n", - ip6_sprintf(ip6buf, &sin6->sin6_addr), sin6->sin6_scope_id); - /* XXX: proceed anyway... */ - } if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr) || IN6_IS_ADDR_MC_INTFACELOCAL(&sin6->sin6_addr)) { /* @@ -387,6 +381,14 @@ sa6_recoverscope(struct sockaddr_in6 *si return (ENXIO); if (!ifnet_byindex(zoneid)) return (ENXIO); + if (sin6->sin6_scope_id != 0 && + zoneid != sin6->sin6_scope_id) { + log(LOG_NOTICE, + "%s: embedded scope mismatch: %s%%%d. " + "sin6_scope_id was overridden.", __func__, + ip6_sprintf(ip6buf, &sin6->sin6_addr), + sin6->sin6_scope_id); + } sin6->sin6_addr.s6_addr16[1] = 0; sin6->sin6_scope_id = zoneid; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 16:07:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4865C3CB; Sun, 18 Nov 2012 16:07:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 23CA98FC08; Sun, 18 Nov 2012 16:07:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIG7sY9060393; Sun, 18 Nov 2012 16:07:54 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIG7rKK060389; Sun, 18 Nov 2012 16:07:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211181607.qAIG7rKK060389@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2012 16:07:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243236 - stable/9/sys/boot/uboot/lib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 16:07:54 -0000 Author: ae Date: Sun Nov 18 16:07:53 2012 New Revision: 243236 URL: http://svnweb.freebsd.org/changeset/base/243236 Log: MFC r234860 (by kientzle): Teach ubldr(8) about simple MBR partitioning. Modified: stable/9/sys/boot/uboot/lib/devicename.c stable/9/sys/boot/uboot/lib/disk.c stable/9/sys/boot/uboot/lib/libuboot.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/uboot/lib/devicename.c ============================================================================== --- stable/9/sys/boot/uboot/lib/devicename.c Sun Nov 18 16:06:51 2012 (r243235) +++ stable/9/sys/boot/uboot/lib/devicename.c Sun Nov 18 16:07:53 2012 (r243236) @@ -131,6 +131,10 @@ uboot_parsedev(struct uboot_devdesc **de *(cp + 1) != ':') { pnum = strtol(cp + 1, &cp, 10); ptype = PTYPE_GPT; + } else if (*cp == 's' && *(cp + 1) && + *(cp + 1) != ':') { + pnum = strtol(cp + 1, &cp, 10); + ptype = PTYPE_MBR; } else { pnum = *cp - 'a'; ptype = PTYPE_BSDLABEL; @@ -218,6 +222,9 @@ uboot_fmtdev(void *vdev) else if (dev->d_kind.disk.ptype == PTYPE_GPT) cp += sprintf(cp, "p%i", dev->d_kind.disk.pnum); + else if (dev->d_kind.disk.ptype == PTYPE_MBR) + cp += sprintf(cp, "s%i", + dev->d_kind.disk.pnum); } strcat(cp, ":"); Modified: stable/9/sys/boot/uboot/lib/disk.c ============================================================================== --- stable/9/sys/boot/uboot/lib/disk.c Sun Nov 18 16:06:51 2012 (r243235) +++ stable/9/sys/boot/uboot/lib/disk.c Sun Nov 18 16:07:53 2012 (r243236) @@ -398,6 +398,94 @@ out: } static int +stor_open_mbr(struct open_dev *od, struct uboot_devdesc *dev) +{ + char *buf = NULL; + struct dos_partition *dp; + int err, i, part; + + od->od_nparts = 0; + od->od_partitions = NULL; + + /* Block size must be at least 512 bytes. */ + if (od->od_bsize < 512) + return (ENXIO); + + /* Read MBR */ + buf = malloc(od->od_bsize); + if (!buf) { + stor_printf("could not allocate memory for MBR\n"); + return (ENOMEM); + } + err = stor_readdev(dev, 0, 1, buf); + if (err) { + stor_printf("MBR read error=%d\n", err); + err = EIO; + goto out; + } + + /* Check the slice table magic. */ + if (le16toh(*((uint16_t *)(buf + DOSMAGICOFFSET))) != DOSMAGIC) { + err = ENXIO; + goto out; + } + + /* Save information about partitions. */ + dp = (struct dos_partition *)(buf + DOSPARTOFF); + od->od_partitions = calloc(NDOSPART, sizeof(struct gpt_part)); + if (!od->od_partitions) { + stor_printf("could not allocate memory for MBR partitions\n"); + err = ENOMEM; + goto out; + } + + part = 0; + for (i = 0; i < NDOSPART; i++) { + u_int32_t start = le32dec(&dp[i].dp_start); + u_int32_t size = le32dec(&dp[i].dp_size); + uuid_t *u = NULL; + + /* Map MBR partition types to GPT partition types. */ + switch (dp[i].dp_typ) { + case DOSPTYP_386BSD: + u = &freebsd_ufs; + break; + /* XXX Other types XXX */ + } + + if (u) { + od->od_partitions[part].gp_type = *u; + od->od_partitions[part].gp_index = i + 1; + od->od_partitions[part].gp_start = start; + od->od_partitions[part].gp_end = start + size; + part += 1; + } + } + od->od_nparts = part; + + if (od->od_nparts == 0) { + err = EINVAL; + goto out; + } + + dev->d_disk.ptype = PTYPE_MBR; + + /* XXX Be smarter here? XXX */ + if (dev->d_disk.pnum == 0) + dev->d_disk.pnum = od->od_partitions[0].gp_index; + + for (i = 0; i < od->od_nparts; i++) + if (od->od_partitions[i].gp_index == dev->d_disk.pnum) + od->od_bstart = od->od_partitions[i].gp_start; + +out: + if (err && od->od_partitions) + free(od->od_partitions); + free(buf); + return (err); +} + +static int stor_open_bsdlabel(struct open_dev *od, struct uboot_devdesc *dev) { char *buf; @@ -443,7 +531,7 @@ stor_readdev(struct uboot_devdesc *dev, lbasize_t real_size; int err, handle; - debugf("reading size=%d @ 0x%08x\n", size, (uint32_t)buf); + debugf("reading blk=%d size=%d @ 0x%08x\n", (int)blk, size, (uint32_t)buf); handle = stor_info[dev->d_unit]; err = ub_dev_read(handle, buf, size, blk, &real_size); @@ -495,7 +583,10 @@ stor_opendev(struct open_dev **odp, stru od->od_bsize = di->di_stor.block_size; od->od_bstart = 0; - if ((err = stor_open_gpt(od, dev)) != 0) + err = stor_open_gpt(od, dev); + if (err != 0) + err = stor_open_mbr(od, dev); + if (err != 0) err = stor_open_bsdlabel(od, dev); if (err != 0) @@ -517,6 +608,8 @@ stor_closedev(struct uboot_devdesc *dev) od = (struct open_dev *)dev->d_disk.data; if (dev->d_disk.ptype == PTYPE_GPT && od->od_nparts != 0) free(od->od_partitions); + if (dev->d_disk.ptype == PTYPE_MBR && od->od_nparts != 0) + free(od->od_partitions); free(od); dev->d_disk.data = NULL; Modified: stable/9/sys/boot/uboot/lib/libuboot.h ============================================================================== --- stable/9/sys/boot/uboot/lib/libuboot.h Sun Nov 18 16:06:51 2012 (r243235) +++ stable/9/sys/boot/uboot/lib/libuboot.h Sun Nov 18 16:07:53 2012 (r243236) @@ -45,6 +45,7 @@ struct uboot_devdesc #define PTYPE_BSDLABEL 1 #define PTYPE_GPT 2 +#define PTYPE_MBR 3 /* * Default network packet alignment in memory From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 16:13:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B330671; Sun, 18 Nov 2012 16:13:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E447A8FC1C; Sun, 18 Nov 2012 16:13:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIGDatH061694; Sun, 18 Nov 2012 16:13:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIGDaEu061683; Sun, 18 Nov 2012 16:13:36 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211181613.qAIGDaEu061683@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2012 16:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243237 - in stable/9/sys: geom/part sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 16:13:37 -0000 Author: ae Date: Sun Nov 18 16:13:36 2012 New Revision: 243237 URL: http://svnweb.freebsd.org/changeset/base/243237 Log: MFC r236023 (by marcel): Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes. The gpart alias for these partition types is "freebsd-nandfs". Modified: stable/9/sys/geom/part/g_part.c stable/9/sys/geom/part/g_part.h stable/9/sys/geom/part/g_part_apm.c stable/9/sys/geom/part/g_part_bsd.c stable/9/sys/geom/part/g_part_gpt.c stable/9/sys/geom/part/g_part_vtoc8.c stable/9/sys/sys/apm.h stable/9/sys/sys/disklabel.h stable/9/sys/sys/gpt.h stable/9/sys/sys/vtoc.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part.c Sun Nov 18 16:13:36 2012 (r243237) @@ -83,6 +83,7 @@ struct g_part_alias_list { { "fat32", G_PART_ALIAS_MS_FAT32 }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, + { "freebsd-nandfs", G_PART_ALIAS_FREEBSD_NANDFS }, { "freebsd-swap", G_PART_ALIAS_FREEBSD_SWAP }, { "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS }, { "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM }, Modified: stable/9/sys/geom/part/g_part.h ============================================================================== --- stable/9/sys/geom/part/g_part.h Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part.h Sun Nov 18 16:13:36 2012 (r243237) @@ -46,6 +46,7 @@ enum g_part_alias { G_PART_ALIAS_EFI, /* A EFI system partition entry. */ G_PART_ALIAS_FREEBSD, /* A BSD labeled partition entry. */ G_PART_ALIAS_FREEBSD_BOOT, /* A FreeBSD boot partition entry. */ + G_PART_ALIAS_FREEBSD_NANDFS, /* A FreeBSD nandfs partition entry. */ G_PART_ALIAS_FREEBSD_SWAP, /* A swap partition entry. */ G_PART_ALIAS_FREEBSD_UFS, /* A UFS/UFS2 file system entry. */ G_PART_ALIAS_FREEBSD_VINUM, /* A Vinum partition entry. */ Modified: stable/9/sys/geom/part/g_part_apm.c ============================================================================== --- stable/9/sys/geom/part/g_part_apm.c Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part_apm.c Sun Nov 18 16:13:36 2012 (r243237) @@ -159,6 +159,11 @@ apm_parse_type(const char *type, char *b strcpy(buf, APM_ENT_TYPE_FREEBSD); return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + strcpy(buf, APM_ENT_TYPE_FREEBSD_NANDFS); + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { strcpy(buf, APM_ENT_TYPE_FREEBSD_SWAP); @@ -485,6 +490,8 @@ g_part_apm_type(struct g_part_table *bas return (g_part_alias_name(G_PART_ALIAS_APPLE_UFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); + if (!strcmp(type, APM_ENT_TYPE_FREEBSD_NANDFS)) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_SWAP)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_UFS)) Modified: stable/9/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/9/sys/geom/part/g_part_bsd.c Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part_bsd.c Sun Nov 18 16:13:36 2012 (r243237) @@ -126,6 +126,11 @@ bsd_parse_type(const char *type, uint8_t *fstype = (u_int)lt; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + *fstype = FS_NANDFS; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { *fstype = FS_SWAP; @@ -457,6 +462,8 @@ g_part_bsd_type(struct g_part_table *bas entry = (struct g_part_bsd_entry *)baseentry; type = entry->part.p_fstype; + if (type == FS_NANDFS) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (type == FS_SWAP) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (type == FS_BSDFFS) Modified: stable/9/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/9/sys/geom/part/g_part_gpt.c Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part_gpt.c Sun Nov 18 16:13:36 2012 (r243237) @@ -155,6 +155,7 @@ static struct uuid gpt_uuid_bios_boot = static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI; static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static struct uuid gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; +static struct uuid gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; static struct uuid gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; @@ -195,6 +196,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_efi, G_PART_ALIAS_EFI, 0xee }, { &gpt_uuid_freebsd, G_PART_ALIAS_FREEBSD, 0xa5 }, { &gpt_uuid_freebsd_boot, G_PART_ALIAS_FREEBSD_BOOT, 0 }, + { &gpt_uuid_freebsd_nandfs, G_PART_ALIAS_FREEBSD_NANDFS, 0 }, { &gpt_uuid_freebsd_swap, G_PART_ALIAS_FREEBSD_SWAP, 0 }, { &gpt_uuid_freebsd_ufs, G_PART_ALIAS_FREEBSD_UFS, 0 }, { &gpt_uuid_freebsd_vinum, G_PART_ALIAS_FREEBSD_VINUM, 0 }, Modified: stable/9/sys/geom/part/g_part_vtoc8.c ============================================================================== --- stable/9/sys/geom/part/g_part_vtoc8.c Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part_vtoc8.c Sun Nov 18 16:13:36 2012 (r243237) @@ -114,6 +114,11 @@ vtoc8_parse_type(const char *type, uint1 *tag = (uint16_t)lt; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + *tag = VTOC_TAG_FREEBSD_NANDFS; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { *tag = VTOC_TAG_FREEBSD_SWAP; @@ -487,6 +492,8 @@ g_part_vtoc8_type(struct g_part_table *b table = (struct g_part_vtoc8_table *)basetable; tag = be16dec(&table->vtoc.part[entry->gpe_index - 1].tag); + if (tag == VTOC_TAG_FREEBSD_NANDFS) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (tag == VTOC_TAG_FREEBSD_SWAP) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (tag == VTOC_TAG_FREEBSD_UFS) Modified: stable/9/sys/sys/apm.h ============================================================================== --- stable/9/sys/sys/apm.h Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/sys/apm.h Sun Nov 18 16:13:36 2012 (r243237) @@ -56,6 +56,7 @@ struct apm_ent { #define APM_ENT_TYPE_UNUSED "Apple_Free" #define APM_ENT_TYPE_FREEBSD "FreeBSD" +#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" #define APM_ENT_TYPE_FREEBSD_SWAP "FreeBSD-swap" #define APM_ENT_TYPE_FREEBSD_UFS "FreeBSD-UFS" #define APM_ENT_TYPE_FREEBSD_VINUM "FreeBSD-Vinum" Modified: stable/9/sys/sys/disklabel.h ============================================================================== --- stable/9/sys/sys/disklabel.h Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/sys/disklabel.h Sun Nov 18 16:13:36 2012 (r243237) @@ -232,6 +232,7 @@ static const char *dktypenames[] = { #define FS_UDF 24 /* UDF */ #define FS_EFS 26 /* SGI's Extent File system */ #define FS_ZFS 27 /* Sun's ZFS */ +#define FS_NANDFS 30 /* FreeBSD nandfs (NiLFS derived) */ #ifdef FSTYPENAMES static const char *fstypenames[] = { @@ -263,6 +264,9 @@ static const char *fstypenames[] = { "?", "EFS", "ZFS", + "?", + "?", + "nandfs", NULL }; #define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) Modified: stable/9/sys/sys/gpt.h ============================================================================== --- stable/9/sys/sys/gpt.h Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/sys/gpt.h Sun Nov 18 16:13:36 2012 (r243237) @@ -79,6 +79,10 @@ struct gpt_ent { {0x024dee41,0x33e7,0x11d3,0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}} #define GPT_ENT_TYPE_FREEBSD \ {0x516e7cb4,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_FREEBSD_BOOT \ + {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} +#define GPT_ENT_TYPE_FREEBSD_NANDFS \ + {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} #define GPT_ENT_TYPE_FREEBSD_SWAP \ {0x516e7cb5,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_UFS \ @@ -87,8 +91,6 @@ struct gpt_ent { {0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_ZFS \ {0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} -#define GPT_ENT_TYPE_FREEBSD_BOOT \ - {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} /* * The following are unused but documented here to avoid reuse. Modified: stable/9/sys/sys/vtoc.h ============================================================================== --- stable/9/sys/sys/vtoc.h Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/sys/vtoc.h Sun Nov 18 16:13:36 2012 (r243237) @@ -51,6 +51,7 @@ #define VTOC_TAG_FREEBSD_UFS 0x0902 #define VTOC_TAG_FREEBSD_VINUM 0x0903 #define VTOC_TAG_FREEBSD_ZFS 0x0904 +#define VTOC_TAG_FREEBSD_NANDFS 0x0905 #define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ #define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 16:33:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1722DBB5; Sun, 18 Nov 2012 16:33:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D6AB48FC12; Sun, 18 Nov 2012 16:33:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIGXpdN065216; Sun, 18 Nov 2012 16:33:51 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIGXpDm065213; Sun, 18 Nov 2012 16:33:51 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211181633.qAIGXpDm065213@svn.freebsd.org> From: Eitan Adler Date: Sun, 18 Nov 2012 16:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243238 - in head: usr.bin/pr usr.bin/seq usr.sbin/nfscbd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 16:33:52 -0000 Author: eadler Date: Sun Nov 18 16:33:51 2012 New Revision: 243238 URL: http://svnweb.freebsd.org/changeset/base/243238 Log: Standardize EXIT STATUS instructions in man pages when possible. Approved by: bcr (mentor) MFC after: 3 days Modified: head/usr.bin/pr/pr.1 head/usr.bin/seq/seq.1 head/usr.sbin/nfscbd/nfscbd.8 Modified: head/usr.bin/pr/pr.1 ============================================================================== --- head/usr.bin/pr/pr.1 Sun Nov 18 16:13:36 2012 (r243237) +++ head/usr.bin/pr/pr.1 Sun Nov 18 16:33:51 2012 (r243238) @@ -361,9 +361,7 @@ and require that both arguments, if present, not be separated from the option letter. .Sh EXIT STATUS -The -.Nm -utility exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh DIAGNOSTICS If .Nm Modified: head/usr.bin/seq/seq.1 ============================================================================== --- head/usr.bin/seq/seq.1 Sun Nov 18 16:13:36 2012 (r243237) +++ head/usr.bin/seq/seq.1 Sun Nov 18 16:33:51 2012 (r243238) @@ -127,10 +127,8 @@ If any sequence numbers will be printed the default conversion is changed to .Cm %e . .El -.Pp -The -.Nm -utility exits 0 on success and non-zero if an error occurs. +.Sh EXIT STATUS +.Ex -std .Sh EXAMPLES .Bd -literal -offset indent # seq 1 3 Modified: head/usr.sbin/nfscbd/nfscbd.8 ============================================================================== --- head/usr.sbin/nfscbd/nfscbd.8 Sun Nov 18 16:13:36 2012 (r243237) +++ head/usr.sbin/nfscbd/nfscbd.8 Sun Nov 18 16:33:51 2012 (r243238) @@ -77,10 +77,8 @@ has been specified. For more information on what callbacks and Open Delegations do, see .%T "Network File System (NFS) Version 4 Protocol" , RFC3530. -.Pp -The -.Nm -utility exits 0 on success or >0 if an error occurred. +.Sh EXIT STATUS +.Ex -std .Sh SEE ALSO .Xr nfsv4 4 , .Xr mount_nfs 8 From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 16:34:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24A9AD20; Sun, 18 Nov 2012 16:34:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E4EA28FC17; Sun, 18 Nov 2012 16:34:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIGY3u5065298; Sun, 18 Nov 2012 16:34:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIGY3Rp065296; Sun, 18 Nov 2012 16:34:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211181634.qAIGY3Rp065296@svn.freebsd.org> From: Eitan Adler Date: Sun, 18 Nov 2012 16:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243239 - head/usr.bin/find X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 16:34:04 -0000 Author: eadler Date: Sun Nov 18 16:34:03 2012 New Revision: 243239 URL: http://svnweb.freebsd.org/changeset/base/243239 Log: Make it clear that amin and friends take + and - options. PR: docs/173265 Submitted by: Anton Shterenlikht Approved by: bcr (mentor) MFC after: 3 days Modified: head/usr.bin/find/find.1 Modified: head/usr.bin/find/find.1 ============================================================================== --- head/usr.bin/find/find.1 Sun Nov 18 16:33:51 2012 (r243238) +++ head/usr.bin/find/find.1 Sun Nov 18 16:34:03 2012 (r243239) @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd September 9, 2012 +.Dd November 18, 2012 .Dt FIND 1 .Os .Sh NAME @@ -203,12 +203,19 @@ files with extended ACLs. See .Xr acl 3 for more information. -.It Ic -amin Ar n +.It Ic -amin Oo Cm - Ns | Ns Cm + Oc Ns Ar n True if the difference between the file last access time and the time .Nm was started, rounded up to the next full minute, is +more than .Ar n -minutes. +.Pq + Ns Ar n , +less than +.Ar n +.Pq - Ns Ar n , +or exactly +.Ar n +minutes ago. .It Ic -anewer Ar file Same as .Ic -neweram . @@ -250,13 +257,20 @@ Units are probably only useful when used or .Cm - modifier. -.It Ic -cmin Ar n +.It Ic -cmin Oo Cm - Ns | Ns Cm + Oc Ns Ar n True if the difference between the time of last change of file status information and the time .Nm was started, rounded up to the next full minute, is +more than .Ar n -minutes. +.Pq + Ns Ar n , +less than +.Ar n +.Pq - Ns Ar n , +or exactly +.Ar n +minutes ago. .It Ic -cnewer Ar file Same as .Ic -newercm . @@ -540,12 +554,18 @@ primary is specified, it applies to the not normally be evaluated. .Dq Ic -mindepth Li 1 processes all but the command line arguments. -.It Ic -mmin Ar n +.It Ic -mmin Oo Cm - Ns | Ns Cm + Oc Ns Ar n True if the difference between the file last modification time and the time .Nm was started, rounded up to the next full minute, is .Ar n -minutes. +.Pq + Ns Ar n , +less than +.Ar n +.Pq - Ns Ar n , +or exactly +.Ar n +minutes ago. .It Ic -mnewer Ar file Same as .Ic -newer . From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 16:34:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F16EAD24; Sun, 18 Nov 2012 16:34:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D768B8FC15; Sun, 18 Nov 2012 16:34:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIGY6wG065347; Sun, 18 Nov 2012 16:34:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIGY6nw065346; Sun, 18 Nov 2012 16:34:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211181634.qAIGY6nw065346@svn.freebsd.org> From: Eitan Adler Date: Sun, 18 Nov 2012 16:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243240 - head/usr.bin/mktemp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 16:34:07 -0000 Author: eadler Date: Sun Nov 18 16:34:06 2012 New Revision: 243240 URL: http://svnweb.freebsd.org/changeset/base/243240 Log: Use the macro for standard error return values. .Dd not bumped because there is no important content change. Approved by: bcr (mentor) MFC after: 3 days Obtained from: DragonflyBSD Modified: head/usr.bin/mktemp/mktemp.1 Modified: head/usr.bin/mktemp/mktemp.1 ============================================================================== --- head/usr.bin/mktemp/mktemp.1 Sun Nov 18 16:34:03 2012 (r243239) +++ head/usr.bin/mktemp/mktemp.1 Sun Nov 18 16:34:06 2012 (r243240) @@ -158,10 +158,7 @@ Use of this option is not encouraged. .El .Sh EXIT STATUS -The -.Nm -utility -exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh EXAMPLES The following .Xr sh 1 From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 16:34:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 598F4E1D; Sun, 18 Nov 2012 16:34:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE4438FC08; Sun, 18 Nov 2012 16:34:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIGY9nd065390; Sun, 18 Nov 2012 16:34:09 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIGY9ht065387; Sun, 18 Nov 2012 16:34:09 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211181634.qAIGY9ht065387@svn.freebsd.org> From: Eitan Adler Date: Sun, 18 Nov 2012 16:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243241 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 16:34:11 -0000 Author: eadler Date: Sun Nov 18 16:34:09 2012 New Revision: 243241 URL: http://svnweb.freebsd.org/changeset/base/243241 Log: Modernize parts of the ports.7 manual page. Approved by: bcr (mentor) MFC after: 3 days Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Sun Nov 18 16:34:06 2012 (r243240) +++ head/share/man/man7/ports.7 Sun Nov 18 16:34:09 2012 (r243241) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2012 +.Dd November 18, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -41,7 +41,7 @@ Each .Em port contains any patches necessary to make the original application source code compile and run on -.Bx . +.Fx . Compiling an application is as simple as typing .Nm make Cm build @@ -56,19 +56,6 @@ simply type .Nm make Cm install to install the application. .Pp -It is possible to download and use ports from the -.Fx -repository -that are newer than the installed system; however it is important to -install the appropriate -.Dq "Upgrade Kit" -from -.Pa http://www.FreeBSD.org/ports/ -first! -The -.Xr portcheckout 1 Pq Pa ports/ports-mgmt/portcheckout -script (also a port, of course!) will help to download new ports. -.Pp For more information about using ports, see .Dq "Packages and Ports" in From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 16:58:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9986F9A7; Sun, 18 Nov 2012 16:58:08 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7BA628FC08; Sun, 18 Nov 2012 16:58:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIGw8Tf069824; Sun, 18 Nov 2012 16:58:08 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIGw8bx069823; Sun, 18 Nov 2012 16:58:08 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201211181658.qAIGw8bx069823@svn.freebsd.org> From: Joel Dahl Date: Sun, 18 Nov 2012 16:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243242 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 16:58:08 -0000 Author: joel (doc committer) Date: Sun Nov 18 16:58:08 2012 New Revision: 243242 URL: http://svnweb.freebsd.org/changeset/base/243242 Log: Minor mdoc fix. Modified: head/usr.sbin/route6d/route6d.8 Modified: head/usr.sbin/route6d/route6d.8 ============================================================================== --- head/usr.sbin/route6d/route6d.8 Sun Nov 18 16:34:09 2012 (r243241) +++ head/usr.sbin/route6d/route6d.8 Sun Nov 18 16:58:08 2012 (r243242) @@ -93,7 +93,7 @@ The characters .Qq Li * , .Qq Li \&? , and -.Qq Li [ +.Qq Li \&[ in the interface list will be interpreted as shell-style pattern. The .Nm From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 17:09:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60589EAB; Sun, 18 Nov 2012 17:09:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4276E8FC08; Sun, 18 Nov 2012 17:09:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIH9Uld072344; Sun, 18 Nov 2012 17:09:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIH9UYN072337; Sun, 18 Nov 2012 17:09:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211181709.qAIH9UYN072337@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2012 17:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243243 - in stable/9/sys/boot: arm/uboot common i386/libi386 i386/loader i386/pmbr powerpc/uboot sparc64/loader uboot/common uboot/lib userboot userboot/test userboot/userboot zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 17:09:30 -0000 Author: ae Date: Sun Nov 18 17:09:29 2012 New Revision: 243243 URL: http://svnweb.freebsd.org/changeset/base/243243 Log: MFC 239054,239057,239058,239060,239066,239067,239068,239070,239073, 239087,239088,239127,239210,239211,239230,239231,239232,239243, 239292,239293,239294,239325,240272,240273,240274,240275,240276, 240277,240335,240481,241023,241047,241053,241065,241068,241069, 241070,241164,241809,241876 239054: Create the interface to work with various partition tables from the loader(8). The following partition tables are supported: BSD label, GPT, MBR, EBR and VTOC8. 239057: Remove unused variables. 239058: Introduce new API to work with disks from the loader's drivers. It uses new API from the part.c to work with partition tables. 239060: When GPT signature is invalid in the primary GPT header, then try to read backup GPT header. 239066: Add offset field to the i386_devdesc structure to be compatible with disk_devdesc structure. Update biosdisk driver to the new disk API. 239067: Remove unneeded flag. 239068: Teach the ZFS use new partitions API when probing. Note: now ZFS does probe only for partitions with type "freebsd-zfs" and "freebsd". 239070: Add simple test program that uses the partition tables handling code. It is useful to test and debug how boot loader handles partition tables metadata. 239073: Bump USERBOOT_VERSION. 239087: Add to the debug output the offset from the parent partitioning scheme. 239088: Fix start offset calculation for the EBR partitions. 239127: As it turned out, there are some installations, where BSD label contains partitions with type zero. And it has worked. So, allow detect these partitions. 239210: Add more debug messages. 239211: Add another debug message. 239230: Unbreak booting from the true dedicated disks. When we open the disk, check the type of partition table, that has been detected. If this is BSD label, then we assume this is DD mode. 239231: Remove colons from the debug message, device name returned by the disk_fmtdev() already has the colons. 239232: Restore the old behaviour. If requested partition is a BSD slice, but d_partition isn't explicitly set, then try to open BSD label and its first partition. 239243: After r239066, reinitialize v86.ctl and v86.addr for int 13 EDD probing in sys/boot/i386/libi386/biosdisk.c. Otherwise, when DISK_DEBUG is enabled, the DEBUG() macros will clobber those fields, and cause the probing to always fail mysteriously when debugging is enabled. 239292: Explicitly terminate the string after strncpy(3). 239293: Rework r239232 to unbreak ZFS detection on MBR slices. 239294: Some BIOSes return incorrect number of sectors, make checks less strictly, to do not lost some partitions. 239325: Add comment why the code has been disabled. 240272: Make struct uboot_devdesc compatible with struct disk_devdesc. 240273: Use disk_fmtdev() and disk_parsedev() functions from the new DISK API. 240274: Update uboot's disk driver to use new DISK API. 240275: Build disk.c only when DISK_SUPPORT is enabled. 240276: Update according to the change of struct uboot_devdesc. 240277: Handle LOADER_NO_DISK_SUPPORT knob in the arm and powerpc ubldr. 240335: Slightly reduce an overhead for the open() call in the zfsloader. libstand(3) tries to detect file system in the predefined order, but zfsloader usually is used for the booting from ZFS, and there is no need to try detect several file system types for each open() call. 240481: The MBR data is not necessarily aligned. This is a problem on ARM. 241023: Make the loader a bit smarter, when it tries to open disk and the slice number is not exactly specified. When the disk has MBR, also try to read BSD label after ptable_getpart() call. When the disk has GPT, also set d_partition to 255. Mostly, this is how it worked before. 241047: Disable splitfs support, since we aren't support floppies for a long time. This slightly reduces an overhead, when loader tries to open file that doesn't exist. 241053: Almost each time when loader opens a file, this leads to calling disk_open(). Very often this is called several times for one file. This leads to reading partition table metadata for each call. To reduce the number of disk I/O we have a simple block cache, but it is very dumb and more than half of I/O operations related to reading metadata, misses this cache. Introduce new cache layer to resolve this problem. It is independent and doesn't need initialization like bcache, and will work by default for all loaders which use the new DISK API. A successful disk_open() call to each new disk or partition produces new entry in the cache. Even more, when disk was already open, now opening of any nested partitions does not require reading top level partition table. So, if without this cache, partition table metadata was read around 20-50 times during boot, now it reads only once. This affects the booting from GPT and MBR from the UFS. 241065: Fix disk_cleanup() to work without DISK_DEBUG too. 241068: Reduce the number of attempts to detect proper kld format for the amd64 loader. 241069: Remember the file format of the last loaded module and try to use it for next files. 241070: Fix the style. 241164: Replace all references to loader_callbacks_v1 with loader_callbacks. 241809: Add the flags parameter to the disk_open() function and DISK_F_NOCACHE flag, that disables the caching of partition tables metadata. Use this flag for floppies in the libi386/biosdisk driver. 241876: When loader tries to open GPT partition, but partition table is not GPT, then try automatically detect an appropriate partition type. Added: stable/9/sys/boot/common/part.c - copied, changed from r239054, head/sys/boot/common/part.c stable/9/sys/boot/common/part.h - copied unchanged from r239054, head/sys/boot/common/part.h Modified: stable/9/sys/boot/arm/uboot/Makefile stable/9/sys/boot/common/Makefile.inc stable/9/sys/boot/common/disk.c stable/9/sys/boot/common/disk.h stable/9/sys/boot/common/module.c stable/9/sys/boot/i386/libi386/Makefile stable/9/sys/boot/i386/libi386/biosdisk.c stable/9/sys/boot/i386/libi386/devicename.c stable/9/sys/boot/i386/libi386/libi386.h stable/9/sys/boot/i386/loader/Makefile stable/9/sys/boot/i386/loader/conf.c stable/9/sys/boot/i386/loader/main.c stable/9/sys/boot/i386/pmbr/pmbr.s stable/9/sys/boot/powerpc/uboot/Makefile stable/9/sys/boot/sparc64/loader/main.c stable/9/sys/boot/uboot/common/main.c stable/9/sys/boot/uboot/lib/Makefile stable/9/sys/boot/uboot/lib/devicename.c stable/9/sys/boot/uboot/lib/disk.c stable/9/sys/boot/uboot/lib/libuboot.h stable/9/sys/boot/userboot/test/test.c stable/9/sys/boot/userboot/userboot.h stable/9/sys/boot/userboot/userboot/Makefile stable/9/sys/boot/userboot/userboot/bootinfo32.c stable/9/sys/boot/userboot/userboot/copy.c stable/9/sys/boot/userboot/userboot/devicename.c stable/9/sys/boot/userboot/userboot/libuserboot.h stable/9/sys/boot/userboot/userboot/main.c stable/9/sys/boot/userboot/userboot/userboot_disk.c stable/9/sys/boot/zfs/zfs.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/9/sys/boot/arm/uboot/Makefile Sun Nov 18 16:58:08 2012 (r243242) +++ stable/9/sys/boot/arm/uboot/Makefile Sun Nov 18 17:09:29 2012 (r243243) @@ -11,7 +11,11 @@ WARNS?= 1 # Architecture-specific loader code SRCS= start.S conf.c vers.c +.if !defined(LOADER_NO_DISK_SUPPORT) LOADER_DISK_SUPPORT?= yes +.else +LOADER_DISK_SUPPORT= no +.endif LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no Modified: stable/9/sys/boot/common/Makefile.inc ============================================================================== --- stable/9/sys/boot/common/Makefile.inc Sun Nov 18 16:58:08 2012 (r243242) +++ stable/9/sys/boot/common/Makefile.inc Sun Nov 18 17:09:29 2012 (r243243) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS+= boot.c commands.c console.c devopen.c disk.c interp.c +SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c SRCS+= module.c panic.c @@ -24,6 +24,18 @@ SRCS+= load_elf64.c reloc_elf64.c SRCS+= dev_net.c .endif +.if !defined(LOADER_NO_DISK_SUPPORT) +SRCS+= disk.c part.c +CFLAGS+= -DLOADER_DISK_SUPPORT +.if !defined(LOADER_NO_GPT_SUPPORT) +SRCS+= crc32.c +CFLAGS+= -DLOADER_GPT_SUPPORT +.endif +.if !defined(LOADER_NO_MBR_SUPPORT) +CFLAGS+= -DLOADER_MBR_SUPPORT +.endif +.endif + .if defined(HAVE_BCACHE) SRCS+= bcache.c .endif Modified: stable/9/sys/boot/common/disk.c ============================================================================== --- stable/9/sys/boot/common/disk.c Sun Nov 18 16:58:08 2012 (r243242) +++ stable/9/sys/boot/common/disk.c Sun Nov 18 17:09:29 2012 (r243243) @@ -1,5 +1,6 @@ /*- * Copyright (c) 1998 Michael Smith + * Copyright (c) 2012 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,26 +28,12 @@ #include __FBSDID("$FreeBSD$"); -/* - * MBR/GPT partitioned disk device handling. - * - * Ideas and algorithms from: - * - * - NetBSD libi386/biosdisk.c - * - FreeBSD biosboot/disk.c - * - */ - +#include +#include #include - -#include -#include -#include - #include -#include - #include +#include #include "disk.h" @@ -56,53 +43,118 @@ __FBSDID("$FreeBSD$"); # define DEBUG(fmt, args...) #endif -/* - * Search for a slice with the following preferences: - * - * 1: Active FreeBSD slice - * 2: Non-active FreeBSD slice - * 3: Active Linux slice - * 4: non-active Linux slice - * 5: Active FAT/FAT32 slice - * 6: non-active FAT/FAT32 slice - */ -#define PREF_RAWDISK 0 -#define PREF_FBSD_ACT 1 -#define PREF_FBSD 2 -#define PREF_LINUX_ACT 3 -#define PREF_LINUX 4 -#define PREF_DOS_ACT 5 -#define PREF_DOS 6 -#define PREF_NONE 7 +struct open_disk { + struct ptable *table; + off_t mediasize; + u_int sectorsize; + u_int flags; + int rcnt; +}; -#ifdef LOADER_GPT_SUPPORT +struct print_args { + struct disk_devdesc *dev; + const char *prefix; + int verbose; +}; -struct gpt_part { - int gp_index; - uuid_t gp_type; - uint64_t gp_start; - uint64_t gp_end; +struct dentry { + const struct devsw *d_dev; + int d_unit; + int d_slice; + int d_partition; + + struct open_disk *od; + off_t d_offset; + STAILQ_ENTRY(dentry) entry; +#ifdef DISK_DEBUG + uint32_t count; +#endif }; -static uuid_t efi = GPT_ENT_TYPE_EFI; -static uuid_t freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; -static uuid_t freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; -static uuid_t freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; -static uuid_t freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; -static uuid_t ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; +static STAILQ_HEAD(, dentry) opened_disks = + STAILQ_HEAD_INITIALIZER(opened_disks); +static int +disk_lookup(struct disk_devdesc *dev) +{ + struct dentry *entry; + int rc; + + rc = ENOENT; + STAILQ_FOREACH(entry, &opened_disks, entry) { + if (entry->d_dev != dev->d_dev || + entry->d_unit != dev->d_unit) + continue; + dev->d_opendata = entry->od; + if (entry->d_slice == dev->d_slice && + entry->d_partition == dev->d_partition) { + dev->d_offset = entry->d_offset; + DEBUG("%s offset %lld", disk_fmtdev(dev), + dev->d_offset); +#ifdef DISK_DEBUG + entry->count++; +#endif + return (0); + } + rc = EAGAIN; + } + return (rc); +} + +static void +disk_insert(struct disk_devdesc *dev) +{ + struct dentry *entry; + + entry = (struct dentry *)malloc(sizeof(struct dentry)); + if (entry == NULL) { + DEBUG("no memory"); + return; + } + entry->d_dev = dev->d_dev; + entry->d_unit = dev->d_unit; + entry->d_slice = dev->d_slice; + entry->d_partition = dev->d_partition; + entry->od = (struct open_disk *)dev->d_opendata; + entry->od->rcnt++; + entry->d_offset = dev->d_offset; +#ifdef DISK_DEBUG + entry->count = 1; #endif + STAILQ_INSERT_TAIL(&opened_disks, entry, entry); + DEBUG("%s cached", disk_fmtdev(dev)); +} + +#ifdef DISK_DEBUG +COMMAND_SET(dcachestat, "dcachestat", "get disk cache stats", + command_dcachestat); + +static int +command_dcachestat(int argc, char *argv[]) +{ + struct disk_devdesc dev; + struct dentry *entry; -#if defined(LOADER_GPT_SUPPORT) || defined(LOADER_MBR_SUPPORT) + STAILQ_FOREACH(entry, &opened_disks, entry) { + dev.d_dev = (struct devsw *)entry->d_dev; + dev.d_unit = entry->d_unit; + dev.d_slice = entry->d_slice; + dev.d_partition = entry->d_partition; + printf("%s %d => %p [%d]\n", disk_fmtdev(&dev), entry->count, + entry->od, entry->od->rcnt); + } + return (CMD_OK); +} +#endif /* DISK_DEBUG */ -/* Given a size in 512 byte sectors, convert it to a human-readable number. */ +/* Convert size to a human-readable number. */ static char * -display_size(uint64_t size) +display_size(uint64_t size, u_int sectorsize) { static char buf[80]; char unit; - size /= 2; + size = size * sectorsize / 1024; unit = 'K'; if (size >= 10485760000LL) { size /= 1073741824; @@ -114,687 +166,328 @@ display_size(uint64_t size) size /= 1024; unit = 'M'; } - sprintf(buf, "%.6ld%cB", (long)size, unit); + sprintf(buf, "%ld%cB", (long)size, unit); return (buf); } -#endif - -#ifdef LOADER_MBR_SUPPORT - -static void -disk_checkextended(struct disk_devdesc *dev, - struct dos_partition *slicetab, int slicenum, int *nslicesp) +static int +ptblread(void *d, void *buf, size_t blocks, off_t offset) { - uint8_t buf[DISK_SECSIZE]; - struct dos_partition *dp; - uint32_t base; - int rc, i, start, end; - - dp = &slicetab[slicenum]; - start = *nslicesp; - - if (dp->dp_size == 0) - goto done; - if (dp->dp_typ != DOSPTYP_EXT) - goto done; - rc = dev->d_dev->dv_strategy(dev, F_READ, dp->dp_start, DISK_SECSIZE, - (char *) buf, NULL); - if (rc) - goto done; - if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) { - DEBUG("no magic in extended table"); - goto done; - } - base = dp->dp_start; - dp = (struct dos_partition *) &buf[DOSPARTOFF]; - for (i = 0; i < NDOSPART; i++, dp++) { - if (dp->dp_size == 0) - continue; - if (*nslicesp == NEXTDOSPART) - goto done; - dp->dp_start += base; - bcopy(dp, &slicetab[*nslicesp], sizeof(*dp)); - (*nslicesp)++; - } - end = *nslicesp; + struct disk_devdesc *dev; + struct open_disk *od; - /* - * now, recursively check the slices we just added - */ - for (i = start; i < end; i++) - disk_checkextended(dev, slicetab, i, nslicesp); -done: - return; + dev = (struct disk_devdesc *)d; + od = (struct open_disk *)dev->d_opendata; + return (dev->d_dev->dv_strategy(dev, F_READ, offset, + blocks * od->sectorsize, (char *)buf, NULL)); } -static int -disk_readslicetab(struct disk_devdesc *dev, - struct dos_partition **slicetabp, int *nslicesp) +#define PWIDTH 35 +static void +ptable_print(void *arg, const char *pname, const struct ptable_entry *part) { - struct dos_partition *slicetab = NULL; - int nslices, i; - int rc; - uint8_t buf[DISK_SECSIZE]; - - /* - * Find the slice in the DOS slice table. - */ - rc = dev->d_dev->dv_strategy(dev, F_READ, 0, DISK_SECSIZE, - (char *) buf, NULL); - if (rc) { - DEBUG("error reading MBR"); - return (rc); - } + struct print_args *pa, bsd; + struct open_disk *od; + struct ptable *table; + char line[80]; - /* - * Check the slice table magic. - */ - if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) { - DEBUG("no slice table/MBR (no magic)"); - return (rc); + pa = (struct print_args *)arg; + od = (struct open_disk *)pa->dev->d_opendata; + sprintf(line, " %s%s: %s", pa->prefix, pname, + parttype2str(part->type)); + if (pa->verbose) + sprintf(line, "%-*s%s", PWIDTH, line, + display_size(part->end - part->start + 1, + od->sectorsize)); + strcat(line, "\n"); + pager_output(line); + if (part->type == PART_FREEBSD) { + /* Open slice with BSD label */ + pa->dev->d_offset = part->start; + table = ptable_open(pa->dev, part->end - part->start + 1, + od->sectorsize, ptblread); + if (table == NULL) + return; + sprintf(line, " %s%s", pa->prefix, pname); + bsd.dev = pa->dev; + bsd.prefix = line; + bsd.verbose = pa->verbose; + ptable_iterate(table, &bsd, ptable_print); + ptable_close(table); } - - /* - * copy the partition table, then pick up any extended partitions. - */ - slicetab = malloc(NEXTDOSPART * sizeof(struct dos_partition)); - bcopy(buf + DOSPARTOFF, slicetab, - sizeof(struct dos_partition) * NDOSPART); - nslices = NDOSPART; /* extended slices start here */ - for (i = 0; i < NDOSPART; i++) - disk_checkextended(dev, slicetab, i, &nslices); - - *slicetabp = slicetab; - *nslicesp = nslices; - return (0); } +#undef PWIDTH -/* - * Search for the best MBR slice (typically the first FreeBSD slice). - */ -static int -disk_bestslice(struct dos_partition *slicetab, int nslices) +void +disk_print(struct disk_devdesc *dev, char *prefix, int verbose) { - struct dos_partition *dp; - int pref, preflevel; - int i, prefslice; - - prefslice = 0; - preflevel = PREF_NONE; - - dp = &slicetab[0]; - for (i = 0; i < nslices; i++, dp++) { - switch (dp->dp_typ) { - case DOSPTYP_386BSD: /* FreeBSD */ - pref = dp->dp_flag & 0x80 ? PREF_FBSD_ACT : PREF_FBSD; - break; - - case DOSPTYP_LINUX: - pref = dp->dp_flag & 0x80 ? PREF_LINUX_ACT : PREF_LINUX; - break; - - case 0x01: /* DOS/Windows */ - case 0x04: - case 0x06: - case 0x0b: - case 0x0c: - case 0x0e: - pref = dp->dp_flag & 0x80 ? PREF_DOS_ACT : PREF_DOS; - break; + struct open_disk *od; + struct print_args pa; - default: - pref = PREF_NONE; - } - if (pref < preflevel) { - preflevel = pref; - prefslice = i + 1; - } - } - return (prefslice); + /* Disk should be opened */ + od = (struct open_disk *)dev->d_opendata; + pa.dev = dev; + pa.prefix = prefix; + pa.verbose = verbose; + ptable_iterate(od->table, &pa, ptable_print); } -static int -disk_openmbr(struct disk_devdesc *dev) +int +disk_open(struct disk_devdesc *dev, off_t mediasize, u_int sectorsize, + u_int flags) { - struct dos_partition *slicetab = NULL, *dptr; - int nslices, sector, slice; - int rc; - uint8_t buf[DISK_SECSIZE]; - struct disklabel *lp; - - /* - * Following calculations attempt to determine the correct value - * for dev->d_offset by looking for the slice and partition specified, - * or searching for reasonable defaults. - */ - rc = disk_readslicetab(dev, &slicetab, &nslices); - if (rc) - return (rc); + struct open_disk *od; + struct ptable *table; + struct ptable_entry part; + int rc, slice, partition; - /* - * if a slice number was supplied but not found, this is an error. - */ - if (dev->d_slice > 0) { - slice = dev->d_slice - 1; - if (slice >= nslices) { - DEBUG("slice %d not found", slice); - rc = EPART; - goto out; - } - } - - /* - * Check for the historically bogus MBR found on true dedicated disks - */ - if (slicetab[3].dp_typ == DOSPTYP_386BSD && - slicetab[3].dp_start == 0 && slicetab[3].dp_size == 50000) { - sector = 0; - goto unsliced; - } - - /* - * Try to auto-detect the best slice; this should always give - * a slice number - */ - if (dev->d_slice == 0) { - slice = disk_bestslice(slicetab, nslices); - if (slice == -1) { - rc = ENOENT; - goto out; - } - dev->d_slice = slice; + rc = 0; + if ((flags & DISK_F_NOCACHE) == 0) { + rc = disk_lookup(dev); + if (rc == 0) + return (0); } - - /* - * Accept the supplied slice number unequivocally (we may be looking - * at a DOS partition). - * Note: we number 1-4, offsets are 0-3 - */ - dptr = &slicetab[dev->d_slice - 1]; - sector = dptr->dp_start; - DEBUG("slice entry %d at %d, %d sectors", - dev->d_slice - 1, sector, dptr->dp_size); - -unsliced: /* - * Now we have the slice offset, look for the partition in the - * disklabel if we have a partition to start with. - * - * XXX we might want to check the label checksum. + * While we are reading disk metadata, make sure we do it relative + * to the start of the disk */ - if (dev->d_partition < 0) { - /* no partition, must be after the slice */ - DEBUG("opening raw slice"); - dev->d_offset = sector; - rc = 0; - goto out; - } - - rc = dev->d_dev->dv_strategy(dev, F_READ, sector + LABELSECTOR, - DISK_SECSIZE, (char *) buf, NULL); - if (rc) { - DEBUG("error reading disklabel"); - goto out; - } - - lp = (struct disklabel *) buf; - - if (lp->d_magic != DISKMAGIC) { - DEBUG("no disklabel"); - rc = ENOENT; - goto out; - } - if (dev->d_partition >= lp->d_npartitions) { - DEBUG("partition '%c' exceeds partitions in table (a-'%c')", - 'a' + dev->d_partition, - 'a' + lp->d_npartitions); - rc = EPART; + dev->d_offset = 0; + table = NULL; + slice = dev->d_slice; + partition = dev->d_partition; + if (rc == EAGAIN) { + /* + * This entire disk was already opened and there is no + * need to allocate new open_disk structure and open the + * main partition table. + */ + od = (struct open_disk *)dev->d_opendata; + DEBUG("%s unit %d, slice %d, partition %d => %p (cached)", + disk_fmtdev(dev), dev->d_unit, dev->d_slice, + dev->d_partition, od); + goto opened; + } else { + od = (struct open_disk *)malloc(sizeof(struct open_disk)); + if (od == NULL) { + DEBUG("no memory"); + return (ENOMEM); + } + dev->d_opendata = od; + od->rcnt = 0; + } + od->mediasize = mediasize; + od->sectorsize = sectorsize; + od->flags = flags; + DEBUG("%s unit %d, slice %d, partition %d => %p", + disk_fmtdev(dev), dev->d_unit, dev->d_slice, dev->d_partition, od); + + /* Determine disk layout. */ + od->table = ptable_open(dev, mediasize / sectorsize, sectorsize, + ptblread); + if (od->table == NULL) { + DEBUG("Can't read partition table"); + rc = ENXIO; goto out; } - - dev->d_offset = - lp->d_partitions[dev->d_partition].p_offset - - lp->d_partitions[RAW_PART].p_offset + - sector; +opened: rc = 0; - -out: - if (slicetab) - free(slicetab); - return (rc); -} - -/* - * Print out each valid partition in the disklabel of a FreeBSD slice. - * For size calculations, we assume a 512 byte sector size. - */ -static void -disk_printbsdslice(struct disk_devdesc *dev, daddr_t offset, - char *prefix, int verbose) -{ - char line[80]; - char buf[DISK_SECSIZE]; - struct disklabel *lp; - int i, rc, fstype; - - /* read disklabel */ - rc = dev->d_dev->dv_strategy(dev, F_READ, offset + LABELSECTOR, - DISK_SECSIZE, (char *) buf, NULL); - if (rc) - return; - lp =(struct disklabel *)(&buf[0]); - if (lp->d_magic != DISKMAGIC) { - sprintf(line, "%s: FFS bad disklabel\n", prefix); - pager_output(line); - return; - } - - /* Print partitions */ - for (i = 0; i < lp->d_npartitions; i++) { - /* - * For each partition, make sure we know what type of fs it - * is. If not, then skip it. - */ - fstype = lp->d_partitions[i].p_fstype; - if (fstype != FS_BSDFFS && - fstype != FS_SWAP && - fstype != FS_VINUM) - continue; - - /* Only print out statistics in verbose mode */ - if (verbose) - sprintf(line, " %s%c: %s %s (%d - %d)\n", - prefix, 'a' + i, - (fstype == FS_SWAP) ? "swap " : - (fstype == FS_VINUM) ? "vinum" : - "FFS ", - display_size(lp->d_partitions[i].p_size), - lp->d_partitions[i].p_offset, - (lp->d_partitions[i].p_offset - + lp->d_partitions[i].p_size)); + if (ptable_gettype(od->table) == PTABLE_BSD && + partition >= 0) { + /* It doesn't matter what value has d_slice */ + rc = ptable_getpart(od->table, &part, partition); + if (rc == 0) + dev->d_offset = part.start; + } else if (slice >= 0) { + /* Try to get information about partition */ + if (slice == 0) + rc = ptable_getbestpart(od->table, &part); else - sprintf(line, " %s%c: %s\n", prefix, 'a' + i, - (fstype == FS_SWAP) ? "swap" : - (fstype == FS_VINUM) ? "vinum" : - "FFS"); - pager_output(line); - } -} - -static void -disk_printslice(struct disk_devdesc *dev, int slice, - struct dos_partition *dp, char *prefix, int verbose) -{ - char stats[80]; - char line[80]; - - if (verbose) - sprintf(stats, " %s (%d - %d)", display_size(dp->dp_size), - dp->dp_start, dp->dp_start + dp->dp_size); - else - stats[0] = '\0'; - - switch (dp->dp_typ) { - case DOSPTYP_386BSD: - disk_printbsdslice(dev, (daddr_t)dp->dp_start, - prefix, verbose); - return; - case DOSPTYP_LINSWP: - sprintf(line, "%s: Linux swap%s\n", prefix, stats); - break; - case DOSPTYP_LINUX: + rc = ptable_getpart(od->table, &part, slice); + if (rc != 0) /* Partition doesn't exist */ + goto out; + dev->d_offset = part.start; + slice = part.index; + if (ptable_gettype(od->table) == PTABLE_GPT) { + partition = 255; + goto out; /* Nothing more to do */ + } else if (partition == 255) { + /* + * When we try to open GPT partition, but partition + * table isn't GPT, reset d_partition value to -1 + * and try to autodetect appropriate value. + */ + partition = -1; + } /* - * XXX - * read the superblock to confirm this is an ext2fs partition? + * If d_partition < 0 and we are looking at a BSD slice, + * then try to read BSD label, otherwise return the + * whole MBR slice. */ - sprintf(line, "%s: ext2fs%s\n", prefix, stats); - break; - case 0x00: /* unused partition */ - case DOSPTYP_EXT: - return; - case 0x01: - sprintf(line, "%s: FAT-12%s\n", prefix, stats); - break; - case 0x04: - case 0x06: - case 0x0e: - sprintf(line, "%s: FAT-16%s\n", prefix, stats); - break; - case 0x07: - sprintf(line, "%s: NTFS/HPFS%s\n", prefix, stats); - break; - case 0x0b: - case 0x0c: - sprintf(line, "%s: FAT-32%s\n", prefix, stats); - break; - default: - sprintf(line, "%s: Unknown fs: 0x%x %s\n", prefix, dp->dp_typ, - stats); - } - pager_output(line); -} - -static int -disk_printmbr(struct disk_devdesc *dev, char *prefix, int verbose) -{ - struct dos_partition *slicetab; - int nslices, i; - int rc; - char line[80]; - - rc = disk_readslicetab(dev, &slicetab, &nslices); - if (rc) - return (rc); - for (i = 0; i < nslices; i++) { - sprintf(line, "%ss%d", prefix, i + 1); - disk_printslice(dev, i, &slicetab[i], line, verbose); - } - free(slicetab); - return (0); -} - -#endif - -#ifdef LOADER_GPT_SUPPORT - -static int -disk_readgpt(struct disk_devdesc *dev, struct gpt_part **gptp, int *ngptp) -{ - struct dos_partition *dp; - struct gpt_hdr *hdr; - struct gpt_ent *ent; - struct gpt_part *gptab = NULL; - int entries_per_sec, rc, i, part; - daddr_t lba, elba; - uint8_t gpt[DISK_SECSIZE], tbl[DISK_SECSIZE]; - - /* - * Following calculations attempt to determine the correct value - * for dev->d_offset by looking for the slice and partition specified, - * or searching for reasonable defaults. - */ - rc = 0; - - /* First, read the MBR and see if we have a PMBR. */ - rc = dev->d_dev->dv_strategy(dev, F_READ, 0, DISK_SECSIZE, - (char *) tbl, NULL); - if (rc) { - DEBUG("error reading MBR"); - return (EIO); - } - - /* Check the slice table magic. */ - if (tbl[0x1fe] != 0x55 || tbl[0x1ff] != 0xaa) - return (ENXIO); - - /* Check for GPT slice. */ - part = 0; - dp = (struct dos_partition *)(tbl + DOSPARTOFF); - for (i = 0; i < NDOSPART; i++) { - if (dp[i].dp_typ == 0xee) - part++; - else if ((part != 1) && (dp[i].dp_typ != 0x00)) - return (EINVAL); - } - if (part != 1) - return (EINVAL); - - /* Read primary GPT table header. */ - rc = dev->d_dev->dv_strategy(dev, F_READ, 1, DISK_SECSIZE, - (char *) gpt, NULL); - if (rc) { - DEBUG("error reading GPT header"); - return (EIO); - } - hdr = (struct gpt_hdr *)gpt; - if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || - hdr->hdr_lba_self != 1 || hdr->hdr_revision < 0x00010000 || - hdr->hdr_entsz < sizeof(*ent) || - DISK_SECSIZE % hdr->hdr_entsz != 0) { - DEBUG("Invalid GPT header\n"); - return (EINVAL); - } - - /* Walk the partition table to count valid partitions. */ - part = 0; - entries_per_sec = DISK_SECSIZE / hdr->hdr_entsz; - elba = hdr->hdr_lba_table + hdr->hdr_entries / entries_per_sec; - for (lba = hdr->hdr_lba_table; lba < elba; lba++) { - rc = dev->d_dev->dv_strategy(dev, F_READ, lba, DISK_SECSIZE, - (char *) tbl, NULL); - if (rc) { - DEBUG("error reading GPT table"); - return (EIO); + if (partition == -1 && + part.type != PART_FREEBSD) + goto out; + /* Try to read BSD label */ + table = ptable_open(dev, part.end - part.start + 1, + od->sectorsize, ptblread); + if (table == NULL) { + DEBUG("Can't read BSD label"); + rc = ENXIO; + goto out; } - for (i = 0; i < entries_per_sec; i++) { - ent = (struct gpt_ent *)(tbl + i * hdr->hdr_entsz); - if (uuid_is_nil(&ent->ent_type, NULL) || - ent->ent_lba_start == 0 || - ent->ent_lba_end < ent->ent_lba_start) - continue; - part++; + /* + * If slice contains BSD label and d_partition < 0, then + * assume the 'a' partition. Otherwise just return the + * whole MBR slice, because it can contain ZFS. + */ + if (partition < 0) { + if (ptable_gettype(table) != PTABLE_BSD) + goto out; + partition = 0; } + rc = ptable_getpart(table, &part, partition); + if (rc != 0) + goto out; + dev->d_offset += part.start; } +out: + if (table != NULL) + ptable_close(table); - /* Save the important information about all the valid partitions. */ - if (part != 0) { - gptab = malloc(part * sizeof(struct gpt_part)); - part = 0; - for (lba = hdr->hdr_lba_table; lba < elba; lba++) { - rc = dev->d_dev->dv_strategy(dev, F_READ, lba, DISK_SECSIZE, - (char *) tbl, NULL); - if (rc) { - DEBUG("error reading GPT table"); - free(gptab); - return (EIO); - } - for (i = 0; i < entries_per_sec; i++) { - ent = (struct gpt_ent *)(tbl + i * hdr->hdr_entsz); - if (uuid_is_nil(&ent->ent_type, NULL) || - ent->ent_lba_start == 0 || - ent->ent_lba_end < ent->ent_lba_start) - continue; - gptab[part].gp_index = (lba - hdr->hdr_lba_table) * - entries_per_sec + i + 1; - gptab[part].gp_type = ent->ent_type; - gptab[part].gp_start = ent->ent_lba_start; - gptab[part].gp_end = ent->ent_lba_end; - part++; - } - } + if (rc != 0) { + if (od->rcnt < 1) { + if (od->table != NULL) + ptable_close(od->table); + free(od); + } + DEBUG("%s could not open", disk_fmtdev(dev)); + } else { + if ((flags & DISK_F_NOCACHE) == 0) + disk_insert(dev); + /* Save the slice and partition number to the dev */ + dev->d_slice = slice; + dev->d_partition = partition; + DEBUG("%s offset %lld => %p", disk_fmtdev(dev), + dev->d_offset, od); } - - *gptp = gptab; - *ngptp = part; - return (0); + return (rc); } -static struct gpt_part * -disk_bestgpt(struct gpt_part *gpt, int ngpt) +int +disk_close(struct disk_devdesc *dev) { - struct gpt_part *gp, *prefpart; - int i, pref, preflevel; + struct open_disk *od; - prefpart = NULL; - preflevel = PREF_NONE; - - gp = gpt; - for (i = 0; i < ngpt; i++, gp++) { - /* Windows. XXX: Also Linux. */ - if (uuid_equal(&gp->gp_type, &ms_basic_data, NULL)) - pref = PREF_DOS; - /* FreeBSD */ - else if (uuid_equal(&gp->gp_type, &freebsd_ufs, NULL) || - uuid_equal(&gp->gp_type, &freebsd_zfs, NULL)) - pref = PREF_FBSD; - else - pref = PREF_NONE; - if (pref < preflevel) { - preflevel = pref; - prefpart = gp; - } + od = (struct open_disk *)dev->d_opendata; + DEBUG("%s closed => %p [%d]", disk_fmtdev(dev), od, od->rcnt); + if (od->flags & DISK_F_NOCACHE) { + ptable_close(od->table); + free(od); } - return (prefpart); + return (0); } -static int -disk_opengpt(struct disk_devdesc *dev) +void +disk_cleanup(const struct devsw *d_dev) { - struct gpt_part *gpt = NULL, *gp; - int rc, ngpt, i; - - rc = disk_readgpt(dev, &gpt, &ngpt); - if (rc) - return (rc); - - /* Is this a request for the whole disk? */ - if (dev->d_slice < 0) { - dev->d_offset = 0; - rc = 0; - goto out; - } - - /* - * If a partition number was supplied, then the user is trying to use - * an MBR address rather than a GPT address, so fail. - */ - if (dev->d_partition != 0xff) { - rc = ENOENT; - goto out; - } - - /* If a slice number was supplied but not found, this is an error. */ - gp = NULL; - if (dev->d_slice > 0) { - for (i = 0; i < ngpt; i++) { - if (gpt[i].gp_index == dev->d_slice) { - gp = &gpt[i]; - break; - } - } - if (gp == NULL) { - DEBUG("partition %d not found", dev->d_slice); - rc = ENOENT; - goto out; - } - } +#ifdef DISK_DEBUG + struct disk_devdesc dev; +#endif + struct dentry *entry, *tmp; - /* Try to auto-detect the best partition. */ - if (dev->d_slice == 0) { - gp = disk_bestgpt(gpt, ngpt); - if (gp == NULL) { - rc = ENOENT; - goto out; + STAILQ_FOREACH_SAFE(entry, &opened_disks, entry, tmp) { + if (entry->d_dev != d_dev) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 17:27:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B2055B0; Sun, 18 Nov 2012 17:27:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0EE7A8FC18; Sun, 18 Nov 2012 17:27:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIHRAMo075415; Sun, 18 Nov 2012 17:27:10 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIHRArQ075414; Sun, 18 Nov 2012 17:27:10 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211181727.qAIHRArQ075414@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2012 17:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243244 - stable/9/tools/tools/bootparttest X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 17:27:11 -0000 Author: ae Date: Sun Nov 18 17:27:10 2012 New Revision: 243244 URL: http://svnweb.freebsd.org/changeset/base/243244 Log: MFC r239070: Add simple test program that uses the partition tables handling code. It is useful to test and debug how boot loader handles partition tables metadata. MFC r239087: Add to the debug output the offset from the parent partitioning scheme. Added: stable/9/tools/tools/bootparttest/ - copied from r239070, head/tools/tools/bootparttest/ Modified: stable/9/tools/tools/bootparttest/bootparttest.c Directory Properties: stable/9/tools/tools/ (props changed) Modified: stable/9/tools/tools/bootparttest/bootparttest.c ============================================================================== --- head/tools/tools/bootparttest/bootparttest.c Sun Aug 5 15:40:16 2012 (r239070) +++ stable/9/tools/tools/bootparttest/bootparttest.c Sun Nov 18 17:27:10 2012 (r243244) @@ -54,8 +54,8 @@ diskread(void *arg, void *buf, size_t bl struct disk *dp; dp = (struct disk *)arg; - printf("%s: read %d blocks from the offset %jd\n", dp->name, - blocks, offset); + printf("%s: read %d blocks from the offset %jd [+%jd]\n", dp->name, + blocks, offset, dp->offset); if (offset >= dp->mediasize / dp->sectorsize) return (-1); From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 18:57:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7EBA6B0B; Sun, 18 Nov 2012 18:57:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 621CC8FC08; Sun, 18 Nov 2012 18:57:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIIvKQq089808; Sun, 18 Nov 2012 18:57:20 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIIvKWu089802; Sun, 18 Nov 2012 18:57:20 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201211181857.qAIIvKWu089802@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Nov 2012 18:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243245 - in head/sys: conf ufs/ffs ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 18:57:20 -0000 Author: trasz Date: Sun Nov 18 18:57:19 2012 New Revision: 243245 URL: http://svnweb.freebsd.org/changeset/base/243245 Log: Add UFS writesuspension mechanism, designed to allow userland processes to modify on-disk metadata for filesystems mounted for write. Reviewed by: kib, mckusick Sponsored by: FreeBSD Foundation Added: head/sys/ufs/ffs/ffs_suspend.c (contents, props changed) Modified: head/sys/conf/files head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/ufsmount.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Nov 18 17:27:10 2012 (r243244) +++ head/sys/conf/files Sun Nov 18 18:57:19 2012 (r243245) @@ -3578,6 +3578,7 @@ ufs/ffs/ffs_tables.c optional ffs ufs/ffs/ffs_vfsops.c optional ffs ufs/ffs/ffs_vnops.c optional ffs ufs/ffs/ffs_rawread.c optional directio +ufs/ffs/ffs_suspend.c optional ffs ufs/ufs/ufs_acl.c optional ffs ufs/ufs/ufs_bmap.c optional ffs ufs/ufs/ufs_dirhash.c optional ffs Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Sun Nov 18 17:27:10 2012 (r243244) +++ head/sys/ufs/ffs/ffs_extern.h Sun Nov 18 18:57:19 2012 (r243245) @@ -79,9 +79,11 @@ int ffs_isfreeblock(struct fs *, u_char void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t); int ffs_mountroot(void); void ffs_oldfscompat_write(struct fs *, struct ufsmount *); +int ffs_own_mount(const struct mount *mp); int ffs_reallocblks(struct vop_reallocblks_args *); int ffs_realloccg(struct inode *, ufs2_daddr_t, ufs2_daddr_t, ufs2_daddr_t, int, int, int, struct ucred *, struct buf **); +int ffs_reload(struct mount *, struct thread *, int); int ffs_sbupdate(struct ufsmount *, int, int); void ffs_setblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, @@ -100,6 +102,8 @@ int ffs_valloc(struct vnode *, int, stru int ffs_vfree(struct vnode *, ino_t, int); vfs_vget_t ffs_vget; int ffs_vgetf(struct mount *, ino_t, int, struct vnode **, int); +void ffs_susp_initialize(void); +void ffs_susp_uninitialize(void); #define FFSV_FORCEINSMQ 0x0001 Added: head/sys/ufs/ffs/ffs_suspend.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/ufs/ffs/ffs_suspend.c Sun Nov 18 18:57:19 2012 (r243245) @@ -0,0 +1,338 @@ +/*- + * Copyright (c) 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Edward Tomasz Napierala under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +static d_open_t ffs_susp_open; +static d_write_t ffs_susp_rdwr; +static d_ioctl_t ffs_susp_ioctl; + +static struct cdevsw ffs_susp_cdevsw = { + .d_version = D_VERSION, + .d_open = ffs_susp_open, + .d_read = ffs_susp_rdwr, + .d_write = ffs_susp_rdwr, + .d_ioctl = ffs_susp_ioctl, + .d_name = "ffs_susp", +}; + +static struct cdev *ffs_susp_dev; +static struct sx ffs_susp_lock; + +static int +ffs_susp_suspended(struct mount *mp) +{ + struct ufsmount *ump; + + sx_assert(&ffs_susp_lock, SA_LOCKED); + + ump = VFSTOUFS(mp); + if (ump->um_writesuspended) + return (1); + return (0); +} + +static int +ffs_susp_open(struct cdev *dev __unused, int flags __unused, + int fmt __unused, struct thread *td __unused) +{ + + return (0); +} + +static int +ffs_susp_rdwr(struct cdev *dev, struct uio *uio, int ioflag) +{ + int error, i; + struct vnode *devvp; + struct mount *mp; + struct ufsmount *ump; + struct buf *bp; + void *base; + size_t len; + ssize_t cnt; + struct fs *fs; + + sx_slock(&ffs_susp_lock); + + error = devfs_get_cdevpriv((void **)&mp); + if (error != 0) { + sx_sunlock(&ffs_susp_lock); + return (ENXIO); + } + + ump = VFSTOUFS(mp); + devvp = ump->um_devvp; + fs = ump->um_fs; + + if (ffs_susp_suspended(mp) == 0) { + sx_sunlock(&ffs_susp_lock); + return (ENXIO); + } + + KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, + ("neither UIO_READ or UIO_WRITE")); + KASSERT(uio->uio_segflg == UIO_USERSPACE, + ("uio->uio_segflg != UIO_USERSPACE")); + + cnt = uio->uio_resid; + + for (i = 0; i < uio->uio_iovcnt; i++) { + while (uio->uio_iov[i].iov_len) { + base = uio->uio_iov[i].iov_base; + len = uio->uio_iov[i].iov_len; + if (len > fs->fs_bsize) + len = fs->fs_bsize; + if (fragoff(fs, uio->uio_offset) != 0 || + fragoff(fs, len) != 0) { + error = EINVAL; + goto out; + } + error = bread(devvp, btodb(uio->uio_offset), len, + NOCRED, &bp); + if (error != 0) + goto out; + if (uio->uio_rw == UIO_WRITE) { + error = copyin(base, bp->b_data, len); + if (error != 0) { + bp->b_flags |= B_INVAL | B_NOCACHE; + brelse(bp); + goto out; + } + error = bwrite(bp); + if (error != 0) + goto out; + } else { + error = copyout(bp->b_data, base, len); + brelse(bp); + if (error != 0) + goto out; + } + uio->uio_iov[i].iov_base = + (char *)uio->uio_iov[i].iov_base + len; + uio->uio_iov[i].iov_len -= len; + uio->uio_resid -= len; + uio->uio_offset += len; + } + } + +out: + sx_sunlock(&ffs_susp_lock); + + if (uio->uio_resid < cnt) + return (0); + + return (error); +} + +static int +ffs_susp_suspend(struct mount *mp) +{ + struct fs *fs; + struct ufsmount *ump; + int error; + + sx_assert(&ffs_susp_lock, SA_XLOCKED); + + if (!ffs_own_mount(mp)) + return (EINVAL); + if (ffs_susp_suspended(mp)) + return (EBUSY); + + ump = VFSTOUFS(mp); + fs = ump->um_fs; + + /* + * Make sure the calling thread is permitted to access the mounted + * device. The permissions can change after we unlock the vnode; + * it's harmless. + */ + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); + error = VOP_ACCESS(ump->um_devvp, VREAD | VWRITE, + curthread->td_ucred, curthread); + VOP_UNLOCK(ump->um_devvp, 0); + if (error != 0) + return (error); +#ifdef MAC + if (mac_mount_check_stat(curthread->td_ucred, mp) != 0) + return (EPERM); +#endif + + if ((error = vfs_write_suspend(mp)) != 0) + return (error); + + ump->um_writesuspended = 1; + + return (0); +} + +static void +ffs_susp_dtor(void *data) +{ + struct fs *fs; + struct ufsmount *ump; + struct mount *mp; + int error; + + sx_xlock(&ffs_susp_lock); + + mp = (struct mount *)data; + ump = VFSTOUFS(mp); + fs = ump->um_fs; + + if (ffs_susp_suspended(mp) == 0) { + sx_xunlock(&ffs_susp_lock); + return; + } + + KASSERT((mp->mnt_kern_flag & MNTK_SUSPEND) != 0, + ("MNTK_SUSPEND not set")); + + error = ffs_reload(mp, curthread, 1); + if (error != 0) + panic("failed to unsuspend writes on %s", fs->fs_fsmnt); + + /* + * XXX: The status is kept per-process; the vfs_write_resume() routine + * asserts that the resuming thread is the same one that called + * vfs_write_suspend(). The cdevpriv data, however, is attached + * to the file descriptor, e.g. is inherited during fork. Thus, + * it's possible that the resuming process will be different from + * the one that started the suspension. + * + * Work around by fooling the check in vfs_write_resume(). + */ + mp->mnt_susp_owner = curthread; + + vfs_write_resume(mp); + vfs_unbusy(mp); + ump->um_writesuspended = 0; + + sx_xunlock(&ffs_susp_lock); +} + +static int +ffs_susp_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, + struct thread *td) +{ + struct mount *mp; + fsid_t *fsidp; + int error; + + /* + * No suspend inside the jail. Allowing it would require making + * sure that e.g. the devfs ruleset for that jail permits access + * to the devvp. + */ + if (jailed(td->td_ucred)) + return (EPERM); + + sx_xlock(&ffs_susp_lock); + + switch (cmd) { + case UFSSUSPEND: + fsidp = (fsid_t *)addr; + mp = vfs_getvfs(fsidp); + if (mp == NULL) { + error = ENOENT; + break; + } + error = vfs_busy(mp, 0); + vfs_rel(mp); + if (error != 0) + break; + error = ffs_susp_suspend(mp); + if (error != 0) { + vfs_unbusy(mp); + break; + } + error = devfs_set_cdevpriv(mp, ffs_susp_dtor); + KASSERT(error == 0, ("devfs_set_cdevpriv failed")); + break; + case UFSRESUME: + error = devfs_get_cdevpriv((void **)&mp); + if (error != 0) + break; + /* + * This calls ffs_susp_dtor, which in turn unsuspends the fs. + * The dtor expects to be called without lock held, because + * sometimes it's called from here, and sometimes due to the + * file being closed or process exiting. + */ + sx_xunlock(&ffs_susp_lock); + devfs_clear_cdevpriv(); + return (0); + default: + error = ENXIO; + break; + } + + sx_xunlock(&ffs_susp_lock); + + return (error); +} + +void +ffs_susp_initialize(void) +{ + + sx_init(&ffs_susp_lock, "ffs_susp"); + ffs_susp_dev = make_dev(&ffs_susp_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + "ufssuspend"); +} + +void +ffs_susp_uninitialize(void) +{ + + destroy_dev(ffs_susp_dev); + sx_destroy(&ffs_susp_lock); +} Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Nov 18 17:27:10 2012 (r243244) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Nov 18 18:57:19 2012 (r243245) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -75,7 +76,6 @@ __FBSDID("$FreeBSD$"); static uma_zone_t uma_inode, uma_ufs1, uma_ufs2; -static int ffs_reload(struct mount *, struct thread *); static int ffs_mountfs(struct vnode *, struct mount *, struct thread *); static void ffs_oldfscompat_read(struct fs *, struct ufsmount *, ufs2_daddr_t); @@ -333,7 +333,7 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp); } if ((mp->mnt_flag & MNT_RELOAD) && - (error = ffs_reload(mp, td)) != 0) + (error = ffs_reload(mp, td, 0)) != 0) return (error); if (fs->fs_ronly && !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { @@ -595,8 +595,8 @@ ffs_cmount(struct mntarg *ma, void *data /* * Reload all incore data for a filesystem (used after running fsck on - * the root filesystem and finding things to fix). The filesystem must - * be mounted read-only. + * the root filesystem and finding things to fix). If the 'force' flag + * is 0, the filesystem must be mounted read-only. * * Things to do to update the mount: * 1) invalidate all cached meta-data. @@ -606,8 +606,8 @@ ffs_cmount(struct mntarg *ma, void *data * 5) invalidate all cached file data. * 6) re-read inode data for all active vnodes. */ -static int -ffs_reload(struct mount *mp, struct thread *td) +int +ffs_reload(struct mount *mp, struct thread *td, int force) { struct vnode *vp, *mvp, *devvp; struct inode *ip; @@ -619,9 +619,15 @@ ffs_reload(struct mount *mp, struct thre int i, blks, size, error; int32_t *lp; - if ((mp->mnt_flag & MNT_RDONLY) == 0) - return (EINVAL); ump = VFSTOUFS(mp); + + MNT_ILOCK(mp); + if ((mp->mnt_flag & MNT_RDONLY) == 0 && force == 0) { + MNT_IUNLOCK(mp); + return (EINVAL); + } + MNT_IUNLOCK(mp); + /* * Step 1: invalidate all cached meta-data. */ @@ -655,8 +661,7 @@ ffs_reload(struct mount *mp, struct thre newfs->fs_maxcluster = fs->fs_maxcluster; newfs->fs_contigdirs = fs->fs_contigdirs; newfs->fs_active = fs->fs_active; - /* The file system is still read-only. */ - newfs->fs_ronly = 1; + newfs->fs_ronly = fs->fs_ronly; sblockloc = fs->fs_sblockloc; bcopy(newfs, fs, (u_int)fs->fs_sbsize); brelse(bp); @@ -711,6 +716,13 @@ ffs_reload(struct mount *mp, struct thre loop: MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { /* + * Skip syncer vnode. + */ + if (vp->v_type == VNON) { + VI_UNLOCK(vp); + continue; + } + /* * Step 4: invalidate all cached file data. */ if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { @@ -1834,6 +1846,7 @@ ffs_init(vfsp) struct vfsconf *vfsp; { + ffs_susp_initialize(); softdep_initialize(); return (ufs_init(vfsp)); } @@ -1849,6 +1862,7 @@ ffs_uninit(vfsp) ret = ufs_uninit(vfsp); softdep_uninitialize(); + ffs_susp_uninitialize(); return (ret); } @@ -2198,6 +2212,15 @@ ffs_geom_strategy(struct bufobj *bo, str g_vfs_strategy(bo, bp); } +int +ffs_own_mount(const struct mount *mp) +{ + + if (mp->mnt_op == &ufs_vfsops) + return (1); + return (0); +} + #ifdef DDB static void Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Sun Nov 18 17:27:10 2012 (r243244) +++ head/sys/ufs/ffs/fs.h Sun Nov 18 18:57:19 2012 (r243245) @@ -33,6 +33,8 @@ #ifndef _UFS_FFS_FS_H_ #define _UFS_FFS_FS_H_ +#include + /* * Each disk drive contains some number of filesystems. * A filesystem consists of a number of cylinder groups. @@ -763,4 +765,10 @@ CTASSERT(sizeof(union jrec) == JREC_SIZE extern int inside[], around[]; extern u_char *fragtbl[]; +/* + * IOCTLs used for filesystem write suspension. + */ +#define UFSSUSPEND _IOW('U', 1, fsid_t) +#define UFSRESUME _IO('U', 2) + #endif Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Sun Nov 18 17:27:10 2012 (r243244) +++ head/sys/ufs/ufs/ufsmount.h Sun Nov 18 18:57:19 2012 (r243245) @@ -98,6 +98,7 @@ struct ufsmount { char um_qflags[MAXQUOTAS]; /* quota specific flags */ int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ int um_candelete; /* devvp supports TRIM */ + int um_writesuspended; /* suspension in progress */ int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **); int (*um_truncate)(struct vnode *, off_t, int, struct ucred *); From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 19:01:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 515CDDC7; Sun, 18 Nov 2012 19:01:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2CE958FC12; Sun, 18 Nov 2012 19:01:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIJ11Jv090591; Sun, 18 Nov 2012 19:01:01 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIJ11AY090588; Sun, 18 Nov 2012 19:01:01 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201211181901.qAIJ11AY090588@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Nov 2012 19:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243246 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 19:01:01 -0000 Author: trasz Date: Sun Nov 18 19:01:00 2012 New Revision: 243246 URL: http://svnweb.freebsd.org/changeset/base/243246 Log: Make it possible to resize filesystems mounted read-write, using newly introduced UFS write suspension mechanism. Reviewed by: kib, mckusick Sponsored by: FreeBSD Foundation Modified: head/sbin/growfs/growfs.8 head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Sun Nov 18 18:57:19 2012 (r243245) +++ head/sbin/growfs/growfs.8 Sun Nov 18 19:01:00 2012 (r243246) @@ -115,11 +115,17 @@ The .Nm utility first appeared in .Fx 4.4 . +The ability to resize mounted filesystems was added in +.Fx 10.0 . .Sh AUTHORS .An Christoph Herrmann Aq chm@FreeBSD.org .An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org .An The GROWFS team Aq growfs@Tomsoft.COM .An Edward Tomasz Napierala Aq trasz@FreeBSD.org +.Sh CAVEATS +.Pp +When expanding a file system mounted read-write, any writes to that file system +will be temporarily suspended until the expansion is finished. .Sh BUGS Normally .Nm Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sun Nov 18 18:57:19 2012 (r243245) +++ head/sbin/growfs/growfs.c Sun Nov 18 19:01:00 2012 (r243246) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1525,8 +1526,9 @@ main(int argc, char **argv) if (yflag == 0 && Nflag == 0) { if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) - errx(1, "%s is mounted read-write on %s", - statfsp->f_mntfromname, statfsp->f_mntonname); + printf("Device is mounted read-write; resizing will " + "result in temporary write suspension for %s.\n", + statfsp->f_mntonname); printf("It's strongly recommended to make a backup " "before growing the file system.\n" "OK to grow filesystem on %s", device); @@ -1555,9 +1557,18 @@ main(int argc, char **argv) if (Nflag) { fso = -1; } else { - fso = open(device, O_WRONLY); - if (fso < 0) - err(1, "%s", device); + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { + fso = open(_PATH_UFSSUSPEND, O_RDWR); + if (fso == -1) + err(1, "unable to open %s", _PATH_UFSSUSPEND); + error = ioctl(fso, UFSSUSPEND, &statfsp->f_fsid); + if (error != 0) + err(1, "UFSSUSPEND"); + } else { + fso = open(device, O_WRONLY); + if (fso < 0) + err(1, "%s", device); + } } /* @@ -1627,12 +1638,17 @@ main(int argc, char **argv) close(fsi); if (fso > -1) { + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { + error = ioctl(fso, UFSRESUME); + if (error != 0) + err(1, "UFSRESUME"); + } error = close(fso); if (error != 0) err(1, "close"); + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) != 0) + mount_reload(statfsp); } - if (statfsp != NULL) - mount_reload(statfsp); DBG_CLOSE; From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 19:16:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DEF74DA; Sun, 18 Nov 2012 19:16:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 631278FC15; Sun, 18 Nov 2012 19:16:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIJGB5I093407; Sun, 18 Nov 2012 19:16:11 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIJGBG2093406; Sun, 18 Nov 2012 19:16:11 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201211181916.qAIJGBG2093406@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Nov 2012 19:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243247 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 19:16:11 -0000 Author: trasz Date: Sun Nov 18 19:16:10 2012 New Revision: 243247 URL: http://svnweb.freebsd.org/changeset/base/243247 Log: Add change missed in 243245. Modified: head/include/paths.h Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Sun Nov 18 19:01:00 2012 (r243246) +++ head/include/paths.h Sun Nov 18 19:16:10 2012 (r243247) @@ -85,6 +85,7 @@ #define _PATH_SHELLS "/etc/shells" #define _PATH_TTY "/dev/tty" #define _PATH_UNIX "don't use _PATH_UNIX" +#define _PATH_UFSSUSPEND "/dev/ufssuspend" #define _PATH_VI "/usr/bin/vi" #define _PATH_WALL "/usr/bin/wall" From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 19:26:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 027C5B2A; Sun, 18 Nov 2012 19:26:04 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw12.york.ac.uk (mail-gw12.york.ac.uk [144.32.129.162]) by mx1.freebsd.org (Postfix) with ESMTP id 2F1AF8FC13; Sun, 18 Nov 2012 19:26:03 +0000 (UTC) Received: from ury.york.ac.uk ([144.32.108.81]:10556) by mail-gw12.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1TaAV9-0000jN-Hs; Sun, 18 Nov 2012 19:25:55 +0000 Date: Sun, 18 Nov 2012 19:25:55 +0000 (GMT) From: Gavin Atkinson X-X-Sender: gavin@thunderhorn.york.ac.uk To: Edward Tomasz Napierala Subject: Re: svn commit: r243246 - head/sbin/growfs In-Reply-To: <201211181901.qAIJ11AY090588@svn.freebsd.org> Message-ID: References: <201211181901.qAIJ11AY090588@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 19:26:04 -0000 On Sun, 18 Nov 2012, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sun Nov 18 19:01:00 2012 > New Revision: 243246 > URL: http://svnweb.freebsd.org/changeset/base/243246 > > Log: > Make it possible to resize filesystems mounted read-write, using newly > introduced UFS write suspension mechanism. > > Modified: head/sbin/growfs/growfs.c > ============================================================================== > --- head/sbin/growfs/growfs.c Sun Nov 18 18:57:19 2012 (r243245) > +++ head/sbin/growfs/growfs.c Sun Nov 18 19:01:00 2012 (r243246) > @@ -1555,9 +1557,18 @@ main(int argc, char **argv) > if (Nflag) { > fso = -1; > } else { > - fso = open(device, O_WRONLY); > - if (fso < 0) > - err(1, "%s", device); > + if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { > + fso = open(_PATH_UFSSUSPEND, O_RDWR); > + if (fso == -1) > + err(1, "unable to open %s", _PATH_UFSSUSPEND); > + error = ioctl(fso, UFSSUSPEND, &statfsp->f_fsid); > + if (error != 0) > + err(1, "UFSSUSPEND"); > + } else { > + fso = open(device, O_WRONLY); > + if (fso < 0) > + err(1, "%s", device); > + } > } It is excellent to see this functionality, and it will be very much appreciated especially for people using virtual machines. All the way through later code there are calls to err() on failure. What happens to the suspended filesystem if that happens and growfs exits before the matching UFSRESUME? Thanks, Gavin From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 19:36:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EC83E6B; Sun, 18 Nov 2012 19:36:17 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 27CC98FC08; Sun, 18 Nov 2012 19:36:15 +0000 (UTC) Received: by mail-ea0-f182.google.com with SMTP id a14so236552eaa.13 for ; Sun, 18 Nov 2012 11:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=Qs5ub4KTIBrQTL3Lzdx1HZ+FDmLqoV1iDAqg5fHON54=; b=qgiNP8oe7CNXPDlGah5sKqYki9uzAmudJ/S8SyuDYd7TbLUuGbVUyDxM+4Ko1DGY1T 9pQAuqBHGcPzwMjJLCYrcwVgL/pb2fYkAyY5fk3ifNhWEG4NRfoby5gFn3cwWECIj0TL F0e2fOPyZp79nO7xgPGTgQIBU81YJbdtwK6gz5dR/DJdzfbCW3wMlFTpgYguyFcxMnJA tYrvMJ6BtD8UuZZit1DPNbiVn3p967QrIla6QqHasKQpXTlVgHU1uNXR0i2AOiU005Fi 6E0dpJRgkc2TpbF1bFZhb0inrVGixTt2uZqwzq/lO/+wIKaDQNyrF9z5fwOuyReWv3Dz Ku/w== Received: by 10.14.215.197 with SMTP id e45mr16919700eep.0.1353267375194; Sun, 18 Nov 2012 11:36:15 -0800 (PST) Received: from [192.168.1.104] (45.81.datacomsa.pl. [195.34.81.45]) by mx.google.com with ESMTPS id f2sm19468442eep.2.2012.11.18.11.36.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Nov 2012 11:36:14 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Subject: Re: svn commit: r243246 - head/sbin/growfs Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: Date: Sun, 18 Nov 2012 20:36:09 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <2AAD2265-B2D9-4407-B44E-FB3235A9B385@FreeBSD.org> References: <201211181901.qAIJ11AY090588@svn.freebsd.org> To: Gavin Atkinson X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 19:36:17 -0000 Wiadomo=B6=E6 napisana przez Gavin Atkinson w dniu 18 lis 2012, o godz. = 20:25: > On Sun, 18 Nov 2012, Edward Tomasz Napierala wrote: >=20 >> Author: trasz >> Date: Sun Nov 18 19:01:00 2012 >> New Revision: 243246 >> URL: http://svnweb.freebsd.org/changeset/base/243246 >>=20 >> Log: >> Make it possible to resize filesystems mounted read-write, using = newly >> introduced UFS write suspension mechanism. >>=20 >> Modified: head/sbin/growfs/growfs.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sbin/growfs/growfs.c Sun Nov 18 18:57:19 2012 = (r243245) >> +++ head/sbin/growfs/growfs.c Sun Nov 18 19:01:00 2012 = (r243246) >> @@ -1555,9 +1557,18 @@ main(int argc, char **argv) >> if (Nflag) { >> fso =3D -1; >> } else { >> - fso =3D open(device, O_WRONLY); >> - if (fso < 0) >> - err(1, "%s", device); >> + if (statfsp !=3D NULL && (statfsp->f_flags & MNT_RDONLY) = =3D=3D 0) { >> + fso =3D open(_PATH_UFSSUSPEND, O_RDWR); >> + if (fso =3D=3D -1) >> + err(1, "unable to open %s", = _PATH_UFSSUSPEND); >> + error =3D ioctl(fso, UFSSUSPEND, = &statfsp->f_fsid); >> + if (error !=3D 0) >> + err(1, "UFSSUSPEND"); >> + } else { >> + fso =3D open(device, O_WRONLY); >> + if (fso < 0) >> + err(1, "%s", device); >> + } >> } >=20 > It is excellent to see this functionality, and it will be very much=20 > appreciated especially for people using virtual machines. Thanks! > All the way through later code there are calls to err() on failure. =20= > What happens to the suspended filesystem if that happens and growfs = exits=20 > before the matching UFSRESUME? Kernel releases the suspension when the process keeping the = filedescriptor exits. It could be said that the UFSRESUME ioctl is there mostly for completeness. And the changes performed by growfs(8) are ordered in a way that keeps the filesystem consistent, so it should be safe to ^C growfs execution without breaking things. --=20 If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 19:39:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D67CF5; Sun, 18 Nov 2012 19:39:43 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1037C8FC08; Sun, 18 Nov 2012 19:39:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIJdgAj096847; Sun, 18 Nov 2012 19:39:42 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIJdg7m096846; Sun, 18 Nov 2012 19:39:42 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201211181939.qAIJdg7m096846@svn.freebsd.org> From: Joel Dahl Date: Sun, 18 Nov 2012 19:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243248 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 19:39:43 -0000 Author: joel (doc committer) Date: Sun Nov 18 19:39:42 2012 New Revision: 243248 URL: http://svnweb.freebsd.org/changeset/base/243248 Log: Remove superfluous paragraph macro. Modified: head/sbin/growfs/growfs.8 Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Sun Nov 18 19:16:10 2012 (r243247) +++ head/sbin/growfs/growfs.8 Sun Nov 18 19:39:42 2012 (r243248) @@ -123,7 +123,6 @@ The ability to resize mounted filesystem .An The GROWFS team Aq growfs@Tomsoft.COM .An Edward Tomasz Napierala Aq trasz@FreeBSD.org .Sh CAVEATS -.Pp When expanding a file system mounted read-write, any writes to that file system will be temporarily suspended until the expansion is finished. .Sh BUGS From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 20:39:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C518B15; Sun, 18 Nov 2012 20:39:20 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id E015E8FC1B; Sun, 18 Nov 2012 20:39:19 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so5432254oag.13 for ; Sun, 18 Nov 2012 12:39:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=kuQbYOa3XGjhrDlpIonJLBgRrBId8bx13z+PWauwF7k=; b=jN9s4xhw5cw+Mj4hqzAA+cYXyQe4IHpq7T12i8uo9OeDF64ika5kcW93UaDbMoipGh zvyxTbMU8NKTqzDnjDxCoPsuQivEc6i5tI9dNrI7DZqYtGCuKkCfteTPbuvz1ieGGES2 WlTps+uLNYWt4LqBkKxy9x5wVgUFM/YP0Wrht1H27mS/6bSPvSg3cNsveH7aHIYr7Pno 29j0kPXNpg29v0WHB01hOqVaOOvOTqXnCFyaRkxvTU5zO6sueAg7Rh51/kHgDxPlnn1W Xa6LNL2T9aLMf1I3lK2hNewb1rATeK2fHpDZ3+6SMLc8NoZdtkQDutVFelQHAgbtv1Es 832Q== MIME-Version: 1.0 Received: by 10.60.13.73 with SMTP id f9mr1522776oec.131.1353271159304; Sun, 18 Nov 2012 12:39:19 -0800 (PST) Sender: edschouten@gmail.com Received: by 10.76.151.39 with HTTP; Sun, 18 Nov 2012 12:39:19 -0800 (PST) In-Reply-To: <201211181421.qAIEL5KT042019@svn.freebsd.org> References: <201211181421.qAIEL5KT042019@svn.freebsd.org> Date: Sun, 18 Nov 2012 21:39:19 +0100 X-Google-Sender-Auth: hXHJeBFB0dzf9FxHQzBO0A0npkQ Message-ID: Subject: Re: svn commit: r243228 - head/etc From: Ed Schouten To: Chris Rees Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 20:39:20 -0000 Hi Chris, 2012/11/18 Chris Rees : > Modified: head/etc/rc.initdiskless > ============================================================================== > --- head/etc/rc.initdiskless Sun Nov 18 14:05:28 2012 (r243227) > +++ head/etc/rc.initdiskless Sun Nov 18 14:21:05 2012 (r243228) > @@ -354,7 +354,7 @@ for i in ${templates} ; do > subdir=${j##*/} > if [ -d $j -a ! -f $j.cpio.gz ]; then > create_md $subdir > - cp -Rp $j/ /$subdir > + (cd $j && pax -rw . /$subdir) > fi > done > for j in /conf/$i/*.cpio.gz ; do Are you sure that this bug wasn't already fixed? The original version of the code in the bug report used the following line: - cp -Rp $j/* /$subdir The old version of the code you changed didn't have this asterisk, meaning dotfiles would already be copied. Still, you could argue that your version is nicer, as our behaviour of cp with the trailing slash contradicts POSIX. Thanks, -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 20:41:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CF0B8CBA; Sun, 18 Nov 2012 20:41:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B378A8FC13; Sun, 18 Nov 2012 20:41:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIKfkXX006911; Sun, 18 Nov 2012 20:41:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIKfk52006910; Sun, 18 Nov 2012 20:41:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211182041.qAIKfk52006910@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 Nov 2012 20:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243249 - head/sys/dev/ath/ath_hal/ar5211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 20:41:46 -0000 Author: adrian Date: Sun Nov 18 20:41:46 2012 New Revision: 243249 URL: http://svnweb.freebsd.org/changeset/base/243249 Log: Remove this include, it isn't needed. Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211desc.h Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211desc.h Sun Nov 18 19:39:42 2012 (r243248) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211desc.h Sun Nov 18 20:41:46 2012 (r243249) @@ -19,8 +19,6 @@ #ifndef _DEV_ATH_AR5211DESC_H #define _DEV_ATH_AR5211DESC_H -#include "ah_desc.h" - /* * Defintions for the DMA descriptors used by the Atheros * AR5211 and AR5110 Wireless Lan controller parts. From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 21:59:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 742B4BE2; Sun, 18 Nov 2012 21:59:23 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9C78A8FC0C; Sun, 18 Nov 2012 21:59:22 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id je9so928055bkc.13 for ; Sun, 18 Nov 2012 13:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=AzTITCsqTpjKBUtN5rfe4Se04vuDeA3T6G4MMkUUdhE=; b=dtwJC1Vcz/8fb/Wv39+jOYRYqDGQh2weYpIE2J86PmNf500n0l5EJ0RfYGPoA87Afk tW4rnqKjZpu0PeXbah5MSOs+sXCfDYvYI7EujdRqW7vgrFGvKLiwR6Ci8ZIM8E5VFrX2 A304avOgk6GuWF0GccoX4bvBI9SfQVuGIEhUIVS0g/9OpVzxm1GEJOO+tfjxL/7jedKz /m6gQ/shyP9ZD/AORFoPbb6sGUK908r6iRF/mBmahMgGrpMZyCr3RU5T23uZB5/InViO 2+rvJ34OdFlpBoZqflpau7xp7LPMUVgLIJ7e8ERWyZlJOPJX2SM+DwpsVksyf5c55ZgF 8jrA== MIME-Version: 1.0 Received: by 10.204.130.140 with SMTP id t12mr2669464bks.39.1353275961450; Sun, 18 Nov 2012 13:59:21 -0800 (PST) Received: by 10.204.50.197 with HTTP; Sun, 18 Nov 2012 13:59:21 -0800 (PST) Received: by 10.204.50.197 with HTTP; Sun, 18 Nov 2012 13:59:21 -0800 (PST) In-Reply-To: References: <201211181421.qAIEL5KT042019@svn.freebsd.org> Date: Sun, 18 Nov 2012 21:59:21 +0000 Message-ID: Subject: Re: svn commit: r243228 - head/etc From: Chris Rees To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 21:59:23 -0000 On 18 Nov 2012 20:39, "Ed Schouten" wrote: > > Hi Chris, > > 2012/11/18 Chris Rees : > > Modified: head/etc/rc.initdiskless > > ============================================================================== > > --- head/etc/rc.initdiskless Sun Nov 18 14:05:28 2012 (r243227) > > +++ head/etc/rc.initdiskless Sun Nov 18 14:21:05 2012 (r243228) > > @@ -354,7 +354,7 @@ for i in ${templates} ; do > > subdir=${j##*/} > > if [ -d $j -a ! -f $j.cpio.gz ]; then > > create_md $subdir > > - cp -Rp $j/ /$subdir > > + (cd $j && pax -rw . /$subdir) > > fi > > done > > for j in /conf/$i/*.cpio.gz ; do > > Are you sure that this bug wasn't already fixed? The original version > of the code in the bug report used the following line: > > - cp -Rp $j/* /$subdir > > The old version of the code you changed didn't have this asterisk, > meaning dotfiles would already be copied. Still, you could argue that > your version is nicer, as our behaviour of cp with the trailing slash > contradicts POSIX. > You are correct, and the second to point it out :) As you say however, pax is technically how it should be done anyway, and has the nice effect of also preserving hard links. If no-one objects I think it should stay in. This is unfortunately another example of many in rc of where something was fixed ages ago and no-one checked GNATS :( Of course, this is still my fault. Chris From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 22:03:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D746E4E; Sun, 18 Nov 2012 22:03:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 428888FC13; Sun, 18 Nov 2012 22:03:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIM3WrY020407; Sun, 18 Nov 2012 22:03:32 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIM3WrI020406; Sun, 18 Nov 2012 22:03:32 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201211182203.qAIM3WrI020406@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Nov 2012 22:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243250 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 22:03:32 -0000 Author: trasz Date: Sun Nov 18 22:03:31 2012 New Revision: 243250 URL: http://svnweb.freebsd.org/changeset/base/243250 Log: Fix build of kdump(1). Modified: head/sys/ufs/ffs/fs.h Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Sun Nov 18 20:41:46 2012 (r243249) +++ head/sys/ufs/ffs/fs.h Sun Nov 18 22:03:31 2012 (r243250) @@ -34,6 +34,7 @@ #define _UFS_FFS_FS_H_ #include +#include /* * Each disk drive contains some number of filesystems. From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 22:52:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB213135; Sun, 18 Nov 2012 22:52:17 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A71178FC0C; Sun, 18 Nov 2012 22:52:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIMqH8w028234; Sun, 18 Nov 2012 22:52:17 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIMqHvN028232; Sun, 18 Nov 2012 22:52:17 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201211182252.qAIMqHvN028232@svn.freebsd.org> From: Benjamin Kaduk Date: Sun, 18 Nov 2012 22:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243251 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 22:52:17 -0000 Author: bjk (doc committer) Date: Sun Nov 18 22:52:17 2012 New Revision: 243251 URL: http://svnweb.freebsd.org/changeset/base/243251 Log: Improve grammar. Approved by: hrs (mentor) Modified: head/share/man/man9/sleep.9 Modified: head/share/man/man9/sleep.9 ============================================================================== --- head/share/man/man9/sleep.9 Sun Nov 18 22:03:31 2012 (r243250) +++ head/share/man/man9/sleep.9 Sun Nov 18 22:52:17 2012 (r243251) @@ -102,7 +102,8 @@ If .Fa priority includes the .Dv PCATCH -flag, signals are checked before and after sleeping, otherwise signals are +flag, pending +signals are checked before and after sleeping, otherwise signals are not checked. If .Dv PCATCH @@ -114,17 +115,18 @@ possible, and is returned if the system call should be interrupted by the signal (return .Er EINTR ) . -If +If the .Dv PBDRY flag is specified in addition to .Dv PCATCH , -then the sleeping thread is not stopped while sleeping upon delivery of +then the sleeping thread is not stopped upon delivery of .Dv SIGSTOP -or other stop action. -Instead, it is waken up, assuming that stop occurs on reaching a stop +or other stop action while it is sleeping. +Instead, it is woken up, with the assumption +that the stop will occur on reaching a stop point when returning to usermode. -The flag should be used when sleeping thread owns resources, for instance -vnode locks, that should be freed timely. +The flag should be used when the sleeping thread owns resources, for instance +vnode locks, that should be released in a timely fashion. .Pp The parameter .Fa wmesg From owner-svn-src-all@FreeBSD.ORG Sun Nov 18 23:15:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 961217EB; Sun, 18 Nov 2012 23:15:22 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0E78FC13; Sun, 18 Nov 2012 23:15:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAINFM7E032340; Sun, 18 Nov 2012 23:15:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAINFMEH032339; Sun, 18 Nov 2012 23:15:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211182315.qAINFMEH032339@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 18 Nov 2012 23:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243252 - head/tools/regression/bin/sh/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 18 Nov 2012 23:15:22 -0000 Author: jilles Date: Sun Nov 18 23:15:22 2012 New Revision: 243252 URL: http://svnweb.freebsd.org/changeset/base/243252 Log: sh: Apply rlimits to parser/alias10.0 so it fails fast. Requested by: uqs Modified: head/tools/regression/bin/sh/parser/alias10.0 Modified: head/tools/regression/bin/sh/parser/alias10.0 ============================================================================== --- head/tools/regression/bin/sh/parser/alias10.0 Sun Nov 18 22:52:17 2012 (r243251) +++ head/tools/regression/bin/sh/parser/alias10.0 Sun Nov 18 23:15:22 2012 (r243252) @@ -1,5 +1,9 @@ # $FreeBSD$ +# This test may start consuming memory indefinitely if it fails. +ulimit -t 5 2>/dev/null +ulimit -v 100000 2>/dev/null + alias echo='echo' alias echo='echo' [ "`eval echo b`" = b ] From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 00:01:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7830341; Mon, 19 Nov 2012 00:01:57 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id EFA028FC17; Mon, 19 Nov 2012 00:01:50 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qAJ01nBw072955; Sun, 18 Nov 2012 17:01:49 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qAJ01j58028796; Sun, 18 Nov 2012 17:01:45 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r243228 - head/etc From: Ian Lepore To: Chris Rees In-Reply-To: References: <201211181421.qAIEL5KT042019@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 18 Nov 2012 17:01:45 -0700 Message-ID: <1353283305.1217.324.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 00:01:57 -0000 On Sun, 2012-11-18 at 21:59 +0000, Chris Rees wrote: > On 18 Nov 2012 20:39, "Ed Schouten" wrote: > > > > Hi Chris, > > > > 2012/11/18 Chris Rees : > > > Modified: head/etc/rc.initdiskless > > > > ============================================================================== > > > --- head/etc/rc.initdiskless Sun Nov 18 14:05:28 2012 > (r243227) > > > +++ head/etc/rc.initdiskless Sun Nov 18 14:21:05 2012 > (r243228) > > > @@ -354,7 +354,7 @@ for i in ${templates} ; do > > > subdir=${j##*/} > > > if [ -d $j -a ! -f $j.cpio.gz ]; then > > > create_md $subdir > > > - cp -Rp $j/ /$subdir > > > + (cd $j && pax -rw . /$subdir) > > > fi > > > done > > > for j in /conf/$i/*.cpio.gz ; do > > > > Are you sure that this bug wasn't already fixed? The original version > > of the code in the bug report used the following line: > > > > - cp -Rp $j/* /$subdir > > > > The old version of the code you changed didn't have this asterisk, > > meaning dotfiles would already be copied. Still, you could argue that > > your version is nicer, as our behaviour of cp with the trailing slash > > contradicts POSIX. > > > > You are correct, and the second to point it out :) > > As you say however, pax is technically how it should be done anyway, and > has the nice effect of also preserving hard links. If no-one objects I > think it should stay in. > > This is unfortunately another example of many in rc of where something was > fixed ages ago and no-one checked GNATS :( Of course, this is still my > fault. I would vote against yet another pointlessly different program required to boot the system. At work, we don't put pax (or anything else we don't need) onto a product image (although if this change sticks, I guess we will be some day). -- Ian From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 00:19:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80CB6790; Mon, 19 Nov 2012 00:19:27 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6673C8FC0C; Mon, 19 Nov 2012 00:19:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ0JRkJ043865; Mon, 19 Nov 2012 00:19:27 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ0JRWa043864; Mon, 19 Nov 2012 00:19:27 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211190019.qAJ0JRWa043864@svn.freebsd.org> From: Juli Mallett Date: Mon, 19 Nov 2012 00:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243253 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 00:19:27 -0000 Author: jmallett Date: Mon Nov 19 00:19:27 2012 New Revision: 243253 URL: http://svnweb.freebsd.org/changeset/base/243253 Log: o) Do boot descriptor parsing before console setup so that we can use a console other than UART 0 from the outset. o) Print board information from sysinfo after consoles have been initialized rather than doing it during boot descriptor parsing. o) Use cvmx_safe_printf and platform_reset rather than panic when doing very early boot descriptor parsing before the console is set up. o) Get rid of the global octeon_bootinfo. Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Sun Nov 18 23:15:22 2012 (r243252) +++ head/sys/mips/cavium/octeon_machdep.c Mon Nov 19 00:19:27 2012 (r243253) @@ -88,14 +88,11 @@ __FBSDID("$FreeBSD$"); #define MAX_APP_DESC_ADDR 0xafffffff #endif -#define OCTEON_CLOCK_DEFAULT (500 * 1000 * 1000) - struct octeon_feature_description { octeon_feature_t ofd_feature; const char *ofd_string; }; -extern int *edata; extern int *end; extern char cpu_model[]; extern char cpu_board[]; @@ -280,26 +277,51 @@ platform_start(__register_t a0, __regist const struct octeon_feature_description *ofd; uint64_t platform_counter_freq; + mips_postboot_fixup(); + /* - * XXX - * octeon_boot_params_init() should be called before anything else, - * certainly before any output; we may find out from the boot - * descriptor's flags that we're supposed to use the PCI or UART1 - * consoles rather than UART0. No point doing that reorganization - * until we actually intercept UART_DEV_CONSOLE for the UART1 case - * and somehow handle the PCI console, which we lack code for - * entirely. + * Initialize boot parameters so that we can determine things like + * which console we shoud use, etc. */ - - mips_postboot_fixup(); + octeon_boot_params_init(a3); /* Initialize pcpu stuff */ mips_pcpu0_init(); - mips_timer_early_init(OCTEON_CLOCK_DEFAULT); + mips_timer_early_init(cvmx_sysinfo_get()->cpu_clock_hz); + + /* Initialize console. */ cninit(); + /* + * Display information about the board/CPU. + */ + printf("CPU clock: %uMHz Core Mask: %#x\n", + cvmx_sysinfo_get()->cpu_clock_hz / 1000000, + cvmx_sysinfo_get()->core_mask); + printf("Board Type: %u Revision: %u/%u\n", + cvmx_sysinfo_get()->board_type, + cvmx_sysinfo_get()->board_rev_major, + cvmx_sysinfo_get()->board_rev_minor); + printf("MAC address base: %6D (%u configured)\n", + cvmx_sysinfo_get()->mac_addr_base, ":", + cvmx_sysinfo_get()->mac_addr_count); + +#if defined(OCTEON_BOARD_CAPK_0100ND) + strcpy(cpu_board, "CAPK-0100ND"); + if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CN3010_EVB_HS5) { + panic("Compiled for %s, but board type is %s.", cpu_board, + cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); + } +#else + strcpy(cpu_board, + cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); +#endif + printf("Board: %s\n", cpu_board); + strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id())); + printf("Model: %s\n", cpu_model); + printf("Serial number: %s\n", cvmx_sysinfo_get()->board_serial_number); + octeon_ciu_reset(); - octeon_boot_params_init(a3); /* * XXX * We can certainly parse command line arguments or U-Boot environment @@ -514,26 +536,26 @@ typedef struct { uint64_t cvmx_desc_vaddr; } octeon_boot_descriptor_t; -cvmx_bootinfo_t *octeon_bootinfo; - -static octeon_boot_descriptor_t *app_desc_ptr; - -static void -octeon_process_app_desc_ver_6(void) +static cvmx_bootinfo_t * +octeon_process_app_desc_ver_6(octeon_boot_descriptor_t *app_desc_ptr) { + cvmx_bootinfo_t *octeon_bootinfo; + /* XXX Why is 0x00000000ffffffffULL a bad value? */ if (app_desc_ptr->cvmx_desc_vaddr == 0 || - app_desc_ptr->cvmx_desc_vaddr == 0xfffffffful) - panic("Bad octeon_bootinfo %p", octeon_bootinfo); + app_desc_ptr->cvmx_desc_vaddr == 0xfffffffful) { + cvmx_safe_printf("Bad octeon_bootinfo %#jx\n", + (uintmax_t)app_desc_ptr->cvmx_desc_vaddr); + return (NULL); + } - octeon_bootinfo = - (cvmx_bootinfo_t *)(intptr_t)app_desc_ptr->cvmx_desc_vaddr; - octeon_bootinfo = - (cvmx_bootinfo_t *) ((intptr_t)octeon_bootinfo | MIPS_KSEG0_START); - if (octeon_bootinfo->major_version != 1) - panic("Incompatible CVMX descriptor from bootloader: %d.%d %p", - (int) octeon_bootinfo->major_version, - (int) octeon_bootinfo->minor_version, octeon_bootinfo); + octeon_bootinfo = cvmx_phys_to_ptr(app_desc_ptr->cvmx_desc_vaddr); + if (octeon_bootinfo->major_version != 1) { + cvmx_safe_printf("Incompatible CVMX descriptor from bootloader: %d.%d %p\n", + (int) octeon_bootinfo->major_version, + (int) octeon_bootinfo->minor_version, octeon_bootinfo); + return (NULL); + } cvmx_sysinfo_minimal_initialize(octeon_bootinfo->phy_mem_desc_addr, octeon_bootinfo->board_type, @@ -553,21 +575,31 @@ octeon_process_app_desc_ver_6(void) memcpy(cvmx_sysinfo_get()->board_serial_number, octeon_bootinfo->board_serial_number, sizeof cvmx_sysinfo_get()->board_serial_number); + return (octeon_bootinfo); } static void octeon_boot_params_init(register_t ptr) { - if (ptr == 0 || ptr >= MAX_APP_DESC_ADDR) - panic("app descriptor passed at invalid address %#jx", + octeon_boot_descriptor_t *app_desc_ptr; + cvmx_bootinfo_t *octeon_bootinfo; + + if (ptr == 0 || ptr >= MAX_APP_DESC_ADDR) { + cvmx_safe_printf("app descriptor passed at invalid address %#jx\n", (uintmax_t)ptr); + platform_reset(); + } app_desc_ptr = (octeon_boot_descriptor_t *)(intptr_t)ptr; - if (app_desc_ptr->desc_version < 6) - panic("Your boot code is too old to be supported."); - octeon_process_app_desc_ver_6(); - - KASSERT(octeon_bootinfo != NULL, ("octeon_bootinfo should be set")); + if (app_desc_ptr->desc_version < 6) { + cvmx_safe_printf("Your boot code is too old to be supported.\n"); + platform_reset(); + } + octeon_bootinfo = octeon_process_app_desc_ver_6(app_desc_ptr); + if (octeon_bootinfo == NULL) { + cvmx_safe_printf("Could not parse boot descriptor.\n"); + platform_reset(); + } if (cvmx_sysinfo_get()->led_display_base_addr != 0) { /* @@ -581,50 +613,14 @@ octeon_boot_params_init(register_t ptr) ebt3000_str_write("FreeBSD!"); } - if (cvmx_sysinfo_get()->phy_mem_desc_addr == (uint64_t)0) - panic("Your boot loader did not supply a memory descriptor."); + if (cvmx_sysinfo_get()->phy_mem_desc_addr == (uint64_t)0) { + cvmx_safe_printf("Your boot loader did not supply a memory descriptor.\n"); + platform_reset(); + } cvmx_bootmem_init(cvmx_sysinfo_get()->phy_mem_desc_addr); octeon_feature_init(); __cvmx_helper_cfg_init(); - - printf("Boot Descriptor Ver: %u -> %u/%u", - app_desc_ptr->desc_version, octeon_bootinfo->major_version, - octeon_bootinfo->minor_version); - printf(" CPU clock: %uMHz Core Mask: %#x\n", - cvmx_sysinfo_get()->cpu_clock_hz / 1000000, - cvmx_sysinfo_get()->core_mask); - printf(" Board Type: %u Revision: %u/%u\n", - cvmx_sysinfo_get()->board_type, - cvmx_sysinfo_get()->board_rev_major, - cvmx_sysinfo_get()->board_rev_minor); - - printf(" Mac Address %02X.%02X.%02X.%02X.%02X.%02X (%d)\n", - octeon_bootinfo->mac_addr_base[0], - octeon_bootinfo->mac_addr_base[1], - octeon_bootinfo->mac_addr_base[2], - octeon_bootinfo->mac_addr_base[3], - octeon_bootinfo->mac_addr_base[4], - octeon_bootinfo->mac_addr_base[5], - octeon_bootinfo->mac_addr_count); - -#if defined(OCTEON_BOARD_CAPK_0100ND) - strcpy(cpu_board, "CAPK-0100ND"); - if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CN3010_EVB_HS5) { - printf("Compiled for CAPK-0100ND, but board type is %s\n", - cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); - strcat(cpu_board, " hardwired, but type is "); - strcat(cpu_board, - cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); - } -#else - strcpy(cpu_board, - cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); - printf("Board: %s\n", cpu_board); -#endif - strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id())); - printf("Model: %s\n", cpu_model); - printf("Serial number: %s\n", cvmx_sysinfo_get()->board_serial_number); } /* impEND: This stuff should move back into the Cavium SDK */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 01:15:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 96DBBFB1; Mon, 19 Nov 2012 01:15:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 600028FC08; Mon, 19 Nov 2012 01:15:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ1FXeq052894; Mon, 19 Nov 2012 01:15:33 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ1FXYq052893; Mon, 19 Nov 2012 01:15:33 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201211190115.qAJ1FXYq052893@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 19 Nov 2012 01:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243254 - head/sys/boot/powerpc/boot1.chrp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 01:15:33 -0000 Author: trasz Date: Mon Nov 19 01:15:32 2012 New Revision: 243254 URL: http://svnweb.freebsd.org/changeset/base/243254 Log: Fix build on powerpc. Reviewed by: nwhitehorn Modified: head/sys/boot/powerpc/boot1.chrp/boot1.c Modified: head/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/boot1.c Mon Nov 19 00:19:27 2012 (r243253) +++ head/sys/boot/powerpc/boot1.chrp/boot1.c Mon Nov 19 01:15:32 2012 (r243254) @@ -61,7 +61,7 @@ static void usage(void); static void bcopy(const void *src, void *dst, size_t len); static void bzero(void *b, size_t len); -static int mount(const char *device, int quiet); +static int domount(const char *device, int quiet); static void panic(const char *fmt, ...) __dead2; static int printf(const char *fmt, ...); @@ -431,7 +431,7 @@ main(int ac, char **av) bootpath_full[len+2] = '\0'; } - if (mount(bootpath_full,1) >= 0) + if (domount(bootpath_full,1) >= 0) break; if (bootdev > 0) @@ -439,10 +439,10 @@ main(int ac, char **av) } if (i >= 16) - panic("mount"); + panic("domount"); } else { - if (mount(bootpath_full,0) == -1) - panic("mount"); + if (domount(bootpath_full,0) == -1) + panic("domount"); } printf(" Boot volume: %s\n",bootpath_full); @@ -469,17 +469,17 @@ exit(int code) static struct dmadat __dmadat; static int -mount(const char *device, int quiet) +domount(const char *device, int quiet) { dmadat = &__dmadat; if ((bootdev = ofw_open(device)) == -1) { - printf("mount: can't open device\n"); + printf("domount: can't open device\n"); return (-1); } if (fsread(0, NULL, 0)) { if (!quiet) - printf("mount: can't read superblock\n"); + printf("domount: can't read superblock\n"); return (-1); } return (0); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 01:58:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33E12CE3; Mon, 19 Nov 2012 01:58:21 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 19AE48FC08; Mon, 19 Nov 2012 01:58:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ1wKHT058488; Mon, 19 Nov 2012 01:58:20 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ1wKr2058487; Mon, 19 Nov 2012 01:58:20 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211190158.qAJ1wKr2058487@svn.freebsd.org> From: Juli Mallett Date: Mon, 19 Nov 2012 01:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243255 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 01:58:21 -0000 Author: jmallett Date: Mon Nov 19 01:58:20 2012 New Revision: 243255 URL: http://svnweb.freebsd.org/changeset/base/243255 Log: Add basic support for the Radisys-specific PCI console mechanism found on the Radisys ATCA-7220. Modified: head/sys/mips/cavium/octeon_pci_console.c Modified: head/sys/mips/cavium/octeon_pci_console.c ============================================================================== --- head/sys/mips/cavium/octeon_pci_console.c Mon Nov 19 01:15:32 2012 (r243254) +++ head/sys/mips/cavium/octeon_pci_console.c Mon Nov 19 01:58:20 2012 (r243255) @@ -39,8 +39,22 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#ifdef OCTEON_VENDOR_RADISYS +#define OPCIC_FLAG_RSYS (0x00000001) + +#define OPCIC_RSYS_FIFO_SIZE (0x2000) +#endif + +struct opcic_softc { + unsigned sc_flags; + uint64_t sc_base_addr; +}; + +static struct opcic_softc opcic_instance; + static cn_probe_t opcic_cnprobe; static cn_init_t opcic_cninit; static cn_term_t opcic_cnterm; @@ -49,20 +63,46 @@ static cn_putc_t opcic_cnputc; static cn_grab_t opcic_cngrab; static cn_ungrab_t opcic_cnungrab; +#ifdef OCTEON_VENDOR_RADISYS +static int opcic_rsys_cngetc(struct opcic_softc *); +static void opcic_rsys_cnputc(struct opcic_softc *, int); +#endif + CONSOLE_DRIVER(opcic); static void opcic_cnprobe(struct consdev *cp) { const struct cvmx_bootmem_named_block_desc *pci_console_block; + struct opcic_softc *sc; + + sc = &opcic_instance; + sc->sc_flags = 0; + sc->sc_base_addr = 0; cp->cn_pri = CN_DEAD; - pci_console_block = cvmx_bootmem_find_named_block(OCTEON_PCI_CONSOLE_BLOCK_NAME); - if (pci_console_block == NULL) - return; + switch (cvmx_sysinfo_get()->board_type) { +#ifdef OCTEON_VENDOR_RADISYS + case CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE: + pci_console_block = + cvmx_bootmem_find_named_block("rsys_gbl_memory"); + if (pci_console_block != NULL) { + sc->sc_flags |= OPCIC_FLAG_RSYS; + sc->sc_base_addr = pci_console_block->base_addr; + break; + } +#endif + default: + pci_console_block = + cvmx_bootmem_find_named_block(OCTEON_PCI_CONSOLE_BLOCK_NAME); + if (pci_console_block == NULL) + return; + sc->sc_base_addr = pci_console_block->base_addr; + break; + } - cp->cn_arg = (void *)(uintptr_t)pci_console_block->base_addr; + cp->cn_arg = sc; snprintf(cp->cn_name, sizeof cp->cn_name, "opcic@%p", cp->cn_arg); cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; } @@ -82,13 +122,19 @@ opcic_cnterm(struct consdev *cp) static int opcic_cngetc(struct consdev *cp) { - uint64_t console_desc_addr; + struct opcic_softc *sc; char ch; int rv; - console_desc_addr = (uintptr_t)cp->cn_arg; + sc = cp->cn_arg; - rv = octeon_pci_console_read(console_desc_addr, 0, &ch, 1, OCT_PCI_CON_FLAG_NONBLOCK); +#ifdef OCTEON_VENDOR_RADISYS + if ((sc->sc_flags & OPCIC_FLAG_RSYS) != 0) + return (opcic_rsys_cngetc(sc)); +#endif + + rv = octeon_pci_console_read(sc->sc_base_addr, 0, &ch, 1, + OCT_PCI_CON_FLAG_NONBLOCK); if (rv != 1) return (-1); return (ch); @@ -97,14 +143,21 @@ opcic_cngetc(struct consdev *cp) static void opcic_cnputc(struct consdev *cp, int c) { - uint64_t console_desc_addr; + struct opcic_softc *sc; char ch; int rv; - console_desc_addr = (uintptr_t)cp->cn_arg; + sc = cp->cn_arg; ch = c; - rv = octeon_pci_console_write(console_desc_addr, 0, &ch, 1, 0); +#ifdef OCTEON_VENDOR_RADISYS + if ((sc->sc_flags & OPCIC_FLAG_RSYS) != 0) { + opcic_rsys_cnputc(sc, c); + return; + } +#endif + + rv = octeon_pci_console_write(sc->sc_base_addr, 0, &ch, 1, 0); if (rv == -1) panic("%s: octeon_pci_console_write failed.", __func__); } @@ -120,3 +173,64 @@ opcic_cnungrab(struct consdev *cp) { (void)cp; } + +#ifdef OCTEON_VENDOR_RADISYS +static int +opcic_rsys_cngetc(struct opcic_softc *sc) +{ + uint64_t gbl_base; + uint64_t console_base; + uint64_t console_rbuf; + uint64_t console_rcnt[2]; + uint16_t rcnt[2]; + uint16_t roff; + int c; + + gbl_base = CVMX_ADD_IO_SEG(sc->sc_base_addr); + console_base = gbl_base + 0x10; + + console_rbuf = console_base + 0x2018; + console_rcnt[0] = console_base + 0x08; + console_rcnt[1] = console_base + 0x0a; + + /* Check if there is anything new in the FIFO. */ + rcnt[0] = cvmx_read64_uint16(console_rcnt[0]); + rcnt[1] = cvmx_read64_uint16(console_rcnt[1]); + if (rcnt[0] == rcnt[1]) + return (-1); + + /* Get first new character in the FIFO. */ + if (rcnt[0] != 0) + roff = rcnt[0] - 1; + else + roff = OPCIC_RSYS_FIFO_SIZE - 1; + c = cvmx_read64_uint8(console_rbuf + roff); + + /* Advance FIFO. */ + rcnt[1] = (rcnt[1] + 1) % OPCIC_RSYS_FIFO_SIZE; + cvmx_write64_uint16(console_rcnt[1], rcnt[1]); + + return (c); +} + +static void +opcic_rsys_cnputc(struct opcic_softc *sc, int c) +{ + uint64_t gbl_base; + uint64_t console_base; + uint64_t console_wbuf; + uint64_t console_wcnt; + uint16_t wcnt; + + gbl_base = CVMX_ADD_IO_SEG(sc->sc_base_addr); + console_base = gbl_base + 0x10; + + console_wbuf = console_base + 0x0018; + console_wcnt = console_base + 0x0c; + + /* Append character to FIFO. */ + wcnt = cvmx_read64_uint16(console_wcnt) % OPCIC_RSYS_FIFO_SIZE; + cvmx_write64_uint8(console_wbuf + wcnt, (uint8_t)c); + cvmx_write64_uint16(console_wcnt, wcnt + 1); +} +#endif From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 04:07:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A0B11B6; Mon, 19 Nov 2012 04:07:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A6808FC08; Mon, 19 Nov 2012 04:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ47ioL077941; Mon, 19 Nov 2012 04:07:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ47iG2077940; Mon, 19 Nov 2012 04:07:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211190407.qAJ47iG2077940@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Nov 2012 04:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243256 - stable/9/usr.bin/chpass X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 04:07:44 -0000 Author: eadler Date: Mon Nov 19 04:07:43 2012 New Revision: 243256 URL: http://svnweb.freebsd.org/changeset/base/243256 Log: MFC r243081: Avoid possible null deref if ypclnt_new returns null PR: bin/172979 Approved by: cperciva (implicit) Modified: stable/9/usr.bin/chpass/chpass.c Directory Properties: stable/9/usr.bin/chpass/ (props changed) Modified: stable/9/usr.bin/chpass/chpass.c ============================================================================== --- stable/9/usr.bin/chpass/chpass.c Mon Nov 19 01:58:20 2012 (r243255) +++ stable/9/usr.bin/chpass/chpass.c Mon Nov 19 04:07:43 2012 (r243256) @@ -241,8 +241,11 @@ main(int argc, char *argv[]) #ifdef YP case _PWF_NIS: ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host); - if (ypclnt == NULL || - ypclnt_connect(ypclnt) == -1 || + if (ypclnt == NULL) { + warnx("ypclnt_new failed"); + exit(1); + } + if (ypclnt_connect(ypclnt) == -1 || ypclnt_passwd(ypclnt, pw, password) == -1) { warnx("%s", ypclnt->error); ypclnt_free(ypclnt); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 04:08:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51D7232D; Mon, 19 Nov 2012 04:08:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3644A8FC0C; Mon, 19 Nov 2012 04:08:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ48Bkb078061; Mon, 19 Nov 2012 04:08:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ48BqN078060; Mon, 19 Nov 2012 04:08:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211190408.qAJ48BqN078060@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Nov 2012 04:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243257 - stable/8/usr.bin/chpass X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 04:08:11 -0000 Author: eadler Date: Mon Nov 19 04:08:10 2012 New Revision: 243257 URL: http://svnweb.freebsd.org/changeset/base/243257 Log: MFC r243081: Avoid possible null deref if ypclnt_new returns null PR: bin/172979 Approved by: cperciva (implicit) Modified: stable/8/usr.bin/chpass/chpass.c Directory Properties: stable/8/usr.bin/chpass/ (props changed) Modified: stable/8/usr.bin/chpass/chpass.c ============================================================================== --- stable/8/usr.bin/chpass/chpass.c Mon Nov 19 04:07:43 2012 (r243256) +++ stable/8/usr.bin/chpass/chpass.c Mon Nov 19 04:08:10 2012 (r243257) @@ -241,8 +241,11 @@ main(int argc, char *argv[]) #ifdef YP case _PWF_NIS: ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host); - if (ypclnt == NULL || - ypclnt_connect(ypclnt) == -1 || + if (ypclnt == NULL) { + warnx("ypclnt_new failed"); + exit(1); + } + if (ypclnt_connect(ypclnt) == -1 || ypclnt_passwd(ypclnt, pw, password) == -1) { warnx("%s", ypclnt->error); ypclnt_free(ypclnt); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 04:08:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8292D43A; Mon, 19 Nov 2012 04:08:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 674158FC12; Mon, 19 Nov 2012 04:08:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ48K5I078124; Mon, 19 Nov 2012 04:08:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ48KrU078123; Mon, 19 Nov 2012 04:08:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211190408.qAJ48KrU078123@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Nov 2012 04:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243258 - stable/7/usr.bin/chpass X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 04:08:20 -0000 Author: eadler Date: Mon Nov 19 04:08:20 2012 New Revision: 243258 URL: http://svnweb.freebsd.org/changeset/base/243258 Log: MFC r243081: Avoid possible null deref if ypclnt_new returns null PR: bin/172979 Approved by: cperciva (implicit) Modified: stable/7/usr.bin/chpass/chpass.c Directory Properties: stable/7/usr.bin/chpass/ (props changed) Modified: stable/7/usr.bin/chpass/chpass.c ============================================================================== --- stable/7/usr.bin/chpass/chpass.c Mon Nov 19 04:08:10 2012 (r243257) +++ stable/7/usr.bin/chpass/chpass.c Mon Nov 19 04:08:20 2012 (r243258) @@ -241,8 +241,11 @@ main(int argc, char *argv[]) #ifdef YP case _PWF_NIS: ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host); - if (ypclnt == NULL || - ypclnt_connect(ypclnt) == -1 || + if (ypclnt == NULL) { + warnx("ypclnt_new failed"); + exit(1); + } + if (ypclnt_connect(ypclnt) == -1 || ypclnt_passwd(ypclnt, pw, password) == -1) { warnx("%s", ypclnt->error); ypclnt_free(ypclnt); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 04:10:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEA2D618; Mon, 19 Nov 2012 04:10:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5218FC12; Mon, 19 Nov 2012 04:10:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ4ANRn078600; Mon, 19 Nov 2012 04:10:23 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ4ANVe078599; Mon, 19 Nov 2012 04:10:23 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211190410.qAJ4ANVe078599@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Nov 2012 04:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243259 - stable/9/share/termcap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 04:10:23 -0000 Author: eadler Date: Mon Nov 19 04:10:23 2012 New Revision: 243259 URL: http://svnweb.freebsd.org/changeset/base/243259 Log: MFC r243073: Some software, notably dialog(1), can understand back-tab, which is typically bound to Shift-Tab. syscons produces ^]]Z for Shift-Tab, like many VT100-like terminal (emulators). The plain xterm does not produce this sequence, but ^I for both Tab and Shift-Tab. PR: conf/162787 PR: bin/151229 Approved by: cperciva (implicit) Modified: stable/9/share/termcap/termcap.src Directory Properties: stable/9/share/termcap/ (props changed) Modified: stable/9/share/termcap/termcap.src ============================================================================== --- stable/9/share/termcap/termcap.src Mon Nov 19 04:08:20 2012 (r243258) +++ stable/9/share/termcap/termcap.src Mon Nov 19 04:10:23 2012 (r243259) @@ -2825,7 +2825,7 @@ xterm-basic|modern xterm common:\ :as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ :cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\ :ei=\E[4l:ho=\E[H:im=\E[4h:is=\E[!p\E[?3;4l\E[4l\E>:\ - :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\ + :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:kB=\E[Z:le=^H:md=\E[1m:\ :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\ :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\ :so=\E[7m:sr=\EM:st=\EH:\ From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 05:24:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9012AEA0; Mon, 19 Nov 2012 05:24:34 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5AE7E8FC16; Mon, 19 Nov 2012 05:24:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ5OYA7090305; Mon, 19 Nov 2012 05:24:34 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ5OYOm090302; Mon, 19 Nov 2012 05:24:34 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211190524.qAJ5OYOm090302@svn.freebsd.org> From: Juli Mallett Date: Mon, 19 Nov 2012 05:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243260 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 05:24:34 -0000 Author: jmallett Date: Mon Nov 19 05:24:33 2012 New Revision: 243260 URL: http://svnweb.freebsd.org/changeset/base/243260 Log: Fix packet receive on the ATCA-7220 by disabling FCS-related checks, since the FCS is stripped by the underlying hardware before it reaches the Octeon. Modified: head/sys/contrib/octeon-sdk/cvmx-helper-spi.c head/sys/contrib/octeon-sdk/cvmx-spi.c Modified: head/sys/contrib/octeon-sdk/cvmx-helper-spi.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Mon Nov 19 04:10:23 2012 (r243259) +++ head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Mon Nov 19 05:24:33 2012 (r243260) @@ -164,6 +164,13 @@ int __cvmx_helper_spi_enable(int interfa cvmx_pip_prt_cfgx_t port_config; port_config.u64 = cvmx_read_csr(CVMX_PIP_PRT_CFGX(ipd_port)); port_config.s.crc_en = 1; +#ifdef OCTEON_VENDOR_RADISYS + /* + * Incoming packets on the RSYS4GBE have the FCS stripped. + */ + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) + port_config.s.crc_en = 0; +#endif cvmx_write_csr(CVMX_PIP_PRT_CFGX(ipd_port), port_config.u64); } Modified: head/sys/contrib/octeon-sdk/cvmx-spi.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-spi.c Mon Nov 19 04:10:23 2012 (r243259) +++ head/sys/contrib/octeon-sdk/cvmx-spi.c Mon Nov 19 05:24:33 2012 (r243260) @@ -652,6 +652,13 @@ int cvmx_spi_interface_up_cb(int interfa gmxx_rxx_frm_min.u64 = 0; gmxx_rxx_frm_min.s.len = 64; +#ifdef OCTEON_VENDOR_RADISYS + /* + * Incoming packets on the RSYS4GBE have the FCS stripped. + */ + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) + gmxx_rxx_frm_min.s.len -= 4; +#endif cvmx_write_csr(CVMX_GMXX_RXX_FRM_MIN(0,interface), gmxx_rxx_frm_min.u64); gmxx_rxx_frm_max.u64 = 0; gmxx_rxx_frm_max.s.len = 64*1024 - 4; From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 05:45:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B394362; Mon, 19 Nov 2012 05:45:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 1A3B88FC08; Mon, 19 Nov 2012 05:45:18 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qAJ5jESH064432; Mon, 19 Nov 2012 07:45:14 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qAJ5jESH064432 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qAJ5jE6L064431; Mon, 19 Nov 2012 07:45:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 19 Nov 2012 07:45:14 +0200 From: Konstantin Belousov To: Benjamin Kaduk Subject: Re: svn commit: r243251 - head/share/man/man9 Message-ID: <20121119054514.GL73505@kib.kiev.ua> References: <201211182252.qAIMqHvN028232@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nSm7qnGuElBFM7UH" Content-Disposition: inline In-Reply-To: <201211182252.qAIMqHvN028232@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 05:45:19 -0000 --nSm7qnGuElBFM7UH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 18, 2012 at 10:52:17PM +0000, Benjamin Kaduk wrote: > Author: bjk (doc committer) > Date: Sun Nov 18 22:52:17 2012 > New Revision: 243251 > URL: http://svnweb.freebsd.org/changeset/base/243251 >=20 > Log: > Improve grammar. > =20 > Approved by: hrs (mentor) >=20 > Modified: > head/share/man/man9/sleep.9 >=20 > Modified: head/share/man/man9/sleep.9 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man9/sleep.9 Sun Nov 18 22:03:31 2012 (r243250) > +++ head/share/man/man9/sleep.9 Sun Nov 18 22:52:17 2012 (r243251) > @@ -102,7 +102,8 @@ If > .Fa priority > includes the > .Dv PCATCH > -flag, signals are checked before and after sleeping, otherwise signals a= re > +flag, pending > +signals are checked before and after sleeping, otherwise signals are > not checked. There, both old and new formulations are strange. The PCATCH flag causes the signal enqueuing to interrupt sleep, so saying that signals are checked before and after, although not wrong, is also confusing. > If > .Dv PCATCH > @@ -114,17 +115,18 @@ possible, and > is returned if the system call should be interrupted by the signal > (return > .Er EINTR ) . > -If > +If the > .Dv PBDRY > flag is specified in addition to > .Dv PCATCH , > -then the sleeping thread is not stopped while sleeping upon delivery of > +then the sleeping thread is not stopped upon delivery of > .Dv SIGSTOP > -or other stop action. > -Instead, it is waken up, assuming that stop occurs on reaching a stop > +or other stop action while it is sleeping. > +Instead, it is woken up, with the assumption > +that the stop will occur on reaching a stop > point when returning to usermode. > -The flag should be used when sleeping thread owns resources, for instance > -vnode locks, that should be freed timely. > +The flag should be used when the sleeping thread owns resources, for ins= tance > +vnode locks, that should be released in a timely fashion. > .Pp > The parameter > .Fa wmesg I think the changes are good. --nSm7qnGuElBFM7UH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQqcdqAAoJEJDCuSvBvK1BoF4P/0L6zmNYCttQsk7eeb/Ds86I vYPLL/gIqfjRO9RKt39du5g8DJwLURmQ7MGKxQxcrqFy9qiJajXN69VjJhuphEdJ 3O5R+Nxrprlb0X79OOll0D8V+DtiCCPiWZ8ABJv4BxZ1UVR/+eDcv4ANEUWo/crF K+M7Ib5jaZROsWPnPkZH2UqYDos50Mxzo4F5AFfpRunJF2/BNQvdEn8AaQnMKkwh lR0hGWFVwgT0i26DH4p5wgqDvUCDKnBvof7n4sdgiMMdhJcmhG9G0DAAxCmxyYQo 4vKDRWPgpWvnOz56zHMlwW8meoVcSQ5rZdv/RpkUkew1/l+PxPxH3vdP0yZ+sVJa oysN9NFqiivTk1tLQwOw9eU+l/1UFu4GOtdY99tXrQhzvlFVuUOtNiy2xM62vOf6 F+ynRjeclg3x+tKsMIV1QVyxK2LEqJabMxNrV+AQmdgMNwMAXlsHiYvkSLhpnQCC VhjbSdDfRRUS9p4jyc1x3ou4zRJtyOODj45zbyscBR9xbQeg1zr9r3NCIC6nSu7Q 1dj3YyEspodovfUer83S/XpCkBGkVNy2b6kOGhLgFycym0B91f6mfVoib5cTawAZ TU+l78csC6oE6XKe8f1OdzhyqdZQkv1dIM9/41bStCt+UQ5mOLWkcVyBXC1psSNH Hh+hA3DBtU3ozoeATcBN =pScn -----END PGP SIGNATURE----- --nSm7qnGuElBFM7UH-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 05:52:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E06653E; Mon, 19 Nov 2012 05:52:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 62C1A8FC08; Mon, 19 Nov 2012 05:52:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ5qNSW094183; Mon, 19 Nov 2012 05:52:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ5qNr7094182; Mon, 19 Nov 2012 05:52:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211190552.qAJ5qNr7094182@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Nov 2012 05:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243261 - stable/9/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 05:52:23 -0000 Author: adrian Date: Mon Nov 19 05:52:23 2012 New Revision: 243261 URL: http://svnweb.freebsd.org/changeset/base/243261 Log: Merge r227468: Don't fondle this particular CCA register from extension channel. Modified: stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Nov 19 05:24:33 2012 (r243260) +++ stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Nov 19 05:52:23 2012 (r243261) @@ -342,11 +342,6 @@ ar5416AniControl(struct ath_hal *ah, HAL OS_REG_RMW_FIELD(ah, AR_PHY_TIMING5, AR_PHY_TIMING5_CYCPWR_THR1, params->cycPwrThr1[level]); - /* Only set the ext channel cycpwr_thr1 field for ht/40 */ - if (IEEE80211_IS_CHAN_HT40(AH_PRIVATE(ah)->ah_curchan)) - OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA, - AR_PHY_EXT_TIMING5_CYCPWR_THR1, params->cycPwrThr1[level]); - if (level > aniState->spurImmunityLevel) ahp->ah_stats.ast_ani_spurup++; else if (level < aniState->spurImmunityLevel) From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 08:03:33 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52D2FC79; Mon, 19 Nov 2012 08:03:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id DC1E88FC0C; Mon, 19 Nov 2012 08:03:32 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAJ83ALQ006413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Nov 2012 19:03:17 +1100 Date: Mon, 19 Nov 2012 19:03:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Chris Rees Subject: Re: svn commit: r243228 - head/etc In-Reply-To: Message-ID: <20121119175936.J1085@besplex.bde.org> References: <201211181421.qAIEL5KT042019@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Ed Schouten , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 08:03:33 -0000 On Sun, 18 Nov 2012, Chris Rees wrote: > On 18 Nov 2012 20:39, "Ed Schouten" wrote: >> >> Hi Chris, >> >> 2012/11/18 Chris Rees : >>> Modified: head/etc/rc.initdiskless >>> > ============================================================================== >>> --- head/etc/rc.initdiskless Sun Nov 18 14:05:28 2012 > (r243227) >>> +++ head/etc/rc.initdiskless Sun Nov 18 14:21:05 2012 > (r243228) >>> @@ -354,7 +354,7 @@ for i in ${templates} ; do >>> subdir=${j##*/} >>> if [ -d $j -a ! -f $j.cpio.gz ]; then >>> create_md $subdir >>> - cp -Rp $j/ /$subdir >>> + (cd $j && pax -rw . /$subdir) >>> fi >>> done >>> for j in /conf/$i/*.cpio.gz ; do >> >> Are you sure that this bug wasn't already fixed? The original version >> of the code in the bug report used the following line: >> >> - cp -Rp $j/* /$subdir >> >> The old version of the code you changed didn't have this asterisk, >> meaning dotfiles would already be copied. Still, you could argue that >> your version is nicer, as our behaviour of cp with the trailing slash >> contradicts POSIX. I don't think POSIX is that broken. > You are correct, and the second to point it out :) > > As you say however, pax is technically how it should be done anyway, and > has the nice effect of also preserving hard links. If no-one objects I > think it should stay in. Not perserving hard links is a bug in cp -R. Another bug in cp -Rp is that it doesn't preserve mtimes for directories. But a non-broken cp -Rp would be nicer than non-broken use of pax, and even a broken cp -Rp is better than a broken use of pax. The above use of pax is semantically very different from cp -Rp, and introduces the following bugs: - no error checking for cd. We have just checked that $j is a directory. If it should somehow go away, then the errors from cp -Rp of it are more fail-safe than the errors from not checking for cd failure. - cp -R creates the target directory /$subdir if it doesn't already exist (and its path prefix does exist and is a directory or a symlink to a directory), but pax doesn't If /$subdir does already exist, then there are races similar to the ones for the source directory if the target directory goes away, and pax handles them differently. - -p was used in 'cp -Rp' to preserve all attributes. The corresponding flags are not used in 'pax -rw'. They are '-p e'. By default, pax preserves file times (so '-p am' is part of the default). pax's man page seems to say that the file mode is not preserved by default and that '-p p' (or '-p e') must be used to preserve it, but in my tests under FreeBSD-~5.2 it was preserved. The uid and gid can only be preserved by root, and it is the default to not preserve them even for root. Root should use '-p e' or '-p o' to preseve them, just like -p was used with cp -Rp. pax is little used and poorly maintained. It has no support for acls, while cp has some. Pax hasn't caught up with the creation of utimes(2) in 4.2BSD, so it still clobbers the tv_nsec part of file times when it "preserves" them (though it uses lutimes(2)), while cp only clobbers the last 3 decimal digits in the tv_nsec part of file times when it "preserves" them. So even with '-p e', pax often clobbers file times and never preserves acls even. Maybe this doesn't matter here. But pax is unusable in general. I normally use cp -pR when I don't care about links or file times (which is rarely), else gnu tar if I care about links but not file times, else bsd tar occasionally for its better handling of file times (tar format just can't handle all the times well, and bsd tar handles them slightly less badly), else gnu tar following by a fixup program to duplicate all the times. gnu cp -a should work best, but I haven't used it lately. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 08:03:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5535BD7C; Mon, 19 Nov 2012 08:03:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6B6C78FC0C; Mon, 19 Nov 2012 08:03:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ83eGI014128; Mon, 19 Nov 2012 08:03:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ83eRo014127; Mon, 19 Nov 2012 08:03:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201211190803.qAJ83eRo014127@svn.freebsd.org> From: Rui Paulo Date: Mon, 19 Nov 2012 08:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243262 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 08:03:41 -0000 Author: rpaulo Date: Mon Nov 19 08:03:40 2012 New Revision: 243262 URL: http://svnweb.freebsd.org/changeset/base/243262 Log: Use the correct size when allocating the cmdbuf string. cmdlengthdelta is the size of the header and we were using it to allocate a buffer to store the command line. This would mean that the cmdbuf could be too short. In practice this was never noticed unless you usually run top -a. On a stock FreeBSD system you can see the problem by running sendmail and then running top -a on a big terminal window. In practice this doubles to size available to cmdbuf since the header is around 65-68 bytes. Reviewed by: adrian Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Nov 19 05:52:23 2012 (r243261) +++ head/usr.bin/top/machine.c Mon Nov 19 08:03:40 2012 (r243262) @@ -786,7 +786,7 @@ get_process_info(struct system_info *si, return ((caddr_t)&handle); } -static char fmt[128]; /* static area where result is built */ +static char fmt[512]; /* static area where result is built */ char * format_next_process(caddr_t handle, char *(*get_userid)(int), int flags) @@ -803,6 +803,7 @@ format_next_process(caddr_t handle, char char *proc_fmt, thr_buf[6], jid_buf[6]; char *cmdbuf = NULL; char **args; + const int cmdlen = 128; /* find and remember the next proc structure */ hp = (struct handle *)handle; @@ -865,31 +866,31 @@ format_next_process(caddr_t handle, char break; } - cmdbuf = (char *)malloc(cmdlengthdelta + 1); + cmdbuf = (char *)malloc(cmdlen + 1); if (cmdbuf == NULL) { - warn("malloc(%d)", cmdlengthdelta + 1); + warn("malloc(%d)", cmdlen + 1); return NULL; } if (!(flags & FMT_SHOWARGS)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) { - snprintf(cmdbuf, cmdlengthdelta, "%s{%s}", pp->ki_comm, + snprintf(cmdbuf, cmdlen, "%s{%s}", pp->ki_comm, pp->ki_tdname); } else { - snprintf(cmdbuf, cmdlengthdelta, "%s", pp->ki_comm); + snprintf(cmdbuf, cmdlen, "%s", pp->ki_comm); } } else { if (pp->ki_flag & P_SYSTEM || pp->ki_args == NULL || - (args = kvm_getargv(kd, pp, cmdlengthdelta)) == NULL || + (args = kvm_getargv(kd, pp, cmdlen)) == NULL || !(*args)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) { - snprintf(cmdbuf, cmdlengthdelta, + snprintf(cmdbuf, cmdlen, "[%s{%s}]", pp->ki_comm, pp->ki_tdname); } else { - snprintf(cmdbuf, cmdlengthdelta, + snprintf(cmdbuf, cmdlen, "[%s]", pp->ki_comm); } } else { @@ -898,7 +899,7 @@ format_next_process(caddr_t handle, char size_t argbuflen; size_t len; - argbuflen = cmdlengthdelta * 4; + argbuflen = cmdlen * 4; argbuf = (char *)malloc(argbuflen + 1); if (argbuf == NULL) { warn("malloc(%d)", argbuflen + 1); @@ -931,22 +932,22 @@ format_next_process(caddr_t handle, char dst--; *dst = '\0'; - if (strcmp(cmd, pp->ki_comm) != 0 ) { + if (strcmp(cmd, pp->ki_comm) != 0) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) - snprintf(cmdbuf, cmdlengthdelta, + snprintf(cmdbuf, cmdlen, "%s (%s){%s}", argbuf, pp->ki_comm, pp->ki_tdname); else - snprintf(cmdbuf, cmdlengthdelta, + snprintf(cmdbuf, cmdlen, "%s (%s)", argbuf, pp->ki_comm); } else { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) - snprintf(cmdbuf, cmdlengthdelta, + snprintf(cmdbuf, cmdlen, "%s{%s}", argbuf, pp->ki_tdname); else - strlcpy(cmdbuf, argbuf, cmdlengthdelta); + strlcpy(cmdbuf, argbuf, cmdlen); } free(argbuf); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 08:26:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id C16CF32B; Mon, 19 Nov 2012 08:26:18 +0000 (UTC) Date: Mon, 19 Nov 2012 08:26:18 +0000 From: Alexey Dokuchaev To: Rui Paulo Subject: Re: svn commit: r243262 - head/usr.bin/top Message-ID: <20121119082618.GB67020@FreeBSD.org> References: <201211190803.qAJ83eRo014127@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201211190803.qAJ83eRo014127@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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 08:26:19 -0000 On Mon, Nov 19, 2012 at 08:03:40AM +0000, Rui Paulo wrote: > New Revision: 243262 > URL: http://svnweb.freebsd.org/changeset/base/243262 > > - cmdbuf = (char *)malloc(cmdlengthdelta + 1); > + cmdbuf = (char *)malloc(cmdlen + 1); Why explicitly casting malloc return() value (void *)? ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 08:29:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 420944C0; Mon, 19 Nov 2012 08:29:54 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26B528FC15; Mon, 19 Nov 2012 08:29:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ8TsMK017963; Mon, 19 Nov 2012 08:29:54 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ8TsbJ017961; Mon, 19 Nov 2012 08:29:54 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211190829.qAJ8TsbJ017961@svn.freebsd.org> From: Juli Mallett Date: Mon, 19 Nov 2012 08:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243263 - head/sys/mips/cavium/octe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 08:29:54 -0000 Author: jmallett Date: Mon Nov 19 08:29:53 2012 New Revision: 243263 URL: http://svnweb.freebsd.org/changeset/base/243263 Log: Remove redundant printf of SDK version which already appears earlier in boot. Modified: head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/octe/ethernet.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet.c Mon Nov 19 08:03:40 2012 (r243262) +++ head/sys/mips/cavium/octe/ethernet.c Mon Nov 19 08:29:53 2012 (r243263) @@ -308,8 +308,6 @@ int cvm_oct_init_module(device_t bus) int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE; int qos; - printf("cavium-ethernet: %s\n", OCTEON_SDK_VERSION_STRING); - cvm_oct_rx_initialize(); cvm_oct_configure_common_hw(bus); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 08:30:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4ED426BD; Mon, 19 Nov 2012 08:30:30 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33F168FC08; Mon, 19 Nov 2012 08:30:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ8UUN7018115; Mon, 19 Nov 2012 08:30:30 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ8UUxM018114; Mon, 19 Nov 2012 08:30:30 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211190830.qAJ8UUxM018114@svn.freebsd.org> From: Juli Mallett Date: Mon, 19 Nov 2012 08:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243264 - head/sys/mips/cavium/octe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 08:30:30 -0000 Author: jmallett Date: Mon Nov 19 08:30:29 2012 New Revision: 243264 URL: http://svnweb.freebsd.org/changeset/base/243264 Log: Prevent hang on ATCA-7220 when transmitting packets < 60 bytes. Modified: head/sys/mips/cavium/octe/ethernet-tx.c Modified: head/sys/mips/cavium/octe/ethernet-tx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-tx.c Mon Nov 19 08:29:53 2012 (r243263) +++ head/sys/mips/cavium/octe/ethernet-tx.c Mon Nov 19 08:30:29 2012 (r243264) @@ -116,6 +116,19 @@ int cvm_oct_xmit(struct mbuf *m, struct } } +#ifdef OCTEON_VENDOR_RADISYS + /* + * The RSYS4GBE will hang if asked to transmit a packet less than 60 bytes. + */ + if (__predict_false(m->m_pkthdr.len < 60) && + cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) { + static uint8_t pad[60]; + + if (!m_append(m, sizeof pad - m->m_pkthdr.len, pad)) + printf("%s: unable to pad small packet.", __func__); + } +#endif + /* * If the packet is not fragmented. */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 08:35:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C6C6904; Mon, 19 Nov 2012 08:35:59 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06E4E8FC12; Mon, 19 Nov 2012 08:35:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ8ZwFo018919; Mon, 19 Nov 2012 08:35:58 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ8ZwIY018917; Mon, 19 Nov 2012 08:35:58 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211190835.qAJ8ZwIY018917@svn.freebsd.org> From: Juli Mallett Date: Mon, 19 Nov 2012 08:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243265 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 08:35:59 -0000 Author: jmallett Date: Mon Nov 19 08:35:58 2012 New Revision: 243265 URL: http://svnweb.freebsd.org/changeset/base/243265 Log: Return port numbers for ATCA-7220 SPI interfaces in a different place for consistency reasons, and to ensure that CRC addition is disabled on output. With this, transmit seems to be working properly on the ATCA-7220. Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Nov 19 08:30:29 2012 (r243264) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Nov 19 08:35:58 2012 (r243265) @@ -1313,14 +1313,6 @@ int __cvmx_helper_board_interface_probe( return 12; break; #endif -#if defined(OCTEON_VENDOR_RADISYS) - case CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE: - if (interface == 0) - return 13; - if (interface == 1) - return 8; - return 0; -#endif } #ifdef CVMX_BUILD_FOR_UBOOT if (CVMX_HELPER_INTERFACE_MODE_SPI == cvmx_helper_interface_get_mode(interface) && getenv("disable_spi")) Modified: head/sys/contrib/octeon-sdk/cvmx-helper-spi.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Mon Nov 19 08:30:29 2012 (r243264) +++ head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Mon Nov 19 08:35:58 2012 (r243265) @@ -104,6 +104,16 @@ int __cvmx_helper_spi_enumerate(int inte } #endif +#if defined(OCTEON_VENDOR_RADISYS) + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) { + if (interface == 0) + return 13; + if (interface == 1) + return 8; + return 0; + } +#endif + if ((cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM) && cvmx_spi4000_is_present(interface)) return 10; From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 11:24:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 76FE8FD8; Mon, 19 Nov 2012 11:24:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 57AED8FC0C; Mon, 19 Nov 2012 11:24:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJBOd6I042783; Mon, 19 Nov 2012 11:24:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJBOdYs042782; Mon, 19 Nov 2012 11:24:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211191124.qAJBOdYs042782@svn.freebsd.org> From: Martin Matuska Date: Mon, 19 Nov 2012 11:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r243267 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 11:24:39 -0000 Author: mm Date: Mon Nov 19 11:24:38 2012 New Revision: 243267 URL: http://svnweb.freebsd.org/changeset/base/243267 Log: Update vendor-sys/illumos/dist to illumos-gate 13888:7204b3392a58 (bugix for illumos zfs issue #3236) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Mon Nov 19 11:22:32 2012 (r243266) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Mon Nov 19 11:24:38 2012 (r243267) @@ -1565,7 +1565,8 @@ dmu_write_policy(objset_t *os, dnode_t * enum zio_checksum checksum = os->os_checksum; enum zio_compress compress = os->os_compress; enum zio_checksum dedup_checksum = os->os_dedup_checksum; - boolean_t dedup, nopwrite; + boolean_t dedup = B_FALSE; + boolean_t nopwrite = B_FALSE; boolean_t dedup_verify = os->os_dedup_verify; int copies = os->os_copies; @@ -1594,9 +1595,6 @@ dmu_write_policy(objset_t *os, dnode_t * if (zio_checksum_table[checksum].ci_correctable < 1 || zio_checksum_table[checksum].ci_eck) checksum = ZIO_CHECKSUM_FLETCHER_4; - - dedup = B_FALSE; - nopwrite = B_FALSE; } else if (wp & WP_NOFILL) { ASSERT(level == 0); @@ -1609,8 +1607,6 @@ dmu_write_policy(objset_t *os, dnode_t * */ compress = ZIO_COMPRESS_OFF; checksum = ZIO_CHECKSUM_OFF; - dedup = B_FALSE; - nopwrite = B_FALSE; } else { compress = zio_compress_select(dn->dn_compress, compress); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 11:25:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1244D1AC; Mon, 19 Nov 2012 11:25:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EAD818FC14; Mon, 19 Nov 2012 11:25:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJBPKcO042929; Mon, 19 Nov 2012 11:25:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJBPKcE042927; Mon, 19 Nov 2012 11:25:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211191125.qAJBPKcE042927@svn.freebsd.org> From: Andriy Gapon Date: Mon, 19 Nov 2012 11:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243268 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 11:25:21 -0000 Author: avg Date: Mon Nov 19 11:25:20 2012 New Revision: 243268 URL: http://svnweb.freebsd.org/changeset/base/243268 Log: zfs_remove: set VV_NOSYNC flag if a node is unlinked Suggested by: kib MFC after: 12 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Nov 19 11:24:38 2012 (r243267) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Nov 19 11:25:20 2012 (r243268) @@ -1937,6 +1937,9 @@ top: } else if (unlinked) { mutex_exit(&zp->z_lock); zfs_unlinked_add(zp, tx); +#ifdef __FreeBSD__ + vp->v_vflag |= VV_NOSYNC; +#endif } txtype = TX_REMOVE; From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 11:30:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05AD7466; Mon, 19 Nov 2012 11:30:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF33A8FC08; Mon, 19 Nov 2012 11:30:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJBU8lB043644; Mon, 19 Nov 2012 11:30:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJBU8GB043643; Mon, 19 Nov 2012 11:30:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211191130.qAJBU8GB043643@svn.freebsd.org> From: Andriy Gapon Date: Mon, 19 Nov 2012 11:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243270 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 11:30:09 -0000 Author: avg Date: Mon Nov 19 11:30:08 2012 New Revision: 243270 URL: http://svnweb.freebsd.org/changeset/base/243270 Log: zfs_remove: assert that delete_now case is never true on FreeBSD That case is specific to Solaris VFS and it would violate pretty fundamental contracts of FreeBSD VFS. Discussed with: pjd MFC after: 12 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Nov 19 11:26:32 2012 (r243269) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Nov 19 11:30:08 2012 (r243270) @@ -1908,6 +1908,9 @@ top: } if (delete_now) { +#ifdef __FreeBSD__ + panic("zfs_remove: delete_now branch taken"); +#endif if (xattr_obj_unlinked) { ASSERT3U(xzp->z_links, ==, 2); mutex_enter(&xzp->z_lock); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 11:32:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3ED6610; Mon, 19 Nov 2012 11:32:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D1AC8FC14; Mon, 19 Nov 2012 11:32:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJBWutr044051; Mon, 19 Nov 2012 11:32:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJBWuDA044048; Mon, 19 Nov 2012 11:32:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211191132.qAJBWuDA044048@svn.freebsd.org> From: Andriy Gapon Date: Mon, 19 Nov 2012 11:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243271 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 11:32:56 -0000 Author: avg Date: Mon Nov 19 11:32:56 2012 New Revision: 243271 URL: http://svnweb.freebsd.org/changeset/base/243271 Log: vnode_if: fix locking protocol description for lookup and cachedlookup Also remove the checks from vop_lookup_pre and vop_lookup_post, which are now completely redundant (before this change they were partially redundant). Discussed with: kib MFC after: 10 days Modified: head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Nov 19 11:30:08 2012 (r243270) +++ head/sys/kern/vfs_subr.c Mon Nov 19 11:32:56 2012 (r243271) @@ -4104,35 +4104,11 @@ vop_strategy_pre(void *ap) void vop_lookup_pre(void *ap) { -#ifdef DEBUG_VFS_LOCKS - struct vop_lookup_args *a; - struct vnode *dvp; - - a = ap; - dvp = a->a_dvp; - ASSERT_VI_UNLOCKED(dvp, "VOP_LOOKUP"); - ASSERT_VOP_LOCKED(dvp, "VOP_LOOKUP"); -#endif } void vop_lookup_post(void *ap, int rc) { -#ifdef DEBUG_VFS_LOCKS - struct vop_lookup_args *a; - struct vnode *dvp; - struct vnode *vp; - - a = ap; - dvp = a->a_dvp; - vp = *(a->a_vpp); - - ASSERT_VI_UNLOCKED(dvp, "VOP_LOOKUP"); - ASSERT_VOP_LOCKED(dvp, "VOP_LOOKUP"); - - if (!rc) - ASSERT_VOP_LOCKED(vp, "VOP_LOOKUP (child)"); -#endif } void Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Mon Nov 19 11:30:08 2012 (r243270) +++ head/sys/kern/vnode_if.src Mon Nov 19 11:32:56 2012 (r243271) @@ -63,7 +63,7 @@ vop_islocked { IN struct vnode *vp; }; -%% lookup dvp L ? ? +%% lookup dvp L L L %% lookup vpp - L - %! lookup pre vop_lookup_pre %! lookup post vop_lookup_post @@ -78,7 +78,7 @@ vop_lookup { IN struct componentname *cnp; }; -%% cachedlookup dvp L ? ? +%% cachedlookup dvp L L L %% cachedlookup vpp - L - # This must be an exact copy of lookup. See kern/vfs_cache.c for details. From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 11:35:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E487F7AE; Mon, 19 Nov 2012 11:35:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C98748FC16; Mon, 19 Nov 2012 11:35:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJBZu8J044470; Mon, 19 Nov 2012 11:35:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJBZu8R044469; Mon, 19 Nov 2012 11:35:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211191135.qAJBZu8R044469@svn.freebsd.org> From: Andriy Gapon Date: Mon, 19 Nov 2012 11:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243272 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 11:35:57 -0000 Author: avg Date: Mon Nov 19 11:35:56 2012 New Revision: 243272 URL: http://svnweb.freebsd.org/changeset/base/243272 Log: assert_vop_locked should treat LK_EXCLOTHER as the not locked case ... from a perspective of the current thread. Spotted by: mjg Discussed with: kib MFC after: 18 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Nov 19 11:32:56 2012 (r243271) +++ head/sys/kern/vfs_subr.c Mon Nov 19 11:35:56 2012 (r243272) @@ -3988,7 +3988,8 @@ void assert_vop_locked(struct vnode *vp, const char *str) { - if (!IGNORE_LOCK(vp) && VOP_ISLOCKED(vp) == 0) + if (!IGNORE_LOCK(vp) && + (VOP_ISLOCKED(vp) == 0 || VOP_ISLOCKED(vp) == LK_EXCLOTHER)) vfs_badlock("is not locked but should be", str, vp); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 15:03:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D92054E; Mon, 19 Nov 2012 15:03:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 607728FC12; Mon, 19 Nov 2012 15:03:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJF3Kcx077722; Mon, 19 Nov 2012 15:03:20 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJF3K2I077720; Mon, 19 Nov 2012 15:03:20 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191503.qAJF3K2I077720@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 15:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243279 - stable/9/sbin/reboot X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 15:03:20 -0000 Author: emaste Date: Mon Nov 19 15:03:19 2012 New Revision: 243279 URL: http://svnweb.freebsd.org/changeset/base/243279 Log: MFC r230812: Add -e to set arbitrary kernel environment variables. Nextboot(8) can now set any combination of kernel name (-k), kernel options (-o), and environment strings (-e). As a result of this change -k also becomes optional. Modified: stable/9/sbin/reboot/nextboot.8 stable/9/sbin/reboot/nextboot.sh Directory Properties: stable/9/sbin/reboot/ (props changed) Modified: stable/9/sbin/reboot/nextboot.8 ============================================================================== --- stable/9/sbin/reboot/nextboot.8 Mon Nov 19 12:10:36 2012 (r243278) +++ stable/9/sbin/reboot/nextboot.8 Mon Nov 19 15:03:19 2012 (r243279) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2002 +.Dd November 19, 2012 .Dt NEXTBOOT 8 .Os .Sh NAME @@ -32,15 +32,17 @@ .Nd "specify an alternate kernel and boot flags for the next reboot" .Sh SYNOPSIS .Nm +.Op Fl e Ar variable=value .Op Fl f +.Op Fl k Ar kernel .Op Fl o Ar options -.Fl k Ar kernel .Nm .Fl D .Sh DESCRIPTION The .Nm -utility allows specifying an alternate kernel and/or boot flags for the +utility allows specifying some combination of an alternate kernel, boot flags +and kernel environment for the next time the machine is booted. Once the .Xr loader 8 @@ -58,6 +60,11 @@ with this option removes an existing .Nm configuration. +.It Fl e Ar variable=value +This option adds the provided variable and value to the kernel environment. +The value is quoted when written to the +.Nm +configuration. .It Fl f This option disables the sanity checking which checks if the kernel really exists Modified: stable/9/sbin/reboot/nextboot.sh ============================================================================== --- stable/9/sbin/reboot/nextboot.sh Mon Nov 19 12:10:36 2012 (r243278) +++ stable/9/sbin/reboot/nextboot.sh Mon Nov 19 15:03:19 2012 (r243279) @@ -2,31 +2,59 @@ # # Copyright 2002. Gordon Tetlow. # gordon@FreeBSD.org +# Copyright (c) 2012 Sandvine Incorporated. All rights reserved. # # $FreeBSD$ delete="NO" +kenv= force="NO" nextboot_file="/boot/nextboot.conf" +add_kenv() +{ + local var value + + var=$1 + # strip literal quotes if passed in + value=${2%\"*} + value=${value#*\"} + + if [ -n "${kenv}" ]; then + kenv="${kenv} +" + fi + kenv="${kenv}${var}=\"${value}\"" +} + display_usage() { - echo "Usage: nextboot [-f] [-o options] -k kernel" + echo "Usage: nextboot [-e variable=value] [-f] [-k kernel] [-o options]" echo " nextboot -D" } -while getopts "Dfk:o:" argument ; do +while getopts "De:fk:o:" argument ; do case "${argument}" in D) delete="YES" ;; + e) + var=${OPTARG%%=*} + value=${OPTARG#*=} + if [ -z "$var" -o -z "$value" ]; then + display_usage + exit 1 + fi + add_kenv "$var" "$value" + ;; f) force="YES" ;; k) kernel="${OPTARG}" + add_kenv kernel "$kernel" ;; o) - kernel_options="${OPTARG}" + add_kenv kernel_options "${OPTARG}" ;; *) display_usage @@ -40,12 +68,12 @@ if [ ${delete} = "YES" ]; then exit 0 fi -if [ "xxx${kernel}" = "xxx" ]; then +if [ -z "${kenv}" ]; then display_usage exit 1 fi -if [ ${force} = "NO" -a ! -d /boot/${kernel} ]; then +if [ -n "${kernel}" -a ${force} = "NO" -a ! -d /boot/${kernel} ]; then echo "Error: /boot/${kernel} doesn't exist. Use -f to override." exit 1 fi @@ -60,6 +88,5 @@ done cat > ${nextboot_file} << EOF nextboot_enable="YES" -kernel="${kernel}" -kernel_options="${kernel_options}" +$kenv EOF From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 15:12:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 421F3A16; Mon, 19 Nov 2012 15:12:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26BEF8FC14; Mon, 19 Nov 2012 15:12:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJFCjW8080350; Mon, 19 Nov 2012 15:12:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJFCj2m080349; Mon, 19 Nov 2012 15:12:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211191512.qAJFCj2m080349@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Nov 2012 15:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243280 - head/usr.bin/find X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 15:12:45 -0000 Author: eadler Date: Mon Nov 19 15:12:44 2012 New Revision: 243280 URL: http://svnweb.freebsd.org/changeset/base/243280 Log: Use .Nm instead of a self xref Approved by: bcr (mentor) MFC after: 1 week Modified: head/usr.bin/find/find.1 Modified: head/usr.bin/find/find.1 ============================================================================== --- head/usr.bin/find/find.1 Mon Nov 19 15:03:19 2012 (r243279) +++ head/usr.bin/find/find.1 Mon Nov 19 15:12:44 2012 (r243280) @@ -298,7 +298,7 @@ Non-portable, BSD-specific version of .Ic depth . GNU find implements this as a primary in mistaken emulation of .Fx -.Xr find 1 . +.Nm . .It Ic -delete Delete found files and/or directories. Always returns true. @@ -473,7 +473,7 @@ for compatibility with GNU find. GNU find imposes a restriction that .Ar gname is numeric, while -.Xr find 1 +.Nm does not. .It Ic -group Ar gname True if the file belongs to the group @@ -646,7 +646,7 @@ This is default behaviour. .It Ic -noleaf This option is for GNU find compatibility. In GNU find it disables an optimization not relevant to -.Xr find 1 , +.Nm , so it is ignored. .It Ic -nouser True if the file belongs to an unknown user. @@ -843,7 +843,7 @@ for compatibility with GNU find. GNU find imposes a restriction that .Ar uname is numeric, while -.Xr find 1 +.Nm does not. .It Ic -user Ar uname True if the file belongs to the user From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 15:24:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4EEB2193; Mon, 19 Nov 2012 15:24:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 335448FC0C; Mon, 19 Nov 2012 15:24:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJFOKqB082892; Mon, 19 Nov 2012 15:24:20 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJFOKjN082890; Mon, 19 Nov 2012 15:24:20 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191524.qAJFOKjN082890@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 15:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243281 - stable/9/tools/tools/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 15:24:20 -0000 Author: emaste Date: Mon Nov 19 15:24:19 2012 New Revision: 243281 URL: http://svnweb.freebsd.org/changeset/base/243281 Log: MFC r237729: Fix ioctl type for compiling with clang MFC r241169: Clean up compiler warnings. MFC r241464: Make local function static. Sponsored by: ADARA Networks Modified: stable/9/tools/tools/netmap/bridge.c stable/9/tools/tools/netmap/pcap.c Directory Properties: stable/9/tools/tools/netmap/ (props changed) Modified: stable/9/tools/tools/netmap/bridge.c ============================================================================== --- stable/9/tools/tools/netmap/bridge.c Mon Nov 19 15:12:44 2012 (r243280) +++ stable/9/tools/tools/netmap/bridge.c Mon Nov 19 15:24:19 2012 (r243281) @@ -79,7 +79,7 @@ sigint_h(__unused int sig) static int -do_ioctl(struct my_ring *me, int what) +do_ioctl(struct my_ring *me, unsigned long what) { struct ifreq ifr; int error; @@ -98,7 +98,7 @@ do_ioctl(struct my_ring *me, int what) } error = ioctl(me->fd, what, &ifr); if (error) { - D("ioctl error %d", what); + D("ioctl error 0x%lx", what); return error; } switch (what) { Modified: stable/9/tools/tools/netmap/pcap.c ============================================================================== --- stable/9/tools/tools/netmap/pcap.c Mon Nov 19 15:12:44 2012 (r243280) +++ stable/9/tools/tools/netmap/pcap.c Mon Nov 19 15:24:19 2012 (r243281) @@ -38,7 +38,7 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) -char *version = "$Id$"; +const char *version = "$Id$"; int verbose = 0; /* debug support */ @@ -49,7 +49,7 @@ int verbose = 0; __FUNCTION__, __LINE__, ##__VA_ARGS__); \ } while (0) -inline void prefetch (const void *x) +static inline void prefetch (const void *x) { __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); } @@ -135,13 +135,12 @@ typedef enum { PCAP_D_OUT } pcap_direction_t; +struct bpf_program; typedef void (*pcap_handler)(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes); -char errbuf[PCAP_ERRBUF_SIZE]; - pcap_t *pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, char *errbuf); @@ -155,6 +154,24 @@ char *pcap_lookupdev(char *errbuf); int pcap_inject(pcap_t *p, const void *buf, size_t size); int pcap_fileno(pcap_t *p); const char *pcap_lib_version(void); +void pcap_freealldevs(pcap_if_t *); +pcap_t *pcap_create(const char *, char *); +int pcap_activate(pcap_t *); +int pcap_can_set_rfmon(pcap_t *); +int pcap_set_snaplen(pcap_t *, int); +int pcap_snapshot(pcap_t *); +int pcap_lookupnet(const char *, uint32_t *, uint32_t *, char *); +int pcap_set_promisc(pcap_t *, int); +int pcap_set_timeout(pcap_t *, int); +int pcap_compile(pcap_t *, struct bpf_program *, const char *, int, + uint32_t); +int pcap_setfilter(pcap_t *, struct bpf_program *); +int pcap_datalink(pcap_t *); +const char *pcap_datalink_val_to_name(int); +const char *pcap_datalink_val_to_description(int); +int pcap_stats(pcap_t *, struct pcap_stat *); +int pcap_loop(pcap_t *, int, pcap_handler, u_char *); +char *pcap_geterr(pcap_t *); struct eproto { @@ -201,7 +218,7 @@ struct my_ring { static int -do_ioctl(struct my_ring *me, int what) +do_ioctl(struct my_ring *me, unsigned long what) { struct ifreq ifr; int error; @@ -221,7 +238,7 @@ do_ioctl(struct my_ring *me, int what) } error = ioctl(me->fd, what, &ifr); if (error) { - D("ioctl 0x%x error %d", what, error); + D("ioctl 0x%lx error %d", what, error); return error; } switch (what) { @@ -739,7 +756,8 @@ pcap_loop(pcap_t *p, int cnt, pcap_handl #endif /* __PIC__ */ #ifndef __PIC__ -void do_send(u_char *user, const struct pcap_pkthdr *h, const u_char *buf) +static void +do_send(u_char *user, const struct pcap_pkthdr *h, const u_char *buf) { pcap_inject((pcap_t *)user, buf, h->caplen); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 15:26:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 535DB401; Mon, 19 Nov 2012 15:26:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 374928FC14; Mon, 19 Nov 2012 15:26:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJFQ4uw083525; Mon, 19 Nov 2012 15:26:04 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJFQ4Xq083523; Mon, 19 Nov 2012 15:26:04 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191526.qAJFQ4Xq083523@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 15:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243282 - stable/9/sys/netinet/libalias X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 15:26:04 -0000 Author: emaste Date: Mon Nov 19 15:26:03 2012 New Revision: 243282 URL: http://svnweb.freebsd.org/changeset/base/243282 Log: MFC r241648: Avoid potential bad pointer dereference. Previously RuleAdd would leave entry->la unset for the first entry in the proxyList. Sponsored by: ADARA Networks Modified: stable/9/sys/netinet/libalias/alias_proxy.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/libalias/alias_proxy.c ============================================================================== --- stable/9/sys/netinet/libalias/alias_proxy.c Mon Nov 19 15:24:19 2012 (r243281) +++ stable/9/sys/netinet/libalias/alias_proxy.c Mon Nov 19 15:26:03 2012 (r243282) @@ -210,13 +210,13 @@ RuleAdd(struct libalias *la, struct prox LIBALIAS_LOCK_ASSERT(la); + entry->la = la; if (la->proxyList == NULL) { la->proxyList = entry; entry->last = NULL; entry->next = NULL; return; } - entry->la = la; rule_index = entry->rule_index; ptr = la->proxyList; From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 15:31:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7ECB9664; Mon, 19 Nov 2012 15:31:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 617098FC0C; Mon, 19 Nov 2012 15:31:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJFV8Ha085015; Mon, 19 Nov 2012 15:31:08 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJFV8FQ085014; Mon, 19 Nov 2012 15:31:08 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191531.qAJFV8FQ085014@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 15:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243283 - stable/9/sys/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 15:31:08 -0000 Author: emaste Date: Mon Nov 19 15:31:07 2012 New Revision: 243283 URL: http://svnweb.freebsd.org/changeset/base/243283 Log: MFC r240945: Correct misspelling in debug output. Modified: stable/9/sys/net/if_tap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_tap.c ============================================================================== --- stable/9/sys/net/if_tap.c Mon Nov 19 15:26:03 2012 (r243282) +++ stable/9/sys/net/if_tap.c Mon Nov 19 15:31:07 2012 (r243283) @@ -933,7 +933,7 @@ tapwrite(struct cdev *dev, struct uio *u struct ifnet *ifp = tp->tap_ifp; struct mbuf *m; - TAPDEBUG("%s writting, minor = %#x\n", + TAPDEBUG("%s writing, minor = %#x\n", ifp->if_xname, dev2unit(dev)); if (uio->uio_resid == 0) From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 15:57:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABB1CDA8; Mon, 19 Nov 2012 15:57:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 901458FC0C; Mon, 19 Nov 2012 15:57:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJFvt3B091391; Mon, 19 Nov 2012 15:57:55 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJFvtPT091390; Mon, 19 Nov 2012 15:57:55 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191557.qAJFvtPT091390@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 15:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243284 - stable/9/sys/geom/part X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 15:57:55 -0000 Author: emaste Date: Mon Nov 19 15:57:55 2012 New Revision: 243284 URL: http://svnweb.freebsd.org/changeset/base/243284 Log: MFC r230990: Correct typo in comment (numbver) Modified: stable/9/sys/geom/part/g_part.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Mon Nov 19 15:31:07 2012 (r243283) +++ stable/9/sys/geom/part/g_part.c Mon Nov 19 15:57:55 2012 (r243284) @@ -221,7 +221,7 @@ g_part_geometry(struct g_part_table *tab continue; /* * Prefer a geometry with sectors > 1, but only if - * it doesn't bump down the numbver of heads to 1. + * it doesn't bump down the number of heads to 1. */ if (chs > bestchs || (chs == bestchs && heads > 1 && table->gpt_sectors == 1)) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 16:02:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5FCCAF6C; Mon, 19 Nov 2012 16:02:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6458FC19; Mon, 19 Nov 2012 16:02:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJG259H092588; Mon, 19 Nov 2012 16:02:05 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJG25vo092587; Mon, 19 Nov 2012 16:02:05 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191602.qAJG25vo092587@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 16:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243285 - stable/9/sbin/reboot X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 16:02:05 -0000 Author: emaste Date: Mon Nov 19 16:02:04 2012 New Revision: 243285 URL: http://svnweb.freebsd.org/changeset/base/243285 Log: MFC r231129: Add BSD copyright notice. Modified: stable/9/sbin/reboot/nextboot.sh Directory Properties: stable/9/sbin/reboot/ (props changed) Modified: stable/9/sbin/reboot/nextboot.sh ============================================================================== --- stable/9/sbin/reboot/nextboot.sh Mon Nov 19 15:57:55 2012 (r243284) +++ stable/9/sbin/reboot/nextboot.sh Mon Nov 19 16:02:04 2012 (r243285) @@ -1,9 +1,29 @@ #! /bin/sh # -# Copyright 2002. Gordon Tetlow. -# gordon@FreeBSD.org +# Copyright (c) 2002 Gordon Tetlow. All rights reserved. # Copyright (c) 2012 Sandvine Incorporated. All rights reserved. # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# # $FreeBSD$ delete="NO" From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 16:16:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEB50400; Mon, 19 Nov 2012 16:16:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B0C8D8FC13; Mon, 19 Nov 2012 16:16:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJGGYNt095912; Mon, 19 Nov 2012 16:16:34 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJGGYJo095911; Mon, 19 Nov 2012 16:16:34 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191616.qAJGGYJo095911@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 16:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243286 - stable/9/sys/dev/aac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 16:16:34 -0000 Author: emaste Date: Mon Nov 19 16:16:34 2012 New Revision: 243286 URL: http://svnweb.freebsd.org/changeset/base/243286 Log: MFC r231589: Add a sysctl to report the firmware build number. Some older firmware versions have issues that can be worked around by avoiding certain operations. Add a sysctl dev.aac.#.firmware_build to make it easy for scripts or userland tools to detect the firmware version. Modified: stable/9/sys/dev/aac/aac.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aac/aac.c ============================================================================== --- stable/9/sys/dev/aac/aac.c Mon Nov 19 16:02:04 2012 (r243285) +++ stable/9/sys/dev/aac/aac.c Mon Nov 19 16:16:34 2012 (r243286) @@ -292,6 +292,15 @@ aac_attach(struct aac_softc *sc) aac_describe_controller(sc); /* + * Add sysctls. + */ + SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->aac_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->aac_dev)), + OID_AUTO, "firmware_build", CTLFLAG_RD, + &sc->aac_revision.buildNumber, 0, + "firmware build number"); + + /* * Register to probe our containers later. */ sc->aac_ich.ich_func = aac_startup; From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 16:26:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A650495C; Mon, 19 Nov 2012 16:26:29 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 833278FC12; Mon, 19 Nov 2012 16:26:29 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:84f9:e144:8dee:996b] (unknown [IPv6:2601:9:4d00:85:84f9:e144:8dee:996b]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 07FDC3981E; Mon, 19 Nov 2012 08:26:28 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r243262 - head/usr.bin/top From: Rui Paulo In-Reply-To: <20121119082618.GB67020@FreeBSD.org> Date: Mon, 19 Nov 2012 08:26:28 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <3241E07C-D177-4297-825A-A52FEA8F1241@FreeBSD.org> References: <201211190803.qAJ83eRo014127@svn.freebsd.org> <20121119082618.GB67020@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 16:26:29 -0000 On 19 Nov 2012, at 00:26, Alexey Dokuchaev wrote: > On Mon, Nov 19, 2012 at 08:03:40AM +0000, Rui Paulo wrote: >> New Revision: 243262 >> URL: http://svnweb.freebsd.org/changeset/base/243262 >>=20 >> - cmdbuf =3D (char *)malloc(cmdlengthdelta + 1); >> + cmdbuf =3D (char *)malloc(cmdlen + 1); >=20 > Why explicitly casting malloc return() value (void *)? Why are you asking me about code I didn't write? :-) I don't want to mix style changes with functional changes so I let it = be. If you're asking why our source tree has malloc casts, it's because = compilers in the 1980s used to be unnecessarily more pedantic. Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 16:39:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5896FD3B; Mon, 19 Nov 2012 16:39:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC768FC16; Mon, 19 Nov 2012 16:39:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJGdAB6000750; Mon, 19 Nov 2012 16:39:10 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJGdAiM000749; Mon, 19 Nov 2012 16:39:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191639.qAJGdAiM000749@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 16:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243287 - stable/8/sys/netinet/libalias X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 16:39:10 -0000 Author: emaste Date: Mon Nov 19 16:39:09 2012 New Revision: 243287 URL: http://svnweb.freebsd.org/changeset/base/243287 Log: MFC r241648: Avoid potential bad pointer dereference. Previously RuleAdd would leave entry->la unset for the first entry in the proxyList. Sponsored by: ADARA Networks Modified: stable/8/sys/netinet/libalias/alias_proxy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/libalias/alias_proxy.c ============================================================================== --- stable/8/sys/netinet/libalias/alias_proxy.c Mon Nov 19 16:16:34 2012 (r243286) +++ stable/8/sys/netinet/libalias/alias_proxy.c Mon Nov 19 16:39:09 2012 (r243287) @@ -210,13 +210,13 @@ RuleAdd(struct libalias *la, struct prox LIBALIAS_LOCK_ASSERT(la); + entry->la = la; if (la->proxyList == NULL) { la->proxyList = entry; entry->last = NULL; entry->next = NULL; return; } - entry->la = la; rule_index = entry->rule_index; ptr = la->proxyList; From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 16:52:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3F06286; Mon, 19 Nov 2012 16:52:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D81548FC12; Mon, 19 Nov 2012 16:52:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJGqwNL002873; Mon, 19 Nov 2012 16:52:58 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJGqwN6002872; Mon, 19 Nov 2012 16:52:58 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191652.qAJGqwN6002872@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 16:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243288 - stable/9/sys/geom/part X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 16:52:59 -0000 Author: emaste Date: Mon Nov 19 16:52:58 2012 New Revision: 243288 URL: http://svnweb.freebsd.org/changeset/base/243288 Log: MFC r232680: Remove unactionable message about label geometry It's not clear to a user what they should do after seeing the "geometry does not match label" kernel message, and it does not appear to present a problem in practice. Thus, just remove the messages. Modified: stable/9/sys/geom/part/g_part_bsd.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/9/sys/geom/part/g_part_bsd.c Mon Nov 19 16:39:09 2012 (r243287) +++ stable/9/sys/geom/part/g_part_bsd.c Mon Nov 19 16:52:58 2012 (r243288) @@ -394,10 +394,6 @@ g_part_bsd_read(struct g_part_table *bas goto invalid_label; if (heads != basetable->gpt_heads && !basetable->gpt_fixgeom) basetable->gpt_heads = heads; - if (sectors != basetable->gpt_sectors || heads != basetable->gpt_heads) - printf("GEOM: %s: geometry does not match label" - " (%uh,%us != %uh,%us).\n", pp->name, heads, sectors, - basetable->gpt_heads, basetable->gpt_sectors); chs = le32dec(buf + 60); if (chs < 1) @@ -407,9 +403,6 @@ g_part_bsd_read(struct g_part_table *bas chs = msize; le32enc(buf + 60, msize); } - if (chs != msize) - printf("GEOM: %s: media size does not match label.\n", - pp->name); basetable->gpt_first = 0; basetable->gpt_last = msize - 1; From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 17:06:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A76C86A; Mon, 19 Nov 2012 17:06:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1EA78FC16; Mon, 19 Nov 2012 17:06:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJH6L5U005363; Mon, 19 Nov 2012 17:06:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJH6Lr9005362; Mon, 19 Nov 2012 17:06:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191706.qAJH6Lr9005362@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 17:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243289 - stable/9/sys/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 17:06:22 -0000 Author: emaste Date: Mon Nov 19 17:06:21 2012 New Revision: 243289 URL: http://svnweb.freebsd.org/changeset/base/243289 Log: MFC r238298: Restore error handling lost in r191603 This was missed in the change from IFQ_ENQUEUE to if_transmit. MFC r238346: Plug potential mbuf leak when bridging fragments If an error occurs when transmitting one mbuf in a chain of fragments, free the subsequent fragments instead of leaking them. MFC r238355: Simplify error case Submitted by: thompsa@ Sponsored by: ADARA Networks Modified: stable/9/sys/net/if_bridge.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_bridge.c ============================================================================== --- stable/9/sys/net/if_bridge.c Mon Nov 19 16:52:58 2012 (r243288) +++ stable/9/sys/net/if_bridge.c Mon Nov 19 17:06:21 2012 (r243289) @@ -1811,8 +1811,10 @@ bridge_enqueue(struct bridge_softc *sc, m->m_flags &= ~M_VLANTAG; } - if (err == 0) - dst_ifp->if_transmit(dst_ifp, m); + if ((err = dst_ifp->if_transmit(dst_ifp, m))) { + m_freem(m0); + break; + } } if (err == 0) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 17:33:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5918ED73; Mon, 19 Nov 2012 17:33:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39CC58FC14; Mon, 19 Nov 2012 17:33:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJHXkeY009693; Mon, 19 Nov 2012 17:33:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJHXkLL009692; Mon, 19 Nov 2012 17:33:46 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191733.qAJHXkLL009692@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 17:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243290 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 17:33:46 -0000 Author: emaste Date: Mon Nov 19 17:33:45 2012 New Revision: 243290 URL: http://svnweb.freebsd.org/changeset/base/243290 Log: MFC r236625 (joel): Minor spelling fixes. Modified: stable/9/sbin/camcontrol/camcontrol.8 Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.8 Mon Nov 19 17:06:21 2012 (r243289) +++ stable/9/sbin/camcontrol/camcontrol.8 Mon Nov 19 17:33:45 2012 (r243290) @@ -740,7 +740,7 @@ Set the partial pathway timeout value, i See the .Tn ANSI .Tn SAS -Protcol Layer (SPL) +Protocol Layer (SPL) specification for more information on this field. .It Fl a Ar enable|disable Enable or disable SATA slumber phy power conditions. @@ -1111,7 +1111,7 @@ Do not ask for confirmation. Run in simulation mode. Packet sizes that will be sent are shown, but no actual packet is sent to the device. -No confimation is asked in simulation mode. +No confirmation is asked in simulation mode. .It Fl v Besides showing sense information in case of a failure, the verbose option causes From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 18:14:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C647A88B; Mon, 19 Nov 2012 18:14:03 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id EBDE48FC13; Mon, 19 Nov 2012 18:14:02 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id je9so1379465bkc.13 for ; Mon, 19 Nov 2012 10:14:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=KPsgl3nRc9jYDsTMHGnhMM8t3Sb03xwqMjxttUFU41g=; b=Obgd85xLqWtvuRj8HPrBdELCRk4+dy9Z7F+wCG7y2h4iz2jpmbT2Zen3D+gP0BN30F NHyniC2M5JSfhRt9mhAblOMyXeN8sohwFvWFhysoOAQUc7ohlvgThVyEQV0GUsHRlbCa cRRBbBh+NeGK5eK1jW4YVZDtQXmCi+XscyTgridlhj/2t8bw/pr4Cj+56+O1iXONMZHz 7DZ3H+phPlr1QILAvAMsRi+qowE3x7DtDlVqgBdPv2I1tOn8turoSGsayzQ+//4kULmF C5uzAUuDnZhCpPBquTxtnroX+oJ1IiOtGJYiozCqxY1cy/qeSiR/FU71Q6uE3HbNZ1Ni 9/4w== Received: by 10.204.150.213 with SMTP id z21mr5240609bkv.45.1353348841605; Mon, 19 Nov 2012 10:14:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.50.197 with HTTP; Mon, 19 Nov 2012 10:13:31 -0800 (PST) In-Reply-To: <20121119175936.J1085@besplex.bde.org> References: <201211181421.qAIEL5KT042019@svn.freebsd.org> <20121119175936.J1085@besplex.bde.org> From: Chris Rees Date: Mon, 19 Nov 2012 18:13:31 +0000 Message-ID: Subject: Re: svn commit: r243228 - head/etc To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 18:14:03 -0000 On 19 November 2012 08:03, Bruce Evans wrote: > On Sun, 18 Nov 2012, Chris Rees wrote: > >> On 18 Nov 2012 20:39, "Ed Schouten" wrote: >>> >>> >>> Hi Chris, >>> >>> 2012/11/18 Chris Rees : >>>> >>>> Modified: head/etc/rc.initdiskless >>>> >> >> ============================================================================== >>>> >>>> --- head/etc/rc.initdiskless Sun Nov 18 14:05:28 2012 >> >> (r243227) >>>> >>>> +++ head/etc/rc.initdiskless Sun Nov 18 14:21:05 2012 >> >> (r243228) >>>> >>>> @@ -354,7 +354,7 @@ for i in ${templates} ; do >>>> subdir=${j##*/} >>>> if [ -d $j -a ! -f $j.cpio.gz ]; then >>>> create_md $subdir >>>> - cp -Rp $j/ /$subdir >>>> + (cd $j && pax -rw . /$subdir) >>>> fi >>>> done >>>> for j in /conf/$i/*.cpio.gz ; do >>> >>> >>> Are you sure that this bug wasn't already fixed? The original version >>> of the code in the bug report used the following line: >>> >>> - cp -Rp $j/* /$subdir >>> >>> The old version of the code you changed didn't have this asterisk, >>> meaning dotfiles would already be copied. Still, you could argue that >>> your version is nicer, as our behaviour of cp with the trailing slash >>> contradicts POSIX. > > > I don't think POSIX is that broken. > > >> You are correct, and the second to point it out :) >> >> As you say however, pax is technically how it should be done anyway, and >> has the nice effect of also preserving hard links. If no-one objects I >> think it should stay in. > > > Not perserving hard links is a bug in cp -R. pax/tar/cpio have always been recommended over cp -R for this very reason-- I would imagine that the fix is non-trivial if this is a bug at all (which I don't think it is). > Another bug in cp -Rp is that > it doesn't preserve mtimes for directories. But a non-broken cp -Rp would > be nicer than non-broken use of pax, and even a broken cp -Rp is better than > a broken use of pax. The above use of pax is semantically very different > from cp -Rp, and introduces the following bugs: > > - no error checking for cd. We have just checked that $j is a directory. > If it should somehow go away, then the errors from cp -Rp of it are more > fail-safe than the errors from not checking for cd failure. $ cp -Rp spam /eggs cp: spam: No such file or directory $ cd spam && pax -rw . /eggs cd: spam: No such file or directory $ I'm not seeing a huge difference. How is cp more fail safe? > - cp -R creates the target directory /$subdir if it doesn't already exist > (and its path prefix does exist and is a directory or a symlink to a > directory), but pax doesn't If /$subdir does already exist, then there > are races similar to the ones for the source directory if the target > directory goes away, and pax handles them differently. In that case the cp -R has the wrong behaviour-- /$subdir must exist, or it should fail with an error. > - -p was used in 'cp -Rp' to preserve all attributes. The corresponding > flags are not used in 'pax -rw'. They are '-p e'. By default, > pax preserves file times (so '-p am' is part of the default). pax's > man page seems to say that the file mode is not preserved by default > and that '-p p' (or '-p e') must be used to preserve it, but in my > tests under FreeBSD-~5.2 it was preserved. The uid and gid can only > be preserved by root, and it is the default to not preserve them even > for root. Root should use '-p e' or '-p o' to preseve them, just like > -p was used with cp -Rp. This I'll concede. > pax is little used and poorly maintained. It has no support for acls, > while cp has some. Pax hasn't caught up with the creation of utimes(2) > in 4.2BSD, so it still clobbers the tv_nsec part of file times when it > "preserves" them (though it uses lutimes(2)), while cp only clobbers > the last 3 decimal digits in the tv_nsec part of file times when it > "preserves" them. So even with '-p e', pax often clobbers file times > and never preserves acls even. Maybe this doesn't matter here. But > pax is unusable in general. I normally use cp -pR when I don't care > about links or file times (which is rarely), else gnu tar if I care > about links but not file times, else bsd tar occasionally for its > better handling of file times (tar format just can't handle all the > times well, and bsd tar handles them slightly less badly), else > gnu tar following by a fixup program to duplicate all the times. > gnu cp -a should work best, but I haven't used it lately. How are any of these alternatives good in an rc script? Using tar requires two threads (tar c | tar x), which is why I replaced it with pax in the first place. Diskless init means that we use RAM as disks-- for your own entertainment, I suggest making a copy of /rescue with pax, and then with cp -R. Which would you prefer in your ramdisk? For those concerned about size, this also applies to you-- 96k of pax vs any hardlink duplication. Additional flags to pax are in the patch at [1]. With approval from someone, I'll commit it. Chris [1] http://www.bayofrum.net/~crees/patches/rc-initdiskless-paxflags.diff From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 18:18:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97BD7B93; Mon, 19 Nov 2012 18:18:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 775B98FC13; Mon, 19 Nov 2012 18:18:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIIOkO017304; Mon, 19 Nov 2012 18:18:24 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIIOLH017303; Mon, 19 Nov 2012 18:18:24 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191818.qAJIIOLH017303@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243293 - stable/9/usr.bin/w X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 18:18:24 -0000 Author: emaste Date: Mon Nov 19 18:18:24 2012 New Revision: 243293 URL: http://svnweb.freebsd.org/changeset/base/243293 Log: MFC r241484: Use CLOCK_UPTIME to get the uptime. Modified: stable/9/usr.bin/w/w.c Directory Properties: stable/9/usr.bin/w/ (props changed) Modified: stable/9/usr.bin/w/w.c ============================================================================== --- stable/9/usr.bin/w/w.c Mon Nov 19 18:09:00 2012 (r243292) +++ stable/9/usr.bin/w/w.c Mon Nov 19 18:18:24 2012 (r243293) @@ -448,7 +448,7 @@ pr_header(time_t *nowp, int nusers) /* * Print how long system has been up. */ - if (clock_gettime(CLOCK_MONOTONIC, &tp) != -1) { + if (clock_gettime(CLOCK_UPTIME, &tp) != -1) { uptime = tp.tv_sec; if (uptime > 60) uptime += 30; From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 18:20:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55109D83; Mon, 19 Nov 2012 18:20:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0788FC14; Mon, 19 Nov 2012 18:20:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIKSEE017707; Mon, 19 Nov 2012 18:20:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIKRAM017703; Mon, 19 Nov 2012 18:20:27 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191820.qAJIKRAM017703@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243294 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 18:20:28 -0000 Author: emaste Date: Mon Nov 19 18:20:27 2012 New Revision: 243294 URL: http://svnweb.freebsd.org/changeset/base/243294 Log: MFC (part of) r241737 (ed): More -Wmissing-variable-declarations fixes. In addition to adding `static' where possible: ... - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. ... Modified: stable/9/sbin/camcontrol/camcontrol.c stable/9/sbin/camcontrol/camcontrol.h stable/9/sbin/camcontrol/fwdownload.c stable/9/sbin/camcontrol/modeedit.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:18:24 2012 (r243293) +++ stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:20:27 2012 (r243294) @@ -5782,9 +5782,10 @@ bailout: #endif /* MINIMALISTIC */ void -usage(int verbose) +usage(int printlong) { - fprintf(verbose ? stdout : stderr, + + fprintf(printlong ? stdout : stderr, "usage: camcontrol [device id][generic args][command args]\n" " camcontrol devlist [-v]\n" #ifndef MINIMALISTIC @@ -5833,7 +5834,7 @@ usage(int verbose) " camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-y][-s]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); - if (!verbose) + if (!printlong) return; #ifndef MINIMALISTIC fprintf(stdout, Modified: stable/9/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.h Mon Nov 19 18:18:24 2012 (r243293) +++ stable/9/sbin/camcontrol/camcontrol.h Mon Nov 19 18:20:27 2012 (r243294) @@ -40,8 +40,10 @@ struct get_hook int got; }; +extern int verbose; + int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int verbose, int retry_count, int timeout, + char *combinedopt, int printerrors, int retry_count, int timeout, const char */*type*/); void mode_sense(struct cam_device *device, int mode_page, int page_control, int dbd, int retry_count, int timeout, u_int8_t *data, @@ -58,5 +60,5 @@ char *cget(void *hook, char *name); int iget(void *hook, char *name); void arg_put(void *hook, int letter, void *arg, int count, char *name); int get_confirmation(void); -void usage(int verbose); +void usage(int printlong); #endif /* _CAMCONTROL_H */ Modified: stable/9/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/9/sbin/camcontrol/fwdownload.c Mon Nov 19 18:18:24 2012 (r243293) +++ stable/9/sbin/camcontrol/fwdownload.c Mon Nov 19 18:20:27 2012 (r243294) @@ -131,7 +131,7 @@ static char *fw_read_img(const char *fw_ const struct fw_vendor *vp, int *num_bytes); static int fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, char *buf, int img_size, - int sim_mode, int verbose, int retry_count, int timeout, + int sim_mode, int printerrors, int retry_count, int timeout, const char */*name*/, const char */*type*/); /* @@ -238,7 +238,7 @@ bailout1: */ static int fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, - char *buf, int img_size, int sim_mode, int verbose, int retry_count, + char *buf, int img_size, int sim_mode, int printerrors, int retry_count, int timeout, const char *imgname, const char *type) { struct scsi_write_buffer cdb; @@ -290,7 +290,7 @@ fw_download_img(struct cam_device *cam_d ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; if (cam_send_ccb(cam_dev, ccb) < 0) { warnx("Error sending identify/test unit ready"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); cam_freeccb(ccb); @@ -298,7 +298,7 @@ fw_download_img(struct cam_device *cam_d } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { warnx("Device is not ready"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); cam_freeccb(ccb); @@ -372,7 +372,7 @@ fw_download_img(struct cam_device *cam_d /* Execute the command. */ if (cam_send_ccb(cam_dev, ccb) < 0) { warnx("Error writing image to device"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); goto bailout; @@ -398,7 +398,7 @@ bailout: int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int verbose, int retry_count, int timeout, + char *combinedopt, int printerrors, int retry_count, int timeout, const char *type) { const struct fw_vendor *vp; @@ -450,7 +450,7 @@ fwdownload(struct cam_device *device, in if (sim_mode) fprintf(stdout, "Running in simulation mode\n"); - if (fw_download_img(device, vp, buf, img_size, sim_mode, verbose, + if (fw_download_img(device, vp, buf, img_size, sim_mode, printerrors, retry_count, timeout, fw_img_path, type) != 0) { fprintf(stderr, "Firmware download failed\n"); goto fail; Modified: stable/9/sbin/camcontrol/modeedit.c ============================================================================== --- stable/9/sbin/camcontrol/modeedit.c Mon Nov 19 18:18:24 2012 (r243293) +++ stable/9/sbin/camcontrol/modeedit.c Mon Nov 19 18:20:27 2012 (r243294) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include "camcontrol.h" -int verbose = 0; - #define DEFAULT_SCSI_MODE_DB "/usr/share/misc/scsi_modes" #define DEFAULT_EDITOR "vi" #define MAX_FORMAT_SPEC 4096 /* Max CDB format specifier. */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 18:25:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A3F5F36; Mon, 19 Nov 2012 18:25:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D84C18FC12; Mon, 19 Nov 2012 18:25:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIP3he018554; Mon, 19 Nov 2012 18:25:03 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIP3md018553; Mon, 19 Nov 2012 18:25:03 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191825.qAJIP3md018553@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243295 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 18:25:04 -0000 Author: emaste Date: Mon Nov 19 18:25:03 2012 New Revision: 243295 URL: http://svnweb.freebsd.org/changeset/base/243295 Log: MFC (part of) r227081 (ed): Add missing static keywords for global variables to tools in sbin/. These tools declare global variables without using the static keyword, even though their use is limited to a single C-file, or without placing an extern declaration of them in the proper header file. Modified: stable/9/sbin/camcontrol/camcontrol.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:20:27 2012 (r243294) +++ stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:25:03 2012 (r243295) @@ -142,7 +142,7 @@ static const char smppc_opts[] = "a:A:d: static const char smpphylist_opts[] = "lq"; #endif -struct camcontrol_opts option_table[] = { +static struct camcontrol_opts option_table[] = { #ifndef MINIMALISTIC {"tur", CAM_CMD_TUR, CAM_ARG_NONE, NULL}, {"inquiry", CAM_CMD_INQUIRY, CAM_ARG_NONE, "DSR"}, @@ -210,8 +210,8 @@ struct cam_devlist { path_id_t path_id; }; -cam_cmdmask cmdlist; -cam_argmask arglist; +static cam_cmdmask cmdlist; +static cam_argmask arglist; camcontrol_optret getoption(struct camcontrol_opts *table, char *arg, uint32_t *cmdnum, cam_argmask *argnum, @@ -4780,7 +4780,7 @@ bailout: return (error); } -struct camcontrol_opts phy_ops[] = { +static struct camcontrol_opts phy_ops[] = { {"nop", SMP_PC_PHY_OP_NOP, CAM_ARG_NONE, NULL}, {"linkreset", SMP_PC_PHY_OP_LINK_RESET, CAM_ARG_NONE, NULL}, {"hardreset", SMP_PC_PHY_OP_HARD_RESET, CAM_ARG_NONE, NULL}, From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 18:26:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51590122; Mon, 19 Nov 2012 18:26:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3082B8FC14; Mon, 19 Nov 2012 18:26:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIQ9Dp018790; Mon, 19 Nov 2012 18:26:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIQ98U018789; Mon, 19 Nov 2012 18:26:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191826.qAJIQ98U018789@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243296 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 18:26:09 -0000 Author: emaste Date: Mon Nov 19 18:26:08 2012 New Revision: 243296 URL: http://svnweb.freebsd.org/changeset/base/243296 Log: MFC (part of) r229778 (uqs): Spelling fixes for sbin Modified: stable/9/sbin/camcontrol/camcontrol.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:25:03 2012 (r243295) +++ stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:26:08 2012 (r243296) @@ -5890,7 +5890,7 @@ usage(int printlong) "defects arguments:\n" "-f format specify defect list format (block, bfi or phys)\n" "-G get the grown defect list\n" -"-P get the permanant defect list\n" +"-P get the permanent defect list\n" "inquiry arguments:\n" "-D get the standard inquiry data\n" "-S get the serial number\n" From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 18:43:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E68E7ABA; Mon, 19 Nov 2012 18:43:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C9ABA8FC18; Mon, 19 Nov 2012 18:43:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIhDbm021927; Mon, 19 Nov 2012 18:43:13 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIhDgU021926; Mon, 19 Nov 2012 18:43:13 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191843.qAJIhDgU021926@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243297 - stable/9/usr.sbin/tzsetup X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 18:43:14 -0000 Author: emaste Date: Mon Nov 19 18:43:13 2012 New Revision: 243297 URL: http://svnweb.freebsd.org/changeset/base/243297 Log: MFC r232297: Grammar: tzsetup now has more than one option. Modified: stable/9/usr.sbin/tzsetup/tzsetup.8 Directory Properties: stable/9/usr.sbin/tzsetup/ (props changed) Modified: stable/9/usr.sbin/tzsetup/tzsetup.8 ============================================================================== --- stable/9/usr.sbin/tzsetup/tzsetup.8 Mon Nov 19 18:26:08 2012 (r243296) +++ stable/9/usr.sbin/tzsetup/tzsetup.8 Mon Nov 19 18:43:13 2012 (r243297) @@ -49,7 +49,7 @@ utility also determines whether any adju the hardware clock does not keep .Tn UTC . .Pp -The following option is available: +The following options are available: .Bl -tag -offset indent -width Fl .It Fl C Ar chroot_directory Open all files and directories relative to From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 18:54:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0D95151; Mon, 19 Nov 2012 18:54:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 920268FC15; Mon, 19 Nov 2012 18:54:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIsbk9023314; Mon, 19 Nov 2012 18:54:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIsbVA023313; Mon, 19 Nov 2012 18:54:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191854.qAJIsbVA023313@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243298 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 18:54:37 -0000 Author: emaste Date: Mon Nov 19 18:54:37 2012 New Revision: 243298 URL: http://svnweb.freebsd.org/changeset/base/243298 Log: MFC r232678: Inbound TCP-MD5 digest validation is now supported MFC r232695: Correct markup, use proper reference for sysctl(3) Submitted by: brueffer@ MFC r232725: Remove undesired sysctl(3) xref Submitted by: bde Modified: stable/9/share/man/man4/tcp.4 Directory Properties: stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/tcp.4 ============================================================================== --- stable/9/share/man/man4/tcp.4 Mon Nov 19 18:43:13 2012 (r243297) +++ stable/9/share/man/man4/tcp.4 Mon Nov 19 18:54:37 2012 (r243298) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 5, 2012 +.Dd November 19, 2012 .Dt TCP 4 .Os .Sh NAME @@ -255,8 +255,10 @@ or the internal send buffer is filled. .It Dv TCP_MD5SIG This option enables the use of MD5 digests (also known as TCP-MD5) on writes to the specified socket. -In the current release, only outgoing traffic is digested; -digests on incoming traffic are not verified. +Outgoing traffic is digested; +digests on incoming traffic are verified if the +.Va net.inet.tcp.signature_verify_input +sysctl is nonzero. The current default behavior for the system is to respond to a system advertising this option with TCP-MD5; this may change. .Pp From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 19:14:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECB4C8E3; Mon, 19 Nov 2012 19:14:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C68128FC12; Mon, 19 Nov 2012 19:14:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJEPa1026304; Mon, 19 Nov 2012 19:14:25 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJEPAk026303; Mon, 19 Nov 2012 19:14:25 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191914.qAJJEPAk026303@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243299 - stable/9/tools/tools/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 19:14:26 -0000 Author: emaste Date: Mon Nov 19 19:14:25 2012 New Revision: 243299 URL: http://svnweb.freebsd.org/changeset/base/243299 Log: Sync netmap pkt-gen with HEAD. MFC r238081, r238165, r238170, r238175, r239139, r239145, r240103, r238081: r238165: Allow threads to finish up when terminated by user Set a flag and allow worker threads to finish upon ^C, instead of immediately cancelling them, so that final packet count and rate stats can be displayed. r238170: Also report tx bandwidth with Ethernet overhead r238175: Allow continuous packet transmission (via -t 0) Also add a missing check for the cancel flag while waiting for the first packet in receive mode. r239139: Round displayed pps (instead of truncating) r239145: Be more descriptive about poll error / timeout when transmitting. r240103: Failure to open netmap device is unrecoverable. There's no reason to "fail later" since there's nothing this tool can do in netmap mode without /dev/netmap open. Sponsored by: ADARA Networks Modified: stable/9/tools/tools/netmap/pkt-gen.c Directory Properties: stable/9/tools/tools/netmap/ (props changed) Modified: stable/9/tools/tools/netmap/pkt-gen.c ============================================================================== --- stable/9/tools/tools/netmap/pkt-gen.c Mon Nov 19 18:54:37 2012 (r243298) +++ stable/9/tools/tools/netmap/pkt-gen.c Mon Nov 19 19:14:25 2012 (r243299) @@ -95,7 +95,7 @@ inline void prefetch (const void *x) __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); } -// XXX only for multiples of 32 bytes, non overlapped. +// XXX only for multiples of 64 bytes, non overlapped. static inline void pkt_copy(void *_src, void *_dst, int l) { @@ -191,6 +191,7 @@ struct targ { struct glob_arg *g; int used; int completed; + int cancel; int fd; struct nmreq nmr; struct netmap_if *nifp; @@ -221,15 +222,8 @@ static int global_nthreads; static void sigint_h(__unused int sig) { - for (int i = 0; i < global_nthreads; i++) { - /* cancel active threads. */ - if (targs[i].used == 0) - continue; - - D("Cancelling thread #%d\n", i); - pthread_cancel(targs[i].thread); - targs[i].used = 0; - } + for (int i = 0; i < global_nthreads; i++) + targs[i].cancel = 1; signal(SIGINT, SIG_DFL); } @@ -474,13 +468,19 @@ static void * sender_body(void *data) { struct targ *targ = (struct targ *) data; - struct pollfd fds[1]; struct netmap_if *nifp = targ->nifp; struct netmap_ring *txring; - int i, n = targ->g->npackets / targ->g->nthreads, sent = 0; + int i, pkts_per_td = targ->g->npackets / targ->g->nthreads, sent = 0; + int continuous = 0; int options = targ->g->options | OPT_COPY; + int retval; + D("start"); + if (pkts_per_td == 0) { + continuous = 1; + pkts_per_td = 100000; + } if (setaffinity(targ->thread, targ->affinity)) goto quit; /* setup poll(2) mechanism. */ @@ -495,7 +495,7 @@ D("start"); void *pkt = &targ->pkt; pcap_t *p = targ->g->p; - for (i = 0; sent < n; i++) { + for (i = 0; (sent < pkts_per_td && !targ->cancel) || continuous; i++) { if (pcap_inject(p, pkt, size) != -1) sent++; if (i > 10000) { @@ -504,13 +504,19 @@ D("start"); } } } else { - while (sent < n) { + while (sent < pkts_per_td || continuous) { /* * wait for available room in the send queue(s) */ - if (poll(fds, 1, 2000) <= 0) { - D("poll error/timeout on queue %d\n", targ->me); + if ((retval = poll(fds, 1, 2000)) <= 0) { + if (targ->cancel) + break; + if (retval == 0) + D("poll timeout on queue %d\n", targ->me); + else + D("poll error on queue %d: %s\n", targ->me, + strerror(errno)); goto quit; } /* @@ -518,8 +524,10 @@ D("start"); */ if (sent > 100000 && !(targ->g->options & OPT_COPY) ) options &= ~OPT_COPY; - for (i = targ->qfirst; i < targ->qlast; i++) { - int m, limit = MIN(n - sent, targ->g->burst); + for (i = targ->qfirst; i < targ->qlast && !targ->cancel; i++) { + int m, limit = targ->g->burst; + if (!continuous && pkts_per_td - sent < limit) + limit = pkts_per_td - sent; txring = NETMAP_TXRING(nifp, i); if (txring->avail == 0) @@ -529,6 +537,8 @@ D("start"); sent += m; targ->count = sent; } + if (targ->cancel) + break; } /* flush any remaining packets */ ioctl(fds[0].fd, NIOCTXSYNC, NULL); @@ -604,7 +614,7 @@ receiver_body(void *data) fds[0].events = (POLLIN); /* unbounded wait for the first packet. */ - for (;;) { + while (!targ->cancel) { i = poll(fds, 1, 1000); if (i > 0 && !(fds[0].revents & POLLERR)) break; @@ -614,11 +624,11 @@ receiver_body(void *data) /* main loop, exit after 1s silence */ gettimeofday(&targ->tic, NULL); if (targ->g->use_pcap) { - for (;;) { + while (!targ->cancel) { pcap_dispatch(targ->g->p, targ->g->burst, receive_pcap, NULL); } } else { - while (1) { + while (!targ->cancel) { /* Once we started to receive packets, wait at most 1 seconds before quitting. */ if (poll(fds, 1, 1 * 1000) <= 0) { @@ -655,27 +665,41 @@ quit: return (NULL); } +static char * +scaled_val(double val) +{ + static char buf[64]; + const char *units[] = {"", "K", "M", "G"}; + int i = 0; + + while (val >= 1000 && i < 3) { + val /= 1000; + i++; + } + snprintf(buf, sizeof(buf), "%.2f%s", val, units[i]); + return (buf); +} + static void tx_output(uint64_t sent, int size, double delta) { - double amount = 8.0 * (1.0 * size * sent) / delta; + uint64_t bytes_sent = sent * size; + double bw = 8.0 * bytes_sent / delta; double pps = sent / delta; - char units[4] = { '\0', 'K', 'M', 'G' }; - int aunit = 0, punit = 0; - - while (amount >= 1000) { - amount /= 1000; - aunit += 1; - } - while (pps >= 1000) { - pps /= 1000; - punit += 1; - } + /* + * Assume Ethernet overhead of 24 bytes per packet excluding header: + * FCS 4 bytes + * Preamble 8 bytes + * IFG 12 bytes + */ + double bw_with_overhead = 8.0 * (bytes_sent + sent * 24) / delta; printf("Sent %" PRIu64 " packets, %d bytes each, in %.2f seconds.\n", sent, size, delta); - printf("Speed: %.2f%cpps. Bandwidth: %.2f%cbps.\n", - pps, units[punit], amount, units[aunit]); + printf("Speed: %spps. ", scaled_val(pps)); + printf("Bandwidth: %sbps ", scaled_val(bw)); + printf("(%sbps with overhead).\n", scaled_val(bw_with_overhead)); + } @@ -704,7 +728,7 @@ usage(void) "Usage:\n" "%s arguments\n" "\t-i interface interface name\n" - "\t-t pkts_to_send also forces send mode\n" + "\t-t pkts_to_send also forces send mode, 0 = continuous\n" "\t-r pkts_to_receive also forces receive mode\n" "\t-l pkts_size in bytes excluding CRC\n" "\t-d dst-ip end with %%n to sweep n addresses\n" @@ -868,7 +892,7 @@ main(int arc, char **argv) fd = open("/dev/netmap", O_RDWR); if (fd == -1) { D("Unable to open /dev/netmap"); - // fail later + exit(1); } else { if ((ioctl(fd, NIOCGINFO, &nmr)) == -1) { D("Unable to get if info without name"); @@ -1057,7 +1081,7 @@ main(int arc, char **argv) pps = toc.tv_sec* 1000000 + toc.tv_usec; if (pps < 10000) continue; - pps = (my_count - prev)*1000000 / pps; + pps = ((my_count - prev) * 1000000 + pps / 2) / pps; D("%" PRIu64 " pps", pps); prev = my_count; toc = now; From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 19:19:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADCBFBF6; Mon, 19 Nov 2012 19:19:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB048FC08; Mon, 19 Nov 2012 19:19:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJJ40S026876; Mon, 19 Nov 2012 19:19:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJJ4sd026875; Mon, 19 Nov 2012 19:19:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211191919.qAJJJ4sd026875@svn.freebsd.org> From: Michael Tuexen Date: Mon, 19 Nov 2012 19:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243300 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 19:19:04 -0000 Author: tuexen Date: Mon Nov 19 19:19:04 2012 New Revision: 243300 URL: http://svnweb.freebsd.org/changeset/base/243300 Log: Fix the handling of mapped IPv6 addresses in sctp_connectx(). MFC after: 3 days Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Mon Nov 19 19:14:25 2012 (r243299) +++ head/lib/libc/net/sctp_sys_calls.c Mon Nov 19 19:19:04 2012 (r243300) @@ -202,7 +202,6 @@ sctp_connectx(int sd, const struct socka return (-1); } if (IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)at)->sin6_addr)) { - len += sizeof(struct sockaddr_in); in6_sin6_2_sin((struct sockaddr_in *)cpto, (struct sockaddr_in6 *)at); cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); len += sizeof(struct sockaddr_in); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 19:24:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88F2FF7F; Mon, 19 Nov 2012 19:24:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 535FE8FC13; Mon, 19 Nov 2012 19:24:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJOntv027652; Mon, 19 Nov 2012 19:24:49 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJOnjY027650; Mon, 19 Nov 2012 19:24:49 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191924.qAJJOnjY027650@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243301 - stable/9/sys/dev/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 19:24:49 -0000 Author: emaste Date: Mon Nov 19 19:24:48 2012 New Revision: 243301 URL: http://svnweb.freebsd.org/changeset/base/243301 Log: MFC r239140: Clarify comments about number of tx / rx rings MFC r239141: Fix whitespace (missing newline) Sponsored by: ADARA Networks Modified: stable/9/sys/dev/netmap/netmap.c stable/9/sys/dev/netmap/netmap_kern.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/netmap/netmap.c ============================================================================== --- stable/9/sys/dev/netmap/netmap.c Mon Nov 19 19:19:04 2012 (r243300) +++ stable/9/sys/dev/netmap/netmap.c Mon Nov 19 19:24:48 2012 (r243301) @@ -976,7 +976,9 @@ netmap_lock_wrapper(struct ifnet *dev, i * kring N+1 is only used for the selinfo for all queues. * Return 0 on success, ENOMEM otherwise. * - * na->num_tx_rings can be set for cards with different tx/rx setups + * By default the receive and transmit adapter ring counts are both initialized + * to num_queues. na->num_tx_rings can be set for cards with different tx/rx + * setups. */ int netmap_attach(struct netmap_adapter *na, int num_queues) Modified: stable/9/sys/dev/netmap/netmap_kern.h ============================================================================== --- stable/9/sys/dev/netmap/netmap_kern.h Mon Nov 19 19:19:04 2012 (r243300) +++ stable/9/sys/dev/netmap/netmap_kern.h Mon Nov 19 19:24:48 2012 (r243301) @@ -118,8 +118,8 @@ struct netmap_adapter { int separate_locks; /* set if the interface suports different locks for rx, tx and core. */ - u_int num_rx_rings; /* number of tx/rx ring pairs */ - u_int num_tx_rings; // if nonzero, overrides num_rx_rings + u_int num_rx_rings; /* number of adapter receive rings */ + u_int num_tx_rings; /* number of adapter transmit rings */ u_int num_tx_desc; /* number of descriptor in each queue */ u_int num_rx_desc; From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 19:26:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 171CE172; Mon, 19 Nov 2012 19:26:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E364B8FC13; Mon, 19 Nov 2012 19:26:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJQJLU027875; Mon, 19 Nov 2012 19:26:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJQJvS027874; Mon, 19 Nov 2012 19:26:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211191926.qAJJQJvS027874@svn.freebsd.org> From: Michael Tuexen Date: Mon, 19 Nov 2012 19:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243302 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 19:26:20 -0000 Author: tuexen Date: Mon Nov 19 19:26:19 2012 New Revision: 243302 URL: http://svnweb.freebsd.org/changeset/base/243302 Log: Cleanup the code a bit, which improves the portability. MFC after: 1 week Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Mon Nov 19 19:24:48 2012 (r243301) +++ head/lib/libc/net/sctp_sys_calls.c Mon Nov 19 19:26:19 2012 (r243302) @@ -188,15 +188,18 @@ sctp_connectx(int sd, const struct socka cpto = ((caddr_t)buf + sizeof(int)); /* validate all the addresses and get the size */ for (i = 0; i < addrcnt; i++) { - if (at->sa_family == AF_INET) { + switch (at->sa_family) { + case AF_INET: if (at->sa_len != sizeof(struct sockaddr_in)) { errno = EINVAL; return (-1); } - memcpy(cpto, at, at->sa_len); - cpto = ((caddr_t)cpto + at->sa_len); - len += at->sa_len; - } else if (at->sa_family == AF_INET6) { + memcpy(cpto, at, sizeof(struct sockaddr_in)); + cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); + len += sizeof(struct sockaddr_in); + at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in)); + break; + case AF_INET6: if (at->sa_len != sizeof(struct sockaddr_in6)) { errno = EINVAL; return (-1); @@ -206,11 +209,13 @@ sctp_connectx(int sd, const struct socka cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); len += sizeof(struct sockaddr_in); } else { - memcpy(cpto, at, at->sa_len); - cpto = ((caddr_t)cpto + at->sa_len); - len += at->sa_len; + memcpy(cpto, at, sizeof(struct sockaddr_in6)); + cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in6)); + len += sizeof(struct sockaddr_in6); } - } else { + at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in6)); + break; + default: errno = EINVAL; return (-1); } @@ -219,7 +224,6 @@ sctp_connectx(int sd, const struct socka errno = E2BIG; return (-1); } - at = (struct sockaddr *)((caddr_t)at + at->sa_len); cnt++; } /* do we have any? */ @@ -260,56 +264,57 @@ sctp_bindx(int sd, struct sockaddr *addr errno = EINVAL; return (-1); } - argsz = (sizeof(struct sockaddr_storage) + - sizeof(struct sctp_getaddresses)); - gaddrs = (struct sctp_getaddresses *)calloc(1, argsz); - if (gaddrs == NULL) { - errno = ENOMEM; - return (-1); - } /* First pre-screen the addresses */ sa = addrs; for (i = 0; i < addrcnt; i++) { - if (sa->sa_family == AF_INET) { - if (sa->sa_len != sizeof(struct sockaddr_in)) - goto out_error; + switch (sa->sa_family) { + case AF_INET: + if (sa->sa_len != sizeof(struct sockaddr_in)) { + errno = EINVAL; + return (-1); + } sin = (struct sockaddr_in *)sa; if (sin->sin_port) { /* non-zero port, check or save */ if (sport) { /* Check against our port */ if (sport != sin->sin_port) { - goto out_error; + errno = EINVAL; + return (-1); } } else { /* save off the port */ sport = sin->sin_port; } } - } else if (sa->sa_family == AF_INET6) { - if (sa->sa_len != sizeof(struct sockaddr_in6)) - goto out_error; + break; + case AF_INET6: + if (sa->sa_len != sizeof(struct sockaddr_in6)) { + errno = EINVAL; + return (-1); + } sin6 = (struct sockaddr_in6 *)sa; if (sin6->sin6_port) { /* non-zero port, check or save */ if (sport) { /* Check against our port */ if (sport != sin6->sin6_port) { - goto out_error; + errno = EINVAL; + return (-1); } } else { /* save off the port */ sport = sin6->sin6_port; } } - } else { - /* invalid address family specified */ - goto out_error; + break; + default: + /* Invalid address family specified. */ + errno = EINVAL; + return (-1); } - sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } - sa = addrs; /* * Now if there was a port mentioned, assure that the first address * has that port to make sure it fails or succeeds correctly. @@ -318,20 +323,14 @@ sctp_bindx(int sd, struct sockaddr *addr sin = (struct sockaddr_in *)sa; sin->sin_port = sport; } + argsz = sizeof(struct sctp_getaddresses) + + sizeof(struct sockaddr_storage); + if ((gaddrs = (struct sctp_getaddresses *)malloc(argsz)) == NULL) { + errno = ENOMEM; + return (-1); + } + sa = addrs; for (i = 0; i < addrcnt; i++) { - if (sa->sa_family == AF_INET) { - if (sa->sa_len != sizeof(struct sockaddr_in)) - goto out_error; - } else if (sa->sa_family == AF_INET6) { - if (sa->sa_len != sizeof(struct sockaddr_in6)) - goto out_error; - } else { - /* invalid address family specified */ - out_error: - free(gaddrs); - errno = EINVAL; - return (-1); - } memset(gaddrs, 0, argsz); gaddrs->sget_assoc_id = 0; memcpy(gaddrs->addr, sa, sa->sa_len); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 19:26:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1E822E0; Mon, 19 Nov 2012 19:26:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B5E918FC15; Mon, 19 Nov 2012 19:26:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJQxdR027984; Mon, 19 Nov 2012 19:26:59 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJQxSk027983; Mon, 19 Nov 2012 19:26:59 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191926.qAJJQxSk027983@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243303 - stable/9/sys/dev/re X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 19:26:59 -0000 Author: emaste Date: Mon Nov 19 19:26:59 2012 New Revision: 243303 URL: http://svnweb.freebsd.org/changeset/base/243303 Log: MFC r239234: Use array notation for consistency. Modified: stable/9/sys/dev/re/if_re.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/re/if_re.c ============================================================================== --- stable/9/sys/dev/re/if_re.c Mon Nov 19 19:26:19 2012 (r243302) +++ stable/9/sys/dev/re/if_re.c Mon Nov 19 19:26:59 2012 (r243303) @@ -2111,8 +2111,8 @@ re_rxeof(struct rl_softc *sc, int *rx_np ifp = sc->rl_ifp; #ifdef DEV_NETMAP if (ifp->if_capenable & IFCAP_NETMAP) { - NA(ifp)->rx_rings->nr_kflags |= NKR_PENDINTR; - selwakeuppri(&NA(ifp)->rx_rings->si, PI_NET); + NA(ifp)->rx_rings[0].nr_kflags |= NKR_PENDINTR; + selwakeuppri(&NA(ifp)->rx_rings[0].si, PI_NET); return 0; } #endif /* DEV_NETMAP */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 19:30:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02B1464F; Mon, 19 Nov 2012 19:30:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA8098FC14; Mon, 19 Nov 2012 19:30:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJUUDw028488; Mon, 19 Nov 2012 19:30:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJUUOT028487; Mon, 19 Nov 2012 19:30:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191930.qAJJUUOT028487@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243304 - stable/9/sys/dev/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 19:30:31 -0000 Author: emaste Date: Mon Nov 19 19:30:30 2012 New Revision: 243304 URL: http://svnweb.freebsd.org/changeset/base/243304 Log: MFC r241643: Avoid panic when a netmap instance cannot obtain memory. A uint32_t is always >= 0. Sponsored by: ADARA Networks Modified: stable/9/sys/dev/netmap/netmap_mem2.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/9/sys/dev/netmap/netmap_mem2.c Mon Nov 19 19:26:59 2012 (r243303) +++ stable/9/sys/dev/netmap/netmap_mem2.c Mon Nov 19 19:30:30 2012 (r243304) @@ -324,7 +324,8 @@ netmap_new_bufs(struct netmap_if *nifp _ return; cleanup: - for (i--; i >= 0; i--) { + while (i > 0) { + i--; netmap_obj_free(nm_mem->nm_buf_pool, slot[i].buf_idx); } } From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 19:31:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0FD27D0; Mon, 19 Nov 2012 19:31:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9313D8FC12; Mon, 19 Nov 2012 19:31:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJVs1p028740; Mon, 19 Nov 2012 19:31:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJVsMb028739; Mon, 19 Nov 2012 19:31:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201211191931.qAJJVsMb028739@svn.freebsd.org> From: Marius Strobl Date: Mon, 19 Nov 2012 19:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243305 - head/sys/boot/sparc64/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 19:31:54 -0000 Author: marius Date: Mon Nov 19 19:31:54 2012 New Revision: 243305 URL: http://svnweb.freebsd.org/changeset/base/243305 Log: Fix build after r243245. Submitted by: trasz Modified: head/sys/boot/sparc64/boot1/boot1.c Modified: head/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- head/sys/boot/sparc64/boot1/boot1.c Mon Nov 19 19:30:30 2012 (r243304) +++ head/sys/boot/sparc64/boot1/boot1.c Mon Nov 19 19:31:54 2012 (r243305) @@ -60,7 +60,7 @@ static void load(const char *); static void bcopy(const void *src, void *dst, size_t len); static void bzero(void *b, size_t len); -static int mount(const char *device); +static int domount(const char *device); static int dskread(void *buf, u_int64_t lba, int nblk); static void panic(const char *fmt, ...) __dead2; @@ -347,8 +347,8 @@ main(int ac, char **av) " Boot loader: %s\n", "", bootpath, path); #endif - if (mount(bootpath) == -1) - panic("mount"); + if (domount(bootpath) == -1) + panic("domount"); #ifdef ZFSBOOT loadzfs(); @@ -497,17 +497,17 @@ load(const char *fname) #endif /* ZFSBOOT */ static int -mount(const char *device) +domount(const char *device) { if ((bootdev = ofw_open(device)) == -1) { - printf("mount: can't open device\n"); + printf("domount: can't open device\n"); return (-1); } #ifndef ZFSBOOT dmadat = &__dmadat; if (fsread(0, NULL, 0)) { - printf("mount: can't read superblock\n"); + printf("domount: can't read superblock\n"); return (-1); } #endif From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 19:31:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B1D3A7D1; Mon, 19 Nov 2012 19:31:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7CF4B8FC08; Mon, 19 Nov 2012 19:31:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJVt61028776; Mon, 19 Nov 2012 19:31:55 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJVt90028775; Mon, 19 Nov 2012 19:31:55 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191931.qAJJVt90028775@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243306 - stable/9/sys/dev/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 19:31:55 -0000 Author: emaste Date: Mon Nov 19 19:31:55 2012 New Revision: 243306 URL: http://svnweb.freebsd.org/changeset/base/243306 Log: MFC r239242: Reword comment to try to improve clarity, and fix a typo. Modified: stable/9/sys/dev/netmap/ixgbe_netmap.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/ixgbe_netmap.h Mon Nov 19 19:31:54 2012 (r243305) +++ stable/9/sys/dev/netmap/ixgbe_netmap.h Mon Nov 19 19:31:55 2012 (r243306) @@ -198,14 +198,17 @@ fail: * Reconcile kernel and user view of the transmit ring. * This routine might be called frequently so it must be efficient. * - * Userspace has filled tx slots up to ring->cur (excluded). - * The last unused slot previously known to the kernel was kring->nkr_hwcur, - * and the last interrupt reported kring->nr_hwavail slots available. + * ring->cur holds the userspace view of the current ring index. Userspace + * has filled the tx slots from the previous call's ring->cur up to but not + * including ring->cur for this call. In this function the kernel updates + * kring->nr_hwcur to ring->cur, thus slots [kring->nr_hwcur, ring->cur) are + * now ready to transmit. At the last interrupt kring->nr_hwavail slots were + * available. * * This function runs under lock (acquired from the caller or internally). * It must first update ring->avail to what the kernel knows, - * subtract the newly used slots (ring->cur - kring->nkr_hwcur) - * from both avail and nr_hwavail, and set ring->nkr_hwcur = ring->cur + * subtract the newly used slots (ring->cur - kring->nr_hwcur) + * from both avail and nr_hwavail, and set ring->nr_hwcur = ring->cur * issuing a dmamap_sync on all slots. * * Since ring comes from userspace, its content must be read only once, From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 19:36:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5AD5C2E; Mon, 19 Nov 2012 19:36:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 3BB038FC0C; Mon, 19 Nov 2012 19:36:18 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAJJa9kM027334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Nov 2012 06:36:11 +1100 Date: Tue, 20 Nov 2012 06:36:09 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rui Paulo Subject: Re: svn commit: r243262 - head/usr.bin/top In-Reply-To: <3241E07C-D177-4297-825A-A52FEA8F1241@FreeBSD.org> Message-ID: <20121120063319.H3656@besplex.bde.org> References: <201211190803.qAJ83eRo014127@svn.freebsd.org> <20121119082618.GB67020@FreeBSD.org> <3241E07C-D177-4297-825A-A52FEA8F1241@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=XbrRV/F5 c=1 sm=1 a=FLvZyyl_zxUA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=6Djc_KAXMDkA:10 a=6I5d2MoRAAAA:8 a=6Q3wHs0oV5EYVVmnQq0A:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 19:36:19 -0000 On Mon, 19 Nov 2012, Rui Paulo wrote: > On 19 Nov 2012, at 00:26, Alexey Dokuchaev wrote: > >> On Mon, Nov 19, 2012 at 08:03:40AM +0000, Rui Paulo wrote: >>> New Revision: 243262 >>> URL: http://svnweb.freebsd.org/changeset/base/243262 >>> >>> - cmdbuf = (char *)malloc(cmdlengthdelta + 1); >>> + cmdbuf = (char *)malloc(cmdlen + 1); >> >> Why explicitly casting malloc return() value (void *)? > > Why are you asking me about code I didn't write? :-) > I don't want to mix style changes with functional changes so I let it be. If you're asking why our source tree has malloc casts, it's because compilers in the 1980s used to be unnecessarily more pedantic. It is more because code written in the 1980's didn't even declare malloc(). It tried to hide its bug by casting malloc(). The behaviour was still undefined. Now, C++ compilers are more strict. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 20:05:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBBC09A2; Mon, 19 Nov 2012 20:05:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 6A12D8FC08; Mon, 19 Nov 2012 20:05:27 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAJK5Cjk017976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Nov 2012 07:05:13 +1100 Date: Tue, 20 Nov 2012 07:05:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Chris Rees Subject: Re: svn commit: r243228 - head/etc In-Reply-To: Message-ID: <20121120063700.M3656@besplex.bde.org> References: <201211181421.qAIEL5KT042019@svn.freebsd.org> <20121119175936.J1085@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=eqGHVfVX c=1 sm=1 a=oqJYCRs2r9kA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=lBvS7PFwMUkA:10 a=ktH97meGC_hl-PfRqxYA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 20:05:28 -0000 On Mon, 19 Nov 2012, Chris Rees wrote: > On 19 November 2012 08:03, Bruce Evans wrote: >> On Sun, 18 Nov 2012, Chris Rees wrote: >> ... >>> As you say however, pax is technically how it should be done anyway, and >>> has the nice effect of also preserving hard links. If no-one objects I >>> think it should stay in. >> >> Not perserving hard links is a bug in cp -R. > > pax/tar/cpio have always been recommended over cp -R for this very > reason-- By who? POSIX wouldn't recommend pax over cp -R because of a bug in FreeBSD's cp. It recommends pax over tar/cpio because it invented pax to avoid having to change tar/cpio to fix them. > I would imagine that the fix is non-trivial if this is a bug > at all (which I don't think it is). Non-trival but not very hard. gnu utilities had it working in 1988 (or 1990?). tar/cpio/pax have always had to support it. Keep a big table of links or something. This is fairly easy unless memory runs out. Even du does this now (but it didn't in 4.4BSD-Lite2). Running out of memory was a problem on 16-bit systems in 1988, bug gnu always assumed that memory was infinite so it had no problems :-). >> Another bug in cp -Rp is that >> it doesn't preserve mtimes for directories. This is easier to fix by re-traversing the source tree to find directory timestamps and fix them up in the target. This works on small-memory systems with relatively large directory trees by using the file system to store the metadata. Links aren't as local as directory times so it isn't clear how to do this for them. At worst you could do 1 pass for every set of linked files and only start doing this when memory runs out. >> - no error checking for cd. We have just checked that $j is a directory. >> If it should somehow go away, then the errors from cp -Rp of it are more >> fail-safe than the errors from not checking for cd failure. > > $ cp -Rp spam /eggs > cp: spam: No such file or directory > $ cd spam && pax -rw . /eggs > cd: spam: No such file or directory > $ > > I'm not seeing a huge difference. How is cp more fail safe? Oops, I forgot the && :-(. >> pax is little used and poorly maintained. It has no support for acls, >> while cp has some. Pax hasn't caught up with the creation of utimes(2) >> in 4.2BSD, so it still clobbers the tv_nsec part of file times when it >> "preserves" them (though it uses lutimes(2)), while cp only clobbers >> the last 3 decimal digits in the tv_nsec part of file times when it >> "preserves" them. So even with '-p e', pax often clobbers file times >> and never preserves acls even. Maybe this doesn't matter here. But >> pax is unusable in general. I normally use cp -pR when I don't care >> about links or file times (which is rarely), else gnu tar if I care >> about links but not file times, else bsd tar occasionally for its >> better handling of file times (tar format just can't handle all the >> times well, and bsd tar handles them slightly less badly), else >> gnu tar following by a fixup program to duplicate all the times. >> gnu cp -a should work best, but I haven't used it lately. > > How are any of these alternatives good in an rc script? Using tar > requires two threads (tar c | tar x), which is why I replaced it with > pax in the first place. Two threads cost little speed and may even improve speed by increasing streaming. The main reason to avoid them is that they complicate error checking a little. > Diskless init means that we use RAM as disks-- for your own > entertainment, I suggest making a copy of /rescue with pax, and then > with cp -R. Which would you prefer in your ramdisk? For those > concerned about size, this also applies to you-- 96k of pax vs any > hardlink duplication. A very good reason to fix cp! I'm concerned about size, but not here. Everything is statically linked for me, and my /rescue is empty. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 20:43:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9D401FB; Mon, 19 Nov 2012 20:43:19 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E9318FC08; Mon, 19 Nov 2012 20:43:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJKhJ69038017; Mon, 19 Nov 2012 20:43:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJKhJ9i038016; Mon, 19 Nov 2012 20:43:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201211192043.qAJKhJ9i038016@svn.freebsd.org> From: Attilio Rao Date: Mon, 19 Nov 2012 20:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243307 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 20:43:19 -0000 Author: attilio Date: Mon Nov 19 20:43:19 2012 New Revision: 243307 URL: http://svnweb.freebsd.org/changeset/base/243307 Log: insmntque() is always called with the lock held in exclusive mode, then: - assume the lock is held in exclusive mode and remove a moot check about the lock acquisition. - in the destructor remove !MPSAFE specific chunk. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Nov 19 19:31:55 2012 (r243306) +++ head/sys/kern/vfs_subr.c Mon Nov 19 20:43:19 2012 (r243307) @@ -1111,10 +1111,6 @@ insmntque_stddtr(struct vnode *vp, void vp->v_data = NULL; vp->v_op = &dead_vnodeops; - /* XXX non mp-safe fs may still call insmntque with vnode - unlocked */ - if (!VOP_ISLOCKED(vp)) - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vgone(vp); vput(vp); } @@ -1126,7 +1122,6 @@ int insmntque1(struct vnode *vp, struct mount *mp, void (*dtr)(struct vnode *, void *), void *dtr_arg) { - int locked; KASSERT(vp->v_mount == NULL, ("insmntque: vnode already on per mount vnode list")); @@ -1144,18 +1139,15 @@ insmntque1(struct vnode *vp, struct moun */ MNT_ILOCK(mp); VI_LOCK(vp); - if ((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && + if (((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0 || - mp->mnt_nvnodelistsize == 0)) { - locked = VOP_ISLOCKED(vp); - if (!locked || (locked == LK_EXCLUSIVE && - (vp->v_vflag & VV_FORCEINSMQ) == 0)) { - VI_UNLOCK(vp); - MNT_IUNLOCK(mp); - if (dtr != NULL) - dtr(vp, dtr_arg); - return (EBUSY); - } + mp->mnt_nvnodelistsize == 0)) && + (vp->v_vflag & VV_FORCEINSMQ) == 0) { + VI_UNLOCK(vp); + MNT_IUNLOCK(mp); + if (dtr != NULL) + dtr(vp, dtr_arg); + return (EBUSY); } vp->v_mount = mp; MNT_REF(mp); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 20:53:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47CB9595; Mon, 19 Nov 2012 20:53:51 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5938FC0C; Mon, 19 Nov 2012 20:53:50 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo13so7267763vcb.13 for ; Mon, 19 Nov 2012 12:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=bDlVD9BgmaiA82aiOzB473Vy3WkPE/Rdi265g9HODKA=; b=lhsxbAGU1GnhrgzV72rttP17e9pFTyjX8Z+wh3Vgx8owzAlVhn8qYR5sl25bzInHUY QQd4OcJiKPge93Vm+/JUeCPjP47knVJ3Y5TtK9QxAU7X5ArYmaO67SDe6eBycZDMpoXS Gu4qVQlosX0lStLjajX+hank6aLTj7gs1ZpXcd0M/mGJa12Hn1K46/JV0bsoLn3UfeNi EvXl261BACEIcuXh0xPTTydyk5ylO/jg04te0mjfj8JM7W8ctQsHvom+RKtVWkrJW5e0 eieGlt1bSrdkLTnbBf3RDoc4fSkA24skpWa2ROxBElqHVv5tCNxMwebrtd+crkBXauvj JnEw== MIME-Version: 1.0 Received: by 10.52.89.235 with SMTP id br11mr18243382vdb.77.1353358428522; Mon, 19 Nov 2012 12:53:48 -0800 (PST) Sender: davide.italiano@gmail.com Received: by 10.58.247.132 with HTTP; Mon, 19 Nov 2012 12:53:48 -0800 (PST) In-Reply-To: <201211192043.qAJKhJ9i038016@svn.freebsd.org> References: <201211192043.qAJKhJ9i038016@svn.freebsd.org> Date: Mon, 19 Nov 2012 21:53:48 +0100 X-Google-Sender-Auth: JXLaSMw0A4ijoZrKYZ0VV9Hgq68 Message-ID: Subject: Re: svn commit: r243307 - head/sys/kern From: Davide Italiano To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 20:53:51 -0000 On Mon, Nov 19, 2012 at 9:43 PM, Attilio Rao wrote: > Author: attilio > Date: Mon Nov 19 20:43:19 2012 > New Revision: 243307 > URL: http://svnweb.freebsd.org/changeset/base/243307 > > Log: > insmntque() is always called with the lock held in exclusive mode, > then: > - assume the lock is held in exclusive mode and remove a moot check > about the lock acquisition. > - in the destructor remove !MPSAFE specific chunk. > > Reviewed by: kib > MFC after: 2 weeks > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Mon Nov 19 19:31:55 2012 (r243306) > +++ head/sys/kern/vfs_subr.c Mon Nov 19 20:43:19 2012 (r243307) > @@ -1111,10 +1111,6 @@ insmntque_stddtr(struct vnode *vp, void > > vp->v_data = NULL; > vp->v_op = &dead_vnodeops; > - /* XXX non mp-safe fs may still call insmntque with vnode > - unlocked */ > - if (!VOP_ISLOCKED(vp)) > - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > vgone(vp); > vput(vp); > } > @@ -1126,7 +1122,6 @@ int > insmntque1(struct vnode *vp, struct mount *mp, > void (*dtr)(struct vnode *, void *), void *dtr_arg) > { > - int locked; > > KASSERT(vp->v_mount == NULL, > ("insmntque: vnode already on per mount vnode list")); > @@ -1144,18 +1139,15 @@ insmntque1(struct vnode *vp, struct moun > */ > MNT_ILOCK(mp); > VI_LOCK(vp); > - if ((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && > + if (((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && > ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0 || > - mp->mnt_nvnodelistsize == 0)) { > - locked = VOP_ISLOCKED(vp); > - if (!locked || (locked == LK_EXCLUSIVE && > - (vp->v_vflag & VV_FORCEINSMQ) == 0)) { > - VI_UNLOCK(vp); > - MNT_IUNLOCK(mp); > - if (dtr != NULL) > - dtr(vp, dtr_arg); > - return (EBUSY); > - } > + mp->mnt_nvnodelistsize == 0)) && > + (vp->v_vflag & VV_FORCEINSMQ) == 0) { > + VI_UNLOCK(vp);s > + MNT_IUNLOCK(mp); > + if (dtr != NULL) > + dtr(vp, dtr_arg); > + return (EBUSY); > } > vp->v_mount = mp; > MNT_REF(mp); Thanks for doing this. Attilio, I don't know if this really could help, but what do you think about adding an assertion to check if the vnode is locked? This could help in some cases, e.g. it might be useful to discover the violation of this assumption for a developer which wants to port a new fs into the source tree. Davide From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 20:55:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50F388DC; Mon, 19 Nov 2012 20:55:29 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1728FC08; Mon, 19 Nov 2012 20:55:27 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so2408878lbb.13 for ; Mon, 19 Nov 2012 12:55:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=MPfODKjIuUnBOiG8joOUyrcV6DZh79pQHtxFarqO+YM=; b=bU6ccUiSrMB0C2mcqFYAYm3Y0z+KkE0V32BoPcPEvd6vB0K2RBPj2vGbeqkDi7dpU1 mKc0K9qNK1P39s7501HioSXckeavvGH6g1ILyBcAMRXyINCnkyKKCGxWiCAXMyzx3Y2z 8V8pD7JnMwgygjA+qT1jkYZ6K/hyHxxljASISKsIsT5RIRmR5KVJIfQ86wD4mBYgYUFW iHTvnr1m0mtYiR7TXtxEGuZKd62fZkp20osS/tLQ+BAZxtPOg1tGLSOV+9RvzFo3njUS Tj2mhC3GUlOVYEbDa3LdJ2iugODp/8tlRNCKNlTMECcBeh95KiPhyhnY1l9BLUxcEWEN Qr1A== MIME-Version: 1.0 Received: by 10.112.98.37 with SMTP id ef5mr5654949lbb.84.1353358526574; Mon, 19 Nov 2012 12:55:26 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Mon, 19 Nov 2012 12:55:26 -0800 (PST) In-Reply-To: References: <201211192043.qAJKhJ9i038016@svn.freebsd.org> Date: Mon, 19 Nov 2012 20:55:26 +0000 X-Google-Sender-Auth: Ji_sQmmbQe6pB8AteK4S5o0iZnE Message-ID: Subject: Re: svn commit: r243307 - head/sys/kern From: Attilio Rao To: Davide Italiano Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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: Mon, 19 Nov 2012 20:55:29 -0000 On Mon, Nov 19, 2012 at 8:53 PM, Davide Italiano wrote: > On Mon, Nov 19, 2012 at 9:43 PM, Attilio Rao wrote: >> Author: attilio >> Date: Mon Nov 19 20:43:19 2012 >> New Revision: 243307 >> URL: http://svnweb.freebsd.org/changeset/base/243307 >> >> Log: >> insmntque() is always called with the lock held in exclusive mode, >> then: >> - assume the lock is held in exclusive mode and remove a moot check >> about the lock acquisition. >> - in the destructor remove !MPSAFE specific chunk. >> >> Reviewed by: kib >> MFC after: 2 weeks >> >> Modified: >> head/sys/kern/vfs_subr.c >> >> Modified: head/sys/kern/vfs_subr.c >> ============================================================================== >> --- head/sys/kern/vfs_subr.c Mon Nov 19 19:31:55 2012 (r243306) >> +++ head/sys/kern/vfs_subr.c Mon Nov 19 20:43:19 2012 (r243307) >> @@ -1111,10 +1111,6 @@ insmntque_stddtr(struct vnode *vp, void >> >> vp->v_data = NULL; >> vp->v_op = &dead_vnodeops; >> - /* XXX non mp-safe fs may still call insmntque with vnode >> - unlocked */ >> - if (!VOP_ISLOCKED(vp)) >> - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); >> vgone(vp); >> vput(vp); >> } >> @@ -1126,7 +1122,6 @@ int >> insmntque1(struct vnode *vp, struct mount *mp, >> void (*dtr)(struct vnode *, void *), void *dtr_arg) >> { >> - int locked; >> >> KASSERT(vp->v_mount == NULL, >> ("insmntque: vnode already on per mount vnode list")); >> @@ -1144,18 +1139,15 @@ insmntque1(struct vnode *vp, struct moun >> */ >> MNT_ILOCK(mp); >> VI_LOCK(vp); >> - if ((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && >> + if (((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && >> ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0 || >> - mp->mnt_nvnodelistsize == 0)) { >> - locked = VOP_ISLOCKED(vp); >> - if (!locked || (locked == LK_EXCLUSIVE && >> - (vp->v_vflag & VV_FORCEINSMQ) == 0)) { >> - VI_UNLOCK(vp); >> - MNT_IUNLOCK(mp); >> - if (dtr != NULL) >> - dtr(vp, dtr_arg); >> - return (EBUSY); >> - } >> + mp->mnt_nvnodelistsize == 0)) && >> + (vp->v_vflag & VV_FORCEINSMQ) == 0) { >> + VI_UNLOCK(vp);s >> + MNT_IUNLOCK(mp); >> + if (dtr != NULL) >> + dtr(vp, dtr_arg); >> + return (EBUSY); >> } >> vp->v_mount = mp; >> MNT_REF(mp); > > Thanks for doing this. > Attilio, I don't know if this really could help, but what do you think > about adding an assertion to check if the vnode is locked? > This could help in some cases, e.g. it might be useful to discover the > violation of this assumption for a developer which wants to port a new > fs into the source tree. Exactly where? insmntque1() already has this. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 21:08:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6A3CBE5; Mon, 19 Nov 2012 21:08:54 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1F48FC0C; Mon, 19 Nov 2012 21:08:54 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo13so7287755vcb.13 for ; Mon, 19 Nov 2012 13:08:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Jlz5O1ts5Vj0d0SWVRrY+srq607OCQZcg/Q4iTR+Fio=; b=u4eeD3lqIStNIeBT/k8jFk9cYULfOHWX33N55T8Rq63McX9K3cGrZR/ho0z4OuGwaX 4i/YXl7ofAgFxCJm5k/uBGX8o0PG1NlRxCGwBiRYy8CNiCQbxyhr/JL8BBtBUMzEGQJ2 K084OVn3EK3kY28YtU8LMPVhLGAd6LRydpErBQ4pZ3jLmaKGdbZbt2LaEo/y0OWxoqRH c4uBxSRHPi5YH0g7KHp8TPx8bxVtkF2SD8tCByEa+B3r8TGAzsYy3wOGvJkIf76YWhtB XQrYk6wwsjZaZSls60TSu+wEavdymUkYHw4DHSO+FGtY+YCrwljqwLrm6rYsLcbpMbR6 NQsQ== MIME-Version: 1.0 Received: by 10.52.89.235 with SMTP id br11mr18292783vdb.77.1353359333638; Mon, 19 Nov 2012 13:08:53 -0800 (PST) Sender: davide.italiano@gmail.com Received: by 10.58.247.132 with HTTP; Mon, 19 Nov 2012 13:08:53 -0800 (PST) In-Reply-To: References: <201211192043.qAJKhJ9i038016@svn.freebsd.org> Date: Mon, 19 Nov 2012 22:08:53 +0100 X-Google-Sender-Auth: M4I7k7jnF3DOajPl20ZJe2dfdQs Message-ID: Subject: Re: svn commit: r243307 - head/sys/kern From: Davide Italiano To: attilio@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 21:08:54 -0000 On Mon, Nov 19, 2012 at 9:55 PM, Attilio Rao wrote: > On Mon, Nov 19, 2012 at 8:53 PM, Davide Italiano wrote: >> On Mon, Nov 19, 2012 at 9:43 PM, Attilio Rao wrote: >>> Author: attilio >>> Date: Mon Nov 19 20:43:19 2012 >>> New Revision: 243307 >>> URL: http://svnweb.freebsd.org/changeset/base/243307 >>> >>> Log: >>> insmntque() is always called with the lock held in exclusive mode, >>> then: >>> - assume the lock is held in exclusive mode and remove a moot check >>> about the lock acquisition. >>> - in the destructor remove !MPSAFE specific chunk. >>> >>> Reviewed by: kib >>> MFC after: 2 weeks >>> >>> Modified: >>> head/sys/kern/vfs_subr.c >>> >>> Modified: head/sys/kern/vfs_subr.c >>> ============================================================================== >>> --- head/sys/kern/vfs_subr.c Mon Nov 19 19:31:55 2012 (r243306) >>> +++ head/sys/kern/vfs_subr.c Mon Nov 19 20:43:19 2012 (r243307) >>> @@ -1111,10 +1111,6 @@ insmntque_stddtr(struct vnode *vp, void >>> >>> vp->v_data = NULL; >>> vp->v_op = &dead_vnodeops; >>> - /* XXX non mp-safe fs may still call insmntque with vnode >>> - unlocked */ >>> - if (!VOP_ISLOCKED(vp)) >>> - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); >>> vgone(vp); >>> vput(vp); >>> } >>> @@ -1126,7 +1122,6 @@ int >>> insmntque1(struct vnode *vp, struct mount *mp, >>> void (*dtr)(struct vnode *, void *), void *dtr_arg) >>> { >>> - int locked; >>> >>> KASSERT(vp->v_mount == NULL, >>> ("insmntque: vnode already on per mount vnode list")); >>> @@ -1144,18 +1139,15 @@ insmntque1(struct vnode *vp, struct moun >>> */ >>> MNT_ILOCK(mp); >>> VI_LOCK(vp); >>> - if ((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && >>> + if (((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && >>> ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0 || >>> - mp->mnt_nvnodelistsize == 0)) { >>> - locked = VOP_ISLOCKED(vp); >>> - if (!locked || (locked == LK_EXCLUSIVE && >>> - (vp->v_vflag & VV_FORCEINSMQ) == 0)) { >>> - VI_UNLOCK(vp); >>> - MNT_IUNLOCK(mp); >>> - if (dtr != NULL) >>> - dtr(vp, dtr_arg); >>> - return (EBUSY); >>> - } >>> + mp->mnt_nvnodelistsize == 0)) && >>> + (vp->v_vflag & VV_FORCEINSMQ) == 0) { >>> + VI_UNLOCK(vp);s >>> + MNT_IUNLOCK(mp); >>> + if (dtr != NULL) >>> + dtr(vp, dtr_arg); >>> + return (EBUSY); >>> } >>> vp->v_mount = mp; >>> MNT_REF(mp); >> >> Thanks for doing this. >> Attilio, I don't know if this really could help, but what do you think >> about adding an assertion to check if the vnode is locked? >> This could help in some cases, e.g. it might be useful to discover the >> violation of this assumption for a developer which wants to port a new >> fs into the source tree. > > Exactly where? insmntque1() already has this. > > Attilio > > > -- > Peace can only be achieved by understanding - A. Einstein I was talking about the destructor code, instead of the vn_lock() call which you removed. I was in doubt so I asked, but now after closely looking at the code I see the destructor function is called only within insmntque1 and the check I suggest is probably redundant/useless. Thanks From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 21:10:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E1BDE70; Mon, 19 Nov 2012 21:10:53 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 08A658FC08; Mon, 19 Nov 2012 21:10:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJLAqNk042056; Mon, 19 Nov 2012 21:10:52 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJLAqpr042055; Mon, 19 Nov 2012 21:10:52 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201211192110.qAJLAqpr042055@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 19 Nov 2012 21:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243308 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 21:10:53 -0000 Author: trociny Date: Mon Nov 19 21:10:52 2012 New Revision: 243308 URL: http://svnweb.freebsd.org/changeset/base/243308 Log: MFC r240997: Kernel and modules have "set_vnet" linker set, where virtualized global variables are placed. When a module is loaded by link_elf linker its variables from "set_vnet" linker set are copied to the kernel "set_vnet" ("modspace") and all references to these variables inside the module are relocated accordingly. The issue is when a module is loaded that has references to global variables from another, previously loaded module: these references are not relocated so an invalid address is used when the module tries to access the variable. The example is V_layer3_chain, defined in ipfw module and accessed from ipfw_nat. The same issue is with DPCPU variables, which use "set_pcpu" linker set. Fix this making the link_elf linker on a module load recognize "external" DPCPU/VNET variables defined in the previously loaded modules and relocate them accordingly. For this set_pcpu_list and set_vnet_list are used, where the addresses of modules' "set_pcpu" and "set_vnet" linker sets are stored. Note, archs that use link_elf_obj (amd64) were not affected by this issue. Reviewed by: jhb, julian, zec (initial version) Modified: stable/9/sys/kern/link_elf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/link_elf.c ============================================================================== --- stable/9/sys/kern/link_elf.c Mon Nov 19 20:43:19 2012 (r243307) +++ stable/9/sys/kern/link_elf.c Mon Nov 19 21:10:52 2012 (r243308) @@ -123,6 +123,15 @@ typedef struct elf_file { #endif } *elf_file_t; +struct elf_set { + Elf_Addr es_start; + Elf_Addr es_stop; + Elf_Addr es_base; + TAILQ_ENTRY(elf_set) es_link; +}; + +TAILQ_HEAD(elf_set_head, elf_set); + #include static int link_elf_link_common_finish(linker_file_t); @@ -181,6 +190,75 @@ static int parse_dynamic(elf_file_t); static int relocate_file(elf_file_t); static int link_elf_preload_parse_symbols(elf_file_t); +static struct elf_set_head set_pcpu_list; +#ifdef VIMAGE +static struct elf_set_head set_vnet_list; +#endif + +static void +elf_set_add(struct elf_set_head *list, Elf_Addr start, Elf_Addr stop, Elf_Addr base) +{ + struct elf_set *set, *iter; + + set = malloc(sizeof(*set), M_LINKER, M_WAITOK); + set->es_start = start; + set->es_stop = stop; + set->es_base = base; + + TAILQ_FOREACH(iter, list, es_link) { + + KASSERT((set->es_start < iter->es_start && set->es_stop < iter->es_stop) || + (set->es_start > iter->es_start && set->es_stop > iter->es_stop), + ("linker sets intersection: to insert: 0x%jx-0x%jx; inserted: 0x%jx-0x%jx", + (uintmax_t)set->es_start, (uintmax_t)set->es_stop, + (uintmax_t)iter->es_start, (uintmax_t)iter->es_stop)); + + if (iter->es_start > set->es_start) { + TAILQ_INSERT_BEFORE(iter, set, es_link); + break; + } + } + + if (iter == NULL) + TAILQ_INSERT_TAIL(list, set, es_link); +} + +static int +elf_set_find(struct elf_set_head *list, Elf_Addr addr, Elf_Addr *start, Elf_Addr *base) +{ + struct elf_set *set; + + TAILQ_FOREACH(set, list, es_link) { + if (addr < set->es_start) + return (0); + if (addr < set->es_stop) { + *start = set->es_start; + *base = set->es_base; + return (1); + } + } + + return (0); +} + +static void +elf_set_delete(struct elf_set_head *list, Elf_Addr start) +{ + struct elf_set *set; + + TAILQ_FOREACH(set, list, es_link) { + if (start < set->es_start) + break; + if (start == set->es_start) { + TAILQ_REMOVE(list, set, es_link); + free(set, M_LINKER); + return; + } + } + KASSERT(0, ("deleting unknown linker set (start = 0x%jx)", + (uintmax_t)start)); +} + #ifdef GDB static void r_debug_state(struct r_debug *, struct link_map *); @@ -345,6 +423,10 @@ link_elf_init(void* arg) (void)link_elf_link_common_finish(linker_kernel_file); linker_kernel_file->flags |= LINKER_FILE_LINKED; + TAILQ_INIT(&set_pcpu_list); +#ifdef VIMAGE + TAILQ_INIT(&set_vnet_list); +#endif } SYSINIT(link_elf, SI_SUB_KLD, SI_ORDER_THIRD, link_elf_init, 0); @@ -515,6 +597,8 @@ parse_dpcpu(elf_file_t ef) return (ENOSPC); memcpy((void *)ef->pcpu_base, (void *)ef->pcpu_start, count); dpcpu_copy((void *)ef->pcpu_base, count); + elf_set_add(&set_pcpu_list, ef->pcpu_start, ef->pcpu_stop, + ef->pcpu_base); return (0); } @@ -544,6 +628,8 @@ parse_vnet(elf_file_t ef) return (ENOSPC); memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, count); vnet_data_copy((void *)ef->vnet_base, count); + elf_set_add(&set_vnet_list, ef->vnet_start, ef->vnet_stop, + ef->vnet_base); return (0); } @@ -996,11 +1082,13 @@ link_elf_unload_file(linker_file_t file) if (ef->pcpu_base != 0) { dpcpu_free((void *)ef->pcpu_base, ef->pcpu_stop - ef->pcpu_start); + elf_set_delete(&set_pcpu_list, ef->pcpu_start); } #ifdef VIMAGE if (ef->vnet_base != 0) { vnet_data_free((void *)ef->vnet_base, ef->vnet_stop - ef->vnet_start); + elf_set_delete(&set_vnet_list, ef->vnet_start); } #endif #ifdef GDB @@ -1439,6 +1527,7 @@ elf_lookup(linker_file_t lf, Elf_Size sy elf_file_t ef = (elf_file_t)lf; const Elf_Sym *sym; const char *symbol; + Elf_Addr addr, start, base; /* Don't even try to lookup the symbol if the index is bogus. */ if (symidx >= ef->nchains) @@ -1470,7 +1559,15 @@ elf_lookup(linker_file_t lf, Elf_Size sy if (*symbol == 0) return (0); - return ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + addr = ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + + if (elf_set_find(&set_pcpu_list, addr, &start, &base)) + addr = addr - start + base; +#ifdef VIMAGE + else if (elf_set_find(&set_vnet_list, addr, &start, &base)) + addr = addr - start + base; +#endif + return addr; } static void From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 21:11:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0411FD6; Mon, 19 Nov 2012 21:11:42 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 936BF8FC12; Mon, 19 Nov 2012 21:11:41 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so2422619lbb.13 for ; Mon, 19 Nov 2012 13:11:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ZkfB8AzPOwu6BUrEJ39oIoCTdiwicjfG54f+pSvYZAA=; b=yu2uEYqCPLavQBlCWVwc/vfSmQtmgakk599sqFhtIrng5it01KV0P+zSugJjCgfH9L N50kGoXureSzbffXmiMj7aFvbh/XkcvS1xtaPhGaNqTvOqmbqPNnc0UwIXAdQSHwS+Yj OYR34zWwmlKX1WqF+8FcKjnvgbcY4qZ6FIgJ6FvTS4NEHDpEZ4Uk/E4VZ4r7zFnkK7e8 Zmuo39yr7sCU4Iqbx7ZphgCiOLgxl54R4+EtauvJP5lKWYmGB4xaWk/Gypcvs4VryN8V TItfhW/dm9+G9Qi45JbXI4GFdez0eiLVZeCuQIJzhQK27uqajqjEc27BQgcvyAmQ48sr 389w== MIME-Version: 1.0 Received: by 10.152.129.197 with SMTP id ny5mr12786964lab.43.1353359500489; Mon, 19 Nov 2012 13:11:40 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Mon, 19 Nov 2012 13:11:40 -0800 (PST) In-Reply-To: References: <201211192043.qAJKhJ9i038016@svn.freebsd.org> Date: Mon, 19 Nov 2012 21:11:40 +0000 X-Google-Sender-Auth: CdB99dSwCkzxnGiltrPl4fyZjbk Message-ID: Subject: Re: svn commit: r243307 - head/sys/kern From: Attilio Rao To: Davide Italiano Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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: Mon, 19 Nov 2012 21:11:42 -0000 On Mon, Nov 19, 2012 at 9:08 PM, Davide Italiano wrote: > On Mon, Nov 19, 2012 at 9:55 PM, Attilio Rao wrote: >> On Mon, Nov 19, 2012 at 8:53 PM, Davide Italiano wrote: >>> On Mon, Nov 19, 2012 at 9:43 PM, Attilio Rao wrote: >>>> Author: attilio >>>> Date: Mon Nov 19 20:43:19 2012 >>>> New Revision: 243307 >>>> URL: http://svnweb.freebsd.org/changeset/base/243307 >>>> >>>> Log: >>>> insmntque() is always called with the lock held in exclusive mode, >>>> then: >>>> - assume the lock is held in exclusive mode and remove a moot check >>>> about the lock acquisition. >>>> - in the destructor remove !MPSAFE specific chunk. >>>> >>>> Reviewed by: kib >>>> MFC after: 2 weeks >>>> >>>> Modified: >>>> head/sys/kern/vfs_subr.c >>>> >>>> Modified: head/sys/kern/vfs_subr.c >>>> ============================================================================== >>>> --- head/sys/kern/vfs_subr.c Mon Nov 19 19:31:55 2012 (r243306) >>>> +++ head/sys/kern/vfs_subr.c Mon Nov 19 20:43:19 2012 (r243307) >>>> @@ -1111,10 +1111,6 @@ insmntque_stddtr(struct vnode *vp, void >>>> >>>> vp->v_data = NULL; >>>> vp->v_op = &dead_vnodeops; >>>> - /* XXX non mp-safe fs may still call insmntque with vnode >>>> - unlocked */ >>>> - if (!VOP_ISLOCKED(vp)) >>>> - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); >>>> vgone(vp); >>>> vput(vp); >>>> } >>>> @@ -1126,7 +1122,6 @@ int >>>> insmntque1(struct vnode *vp, struct mount *mp, >>>> void (*dtr)(struct vnode *, void *), void *dtr_arg) >>>> { >>>> - int locked; >>>> >>>> KASSERT(vp->v_mount == NULL, >>>> ("insmntque: vnode already on per mount vnode list")); >>>> @@ -1144,18 +1139,15 @@ insmntque1(struct vnode *vp, struct moun >>>> */ >>>> MNT_ILOCK(mp); >>>> VI_LOCK(vp); >>>> - if ((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && >>>> + if (((mp->mnt_kern_flag & MNTK_NOINSMNTQ) != 0 && >>>> ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0 || >>>> - mp->mnt_nvnodelistsize == 0)) { >>>> - locked = VOP_ISLOCKED(vp); >>>> - if (!locked || (locked == LK_EXCLUSIVE && >>>> - (vp->v_vflag & VV_FORCEINSMQ) == 0)) { >>>> - VI_UNLOCK(vp); >>>> - MNT_IUNLOCK(mp); >>>> - if (dtr != NULL) >>>> - dtr(vp, dtr_arg); >>>> - return (EBUSY); >>>> - } >>>> + mp->mnt_nvnodelistsize == 0)) && >>>> + (vp->v_vflag & VV_FORCEINSMQ) == 0) { >>>> + VI_UNLOCK(vp);s >>>> + MNT_IUNLOCK(mp); >>>> + if (dtr != NULL) >>>> + dtr(vp, dtr_arg); >>>> + return (EBUSY); >>>> } >>>> vp->v_mount = mp; >>>> MNT_REF(mp); >>> >>> Thanks for doing this. >>> Attilio, I don't know if this really could help, but what do you think >>> about adding an assertion to check if the vnode is locked? >>> This could help in some cases, e.g. it might be useful to discover the >>> violation of this assumption for a developer which wants to port a new >>> fs into the source tree. >> >> Exactly where? insmntque1() already has this. >> >> Attilio >> >> >> -- >> Peace can only be achieved by understanding - A. Einstein > > I was talking about the destructor code, instead of the vn_lock() call > which you removed. > I was in doubt so I asked, but now after closely looking at the code I > see the destructor function is called only within insmntque1 and the > check I suggest is probably redundant/useless. I've discussed this with kib privately, the thing is that asserts in insmntque1() and ones in the destructors implicitely (like the one in vgone()) should give enough protection already. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 21:11:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 517481B4; Mon, 19 Nov 2012 21:11:59 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3CA8FC0C; Mon, 19 Nov 2012 21:11:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJLBxlq042288; Mon, 19 Nov 2012 21:11:59 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJLBxmA042287; Mon, 19 Nov 2012 21:11:59 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201211192111.qAJLBxmA042287@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 19 Nov 2012 21:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243309 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 21:11:59 -0000 Author: trociny Date: Mon Nov 19 21:11:58 2012 New Revision: 243309 URL: http://svnweb.freebsd.org/changeset/base/243309 Log: MFC r240997: Kernel and modules have "set_vnet" linker set, where virtualized global variables are placed. When a module is loaded by link_elf linker its variables from "set_vnet" linker set are copied to the kernel "set_vnet" ("modspace") and all references to these variables inside the module are relocated accordingly. The issue is when a module is loaded that has references to global variables from another, previously loaded module: these references are not relocated so an invalid address is used when the module tries to access the variable. The example is V_layer3_chain, defined in ipfw module and accessed from ipfw_nat. The same issue is with DPCPU variables, which use "set_pcpu" linker set. Fix this making the link_elf linker on a module load recognize "external" DPCPU/VNET variables defined in the previously loaded modules and relocate them accordingly. For this set_pcpu_list and set_vnet_list are used, where the addresses of modules' "set_pcpu" and "set_vnet" linker sets are stored. Note, archs that use link_elf_obj (amd64) were not affected by this issue. Reviewed by: jhb, julian, zec (initial version) Modified: stable/8/sys/kern/link_elf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/link_elf.c ============================================================================== --- stable/8/sys/kern/link_elf.c Mon Nov 19 21:10:52 2012 (r243308) +++ stable/8/sys/kern/link_elf.c Mon Nov 19 21:11:58 2012 (r243309) @@ -123,6 +123,15 @@ typedef struct elf_file { #endif } *elf_file_t; +struct elf_set { + Elf_Addr es_start; + Elf_Addr es_stop; + Elf_Addr es_base; + TAILQ_ENTRY(elf_set) es_link; +}; + +TAILQ_HEAD(elf_set_head, elf_set); + #include static int link_elf_link_common_finish(linker_file_t); @@ -181,6 +190,75 @@ static int parse_dynamic(elf_file_t); static int relocate_file(elf_file_t); static int link_elf_preload_parse_symbols(elf_file_t); +static struct elf_set_head set_pcpu_list; +#ifdef VIMAGE +static struct elf_set_head set_vnet_list; +#endif + +static void +elf_set_add(struct elf_set_head *list, Elf_Addr start, Elf_Addr stop, Elf_Addr base) +{ + struct elf_set *set, *iter; + + set = malloc(sizeof(*set), M_LINKER, M_WAITOK); + set->es_start = start; + set->es_stop = stop; + set->es_base = base; + + TAILQ_FOREACH(iter, list, es_link) { + + KASSERT((set->es_start < iter->es_start && set->es_stop < iter->es_stop) || + (set->es_start > iter->es_start && set->es_stop > iter->es_stop), + ("linker sets intersection: to insert: 0x%jx-0x%jx; inserted: 0x%jx-0x%jx", + (uintmax_t)set->es_start, (uintmax_t)set->es_stop, + (uintmax_t)iter->es_start, (uintmax_t)iter->es_stop)); + + if (iter->es_start > set->es_start) { + TAILQ_INSERT_BEFORE(iter, set, es_link); + break; + } + } + + if (iter == NULL) + TAILQ_INSERT_TAIL(list, set, es_link); +} + +static int +elf_set_find(struct elf_set_head *list, Elf_Addr addr, Elf_Addr *start, Elf_Addr *base) +{ + struct elf_set *set; + + TAILQ_FOREACH(set, list, es_link) { + if (addr < set->es_start) + return (0); + if (addr < set->es_stop) { + *start = set->es_start; + *base = set->es_base; + return (1); + } + } + + return (0); +} + +static void +elf_set_delete(struct elf_set_head *list, Elf_Addr start) +{ + struct elf_set *set; + + TAILQ_FOREACH(set, list, es_link) { + if (start < set->es_start) + break; + if (start == set->es_start) { + TAILQ_REMOVE(list, set, es_link); + free(set, M_LINKER); + return; + } + } + KASSERT(0, ("deleting unknown linker set (start = 0x%jx)", + (uintmax_t)start)); +} + #ifdef GDB static void r_debug_state(struct r_debug *, struct link_map *); @@ -345,6 +423,10 @@ link_elf_init(void* arg) (void)link_elf_link_common_finish(linker_kernel_file); linker_kernel_file->flags |= LINKER_FILE_LINKED; + TAILQ_INIT(&set_pcpu_list); +#ifdef VIMAGE + TAILQ_INIT(&set_vnet_list); +#endif } SYSINIT(link_elf, SI_SUB_KLD, SI_ORDER_THIRD, link_elf_init, 0); @@ -515,6 +597,8 @@ parse_dpcpu(elf_file_t ef) return (ENOSPC); memcpy((void *)ef->pcpu_base, (void *)ef->pcpu_start, count); dpcpu_copy((void *)ef->pcpu_base, count); + elf_set_add(&set_pcpu_list, ef->pcpu_start, ef->pcpu_stop, + ef->pcpu_base); return (0); } @@ -544,6 +628,8 @@ parse_vnet(elf_file_t ef) return (ENOSPC); memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, count); vnet_data_copy((void *)ef->vnet_base, count); + elf_set_add(&set_vnet_list, ef->vnet_start, ef->vnet_stop, + ef->vnet_base); return (0); } @@ -995,11 +1081,13 @@ link_elf_unload_file(linker_file_t file) if (ef->pcpu_base != 0) { dpcpu_free((void *)ef->pcpu_base, ef->pcpu_stop - ef->pcpu_start); + elf_set_delete(&set_pcpu_list, ef->pcpu_start); } #ifdef VIMAGE if (ef->vnet_base != 0) { vnet_data_free((void *)ef->vnet_base, ef->vnet_stop - ef->vnet_start); + elf_set_delete(&set_vnet_list, ef->vnet_start); } #endif #ifdef GDB @@ -1438,6 +1526,7 @@ elf_lookup(linker_file_t lf, Elf_Size sy elf_file_t ef = (elf_file_t)lf; const Elf_Sym *sym; const char *symbol; + Elf_Addr addr, start, base; /* Don't even try to lookup the symbol if the index is bogus. */ if (symidx >= ef->nchains) @@ -1469,7 +1558,15 @@ elf_lookup(linker_file_t lf, Elf_Size sy if (*symbol == 0) return (0); - return ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + addr = ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + + if (elf_set_find(&set_pcpu_list, addr, &start, &base)) + addr = addr - start + base; +#ifdef VIMAGE + else if (elf_set_find(&set_vnet_list, addr, &start, &base)) + addr = addr - start + base; +#endif + return addr; } static void From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 21:58:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B2F95C8; Mon, 19 Nov 2012 21:58:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 310ED8FC08; Mon, 19 Nov 2012 21:58:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJLwEid048993; Mon, 19 Nov 2012 21:58:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJLwEUR048991; Mon, 19 Nov 2012 21:58:14 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201211192158.qAJLwEUR048991@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Nov 2012 21:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243310 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 21:58:15 -0000 Author: jkim Date: Mon Nov 19 21:58:14 2012 New Revision: 243310 URL: http://svnweb.freebsd.org/changeset/base/243310 Log: Add x86 CPUs supported by clang on head. Reviewed by: arch (silence) X-MFC: r242624 Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Mon Nov 19 21:11:58 2012 (r243309) +++ head/share/mk/bsd.cpu.mk Mon Nov 19 21:58:14 2012 (r243310) @@ -27,9 +27,9 @@ MACHINE_CPU = mips # between e.g. i586 and pentium) . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "nocona" -CPUTYPE = prescott -. elif ${CPUTYPE} == "core" +. if ${CPUTYPE} == "nocona" || ${CPUTYPE} == "core" || \ + ${CPUTYPE} == "core2" || ${CPUTYPE} == "corei7" || \ + ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" CPUTYPE = prescott . elif ${CPUTYPE} == "p4" CPUTYPE = pentium4 @@ -50,10 +50,11 @@ CPUTYPE = pentium-mmx . elif ${CPUTYPE} == "i586" CPUTYPE = pentium . elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || \ - ${CPUTYPE} == "k8-sse3" + ${CPUTYPE} == "k8-sse3" || ${CPUTYPE} == "amdfam10" || \ + ${CPUTYPE} == "btver1" || ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" CPUTYPE = prescott . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ - ${CPUTYPE} == "k8" + ${CPUTYPE} == "k8" CPUTYPE = athlon-mp . elif ${CPUTYPE} == "k7" CPUTYPE = athlon @@ -142,7 +143,15 @@ _CPUCFLAGS = -mcpu=ultrasparc3 # presence of a CPU feature. . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" +. if ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" +MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 +MACHINE_CPU += i486 i386 +. elif ${CPUTYPE} == "btver1" +MACHINE_CPU = ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 i486 i386 +. elif ${CPUTYPE} == "amdfam10" +MACHINE_CPU = athlon-xp athlon k7 3dnow sse4a sse3 sse2 sse mmx k6 k5 i586 +MACHINE_CPU += i486 i386 +. elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" MACHINE_CPU = athlon-xp athlon k7 3dnow sse3 sse2 sse mmx k6 k5 i586 i486 i386 . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386 @@ -163,11 +172,16 @@ MACHINE_CPU = 3dnow mmx i586 i486 i386 MACHINE_CPU = sse mmx i586 i486 i386 . elif ${CPUTYPE} == "c7" MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386 +. elif ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" +MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 i486 i386 +. elif ${CPUTYPE} == "corei7" +MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 i486 i386 . elif ${CPUTYPE} == "core2" MACHINE_CPU = ssse3 sse3 sse2 sse i686 mmx i586 i486 i386 . elif ${CPUTYPE} == "prescott" MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386 -. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || ${CPUTYPE} == "pentium-m" +. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || \ + ${CPUTYPE} == "pentium-m" MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386 . elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m" MACHINE_CPU = sse i686 mmx i586 i486 i386 @@ -185,10 +199,22 @@ MACHINE_CPU = i486 i386 MACHINE_CPU = i386 . endif . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || ${CPUTYPE} == "k8-sse3" +. if ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" +MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 +. elif ${CPUTYPE} == "btver1" +MACHINE_CPU = ssse3 sse4a sse3 +. elif ${CPUTYPE} == "amdfam10" +MACHINE_CPU = k8 3dnow sse4a sse3 +. elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || \ + ${CPUTYPE} == "k8-sse3" MACHINE_CPU = k8 3dnow sse3 -. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" +. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ + ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow +. elif ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" +MACHINE_CPU = avx sse42 sse41 ssse3 sse3 +. elif ${CPUTYPE} == "corei7" +MACHINE_CPU = sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "core2" MACHINE_CPU = ssse3 sse3 . elif ${CPUTYPE} == "nocona" From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 22:07:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 069148A0; Mon, 19 Nov 2012 22:07:53 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (mail.vlakno.cz [178.238.39.38]) by mx1.freebsd.org (Postfix) with ESMTP id 7DFF88FC16; Mon, 19 Nov 2012 22:07:52 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id EA8671CC5553; Mon, 19 Nov 2012 23:07:44 +0100 (CET) Date: Mon, 19 Nov 2012 23:07:44 +0100 From: Roman Divacky To: Jung-uk Kim Subject: Re: svn commit: r243310 - head/share/mk Message-ID: <20121119220744.GA70471@freebsd.org> References: <201211192158.qAJLwEUR048991@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201211192158.qAJLwEUR048991@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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 22:07:53 -0000 Maybe update share/examples/etc/make.conf too? On Mon, Nov 19, 2012 at 09:58:14PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Mon Nov 19 21:58:14 2012 > New Revision: 243310 > URL: http://svnweb.freebsd.org/changeset/base/243310 > > Log: > Add x86 CPUs supported by clang on head. > > Reviewed by: arch (silence) > X-MFC: r242624 > > Modified: > head/share/mk/bsd.cpu.mk > > Modified: head/share/mk/bsd.cpu.mk > ============================================================================== > --- head/share/mk/bsd.cpu.mk Mon Nov 19 21:11:58 2012 (r243309) > +++ head/share/mk/bsd.cpu.mk Mon Nov 19 21:58:14 2012 (r243310) > @@ -27,9 +27,9 @@ MACHINE_CPU = mips > # between e.g. i586 and pentium) > > . if ${MACHINE_CPUARCH} == "i386" > -. if ${CPUTYPE} == "nocona" > -CPUTYPE = prescott > -. elif ${CPUTYPE} == "core" > +. if ${CPUTYPE} == "nocona" || ${CPUTYPE} == "core" || \ > + ${CPUTYPE} == "core2" || ${CPUTYPE} == "corei7" || \ > + ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" > CPUTYPE = prescott > . elif ${CPUTYPE} == "p4" > CPUTYPE = pentium4 > @@ -50,10 +50,11 @@ CPUTYPE = pentium-mmx > . elif ${CPUTYPE} == "i586" > CPUTYPE = pentium > . elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || \ > - ${CPUTYPE} == "k8-sse3" > + ${CPUTYPE} == "k8-sse3" || ${CPUTYPE} == "amdfam10" || \ > + ${CPUTYPE} == "btver1" || ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" > CPUTYPE = prescott > . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ > - ${CPUTYPE} == "k8" > + ${CPUTYPE} == "k8" > CPUTYPE = athlon-mp > . elif ${CPUTYPE} == "k7" > CPUTYPE = athlon > @@ -142,7 +143,15 @@ _CPUCFLAGS = -mcpu=ultrasparc3 > # presence of a CPU feature. > > . if ${MACHINE_CPUARCH} == "i386" > -. if ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" > +. if ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" > +MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 > +MACHINE_CPU += i486 i386 > +. elif ${CPUTYPE} == "btver1" > +MACHINE_CPU = ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 i486 i386 > +. elif ${CPUTYPE} == "amdfam10" > +MACHINE_CPU = athlon-xp athlon k7 3dnow sse4a sse3 sse2 sse mmx k6 k5 i586 > +MACHINE_CPU += i486 i386 > +. elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" > MACHINE_CPU = athlon-xp athlon k7 3dnow sse3 sse2 sse mmx k6 k5 i586 i486 i386 > . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" > MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386 > @@ -163,11 +172,16 @@ MACHINE_CPU = 3dnow mmx i586 i486 i386 > MACHINE_CPU = sse mmx i586 i486 i386 > . elif ${CPUTYPE} == "c7" > MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386 > +. elif ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" > +MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 i486 i386 > +. elif ${CPUTYPE} == "corei7" > +MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 i486 i386 > . elif ${CPUTYPE} == "core2" > MACHINE_CPU = ssse3 sse3 sse2 sse i686 mmx i586 i486 i386 > . elif ${CPUTYPE} == "prescott" > MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386 > -. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || ${CPUTYPE} == "pentium-m" > +. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || \ > + ${CPUTYPE} == "pentium-m" > MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386 > . elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m" > MACHINE_CPU = sse i686 mmx i586 i486 i386 > @@ -185,10 +199,22 @@ MACHINE_CPU = i486 i386 > MACHINE_CPU = i386 > . endif > . elif ${MACHINE_CPUARCH} == "amd64" > -. if ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || ${CPUTYPE} == "k8-sse3" > +. if ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" > +MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 > +. elif ${CPUTYPE} == "btver1" > +MACHINE_CPU = ssse3 sse4a sse3 > +. elif ${CPUTYPE} == "amdfam10" > +MACHINE_CPU = k8 3dnow sse4a sse3 > +. elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || \ > + ${CPUTYPE} == "k8-sse3" > MACHINE_CPU = k8 3dnow sse3 > -. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" > +. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ > + ${CPUTYPE} == "k8" > MACHINE_CPU = k8 3dnow > +. elif ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" > +MACHINE_CPU = avx sse42 sse41 ssse3 sse3 > +. elif ${CPUTYPE} == "corei7" > +MACHINE_CPU = sse42 sse41 ssse3 sse3 > . elif ${CPUTYPE} == "core2" > MACHINE_CPU = ssse3 sse3 > . elif ${CPUTYPE} == "nocona" From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 22:43:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8251D181; Mon, 19 Nov 2012 22:43:46 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5C2388FC12; Mon, 19 Nov 2012 22:43:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJMhkcg055717; Mon, 19 Nov 2012 22:43:46 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJMhjFF055708; Mon, 19 Nov 2012 22:43:45 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201211192243.qAJMhjFF055708@svn.freebsd.org> From: Attilio Rao Date: Mon, 19 Nov 2012 22:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 22:43:46 -0000 Author: attilio Date: Mon Nov 19 22:43:45 2012 New Revision: 243311 URL: http://svnweb.freebsd.org/changeset/base/243311 Log: r16312 is not any longer real since many years (likely since when VFS received granular locking) but the comment present in UFS has been copied all over other filesystems code incorrectly for several times. Removes comments that makes no sense now. Reviewed by: kib MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nullfs/null_subr.c head/sys/fs/unionfs/union_subr.c head/sys/gnu/fs/reiserfs/reiserfs_inode.c head/sys/nfsclient/nfs_node.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Mon Nov 19 21:58:14 2012 (r243310) +++ head/sys/fs/ext2fs/ext2_vfsops.c Mon Nov 19 22:43:45 2012 (r243311) @@ -905,14 +905,6 @@ ext2_vget(struct mount *mp, ino_t ino, i ump = VFSTOEXT2(mp); dev = ump->um_dev; - - /* - * If this malloc() is performed after the getnewvnode() - * it might block, leaving a vnode with a NULL v_data to be - * found by ext2_sync() if a sync happens to fire right then, - * which will cause a panic because ext2_sync() blindly - * dereferences vp->v_data (as well it should). - */ ip = malloc(sizeof(struct inode), M_EXT2NODE, M_WAITOK | M_ZERO); /* Allocate a new vnode/inode. */ Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Mon Nov 19 21:58:14 2012 (r243310) +++ head/sys/fs/msdosfs/msdosfs_denode.c Mon Nov 19 22:43:45 2012 (r243311) @@ -142,12 +142,6 @@ deget(pmp, dirclust, diroffset, depp) KASSERT((*depp)->de_diroffset == diroffset, ("wrong diroffset")); return (0); } - - /* - * Do the malloc before the getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if malloc should block. - */ ldep = malloc(sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK | M_ZERO); /* Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Mon Nov 19 21:58:14 2012 (r243310) +++ head/sys/fs/nfsclient/nfs_clnode.c Mon Nov 19 22:43:45 2012 (r243311) @@ -122,12 +122,6 @@ ncl_nget(struct mount *mntp, u_int8_t *f *npp = VTONFS(nvp); return (0); } - - /* - * Allocate before getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if zalloc should block. - */ np = uma_zalloc(newnfsnode_zone, M_WAITOK | M_ZERO); error = getnewvnode("newnfs", mntp, &newnfs_vnodeops, &nvp); Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Mon Nov 19 21:58:14 2012 (r243310) +++ head/sys/fs/nfsclient/nfs_clport.c Mon Nov 19 22:43:45 2012 (r243311) @@ -197,12 +197,6 @@ nfscl_nget(struct mount *mntp, struct vn FREE((caddr_t)nfhp, M_NFSFH); return (0); } - - /* - * Allocate before getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if zalloc should block. - */ np = uma_zalloc(newnfsnode_zone, M_WAITOK | M_ZERO); error = getnewvnode("newnfs", mntp, &newnfs_vnodeops, &nvp); Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Mon Nov 19 21:58:14 2012 (r243310) +++ head/sys/fs/nullfs/null_subr.c Mon Nov 19 22:43:45 2012 (r243311) @@ -236,10 +236,6 @@ null_nodeget(mp, lowervp, vpp) * duplicates later, when adding new vnode to hash. * Note that duplicate can only appear in hash if the lowervp is * locked LK_SHARED. - * - * Do the MALLOC before the getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if MALLOC should block. */ xp = malloc(sizeof(struct null_node), M_NULLFSNODE, M_WAITOK); Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Mon Nov 19 21:58:14 2012 (r243310) +++ head/sys/fs/unionfs/union_subr.c Mon Nov 19 22:43:45 2012 (r243311) @@ -247,12 +247,6 @@ unionfs_nodeget(struct mount *mp, struct if (dvp == NULLVP) return (EINVAL); } - - /* - * Do the MALLOC before the getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced elsewhere - * if MALLOC should block. - */ unp = malloc(sizeof(struct unionfs_node), M_UNIONFSNODE, M_WAITOK | M_ZERO); Modified: head/sys/gnu/fs/reiserfs/reiserfs_inode.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_inode.c Mon Nov 19 21:58:14 2012 (r243310) +++ head/sys/gnu/fs/reiserfs/reiserfs_inode.c Mon Nov 19 22:43:45 2012 (r243311) @@ -757,13 +757,6 @@ reiserfs_iget( rmp = VFSTOREISERFS(mp); dev = rmp->rm_dev; - /* - * If this malloc() is performed after the getnewvnode() it might - * block, leaving a vnode with a NULL v_data to be found by - * reiserfs_sync() if a sync happens to fire right then, which - * will cause a panic because reiserfs_sync() blindly dereferences - * vp->v_data (as well it should). - */ reiserfs_log(LOG_DEBUG, "malloc(struct reiserfs_node)\n"); ip = malloc(sizeof(struct reiserfs_node), M_REISERFSNODE, M_WAITOK | M_ZERO); Modified: head/sys/nfsclient/nfs_node.c ============================================================================== --- head/sys/nfsclient/nfs_node.c Mon Nov 19 21:58:14 2012 (r243310) +++ head/sys/nfsclient/nfs_node.c Mon Nov 19 22:43:45 2012 (r243311) @@ -128,12 +128,6 @@ nfs_nget(struct mount *mntp, nfsfh_t *fh *npp = VTONFS(nvp); return (0); } - - /* - * Allocate before getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if zalloc should block. - */ np = uma_zalloc(nfsnode_zone, M_WAITOK | M_ZERO); error = getnewvnode("nfs", mntp, &nfs_vnodeops, &nvp); Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 (r243310) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 (r243311) @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags ump = VFSTOUFS(mp); dev = ump->um_dev; fs = ump->um_fs; - - /* - * If this malloc() is performed after the getnewvnode() - * it might block, leaving a vnode with a NULL v_data to be - * found by ffs_sync() if a sync happens to fire right then, - * which will cause a panic because ffs_sync() blindly - * dereferences vp->v_data (as well it should). - */ ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); /* Allocate a new vnode/inode. */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 22:46:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A398340; Mon, 19 Nov 2012 22:46:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E6898FC12; Mon, 19 Nov 2012 22:46:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJMkHtE056141; Mon, 19 Nov 2012 22:46:17 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJMkHqu056140; Mon, 19 Nov 2012 22:46:17 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211192246.qAJMkHqu056140@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 22:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243312 - head/tools/regression/sockets/sigpipe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 22:46:18 -0000 Author: emaste Date: Mon Nov 19 22:46:17 2012 New Revision: 243312 URL: http://svnweb.freebsd.org/changeset/base/243312 Log: Use '%zd' printf format for ssize_t. Modified: head/tools/regression/sockets/sigpipe/sigpipe.c Modified: head/tools/regression/sockets/sigpipe/sigpipe.c ============================================================================== --- head/tools/regression/sockets/sigpipe/sigpipe.c Mon Nov 19 22:43:45 2012 (r243311) +++ head/tools/regression/sockets/sigpipe/sigpipe.c Mon Nov 19 22:46:17 2012 (r243312) @@ -97,7 +97,7 @@ test_send(const char *testname, int sock return; err(-1, "%s: send", testname); } - errx(-1, "%s: send: returned %d", testname, len); + errx(-1, "%s: send: returned %zd", testname, len); } static void @@ -113,7 +113,7 @@ test_write(const char *testname, int soc return; err(-1, "%s: write", testname); } - errx(-1, "%s: write: returned %d", testname, len); + errx(-1, "%s: write: returned %zd", testname, len); } static void From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 22:53:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42AF0610; Mon, 19 Nov 2012 22:53:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 275FD8FC15; Mon, 19 Nov 2012 22:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJMrwB5057347; Mon, 19 Nov 2012 22:53:58 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJMrvYt057344; Mon, 19 Nov 2012 22:53:57 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211192253.qAJMrvYt057344@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 22:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243313 - in head/tools/regression/sockets: sblock unix_seqpacket_exercise zerosend X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 22:53:58 -0000 Author: emaste Date: Mon Nov 19 22:53:57 2012 New Revision: 243313 URL: http://svnweb.freebsd.org/changeset/base/243313 Log: Use '%zd' format specifier for ssize_t Found by: clang Modified: head/tools/regression/sockets/sblock/sblock.c head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c head/tools/regression/sockets/zerosend/zerosend.c Modified: head/tools/regression/sockets/sblock/sblock.c ============================================================================== --- head/tools/regression/sockets/sblock/sblock.c Mon Nov 19 22:46:17 2012 (r243312) +++ head/tools/regression/sockets/sblock/sblock.c Mon Nov 19 22:53:57 2012 (r243313) @@ -76,7 +76,7 @@ blocking_recver(int fd) if (len == 0) errx(-1, "FAIL: blocking_recver: recv: eof"); if (len != 1) - errx(-1, "FAIL: blocking_recver: recv: %d bytes", len); + errx(-1, "FAIL: blocking_recver: recv: %zd bytes", len); if (interrupted) errx(-1, "FAIL: blocking_recver: interrupted wrong pid"); } @@ -134,7 +134,7 @@ signaller(pid_t locking_recver_pid, int return; } if (len != sizeof(ch)) { - warnx("signaller send ret %d", len); + warnx("signaller send ret %zd", len); return; } if (close(fd) < 0) { Modified: head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c ============================================================================== --- head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c Mon Nov 19 22:46:17 2012 (r243312) +++ head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c Mon Nov 19 22:53:57 2012 (r243313) @@ -50,21 +50,21 @@ __FBSDID("$FreeBSD$"); #define SEQPACKET_SNDBUF (131072-16) #define FAILERR(str) err(-1, "%s: %s", __func__, str) -#define FAILNERR(str, n) err(-1, "%s %d: %s", __func__, n, str) -#define FAILNMERR(str, n, m) err(-1, "%s %d %d: %s", __func__, n, m, str) +#define FAILNERR(str, n) err(-1, "%s %zd: %s", __func__, n, str) +#define FAILNMERR(str, n, m) err(-1, "%s %zd %d: %s", __func__, n, m, str) #define FAILERRX(str) errx(-1, "%s: %s", __func__, str) -#define FAILNERRX(str, n) errx(-1, "%s %d: %s", __func__, n, str) -#define FAILNMERRX(str, n, m) errx(-1, "%s %d %d: %s", __func__, n, m, str) +#define FAILNERRX(str, n) errx(-1, "%s %zd: %s", __func__, n, str) +#define FAILNMERRX(str, n, m) errx(-1, "%s %zd %d: %s", __func__, n, m, str) static int ann = 0; #define ANN() (ann ? warnx("%s: start", __func__) : 0) -#define ANNN(n) (ann ? warnx("%s %d: start", __func__, (n)) : 0) -#define ANNNM(n, m) (ann ? warnx("%s %d %d: start", __func__, (n), (m)) : 0) +#define ANNN(n) (ann ? warnx("%s %zd: start", __func__, (n)) : 0) +#define ANNNM(n, m) (ann ? warnx("%s %zd %d: start", __func__, (n), (m)):0) #define OK() warnx("%s: ok", __func__) -#define OKN(n) warnx("%s %d: ok", __func__, (n)) -#define OKNM(n, m) warnx("%s %d %d: ok", __func__, (n), (m)) +#define OKN(n) warnx("%s %zd: ok", __func__, (n)) +#define OKNM(n, m) warnx("%s %zd %d: ok", __func__, (n), (m)) #ifdef SO_NOSIGPIPE #define NEW_SOCKET(s) do { \ @@ -168,7 +168,7 @@ server(int s_listen) break; } if (ssize_send != ssize_recv) - warnx("server: recv %d sent %d", + warnx("server: recv %zd sent %zd", ssize_recv, ssize_send); } while (1); close(s_accept); Modified: head/tools/regression/sockets/zerosend/zerosend.c ============================================================================== --- head/tools/regression/sockets/zerosend/zerosend.c Mon Nov 19 22:46:17 2012 (r243312) +++ head/tools/regression/sockets/zerosend/zerosend.c Mon Nov 19 22:53:57 2012 (r243313) @@ -56,7 +56,7 @@ try_0send(const char *test, int fd) if (len < 0) err(-1, "%s: try_0send", test); if (len != 0) - errx(-1, "%s: try_0send: returned %d", test, len); + errx(-1, "%s: try_0send: returned %zd", test, len); } static void @@ -70,7 +70,7 @@ try_0write(const char *test, int fd) if (len < 0) err(-1, "%s: try_0write", test); if (len != 0) - errx(-1, "%s: try_0write: returned %d", test, len); + errx(-1, "%s: try_0write: returned %zd", test, len); } static void From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 22:56:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 99CD895C; Mon, 19 Nov 2012 22:56:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7F4708FC14; Mon, 19 Nov 2012 22:56:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJMupBK057813; Mon, 19 Nov 2012 22:56:51 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJMupNn057812; Mon, 19 Nov 2012 22:56:51 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211192256.qAJMupNn057812@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 22:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243314 - head/tools/regression/sockets/unix_cmsg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 22:56:51 -0000 Author: emaste Date: Mon Nov 19 22:56:51 2012 New Revision: 243314 URL: http://svnweb.freebsd.org/changeset/base/243314 Log: Zero the whole struct not just the size of a pointer. Found by: clang Modified: head/tools/regression/sockets/unix_cmsg/unix_cmsg.c Modified: head/tools/regression/sockets/unix_cmsg/unix_cmsg.c ============================================================================== --- head/tools/regression/sockets/unix_cmsg/unix_cmsg.c Mon Nov 19 22:53:57 2012 (r243313) +++ head/tools/regression/sockets/unix_cmsg/unix_cmsg.c Mon Nov 19 22:56:51 2012 (r243314) @@ -449,7 +449,7 @@ create_socket(char *sock_path, size_t so goto failed; } - memset(addr, 0, sizeof(addr)); + memset(addr, 0, sizeof(*addr)); addr->sun_family = AF_LOCAL; if (strlen(sock_path) >= sizeof(addr->sun_path)) { logmsgx("create_socket: too long path name (>= %lu) for local domain socket", From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 23:04:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D72FB78; Mon, 19 Nov 2012 23:04:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 380768FC0C; Mon, 19 Nov 2012 23:04:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJN4Nmp059233; Mon, 19 Nov 2012 23:04:23 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJN4Nx9059232; Mon, 19 Nov 2012 23:04:23 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201211192304.qAJN4Nx9059232@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Nov 2012 23:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243315 - head/share/examples/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 23:04:23 -0000 Author: jkim Date: Mon Nov 19 23:04:22 2012 New Revision: 243315 URL: http://svnweb.freebsd.org/changeset/base/243315 Log: Clean up and update comments for CPUTYPE. Requested by: rdivacky Modified: head/share/examples/etc/make.conf Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Mon Nov 19 22:56:51 2012 (r243314) +++ head/share/examples/etc/make.conf Mon Nov 19 23:04:22 2012 (r243315) @@ -25,22 +25,27 @@ # The CPUTYPE variable controls which processor should be targeted for # generated code. This controls processor-specific optimizations in # certain code (currently only OpenSSL) as well as modifying the value -# of CFLAGS to contain the appropriate optimization directive to gcc. +# of CFLAGS to contain the appropriate optimization directive to cc. # The automatic setting of CFLAGS may be overridden using the # NO_CPU_CFLAGS variable below. -# Currently the following CPU types are recognized: +# Currently the following CPU types are recognized by gcc: # Intel x86 architecture: -# (AMD CPUs) opteron-sse3 opteron athlon64-sse3 athlon64 athlon-mp -# athlon-xp athlon-4 athlon-tbird athlon k8-sse3 k8 -# geode k6-3 k6-2 k6 k5 -# (Intel CPUs) core2 core nocona pentium4m pentium4 prescott -# pentium3m pentium3 pentium-m pentium2 -# pentiumpro pentium-mmx pentium i486 i386 -# (Via CPUs) c3 c3-2 -# AMD64 architecture: opteron, athlon64, nocona, prescott, core2 -# Intel ia64 architecture: itanium2, itanium +# (AMD CPUs) opteron-sse3, athlon64-sse3, k8-sse3, opteron, +# athlon64, k8, athlon-mp, athlon-xp, athlon-4, +# athlon-tbird, athlon, k7, geode, k6-3, k6-2, k6, k5 +# (Intel CPUs) core2, core, nocona, pentium4m, pentium4, prescott, +# pentium3m, pentium3, pentium-m, pentium2, +# pentiumpro, pentium-mmx, pentium, i486, i386 +# (VIA CPUs) c7, c3-2, c3 +# AMD64 architecture: opteron-sse3, athlon64-sse3, k8-sse3, opteron, +# athlon64, k8, core2, nocona, prescott +# Intel ia64 architecture: itanium2, itanium # SPARC-V9 architecture: v9 (generic 64-bit V9), ultrasparc (default # if omitted), ultrasparc3 +# Additionally the following CPU types are recognized by clang: +# Intel x86 architecture (for both amd64 and i386): +# (AMD CPUs) bdver2, bdver1, btver1, amdfam10 +# (Intel CPUs) core-avx-i, corei7-avx, corei7 # # (?= allows to buildworld for a different CPUTYPE.) # From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 23:07:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EAF8DDF5; Mon, 19 Nov 2012 23:07:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC2488FC08; Mon, 19 Nov 2012 23:07:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJN7cvi059993; Mon, 19 Nov 2012 23:07:38 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJN7cfN059990; Mon, 19 Nov 2012 23:07:38 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211192307.qAJN7cfN059990@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 23:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243316 - in head/tools/regression: netinet/udpzerobyte netipx/ipxdgramloopback ufs/uprintf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 23:07:39 -0000 Author: emaste Date: Mon Nov 19 23:07:38 2012 New Revision: 243316 URL: http://svnweb.freebsd.org/changeset/base/243316 Log: Use '%zu' and '%zd' as appropriate for size_t / ssize_t. Modified: head/tools/regression/netinet/udpzerobyte/udpzerobyte.c head/tools/regression/netipx/ipxdgramloopback/ipxdgramloopback.c head/tools/regression/ufs/uprintf/ufs_uprintf.c Modified: head/tools/regression/netinet/udpzerobyte/udpzerobyte.c ============================================================================== --- head/tools/regression/netinet/udpzerobyte/udpzerobyte.c Mon Nov 19 23:04:22 2012 (r243315) +++ head/tools/regression/netinet/udpzerobyte/udpzerobyte.c Mon Nov 19 23:07:38 2012 (r243316) @@ -80,7 +80,7 @@ test(int domain, const char *domainstr, size = recv(sock_receive, NULL, 0, 0); if (size > 0) - errx(-1, "Protocol %s recv(sock_receive, NULL, 0) before: %d", + errx(-1, "Protocol %s recv(sock_receive, NULL, 0) before: %zd", domainstr, size); else if (size < 0) err(-1, "Protocol %s recv(sock_receive, NULL, 0) before", @@ -98,7 +98,7 @@ test(int domain, const char *domainstr, size = recv(sock_receive, NULL, 0, 0); if (size > 0) - errx(-1, "Protocol %s recv(sock_receive, NULL, 0) after: %d", + errx(-1, "Protocol %s recv(sock_receive, NULL, 0) after: %zd", domainstr, size); else if (size < 0) err(-1, "Protocol %s recv(sock_receive, NULL, 0) after", Modified: head/tools/regression/netipx/ipxdgramloopback/ipxdgramloopback.c ============================================================================== --- head/tools/regression/netipx/ipxdgramloopback/ipxdgramloopback.c Mon Nov 19 23:04:22 2012 (r243315) +++ head/tools/regression/netipx/ipxdgramloopback/ipxdgramloopback.c Mon Nov 19 23:07:38 2012 (r243316) @@ -95,7 +95,7 @@ main(int argc, char *argv[]) if (len < 0) err(-1, "sendto()"); if (len != sizeof(packet)) - errx(-1, "sendto(): short send (%d length, %d sent)", + errx(-1, "sendto(): short send (%zu length, %zd sent)", sizeof(packet), len); sleep(1); /* Arbitrary non-zero amount. */ @@ -105,7 +105,7 @@ main(int argc, char *argv[]) if (len < 0) err(-1, "recv()"); if (len != sizeof(packet)) - errx(-1, "recv(): short receive (%d length, %d received)", + errx(-1, "recv(): short receive (%zu length, %zd received)", sizeof(packet), len); for (i = 0; i < PACKETLEN; i++) { Modified: head/tools/regression/ufs/uprintf/ufs_uprintf.c ============================================================================== --- head/tools/regression/ufs/uprintf/ufs_uprintf.c Mon Nov 19 23:04:22 2012 (r243315) +++ head/tools/regression/ufs/uprintf/ufs_uprintf.c Mon Nov 19 23:07:38 2012 (r243316) @@ -86,7 +86,7 @@ fill_blocks(void) if (len < 0) break; if (len != BLOCKSIZE) { - warnx("fill_blocks: write(%d) returned %d", + warnx("fill_blocks: write(%d) returned %zd", BLOCKSIZE, len); close(fd); (void)unlink(BLOCKS_FILENAME); From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 23:42:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2331E595; Mon, 19 Nov 2012 23:42:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 094278FC17; Mon, 19 Nov 2012 23:42:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJNgkR9067140; Mon, 19 Nov 2012 23:42:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJNgkgl067133; Mon, 19 Nov 2012 23:42:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211192342.qAJNgkgl067133@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Nov 2012 23:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243317 - head/sys/dev/ath/ath_hal/ar5210 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 23:42:47 -0000 Author: adrian Date: Mon Nov 19 23:42:46 2012 New Revision: 243317 URL: http://svnweb.freebsd.org/changeset/base/243317 Log: Disable WEP hardware encryption on the AR5210, in order to allow other encryption types. The AR5210 only has four WEP key slots, in contrast to what the later MACs have (ie, the keycache.) So there's no way to store a "clear" key. Even if the driver is taught to not allocate CLR key entries for the AR5210, the hardware will actually attempt to decode the encrypted frames with the (likely all 0!) WEP keys. So for now, disable the hardware encryption entirely and just so it all in software. That allows both WEP -and- WPA to actually work. If someone wishes to try and make hardware WEP _but_ software WPA work, they'll have to create a HAL capability to enable/disable hardware encryption based on the current STA/Hostap mode. However, making multi-vap work with one WEP and one WPA VAP will require hardware encryption to be disabled anyway. Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c head/sys/dev/ath/ath_hal/ar5210/ar5210reg.h Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Mon Nov 19 23:07:38 2012 (r243316) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Mon Nov 19 23:42:46 2012 (r243317) @@ -261,6 +261,7 @@ extern HAL_BOOL ar5210GetMibCycleCounts( HAL_SURVEY_SAMPLE *); extern void ar5210EnableDfs(struct ath_hal *, HAL_PHYERR_PARAM *); extern void ar5210GetDfsThresh(struct ath_hal *, HAL_PHYERR_PARAM *); +extern void ar5210UpdateDiagReg(struct ath_hal *ah, uint32_t val); extern u_int ar5210GetKeyCacheSize(struct ath_hal *); extern HAL_BOOL ar5210IsKeyCacheEntryValid(struct ath_hal *, uint16_t); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Mon Nov 19 23:07:38 2012 (r243316) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Mon Nov 19 23:42:46 2012 (r243317) @@ -576,8 +576,6 @@ ar5210MibEvent(struct ath_hal *ah, const { } -#define AR_DIAG_SW_DIS_CRYPTO (AR_DIAG_SW_DIS_ENC | AR_DIAG_SW_DIS_DEC) - HAL_STATUS ar5210GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t *result) @@ -585,7 +583,11 @@ ar5210GetCapability(struct ath_hal *ah, switch (type) { case HAL_CAP_CIPHER: /* cipher handled in hardware */ +#if 0 return (capability == HAL_CIPHER_WEP ? HAL_OK : HAL_ENOTSUPP); +#else + return HAL_ENOTSUPP; +#endif default: return ath_hal_getcapability(ah, type, capability, result); } @@ -608,7 +610,7 @@ ar5210SetCapability(struct ath_hal *ah, #else AH_PRIVATE(ah)->ah_diagreg = setting & 0x6; /* ACK+CTS */ #endif - OS_REG_WRITE(ah, AR_DIAG_SW, AH_PRIVATE(ah)->ah_diagreg); + ar5210UpdateDiagReg(ah, AH_PRIVATE(ah)->ah_diagreg); return AH_TRUE; case HAL_CAP_RXORN_FATAL: /* HAL_INT_RXORN treated as fatal */ return AH_FALSE; /* NB: disallow */ @@ -677,3 +679,18 @@ void ar5210GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) { } + +/* + * Update the diagnostic register. + * + * This merges in the diagnostic register setting with the default + * value, which may or may not involve disabling hardware encryption. + */ +void +ar5210UpdateDiagReg(struct ath_hal *ah, uint32_t val) +{ + + /* Disable all hardware encryption */ + val |= AR_DIAG_SW_DIS_CRYPTO; + OS_REG_WRITE(ah, AR_DIAG_SW, val); +} Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c Mon Nov 19 23:07:38 2012 (r243316) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c Mon Nov 19 23:42:46 2012 (r243317) @@ -86,7 +86,7 @@ ar5210StopDmaReceive(struct ath_hal *ah) void ar5210StartPcuReceive(struct ath_hal *ah) { - OS_REG_WRITE(ah, AR_DIAG_SW, + ar5210UpdateDiagReg(ah, OS_REG_READ(ah, AR_DIAG_SW) & ~(AR_DIAG_SW_DIS_RX)); } @@ -96,7 +96,7 @@ ar5210StartPcuReceive(struct ath_hal *ah void ar5210StopPcuReceive(struct ath_hal *ah) { - OS_REG_WRITE(ah, AR_DIAG_SW, + ar5210UpdateDiagReg(ah, OS_REG_READ(ah, AR_DIAG_SW) | AR_DIAG_SW_DIS_RX); } Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Mon Nov 19 23:07:38 2012 (r243316) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Mon Nov 19 23:42:46 2012 (r243317) @@ -190,7 +190,7 @@ ar5210Reset(struct ath_hal *ah, HAL_OPMO OS_REG_WRITE(ah, AR_CLR_TMASK, 1); OS_REG_WRITE(ah, AR_TRIG_LEV, 1); /* minimum */ - OS_REG_WRITE(ah, AR_DIAG_SW, 0); + ar5210UpdateDiagReg(ah, 0); OS_REG_WRITE(ah, AR_CFP_PERIOD, 0); OS_REG_WRITE(ah, AR_TIMER0, 0); /* next beacon time */ @@ -285,7 +285,7 @@ ar5210Reset(struct ath_hal *ah, HAL_OPMO if (ahp->ah_ctstimeout != (u_int) -1) ar5210SetCTSTimeout(ah, ahp->ah_ctstimeout); if (AH_PRIVATE(ah)->ah_diagreg != 0) - OS_REG_WRITE(ah, AR_DIAG_SW, AH_PRIVATE(ah)->ah_diagreg); + ar5210UpdateDiagReg(ah, AH_PRIVATE(ah)->ah_diagreg); AH_PRIVATE(ah)->ah_opmode = opmode; /* record operating mode */ @@ -454,7 +454,7 @@ ar5210PerCalibrationN(struct ath_hal *ah if (ichan == AH_NULL) return AH_FALSE; /* Disable tx and rx */ - OS_REG_WRITE(ah, AR_DIAG_SW, + ar5210UpdateDiagReg(ah, OS_REG_READ(ah, AR_DIAG_SW) | (AR_DIAG_SW_DIS_TX | AR_DIAG_SW_DIS_RX)); /* Disable Beacon Enable */ @@ -551,7 +551,7 @@ ar5210PerCalibrationN(struct ath_hal *ah } /* Clear tx and rx disable bit */ - OS_REG_WRITE(ah, AR_DIAG_SW, + ar5210UpdateDiagReg(ah, OS_REG_READ(ah, AR_DIAG_SW) & ~(AR_DIAG_SW_DIS_TX | AR_DIAG_SW_DIS_RX)); /* Re-enable Beacons */ Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210reg.h Mon Nov 19 23:07:38 2012 (r243316) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210reg.h Mon Nov 19 23:42:46 2012 (r243317) @@ -385,6 +385,7 @@ #define AR_DIAG_SW_SCVRAM_SEED 0x0003f800 /* fixed scrambler seed */ #define AR_DIAG_SW_DIS_SEQ_INC 0x00040000 /* seq increment disable */ #define AR_DIAG_SW_FRAME_NV0 0x00080000 /* accept frame vers != 0 */ +#define AR_DIAG_SW_DIS_CRYPTO (AR_DIAG_SW_DIS_ENC | AR_DIAG_SW_DIS_DEC) #define AR_DIAG_SW_BITS \ "\20\1DIS_WEP_ACK\2DIS_ACK\3DIS_CTS\4DIS_ENC\5DIS_DEC\6DIS_TX"\ "\7DIS_RX\10LOOP_BACK\11CORR_FCS\12CHAN_INFO\13EN_SCRAM_SEED"\ From owner-svn-src-all@FreeBSD.ORG Mon Nov 19 23:54:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8B36887; Mon, 19 Nov 2012 23:54:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD5F18FC12; Mon, 19 Nov 2012 23:54:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJNs591069993; Mon, 19 Nov 2012 23:54:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJNs51P069992; Mon, 19 Nov 2012 23:54:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211192354.qAJNs51P069992@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Nov 2012 23:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243318 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 19 Nov 2012 23:54:05 -0000 Author: adrian Date: Mon Nov 19 23:54:05 2012 New Revision: 243318 URL: http://svnweb.freebsd.org/changeset/base/243318 Log: Don't allocate or program a key for the AR5210. The AR5210 doesn't support HAL_CIPHER_CLR ('clear encryption' keycache slots), so don't bother - just map them to slot 0 and never program them. Modified: head/sys/dev/ath/if_ath_keycache.c Modified: head/sys/dev/ath/if_ath_keycache.c ============================================================================== --- head/sys/dev/ath/if_ath_keycache.c Mon Nov 19 23:42:46 2012 (r243317) +++ head/sys/dev/ath/if_ath_keycache.c Mon Nov 19 23:54:05 2012 (r243318) @@ -214,6 +214,15 @@ ath_keyset(struct ath_softc *sc, struct hk.kv_type = HAL_CIPHER_CLR; /* + * If we're installing a clear cipher key and + * the hardware doesn't support that, just succeed. + * Leave it up to the net80211 layer to figure it out. + */ + if (hk.kv_type == HAL_CIPHER_CLR && sc->sc_hasclrkey == 0) { + return (1); + } + + /* * XXX TODO: check this: * * Group keys on hardware that supports multicast frame @@ -364,6 +373,14 @@ key_alloc_single(struct ath_softc *sc, #define N(a) (sizeof(a)/sizeof(a[0])) u_int i, keyix; + if (sc->sc_hasclrkey == 0) { + /* + * Map to slot 0 for the AR5210. + */ + *txkeyix = *rxkeyix = 0; + return (1); + } + /* XXX try i,i+32,i+64,i+32+64 to minimize key pair conflicts */ for (i = 0; i < N(sc->sc_keymap); i++) { u_int8_t b = sc->sc_keymap[i]; From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 01:42:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A86761F1; Tue, 20 Nov 2012 01:42:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8EA258FC08; Tue, 20 Nov 2012 01:42:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAK1gITS091863; Tue, 20 Nov 2012 01:42:18 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAK1gINO091862; Tue, 20 Nov 2012 01:42:18 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211200142.qAK1gINO091862@svn.freebsd.org> From: Ed Maste Date: Tue, 20 Nov 2012 01:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243319 - head/tools/regression/netinet/arphold X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 01:42:18 -0000 Author: emaste Date: Tue Nov 20 01:42:18 2012 New Revision: 243319 URL: http://svnweb.freebsd.org/changeset/base/243319 Log: Remove unused variable. Modified: head/tools/regression/netinet/arphold/arphold.c Modified: head/tools/regression/netinet/arphold/arphold.c ============================================================================== --- head/tools/regression/netinet/arphold/arphold.c Mon Nov 19 23:54:05 2012 (r243318) +++ head/tools/regression/netinet/arphold/arphold.c Tue Nov 20 01:42:18 2012 (r243319) @@ -63,7 +63,6 @@ main(int argc, char **argv) int sock; int maxhold; - int wait; size_t size = sizeof(maxhold); struct sockaddr_in dest; char message[MSG_SIZE]; From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 01:57:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE1084B0; Tue, 20 Nov 2012 01:57:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C99808FC14; Tue, 20 Nov 2012 01:57:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAK1vLj2094331; Tue, 20 Nov 2012 01:57:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAK1vL49094329; Tue, 20 Nov 2012 01:57:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211200157.qAK1vL49094329@svn.freebsd.org> From: Eitan Adler Date: Tue, 20 Nov 2012 01:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243320 - head/usr.bin/cut X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 01:57:22 -0000 Author: eadler Date: Tue Nov 20 01:57:21 2012 New Revision: 243320 URL: http://svnweb.freebsd.org/changeset/base/243320 Log: Add 'w' flag to: Use whitespace (spaces and tabs) as the delimiter. Consecutive spaces and tabs count as one single field separator. Reviewed by: swildner@dragonflybsd.org Approved by: cperciva Obtained from: DragonFlyBSD MFC after: 1 week Modified: head/usr.bin/cut/cut.1 head/usr.bin/cut/cut.c Modified: head/usr.bin/cut/cut.1 ============================================================================== --- head/usr.bin/cut/cut.1 Tue Nov 20 01:42:18 2012 (r243319) +++ head/usr.bin/cut/cut.1 Tue Nov 20 01:57:21 2012 (r243320) @@ -31,7 +31,7 @@ .\" @(#)cut.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 21, 2006 +.Dd August 8, 2012 .Dt CUT 1 .Os .Sh NAME @@ -47,7 +47,7 @@ .Op Ar .Nm .Fl f Ar list -.Op Fl d Ar delim +.Op Fl w | Fl d Ar delim .Op Fl s .Op Ar .Sh DESCRIPTION @@ -119,6 +119,9 @@ that form the character are selected. .It Fl s Suppress lines with no field delimiter characters. Unless specified, lines with no delimiters are passed through unmodified. +.It Fl w +Use whitespace (spaces and tabs) as the delimiter. +Consecutive spaces and tabs count as one single field separator. .El .Sh ENVIRONMENT The Modified: head/usr.bin/cut/cut.c ============================================================================== --- head/usr.bin/cut/cut.c Tue Nov 20 01:42:18 2012 (r243319) +++ head/usr.bin/cut/cut.c Tue Nov 20 01:57:21 2012 (r243320) @@ -58,6 +58,7 @@ static int dflag; static int fflag; static int nflag; static int sflag; +static int wflag; static size_t autostart, autostop, maxval; static char * positions; @@ -67,6 +68,7 @@ static int b_n_cut(FILE *, const char *) static int c_cut(FILE *, const char *); static int f_cut(FILE *, const char *); static void get_list(char *); +static int is_delim(int); static void needpos(size_t); static void usage(void); @@ -84,7 +86,7 @@ main(int argc, char *argv[]) dchar = '\t'; /* default delimiter is \t */ strcpy(dcharmb, "\t"); - while ((ch = getopt(argc, argv, "b:c:d:f:sn")) != -1) + while ((ch = getopt(argc, argv, "b:c:d:f:snw")) != -1) switch(ch) { case 'b': get_list(optarg); @@ -111,6 +113,9 @@ main(int argc, char *argv[]) case 'n': nflag = 1; break; + case 'w': + wflag = 1; + break; case '?': default: usage(); @@ -119,9 +124,9 @@ main(int argc, char *argv[]) argv += optind; if (fflag) { - if (bflag || cflag || nflag) + if (bflag || cflag || nflag || (wflag && dflag)) usage(); - } else if (!(bflag || cflag) || dflag || sflag) + } else if (!(bflag || cflag) || dflag || sflag || wflag) usage(); else if (!bflag && nflag) usage(); @@ -359,18 +364,30 @@ out: } static int +is_delim(int ch) +{ + if (wflag) { + if (ch == ' ' || ch == '\t') + return 1; + } else { + if (ch == dchar) + return 1; + } + return 0; +} + +static int f_cut(FILE *fp, const char *fname) { wchar_t ch; int field, i, isdelim; char *pos, *p; - wchar_t sep; int output; char *lbuf, *mlbuf; size_t clen, lbuflen, reallen; mlbuf = NULL; - for (sep = dchar; (lbuf = fgetln(fp, &lbuflen)) != NULL;) { + while ((lbuf = fgetln(fp, &lbuflen)) != NULL) { reallen = lbuflen; /* Assert EOL has a newline. */ if (*(lbuf + lbuflen - 1) != '\n') { @@ -394,7 +411,7 @@ f_cut(FILE *fp, const char *fname) if (clen == 0) clen = 1; /* this should work if newline is delimiter */ - if (ch == sep) + if (is_delim(ch)) isdelim = 1; if (ch == '\n') { if (!isdelim && !sflag) @@ -421,8 +438,13 @@ f_cut(FILE *fp, const char *fname) if (clen == 0) clen = 1; p += clen; - if (ch == '\n' || ch == sep) + if (ch == '\n' || is_delim(ch)) { + /* compress whitespace */ + if (wflag && ch != '\n') + while (is_delim(*p)) + p++; break; + } if (*pos) for (i = 0; i < (int)clen; i++) putchar(p[i - clen]); @@ -452,6 +474,6 @@ usage(void) (void)fprintf(stderr, "%s\n%s\n%s\n", "usage: cut -b list [-n] [file ...]", " cut -c list [file ...]", - " cut -f list [-s] [-d delim] [file ...]"); + " cut -f list [-s] [-w | -d delim] [file ...]"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 02:12:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE7AA91C; Tue, 20 Nov 2012 02:12:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D1E518FC08; Tue, 20 Nov 2012 02:12:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAK2C1BH097755; Tue, 20 Nov 2012 02:12:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAK2C1sT097754; Tue, 20 Nov 2012 02:12:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211200212.qAK2C1sT097754@svn.freebsd.org> From: Eitan Adler Date: Tue, 20 Nov 2012 02:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243321 - head/usr.sbin/edquota X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 02:12:02 -0000 Author: eadler Date: Tue Nov 20 02:12:01 2012 New Revision: 243321 URL: http://svnweb.freebsd.org/changeset/base/243321 Log: Remove unneeded includes. Tested with "make universe"; there are no conditional features. Approved by: cperciva MFC after: 3 daus Modified: head/usr.sbin/edquota/edquota.c Modified: head/usr.sbin/edquota/edquota.c ============================================================================== --- head/usr.sbin/edquota/edquota.c Tue Nov 20 01:57:21 2012 (r243320) +++ head/usr.sbin/edquota/edquota.c Tue Nov 20 02:12:01 2012 (r243321) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); * Disk quota editor. */ -#include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 03:21:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F2F7B05; Tue, 20 Nov 2012 03:21:26 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 71A338FC08; Tue, 20 Nov 2012 03:21:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAK3LQsG011454; Tue, 20 Nov 2012 03:21:26 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAK3LQQt011453; Tue, 20 Nov 2012 03:21:26 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211200321.qAK3LQQt011453@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 20 Nov 2012 03:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243322 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 03:21:26 -0000 Author: marcel Date: Tue Nov 20 03:21:26 2012 New Revision: 243322 URL: http://svnweb.freebsd.org/changeset/base/243322 Log: Unbreak amd64 cross-build where amd64 is the target. While clang may be installed as cc and we don't need to build gcc as a cross-tools, we still build gcc and thus need cc_tools built as a build tool. Not doing this results in building gengenrtl with the target compiler while we need to run it on the build machine. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Nov 20 02:12:01 2012 (r243321) +++ head/Makefile.inc1 Tue Nov 20 03:21:26 2012 (r243322) @@ -1138,7 +1138,7 @@ _aicasm= sys/modules/aic7xxx/aicasm _share= share/syscons/scrnmaps .endif -.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") +.if ${MK_GCC} != "no" _gcc_tools= gnu/usr.bin/cc/cc_tools .endif From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 04:45:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B18D7C93; Tue, 20 Nov 2012 04:45:04 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 97DD38FC0C; Tue, 20 Nov 2012 04:45:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAK4j4Qn027282; Tue, 20 Nov 2012 04:45:04 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAK4j4YF027280; Tue, 20 Nov 2012 04:45:04 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211200445.qAK4j4YF027280@svn.freebsd.org> From: Hiroki Sato Date: Tue, 20 Nov 2012 04:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243324 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 04:45:04 -0000 Author: hrs Date: Tue Nov 20 04:45:04 2012 New Revision: 243324 URL: http://svnweb.freebsd.org/changeset/base/243324 Log: Do not put "already running" message when rc_quiet=yes. PR: bin/165477 Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Tue Nov 20 03:57:54 2012 (r243323) +++ head/etc/rc.subr Tue Nov 20 04:45:04 2012 (r243324) @@ -704,7 +704,10 @@ run_rc_command() start) if [ -z "$rc_fast" -a -n "$rc_pid" ]; then - echo 1>&2 "${name} already running? (pid=$rc_pid)." + if [ -z "$rc_quiet" ]; then + echo 1>&2 "${name} already running? " \ + "(pid=$rc_pid)." + fi return 1 fi From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 05:49:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C3AF33D; Tue, 20 Nov 2012 05:49:18 +0000 (UTC) (envelope-from mike.telahun@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4E65E8FC14; Tue, 20 Nov 2012 05:49:17 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id je9so1556890bkc.13 for ; Mon, 19 Nov 2012 21:49:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=icqdCOqmJdzxuUZCsCtwHrojJ3Pdg6uHV8ZkdTYmwQA=; b=SUuN/Wtaae0UShmLjSMA/M8uF0/+wW3Tlxht/CSQ1kWdLgkyOq+cloLuGXLLBWOduD 9C2lro6+z67Zdtm3asZV/EVIEF+z1kqBgePHupMsduT6MjEmYrgejWzJTYfl/QZwMoXG nQxWQp4/DaCmclb/NaXRUMnPulB0BZQGRbBF/j2dQMjtm++txPIjo81fh8OLcCplDHv4 KzKjVh3USkeTvOjhs4wCblVUbK6qviWMH8x3tLTFdtnR5IWddUQtBWiEYH8bO/tYGCj2 2f4JmhrjSR3Rye+aBzaf2NO+eVuwbu/iKIEDUzVleRuyBcpni6I823UBi2N53yeqNMo3 WlxA== Received: by 10.204.11.70 with SMTP id s6mr5754011bks.63.1353390555346; Mon, 19 Nov 2012 21:49:15 -0800 (PST) Received: from [172.16.16.143] ([213.55.76.19]) by mx.google.com with ESMTPS id f24sm3208239bkv.7.2012.11.19.21.49.11 (version=SSLv3 cipher=OTHER); Mon, 19 Nov 2012 21:49:14 -0800 (PST) Message-ID: <50AB19D3.9080106@gmail.com> Date: Tue, 20 Nov 2012 08:49:07 +0300 From: Mike Telahun User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: Hiroki Sato Subject: Re: svn commit: r243324 - head/etc References: <201211200445.qAK4j4YF027280@svn.freebsd.org> In-Reply-To: <201211200445.qAK4j4YF027280@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 05:49:18 -0000 > @@ -704,7 +704,10 @@ run_rc_command() > > start) > if [ -z "$rc_fast" -a -n "$rc_pid" ]; then > - echo 1>&2 "${name} already running? (pid=$rc_pid)." > + if [ -z "$rc_quiet" ]; then Shouldn't this be using checkyesno() ? What happens if someone has rc_quiet=NO in /etc/rc.conf? > + echo 1>&2 "${name} already running? " \ > + "(pid=$rc_pid)." > + fi > return 1 > fi > > Cheers, Mike. From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 06:20:50 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DA37B49; Tue, 20 Nov 2012 06:20:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id E49668FC15; Tue, 20 Nov 2012 06:20:49 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAK6Kc8K027318 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Nov 2012 17:20:40 +1100 Date: Tue, 20 Nov 2012 17:20:38 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Attilio Rao Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs In-Reply-To: <201211192243.qAJMhjFF055708@svn.freebsd.org> Message-ID: <20121120162708.I924@besplex.bde.org> References: <201211192243.qAJMhjFF055708@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=M4YVsFMs c=1 sm=1 a=m-t6nEIf1F8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=t5VDnOqDOncA:10 a=ZSNbJLfsP4irUuco1f0A:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 06:20:50 -0000 On Mon, 19 Nov 2012, Attilio Rao wrote: > Log: > r16312 is not any longer real since many years (likely since when VFS > received granular locking) but the comment present in UFS has been > copied all over other filesystems code incorrectly for several times. > > Removes comments that makes no sense now. It still made sense (except for bitrot in the function name), but might not be true). The code made sense with it. Now the code makes no sense. > Modified: head/sys/ufs/ffs/ffs_vfsops.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 (r243310) > +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 (r243311) > @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags > ump = VFSTOUFS(mp); > dev = ump->um_dev; > fs = ump->um_fs; > - > - /* > - * If this malloc() is performed after the getnewvnode() This malloc() didn't match the code, which uses uma_zalloc(). Old versions used MALLOC() in both the comment and the code. ffs's comment was updated to say malloc() when the code was changed to use malloc(), then rotted when the code was changed to use uma_zalloc(). In some other file systems, the comment still said MALLOC(). > - * it might block, leaving a vnode with a NULL v_data to be > - * found by ffs_sync() if a sync happens to fire right then, > - * which will cause a panic because ffs_sync() blindly > - * dereferences vp->v_data (as well it should). > - */ > ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); > > /* Allocate a new vnode/inode. */ > The code makes no sense now. The comment explains why ip is allocated before vp, instead of in the natural, opposite order like it used to be. Allocating things in an unnatural order requires extra code to free ip when the allocation of vp fails. I use the following comment fixes for this and nearby comments in an old version: % Index: ffs_vfsops.c % =================================================================== % RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vfsops.c,v % retrieving revision 1.233 % diff -u -2 -r1.233 ffs_vfsops.c % --- ffs_vfsops.c 16 Jun 2004 09:47:25 -0000 1.233 % +++ ffs_vfsops.c 1 Oct 2007 12:41:25 -0000 % @@ -1210,4 +1275,10 @@ % } % % +/* % + * Look up a FFS dinode number to find its incore vnode, otherwise read it % + * in from disk. If it is in core, wait for the lock bit to clear, then % + * return the inode locked. Detection and handling of mount points must be % + * done by the calling routine. % + */ % int % ffs_vget(mp, ino, flags, vpp) Previous bitrot removed this comment, leaving no comment about what the function does. The above just restores it from rev.1.1. I didn't fix its grammar error (comma splice before "otherwise") or style bugs (it uses KNF style with 2-space sentence breaks, but other parts of ffs use non-KNF style with 1-space sentence breaks). This fix is still relevant. % @@ -1230,8 +1301,9 @@ % % /* % - * We do not lock vnode creation as it is believed to be too % - * expensive for such rare case as simultaneous creation of vnode % - * for same ino by different processes. We just allow them to race % - * and check later to decide who wins. Let the race begin! % + * We do not lock vnode creation since it is believed to be too % + * expensive to prevent the rare operation of simultaneous creation % + * of a vnode for the same ino by different processes. We just allow % + * the processes to race and check later to decide who wins. Let the % + * race begin! % */ % if ((error = ufs_ihashget(dev, ino, flags, vpp)) != 0) Improve grammar. This fix is still relevant, although ufs_ihashget() is no longer used. Now the comment is attached to null code, where previously it was only attached to the hashget call. It should be attached to the (ip, vp) allocation code. Your commit removes just 1 of the blank lines that obfuscated the scope of the above comment by splitting up related sections. % @@ -1241,5 +1313,5 @@ % % /* % - * If this MALLOC() is performed after the getnewvnode() % + * If this uma_zalloc() is performed after the getnewvnode() % * it might block, leaving a vnode with a NULL v_data to be % * found by ffs_sync() if a sync happens to fire right then, Perhaps still relevant. The vnode is still not locked here. If this is not relevant, then please fix the code by moving the ip allocation back to after the vp allocation and removing error recovering. It would only not be still relevant if ffs_sync() has been changed to either not see or to ignore vnodes with a NULL v_data. % @@ -1275,14 +1347,14 @@ % #endif % /* % - * Exclusively lock the vnode before adding to hash. Note, that we % - * must not release nor downgrade the lock (despite flags argument % - * says) till it is fully initialized. % + * Exclusively lock the vnode before hashing it. Note that we must % + * not release nor downgrade the lock (no matter what the flags % + * argument says) until it is fully initialized. % */ % lockmgr(vp->v_vnlock, LK_EXCLUSIVE, (struct mtx *)0, td); Improve grammar. This has been replaced by a much shorter comment. I like shortness, but it is less descriptive now. I don't see any problems in the above except that it is too specific about hashing. The lock covers much more than hashing in preemptible kernels. This and the corresponding current comment are not separated from previous code by blank lines, while the previous code has bogus subsections created by blank lines, so the scope of the previous comments is especially unclear. % % /* % - * Atomicaly (in terms of ufs_hash operations) check the hash for % - * duplicate of vnode being created and add it to the hash. If a % - * duplicate vnode was found, it will be vget()ed from hash for us. % + * Atomically (in terms of ufs_hash operations) check the hash table % + * for a duplicate of our vnode. If a duplicate is found, it will be % + * vget()ed from the hash table for us. % */ % if ((error = ufs_ihashins(ip, flags, vpp)) != 0) { Fix spelling and improve wording. This is mostly no longer relevant, at least here. Comments about how the hashing function works belong in the function. % @@ -1292,5 +1364,8 @@ % } % % - /* We lost the race, then throw away our vnode and return existing */ % + /* % + * If we lost the race, throw away our vnode and return the % + * duplicate. % + */ % if (*vpp != NULL) { % vput(vp); Fix grammar and punctuation. This code has been merged with the error checking for the hash function and its comment and the comment about the error checking both removed. This seems to be a regression. An earlier comment still says "Let the race begin!" This was where the race ended. It is less clear where it ends now. I think it ends when we acquire the lock, but we still have to check if it was lost while we didn't hold the lock. The above seems to be such a check, except it seems to be placed too far from the lock acquisition for just that. Maybe there were multiple races. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 07:04:03 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67351367; Tue, 20 Nov 2012 07:04:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id E38998FC08; Tue, 20 Nov 2012 07:04:02 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAK73vLT008767 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Nov 2012 18:03:59 +1100 Date: Tue, 20 Nov 2012 18:03:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r243321 - head/usr.sbin/edquota In-Reply-To: <201211200212.qAK2C1sT097754@svn.freebsd.org> Message-ID: <20121120172226.R1115@besplex.bde.org> References: <201211200212.qAK2C1sT097754@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=XbrRV/F5 c=1 sm=1 a=ZxRWe08iPxcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=jzXQl5q7vI0A:10 a=Z2WMB8SLCj99l0N3Wx0A:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 07:04:03 -0000 On Tue, 20 Nov 2012, Eitan Adler wrote: > Log: > Remove unneeded includes. > > Tested with "make universe"; there are no conditional features. "make universe" can't find such features. Except inversely -- when it doesn't find them, it usually means that there is a bug in the headers. > Modified: head/usr.sbin/edquota/edquota.c > ============================================================================== > --- head/usr.sbin/edquota/edquota.c Tue Nov 20 01:57:21 2012 (r243320) > +++ head/usr.sbin/edquota/edquota.c Tue Nov 20 02:12:01 2012 (r243321) > @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); > * Disk quota editor. > */ > > -#include > -#include > #include > #include > #include > This removes used includes. is a documented prerequisite of . sys/mount.h has some pollution but not that until recently. has included for a long time, and someone recently added the following disgusting pollution to : - includes - includes and all of its standard pollution According to cc -E -MM, this is: % f.o: f.c /usr/include/bsm/audit.h /usr/include/sys/param.h \ ^^^^^^^^^^^^^^^^^^^^^^^^ Polluting headers are underlined. % /usr/include/sys/_null.h /usr/include/sys/types.h \ ^^^^^^^^^^^^^^^^^^^^^^^^ is of low quality. It also includes after . This is a style bug. is standard pollution in . % /usr/include/sys/cdefs.h /usr/include/machine/endian.h \ % /usr/include/x86/endian.h /usr/include/sys/_types.h \ % /usr/include/machine/_types.h /usr/include/x86/_types.h \ % /usr/include/sys/_pthreadtypes.h /usr/include/sys/_stdint.h \ % /usr/include/sys/select.h /usr/include/sys/_sigset.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^ Standard pollution in . % /usr/include/sys/_timeval.h /usr/include/sys/timespec.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Standard pollution in . % /usr/include/sys/_timespec.h /usr/include/sys/syslimits.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % /usr/include/sys/signal.h /usr/include/machine/_limits.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^ Standard pollutions in . % /usr/include/x86/_limits.h /usr/include/machine/signal.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % /usr/include/machine/trap.h /usr/include/x86/trap.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ Standard pollutions in and thus in . % /usr/include/machine/param.h /usr/include/machine/_align.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % /usr/include/x86/_align.h /usr/include/sys/limits.h ^^^^^^^^^^^^^^^^^^^^^^^^^ Standard pollutions in . To remove a single header, you must know all the standard pollutions and check cc -E -MM output to verify that no nonstandard pollutions are depended on. That was for . Now for some others. > -#include > -#include > #include a is documented prerequisite for . It was correct to get it via . However, is a POSIX header. POSIX required before in 1988, but removed this requirement in 2001 or before. FreeBSD is slowly catching up with this: - FreeBSD has always been massively polluted by including and all if its pollution (which includes . The polluting became unnecessary in about 1995 and is mostly fixed in my version (I include instead). - FreeBSD man pages were originally very inconsistent about documenting the prereq. It wasn't ever a prereq in FreeBSD, but was required for portability. None documented this of course. - At about the same time that POSIX removed the prereq, lots of man pages were "fixed" to document the old POSIX prereq. - man pages (e.g., stat(2)) still document the old POSIX prereq. More code than before probably doesn't satisfy this. is documented as having no prereqs (in flock(2)). It satisfies this by polluting itself with and other includes. The pollution is not documented of course. So this commit is correct for and except it depends on undocumented details for the former. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 07:15:45 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B7127E1; Tue, 20 Nov 2012 07:15:45 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE0B8FC15; Tue, 20 Nov 2012 07:15:42 +0000 (UTC) Received: from alph.allbsd.org (p1137-ipbf1505funabasi.chiba.ocn.ne.jp [118.7.212.137]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id qAK7FDr4041985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Nov 2012 16:15:28 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.allbsd.org (8.14.5/8.14.5) with ESMTP id qAK7FBo8044342; Tue, 20 Nov 2012 16:15:12 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 20 Nov 2012 16:14:34 +0900 (JST) Message-Id: <20121120.161434.1928803376818060657.hrs@allbsd.org> To: mike.telahun@gmail.com Subject: Re: svn commit: r243324 - head/etc From: Hiroki Sato In-Reply-To: <50AB19D3.9080106@gmail.com> References: <201211200445.qAK4j4YF027280@svn.freebsd.org> <50AB19D3.9080106@gmail.com> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Nov_20_16_14_34_2012_620)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Tue, 20 Nov 2012 16:15:30 +0900 (JST) X-Spam-Status: No, score=-98.1 required=13.0 tests=CONTENT_TYPE_PRESENT, ONLY1HOPDIRECT,SAMEHELOBY2HOP,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 07:15:45 -0000 ----Security_Multipart(Tue_Nov_20_16_14_34_2012_620)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mike Telahun wrote in <50AB19D3.9080106@gmail.com>: mi> > @@ -704,7 +704,10 @@ run_rc_command() mi> > mi> > start) mi> > if [ -z "$rc_fast" -a -n "$rc_pid" ]; then mi> > - echo 1>&2 "${name} already running? (pid=$rc_pid)." mi> > + if [ -z "$rc_quiet" ]; then mi> mi> Shouldn't this be using checkyesno() ? mi> What happens if someone has rc_quiet=NO in /etc/rc.conf? rc_fast, rc_force, and rc_quiet are not intended to be used in /etc/rc.conf or other config files. These variables have no default value and will be defined forcibly via {fast,force,quiet}start. If we use checkyesno() here, it checks whether a variable is defined or not and then put an warning message when not defined. It is a bad side-effect for them. -- Hiroki ----Security_Multipart(Tue_Nov_20_16_14_34_2012_620)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAlCrLdoACgkQTyzT2CeTzy2RDwCfZBTwX8TUMmtEBr4s4x/1lIHy qEoAoM38y7nb6eihI8rwZJOW2R7GOXhH =4HCO -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Nov_20_16_14_34_2012_620)---- From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 07:22:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C62C9F2; Tue, 20 Nov 2012 07:22:08 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 126FD8FC0C; Tue, 20 Nov 2012 07:22:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAK7M7Ux057618; Tue, 20 Nov 2012 07:22:07 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAK7M7Im057617; Tue, 20 Nov 2012 07:22:07 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211200722.qAK7M7Im057617@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 20 Nov 2012 07:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243328 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 07:22:08 -0000 Author: bapt Date: Tue Nov 20 07:22:07 2012 New Revision: 243328 URL: http://svnweb.freebsd.org/changeset/base/243328 Log: change mode the group file to 0644 after a successfull rename(2) Modified: head/lib/libutil/gr_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Tue Nov 20 07:01:26 2012 (r243327) +++ head/lib/libutil/gr_util.c Tue Nov 20 07:22:07 2012 (r243328) @@ -318,7 +318,14 @@ gr_copy(int ffd, int tfd, const struct g int gr_mkdb(void) { - return (rename(tempname, group_file)); + int ret; + + ret = rename(tempname, group_file); + + if (ret == 0) + chmod(group_file, 0644); + + return (ret); } /* From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 07:32:14 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D28A6FDB; Tue, 20 Nov 2012 07:32:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 61B918FC12; Tue, 20 Nov 2012 07:32:13 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAK7WAdx032231 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Nov 2012 18:32:11 +1100 Date: Tue, 20 Nov 2012 18:32:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans Subject: Re: svn commit: r243321 - head/usr.sbin/edquota In-Reply-To: <20121120172226.R1115@besplex.bde.org> Message-ID: <20121120180834.U1234@besplex.bde.org> References: <201211200212.qAK2C1sT097754@svn.freebsd.org> <20121120172226.R1115@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=JORjKL2b c=1 sm=1 a=ZxRWe08iPxcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=jzXQl5q7vI0A:10 a=q3AStbvwKXHuODWMB-cA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 07:32:15 -0000 On Tue, 20 Nov 2012, Bruce Evans wrote: > On Tue, 20 Nov 2012, Eitan Adler wrote: > >> Log: >> Remove unneeded includes. >> >> Tested with "make universe"; there are no conditional features. > > "make universe" can't find such features. Except inversely -- when it > doesn't find them, it usually means that there is a bug in the headers. > [... oops; I wrote a lot about sys/stat.h, but removing it was correct] > To remove a single header, you must know all the standard pollutions and > check cc -E -MM output to verify that no nonstandard pollutions are > depended on. My unused includes checking utility doesn't do much better with the pollution, but it finds better includes to remove: (it tends to find pollution problems by generating large output that is not quite so large as cc -E -MM output). It gives: %%% trying /home/bde/r/edquota/edquota.c line 55 in source /home/bde/r/edquota/edquota.c seems to be unnecessary: #include line 53 in source /home/bde/r/edquota/edquota.c seems to be unnecessary: #include line 52 in source /home/bde/r/edquota/edquota.c seems to be unnecessary: #include %%% Removing all 3 headers doesn't work, and shows that some ufs header depends on sys/param.h> But removing sys/stat.h like you did and also sys/mount.h works, and checking .depend (which is equivalent to checking cc -E -MM) shows that neither sys/stat.h nor sys/mount.h is used. Except I didn't check with a universe-wide set of variations of options. Removing the include of sys/mount.h instead of the include of sys/param.h is correct. In the current version, the ufs header is satisfying its dependency on sys/param.h accidentally by getting sufficient pollution from sys/mount.h, which it otherwise doesn't use. Pollution in headers makes this bug too easy to write, and dependencies on accidental pollution make cleaning the pollution harder. @ #!/bin/sh @ @ # unusedinc - find unused `#include' lines in almost (?) any directory with @ # a makefile. Usage: `unusedinc' or `unusedinc file.o ...'. @ # @ # Known bugs: @ # - scribbles in current directory @ # - copying files to the current directory tends to break #include "foo.h", @ # e.g., in src/usr.bin/w. @ # - doesn't handle undocumented nested includes properly. E.g., including @ # to get `struct timeval' gives a free include of , @ # but it is not correct to depend on this pollution. We should run gcc -M @ # to separate these unused but necessary includes from the completely @ # unused ones. @ # - slow. @ @ # XXX removed -Wconversion since it was too painful. @ # XXX removed -Wshadow since it was too painful. @ # XXX removed -Wwrite-strings since it was too painful. @ MAKEOBJDIR=/ make -n "$@" | grep '^cc .*-c ' | sed 's/cc/cc -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -fno-builtin/' | @ while :; @ do @ read line @ if [ -z "$line" ] @ then @ rm -f 1 2 1.o 2.o z.c @ exit @ fi @ line=`echo "$line" | sed 's; -o [^ ]*;;'` @ cmd=`echo "$line" | sed 's;[ ][^ ]*$;;'` @ src=`echo "$line" | sed 's;.* ;;'` @ echo "trying $src" @ cat $src >z.c @ $cmd z.c >/dev/null 2>1 @ if test -f z.o @ then @ mv z.o 1.o @ else @ echo "original build of $src failed!" @ $cmd z.c @ exit 1 @ fi @ for i in `grep -n '^[ ]*#include' $src | sed 's/:.*//' | sort -nr` @ do @ sed -e "$i""s/.*//" $src >z.c @ $cmd z.c >/dev/null 2>2 @ if test -f z.o @ then @ mv z.o 2.o @ if cmp -s 1 2 && cmp -s 1.o 2.o @ then @ echo "line $i in source $src seems to be unnecessary:" @ head -$i $src | tail -1 @ # exit 1 @ fi @ fi @ done @ done unusedinc is not very good in different ways than /usr/src/tools/tools/kerninclude/kerninclude.sh. The latter is smarter about annulling includes (IIRC, it builds a new include tree and replaces 1 include at a time with an empty file, where the above removes #include lines 1 at a time). This gives many fewer false positives, but makes the checking too heavyweight to use on 1 small program at a time. It is only implemented for the kernel, while the above works in any reasonably- structured source directory (no subdirectories or .PATH's pointing elsewhere), or on a single source file at a time in such a directory. kerninclude.sh is also unusable because its globality and the kernel size generates more output than anyone wants to see. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 08:17:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A3BEDD1; Tue, 20 Nov 2012 08:17:36 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 34A388FC08; Tue, 20 Nov 2012 08:17:34 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so2787104lbb.13 for ; Tue, 20 Nov 2012 00:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=zNk1flpvpJ3wuGKRYnb4H9lvUoMymjjZcI7u8UBkKPY=; b=ViCB7ExE1RAzz5OIBvFFU5YOAPMc6Mp6xvUgGQQ2GWgCQNbfrFgWeQlpDhEZxme8KM m7D5fSsJkrF8fFqtKcm0cc5S9GWmBJHH4QedrBtZ1mq4zUYiwaAZzg3X7tMo02k3d2rU LpY/xGVDy6KMvEhQpsYn4/N5zMitah0nOnuNz8eZ5V767q6HwBIyRk+qn0uvXfIdYIaM 3aQxRCBMHj9EJcAGwYxVpsp+MIvrB8W7CDN7jLF08Vf0t1Dx0M2HEt3bmf7RyVTubuyS gimUSJfPwQzHKFftxX6POrs9RswAEZFTfyY0JxZupCHCcPlqEpSxTCR8q3yz1cNnW3P7 9MRw== MIME-Version: 1.0 Received: by 10.152.110.234 with SMTP id id10mr14016613lab.15.1353399453711; Tue, 20 Nov 2012 00:17:33 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Tue, 20 Nov 2012 00:17:33 -0800 (PST) In-Reply-To: <20121120162708.I924@besplex.bde.org> References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> Date: Tue, 20 Nov 2012 08:17:33 +0000 X-Google-Sender-Auth: bg9E63SuNZp3UuwsOB8ET2OZdr8 Message-ID: Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs From: Attilio Rao To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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: Tue, 20 Nov 2012 08:17:36 -0000 On Tue, Nov 20, 2012 at 6:20 AM, Bruce Evans wrote: > On Mon, 19 Nov 2012, Attilio Rao wrote: > >> Log: >> r16312 is not any longer real since many years (likely since when VFS >> received granular locking) but the comment present in UFS has been >> copied all over other filesystems code incorrectly for several times. >> >> Removes comments that makes no sense now. > > > It still made sense (except for bitrot in the function name), but might not > be true). The code made sense with it. Now the code makes no sense. > > >> Modified: head/sys/ufs/ffs/ffs_vfsops.c >> >> ============================================================================== >> --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 >> (r243310) >> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 >> (r243311) >> @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags >> ump = VFSTOUFS(mp); >> dev = ump->um_dev; >> fs = ump->um_fs; >> - >> - /* >> - * If this malloc() is performed after the getnewvnode() > > > This malloc() didn't match the code, which uses uma_zalloc(). Old > versions used MALLOC() in both the comment and the code. ffs's comment > was updated to say malloc() when the code was changed to use malloc(), > then rotted when the code was changed to use uma_zalloc(). In some > other file systems, the comment still said MALLOC(). > > >> - * it might block, leaving a vnode with a NULL v_data to be >> - * found by ffs_sync() if a sync happens to fire right then, >> - * which will cause a panic because ffs_sync() blindly >> - * dereferences vp->v_data (as well it should). >> - */ >> ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); >> >> /* Allocate a new vnode/inode. */ >> > > The code makes no sense now. The comment explains why ip is allocated > before vp, instead of in the natural, opposite order like it used to > be. Allocating things in an unnatural order requires extra code to > free ip when the allocation of vp fails. "Used to be" is very arguably. The code has been like its current form many more years than the opposite (16 against 3 I think). And the code makes perfectly sense if you know the history. So I don't agree with you. Thanks for the other comments, I will try to squeeze a patch about it. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 08:43:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 52F282B7; Tue, 20 Nov 2012 08:43:14 +0000 (UTC) Date: Tue, 20 Nov 2012 08:43:14 +0000 From: Alexey Dokuchaev To: Eitan Adler Subject: Re: svn commit: r243320 - head/usr.bin/cut Message-ID: <20121120084314.GA78646@FreeBSD.org> References: <201211200157.qAK1vL49094329@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201211200157.qAK1vL49094329@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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 08:43:14 -0000 On Tue, Nov 20, 2012 at 01:57:21AM +0000, Eitan Adler wrote: > Author: eadler > Date: Tue Nov 20 01:57:21 2012 > New Revision: 243320 > URL: http://svnweb.freebsd.org/changeset/base/243320 > > Log: > Add 'w' flag to: > > Use whitespace (spaces and tabs) as the delimiter. > Consecutive spaces and tabs count as one single field > separator. Awesome, long desired. Thanks! ./danfe From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 09:17:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38A7DE0A; Tue, 20 Nov 2012 09:17:07 +0000 (UTC) (envelope-from mike.telahun@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 21C6E8FC14; Tue, 20 Nov 2012 09:17:05 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so5433886lah.13 for ; Tue, 20 Nov 2012 01:17:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=DH4pNsybmX4iDoMZaXjl164XKfah9ta7L2NgZdiCieQ=; b=a2tq39rcmMwxnEetKcRxe2xi8rlOCNVewUNuZjc4BtLamKZQiQT1mIxdZmQhVJt7pW ihsRbW7N+CK6a8wiPwufuB3QGmiB4GKlkmGC5PwkRgKWgYvyqo3WX2yrJNs6NMujVb4Y PoPnirDK25sAdR8gaUzNUbzTICxzRHudtqZbCkksFiyGeg8xLCl7/q7po09h3ngMF7od iaPfC1obY8bJ4cVS9jAFi/cPfswH7ipk9hQkxfjaJT++nhkPdVQpHtr3peAxQZ5s8w/X XRpd+fUYP7KdjDxK2nSbj6DkOWiBtkEvf6rK+Gl1SIXgGWgvUcUJG5MXLVyaGaxWAa0g SuxA== Received: by 10.152.106.79 with SMTP id gs15mr14178871lab.31.1353403024444; Tue, 20 Nov 2012 01:17:04 -0800 (PST) Received: from [172.16.16.157] ([213.55.108.232]) by mx.google.com with ESMTPS id hu6sm4475565lab.13.2012.11.20.01.17.00 (version=SSLv3 cipher=OTHER); Tue, 20 Nov 2012 01:17:02 -0800 (PST) Message-ID: <50AB4A89.5030707@gmail.com> Date: Tue, 20 Nov 2012 12:16:57 +0300 From: Mike Telahun User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: Hiroki Sato Subject: Re: svn commit: r243324 - head/etc References: <201211200445.qAK4j4YF027280@svn.freebsd.org> <50AB19D3.9080106@gmail.com> <20121120.161434.1928803376818060657.hrs@allbsd.org> In-Reply-To: <20121120.161434.1928803376818060657.hrs@allbsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 09:17:07 -0000 On 11/20/2012 10:14 AM, Hiroki Sato wrote: > rc_fast, rc_force, and rc_quiet are not intended to be used in > /etc/rc.conf or other config files. These variables have no default > value and will be defined forcibly via {fast,force,quiet}start. If > we use checkyesno() here, it checks whether a variable is defined or > not and then put an warning message when not defined. It is a bad > side-effect for them. Ok. Thanks for the explanation. Cheers, Mike. From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 10:59:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3379FAB3; Tue, 20 Nov 2012 10:59:03 +0000 (UTC) (envelope-from jhay@meraka.csir.co.za) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [IPv6:2001:4200:7000:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 0F9688FC14; Tue, 20 Nov 2012 10:59:02 +0000 (UTC) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973) id 4BF7AB817; Tue, 20 Nov 2012 12:58:58 +0200 (SAST) Date: Tue, 20 Nov 2012 12:58:58 +0200 From: John Hay To: Chris Rees Subject: Re: svn commit: r243228 - head/etc Message-ID: <20121120105858.GA73018@zibbi.meraka.csir.co.za> References: <201211181421.qAIEL5KT042019@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201211181421.qAIEL5KT042019@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 10:59:03 -0000 Hi Chris, On Sun, Nov 18, 2012 at 02:21:05PM +0000, Chris Rees wrote: > Author: crees (ports committer) > Date: Sun Nov 18 14:21:05 2012 > New Revision: 243228 > URL: http://svnweb.freebsd.org/changeset/base/243228 > > Log: > cp -R misses out dotfiles; use pax instead to copy file hierarchies > > PR: conf/99721 (based on) > Submitted by: Florian Zavatzki > Approved by: hrs > MFC after: 1 month > > Modified: > head/etc/rc.initdiskless > > Modified: head/etc/rc.initdiskless > ============================================================================== > --- head/etc/rc.initdiskless Sun Nov 18 14:05:28 2012 (r243227) > +++ head/etc/rc.initdiskless Sun Nov 18 14:21:05 2012 (r243228) > @@ -354,7 +354,7 @@ for i in ${templates} ; do > subdir=${j##*/} > if [ -d $j -a ! -f $j.cpio.gz ]; then > create_md $subdir > - cp -Rp $j/ /$subdir > + (cd $j && pax -rw . /$subdir) > fi > done > for j in /conf/$i/*.cpio.gz ; do Have you tested this on a diskless and readonly system? It looks like pax need to write something in /tmp and it might not be writeable yet. I got an error, after the first of /bin/pax not found and having to add that to the list of files needed. John -- John Hay -- jhay@meraka.csir.co.za / jhay@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 10:59:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 341E7C23; Tue, 20 Nov 2012 10:59:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A1C58FC08; Tue, 20 Nov 2012 10:59:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKAxfqu003227; Tue, 20 Nov 2012 10:59:41 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKAxfYi003226; Tue, 20 Nov 2012 10:59:41 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211201059.qAKAxfYi003226@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 20 Nov 2012 10:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243330 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 10:59:42 -0000 Author: bapt Date: Tue Nov 20 10:59:41 2012 New Revision: 243330 URL: http://svnweb.freebsd.org/changeset/base/243330 Log: Correctly set the password file mode after renaming in NIS mode Modified: head/usr.sbin/pw/pw_nis.c Modified: head/usr.sbin/pw/pw_nis.c ============================================================================== --- head/usr.sbin/pw/pw_nis.c Tue Nov 20 09:27:56 2012 (r243329) +++ head/usr.sbin/pw/pw_nis.c Tue Nov 20 10:59:41 2012 (r243330) @@ -68,6 +68,8 @@ pw_nisupdate(const char * path, struct p } if (rename(pw_tempname(), path) == -1) err(1, "rename()"); + if (chmod(path, 0644) == -1) + err(1, "chmod()"); free(pw); pw_fini(); From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 11:47:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 330818AD; Tue, 20 Nov 2012 11:47:23 +0000 (UTC) (envelope-from demon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0C6618FC08; Tue, 20 Nov 2012 11:47:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKBlM1v010777; Tue, 20 Nov 2012 11:47:22 GMT (envelope-from demon@svn.freebsd.org) Received: (from demon@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKBlMFq010776; Tue, 20 Nov 2012 11:47:22 GMT (envelope-from demon@svn.freebsd.org) Message-Id: <201211201147.qAKBlMFq010776@svn.freebsd.org> From: Dmitry Sivachenko Date: Tue, 20 Nov 2012 11:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243331 - stable/9/include/xlocale X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 11:47:23 -0000 Author: demon (ports committer) Date: Tue Nov 20 11:47:22 2012 New Revision: 243331 URL: http://svnweb.freebsd.org/changeset/base/243331 Log: MFC r243032: Use defined() to test macro definitions. Approved by: theraven Modified: stable/9/include/xlocale/_ctype.h Modified: stable/9/include/xlocale/_ctype.h ============================================================================== --- stable/9/include/xlocale/_ctype.h Tue Nov 20 10:59:41 2012 (r243330) +++ stable/9/include/xlocale/_ctype.h Tue Nov 20 11:47:22 2012 (r243331) @@ -53,7 +53,7 @@ _RuneLocale *__runes_for_locale(locale_t #endif #ifndef _XLOCALE_INLINE -#if __GNUC__ && !__GNUC_STDC_INLINE__ +#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__) /* GNU89 inline has nonstandard semantics. */ #define _XLOCALE_INLINE extern __inline #else From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 12:17:57 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C555CD9; Tue, 20 Nov 2012 12:17:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id E8F538FC14; Tue, 20 Nov 2012 12:17:56 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAKCHq5V024781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Nov 2012 23:17:54 +1100 Date: Tue, 20 Nov 2012 23:17:52 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Attilio Rao Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs In-Reply-To: Message-ID: <20121120230708.G6016@besplex.bde.org> References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=eJBLFwV1 c=1 sm=1 a=m-t6nEIf1F8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=t5VDnOqDOncA:10 a=lwsZ13Hph336hBIlgwAA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 12:17:57 -0000 On Tue, 20 Nov 2012, Attilio Rao wrote: > On Tue, Nov 20, 2012 at 6:20 AM, Bruce Evans wrote: >> On Mon, 19 Nov 2012, Attilio Rao wrote: >> >>> Log: >>> r16312 is not any longer real since many years (likely since when VFS >>> received granular locking) but the comment present in UFS has been >>> copied all over other filesystems code incorrectly for several times. >>> >>> Removes comments that makes no sense now. >> >> >> It still made sense (except for bitrot in the function name), but might not >> be true). The code made sense with it. Now the code makes no sense. >> >> >>> Modified: head/sys/ufs/ffs/ffs_vfsops.c >>> >>> ============================================================================== >>> --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 >>> (r243310) >>> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 >>> (r243311) >>> @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags >>> ump = VFSTOUFS(mp); >>> dev = ump->um_dev; >>> fs = ump->um_fs; >>> - >>> - /* >>> - * If this malloc() is performed after the getnewvnode() >> >> >> This malloc() didn't match the code, which uses uma_zalloc(). Old >> versions used MALLOC() in both the comment and the code. ffs's comment >> was updated to say malloc() when the code was changed to use malloc(), >> then rotted when the code was changed to use uma_zalloc(). In some >> other file systems, the comment still said MALLOC(). >> >> >>> - * it might block, leaving a vnode with a NULL v_data to be >>> - * found by ffs_sync() if a sync happens to fire right then, >>> - * which will cause a panic because ffs_sync() blindly >>> - * dereferences vp->v_data (as well it should). >>> - */ >>> ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); >>> >>> /* Allocate a new vnode/inode. */ >>> >> >> The code makes no sense now. The comment explains why ip is allocated >> before vp, instead of in the natural, opposite order like it used to >> be. Allocating things in an unnatural order requires extra code to >> free ip when the allocation of vp fails. > > "Used to be" is very arguably. The code has been like its current form > many more years than the opposite (16 against 3 I think). > And the code makes perfectly sense if you know the history. So I don't > agree with you. But it shouldn't be necessary to know the history of the code to understand it. The code only makes sense if its comment is not removed, or if you know the history of the code so that you can restore the removed comment. However, if the comment makes no sense as you claim, then the code that it it describes makes no sense. I didn't point out before that the comment "/* Allocate a new vnode/inode. */" does less than echo the code, since the code obviously allocates a new vnode/inode and only the extent of the part which does that is unclear, and the comment is disorganized so as to make the scope unclear. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 12:20:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75D96E63; Tue, 20 Nov 2012 12:20:59 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8AF308FC0C; Tue, 20 Nov 2012 12:20:58 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so2988191lbb.13 for ; Tue, 20 Nov 2012 04:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=B4JWPujATvhyKjWeHu1NaML+MxMRx3E6fpXm/twfJFM=; b=1DuXZOIcfIlQ38OXf4PvCQnOokttgKUXXU/pZXtP3tROVna6urjFl0hGdo3GJnEZ6o PboUde5vR2OEr8uDleKU2Exk2KYDtMNBUvc/4d3I11wiTq/mCjsL1WRr8TvkYxWW1IVk jxzygWhSNV5Sbq69XJn3ZMMl2Odm8HOL4hbvBCQ39LbQIRDAA5AxH3FESj+dQQrBvuMs zFS4K1KZvzQkUQN04Ez+9luzIYDeGsvdQZPNSHPNe5t9arc3IpvnuHa+1eZcZPK/ZQ3e +5nUjW/3qc1s6yMmZkgiygA95LwhPZVf0I7iLx6ZWjwEHLvoBT+6CCmKMS9svhv8exaq 1pXA== MIME-Version: 1.0 Received: by 10.112.26.67 with SMTP id j3mr6492309lbg.39.1353414057258; Tue, 20 Nov 2012 04:20:57 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Tue, 20 Nov 2012 04:20:57 -0800 (PST) In-Reply-To: <20121120230708.G6016@besplex.bde.org> References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> <20121120230708.G6016@besplex.bde.org> Date: Tue, 20 Nov 2012 12:20:57 +0000 X-Google-Sender-Auth: PrMnFm2vxcVVncWooPgo9wxy3cs Message-ID: Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs From: Attilio Rao To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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: Tue, 20 Nov 2012 12:20:59 -0000 On 11/20/12, Bruce Evans wrote: > On Tue, 20 Nov 2012, Attilio Rao wrote: > >> On Tue, Nov 20, 2012 at 6:20 AM, Bruce Evans >> wrote: >>> On Mon, 19 Nov 2012, Attilio Rao wrote: >>> >>>> Log: >>>> r16312 is not any longer real since many years (likely since when VFS >>>> received granular locking) but the comment present in UFS has been >>>> copied all over other filesystems code incorrectly for several times. >>>> >>>> Removes comments that makes no sense now. >>> >>> >>> It still made sense (except for bitrot in the function name), but might >>> not >>> be true). The code made sense with it. Now the code makes no sense. >>> >>> >>>> Modified: head/sys/ufs/ffs/ffs_vfsops.c >>>> >>>> ============================================================================== >>>> --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 >>>> (r243310) >>>> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 >>>> (r243311) >>>> @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags >>>> ump = VFSTOUFS(mp); >>>> dev = ump->um_dev; >>>> fs = ump->um_fs; >>>> - >>>> - /* >>>> - * If this malloc() is performed after the getnewvnode() >>> >>> >>> This malloc() didn't match the code, which uses uma_zalloc(). Old >>> versions used MALLOC() in both the comment and the code. ffs's comment >>> was updated to say malloc() when the code was changed to use malloc(), >>> then rotted when the code was changed to use uma_zalloc(). In some >>> other file systems, the comment still said MALLOC(). >>> >>> >>>> - * it might block, leaving a vnode with a NULL v_data to be >>>> - * found by ffs_sync() if a sync happens to fire right then, >>>> - * which will cause a panic because ffs_sync() blindly >>>> - * dereferences vp->v_data (as well it should). >>>> - */ >>>> ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); >>>> >>>> /* Allocate a new vnode/inode. */ >>>> >>> >>> The code makes no sense now. The comment explains why ip is allocated >>> before vp, instead of in the natural, opposite order like it used to >>> be. Allocating things in an unnatural order requires extra code to >>> free ip when the allocation of vp fails. >> >> "Used to be" is very arguably. The code has been like its current form >> many more years than the opposite (16 against 3 I think). >> And the code makes perfectly sense if you know the history. So I don't >> agree with you. > > But it shouldn't be necessary to know the history of the code to > understand it. The code only makes sense if its comment is not removed, > or if you know the history of the code so that you can restore the > removed comment. However, if the comment makes no sense as you claim, > then the code that it it describes makes no sense. The "code that makes no sense" is basically the justification to have the allocation before the getnewvnode(). It makes no sense because the order makes no sense (you can allocate before or after getnewvnode(), you won't have v_data corruption as the comment claims). Hence the code makes no sense. I don't understand what is the point you are trying to make honestly. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 12:21:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42D9025C; Tue, 20 Nov 2012 12:21:56 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 53E608FC08; Tue, 20 Nov 2012 12:21:55 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so2988995lbb.13 for ; Tue, 20 Nov 2012 04:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=8jL/NDw86VkSf7BxO9C3s17WjO6QGRnj81Gp0RZQvjQ=; b=r9JyLrGlDLxhQRqhixI31QWNTkXl65ONYqLV+3jIk1qDpoaqPqcnN/F7yRou3AlPke Z8qTJikrE/R9LpZdbC9JRD6mlVfjnh2cFUYtd+N3jwCsX0PnBrbhHGIVbVtE5R/5xYS8 /JBrS9a26XrmJugGPphaAoGFlJoDf715qlbzAjQDBPmZd/0y+zxMIMB2gF/8VWu7+/xl DmdHLxmbMAH4t1OA5CtTpge5JWebtQI7rCcdHuV+e5evrsKvv3Y1HmbrWchIuufsiios tepQfQ7SVQeTTCgx8WvqXSj29QyKo+Zg3UfMQ1KfFCCiEtGlzPPBpOB0f9q4rMEtfupz LPew== MIME-Version: 1.0 Received: by 10.152.129.197 with SMTP id ny5mr14574259lab.43.1353414114087; Tue, 20 Nov 2012 04:21:54 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Tue, 20 Nov 2012 04:21:54 -0800 (PST) In-Reply-To: References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> <20121120230708.G6016@besplex.bde.org> Date: Tue, 20 Nov 2012 12:21:54 +0000 X-Google-Sender-Auth: KP6DZmwmE6X5rXanQtkcEIjqi6E Message-ID: Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs From: Attilio Rao To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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: Tue, 20 Nov 2012 12:21:56 -0000 On 11/20/12, Attilio Rao wrote: > On 11/20/12, Bruce Evans wrote: >> On Tue, 20 Nov 2012, Attilio Rao wrote: >> >>> On Tue, Nov 20, 2012 at 6:20 AM, Bruce Evans >>> wrote: >>>> On Mon, 19 Nov 2012, Attilio Rao wrote: >>>> >>>>> Log: >>>>> r16312 is not any longer real since many years (likely since when VFS >>>>> received granular locking) but the comment present in UFS has been >>>>> copied all over other filesystems code incorrectly for several times. >>>>> >>>>> Removes comments that makes no sense now. >>>> >>>> >>>> It still made sense (except for bitrot in the function name), but might >>>> not >>>> be true). The code made sense with it. Now the code makes no sense. >>>> >>>> >>>>> Modified: head/sys/ufs/ffs/ffs_vfsops.c >>>>> >>>>> ============================================================================== >>>>> --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 >>>>> (r243310) >>>>> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 >>>>> (r243311) >>>>> @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags >>>>> ump = VFSTOUFS(mp); >>>>> dev = ump->um_dev; >>>>> fs = ump->um_fs; >>>>> - >>>>> - /* >>>>> - * If this malloc() is performed after the getnewvnode() >>>> >>>> >>>> This malloc() didn't match the code, which uses uma_zalloc(). Old >>>> versions used MALLOC() in both the comment and the code. ffs's comment >>>> was updated to say malloc() when the code was changed to use malloc(), >>>> then rotted when the code was changed to use uma_zalloc(). In some >>>> other file systems, the comment still said MALLOC(). >>>> >>>> >>>>> - * it might block, leaving a vnode with a NULL v_data to be >>>>> - * found by ffs_sync() if a sync happens to fire right then, >>>>> - * which will cause a panic because ffs_sync() blindly >>>>> - * dereferences vp->v_data (as well it should). >>>>> - */ >>>>> ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); >>>>> >>>>> /* Allocate a new vnode/inode. */ >>>>> >>>> >>>> The code makes no sense now. The comment explains why ip is allocated >>>> before vp, instead of in the natural, opposite order like it used to >>>> be. Allocating things in an unnatural order requires extra code to >>>> free ip when the allocation of vp fails. >>> >>> "Used to be" is very arguably. The code has been like its current form >>> many more years than the opposite (16 against 3 I think). >>> And the code makes perfectly sense if you know the history. So I don't >>> agree with you. >> >> But it shouldn't be necessary to know the history of the code to >> understand it. The code only makes sense if its comment is not removed, >> or if you know the history of the code so that you can restore the >> removed comment. However, if the comment makes no sense as you claim, >> then the code that it it describes makes no sense. > > The "code that makes no sense" is basically the justification to have > the allocation before the getnewvnode(). It makes no sense because the > order makes no sense (you can allocate before or after getnewvnode(), > you won't have v_data corruption as the comment claims). > > Hence the code makes no sense. Herm, s/code/comment. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 12:22:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A4723F3; Tue, 20 Nov 2012 12:22:40 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB458FC13; Tue, 20 Nov 2012 12:22:39 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id B5B5921661E; Tue, 20 Nov 2012 14:22:27 +0200 (EET) Date: Tue, 20 Nov 2012 14:22:26 +0200 From: Jaakko Heinonen To: Baptiste Daroussin Subject: Re: svn commit: r243328 - head/lib/libutil Message-ID: <20121120122226.GA1828@a91-153-116-96.elisa-laajakaista.fi> References: <201211200722.qAK7M7Im057617@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201211200722.qAK7M7Im057617@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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 12:22:40 -0000 Hi! On 2012-11-20, Baptiste Daroussin wrote: > change mode the group file to 0644 after a successfull rename(2) > > int > gr_mkdb(void) > { > - return (rename(tempname, group_file)); > + int ret; > + > + ret = rename(tempname, group_file); > + > + if (ret == 0) > + chmod(group_file, 0644); > + > + return (ret); > } Rename+chmod is not an atomic operation. There is a window when the file has wrong permissions. Also, you don't check the return value of chmod(). Maybe chmod first and then rename? -- Jaakko From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 12:32:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7949A93C; Tue, 20 Nov 2012 12:32:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A04D8FC12; Tue, 20 Nov 2012 12:32:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKCWJSZ017835; Tue, 20 Nov 2012 12:32:19 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKCWIx7017819; Tue, 20 Nov 2012 12:32:18 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201211201232.qAKCWIx7017819@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 20 Nov 2012 12:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243333 - in head/sys: dev/fdc geom geom/bde geom/cache geom/label geom/mountver geom/multipath geom/nop geom/sched vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 12:32:19 -0000 Author: jh Date: Tue Nov 20 12:32:18 2012 New Revision: 243333 URL: http://svnweb.freebsd.org/changeset/base/243333 Log: - Don't pass geom and provider names as format strings. - Add __printflike() attributes. - Remove an extra argument for the g_new_geomf() call in swapongeom_ev(). Reviewed by: pjd Modified: head/sys/dev/fdc/fdc.c head/sys/geom/bde/g_bde.c head/sys/geom/cache/g_cache.c head/sys/geom/geom.h head/sys/geom/geom_aes.c head/sys/geom/geom_dev.c head/sys/geom/geom_mbr.c head/sys/geom/geom_slice.c head/sys/geom/geom_slice.h head/sys/geom/label/g_label.c head/sys/geom/mountver/g_mountver.c head/sys/geom/multipath/g_multipath.c head/sys/geom/nop/g_nop.c head/sys/geom/sched/g_sched.c head/sys/vm/swap_pager.c Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/dev/fdc/fdc.c Tue Nov 20 12:32:18 2012 (r243333) @@ -865,7 +865,7 @@ fdc_worker(struct fdc_data *fdc) g_orphan_provider(fd->fd_provider, ENXIO); fd->fd_provider->flags |= G_PF_WITHER; fd->fd_provider = - g_new_providerf(fd->fd_geom, fd->fd_geom->name); + g_new_providerf(fd->fd_geom, "%s", fd->fd_geom->name); g_error_provider(fd->fd_provider, 0); g_topology_unlock(); return (fdc_biodone(fdc, ENXIO)); @@ -2011,7 +2011,7 @@ fd_attach2(void *arg, int flag) fd->fd_geom = g_new_geomf(&g_fd_class, "fd%d", device_get_unit(fd->dev)); - fd->fd_provider = g_new_providerf(fd->fd_geom, fd->fd_geom->name); + fd->fd_provider = g_new_providerf(fd->fd_geom, "%s", fd->fd_geom->name); fd->fd_geom->softc = fd; g_error_provider(fd->fd_provider, 0); } Modified: head/sys/geom/bde/g_bde.c ============================================================================== --- head/sys/geom/bde/g_bde.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/bde/g_bde.c Tue Nov 20 12:32:18 2012 (r243333) @@ -184,7 +184,7 @@ g_bde_create_geom(struct gctl_req *req, /* XXX: error check */ kproc_create(g_bde_worker, gp, &sc->thread, 0, 0, "g_bde %s", gp->name); - pp = g_new_providerf(gp, gp->name); + pp = g_new_providerf(gp, "%s", gp->name); pp->stripesize = kp->zone_cont; pp->stripeoffset = 0; pp->mediasize = sc->mediasize; Modified: head/sys/geom/cache/g_cache.c ============================================================================== --- head/sys/geom/cache/g_cache.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/cache/g_cache.c Tue Nov 20 12:32:18 2012 (r243333) @@ -502,7 +502,7 @@ g_cache_create(struct g_class *mp, struc return (NULL); } - gp = g_new_geomf(mp, md->md_name); + gp = g_new_geomf(mp, "%s", md->md_name); sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); sc->sc_type = type; sc->sc_bshift = bshift; Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/geom.h Tue Nov 20 12:32:18 2012 (r243333) @@ -271,8 +271,10 @@ int g_handleattr_int(struct bio *bp, con int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val); int g_handleattr_str(struct bio *bp, const char *attribute, const char *str); struct g_consumer * g_new_consumer(struct g_geom *gp); -struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...); -struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...); +struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...) + __printflike(2, 3); +struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...) + __printflike(2, 3); void g_resize_provider(struct g_provider *pp, off_t size); int g_retaste(struct g_class *mp); void g_spoil(struct g_provider *pp, struct g_consumer *cp); Modified: head/sys/geom/geom_aes.c ============================================================================== --- head/sys/geom/geom_aes.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/geom_aes.c Tue Nov 20 12:32:18 2012 (r243333) @@ -342,7 +342,7 @@ g_aes_taste(struct g_class *mp, struct g } } g_topology_lock(); - pp = g_new_providerf(gp, gp->name); + pp = g_new_providerf(gp, "%s", gp->name); pp->mediasize = mediasize - sectorsize; pp->sectorsize = sectorsize; g_error_provider(pp, 0); Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/geom_dev.c Tue Nov 20 12:32:18 2012 (r243333) @@ -176,7 +176,7 @@ g_dev_taste(struct g_class *mp, struct g g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name); g_topology_assert(); - gp = g_new_geomf(mp, pp->name); + gp = g_new_geomf(mp, "%s", pp->name); cp = g_new_consumer(gp); error = g_attach(cp, pp); KASSERT(error == 0, Modified: head/sys/geom/geom_mbr.c ============================================================================== --- head/sys/geom/geom_mbr.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/geom_mbr.c Tue Nov 20 12:32:18 2012 (r243333) @@ -483,8 +483,8 @@ g_mbrext_taste(struct g_class *mp, struc ((off_t)dp[0].dp_size) << 9ULL, sectorsize, "%*.*s%d", - strlen(gp->name) - 1, - strlen(gp->name) - 1, + (int)strlen(gp->name) - 1, + (int)strlen(gp->name) - 1, gp->name, slice + 5); g_topology_unlock(); Modified: head/sys/geom/geom_slice.c ============================================================================== --- head/sys/geom/geom_slice.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/geom_slice.c Tue Nov 20 12:32:18 2012 (r243333) @@ -390,7 +390,7 @@ g_slice_config(struct g_geom *gp, u_int sbuf_vprintf(sb, fmt, ap); va_end(ap); sbuf_finish(sb); - pp = g_new_providerf(gp, sbuf_data(sb)); + pp = g_new_providerf(gp, "%s", sbuf_data(sb)); pp2 = LIST_FIRST(&gp->consumer)->provider; pp->stripesize = pp2->stripesize; pp->stripeoffset = pp2->stripeoffset + offset; Modified: head/sys/geom/geom_slice.h ============================================================================== --- head/sys/geom/geom_slice.h Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/geom_slice.h Tue Nov 20 12:32:18 2012 (r243333) @@ -69,7 +69,7 @@ struct g_slicer { }; g_dumpconf_t g_slice_dumpconf; -int g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length, u_int sectorsize, const char *fmt, ...); +int g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length, u_int sectorsize, const char *fmt, ...) __printflike(7, 8); void g_slice_spoiled(struct g_consumer *cp); void g_slice_orphan(struct g_consumer *cp); #define G_SLICE_CONFIG_CHECK 0 Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/label/g_label.c Tue Nov 20 12:32:18 2012 (r243333) @@ -187,7 +187,7 @@ g_label_create(struct gctl_req *req, str gp->spoiled = g_label_spoiled; g_access(cp, -1, 0, 0); g_slice_config(gp, 0, G_SLICE_CONFIG_SET, (off_t)0, mediasize, - pp->sectorsize, name); + pp->sectorsize, "%s", name); G_LABEL_DEBUG(1, "Label for provider %s is %s.", pp->name, name); return (gp); } Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/mountver/g_mountver.c Tue Nov 20 12:32:18 2012 (r243333) @@ -250,7 +250,7 @@ g_mountver_create(struct gctl_req *req, return (EEXIST); } } - gp = g_new_geomf(mp, name); + gp = g_new_geomf(mp, "%s", name); sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); mtx_init(&sc->sc_mtx, "gmountver", NULL, MTX_DEF); TAILQ_INIT(&sc->sc_queue); @@ -262,7 +262,7 @@ g_mountver_create(struct gctl_req *req, gp->access = g_mountver_access; gp->dumpconf = g_mountver_dumpconf; - newpp = g_new_providerf(gp, gp->name); + newpp = g_new_providerf(gp, "%s", gp->name); newpp->mediasize = pp->mediasize; newpp->sectorsize = pp->sectorsize; Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/multipath/g_multipath.c Tue Nov 20 12:32:18 2012 (r243333) @@ -429,7 +429,7 @@ g_multipath_create(struct g_class *mp, s } } - gp = g_new_geomf(mp, md->md_name); + gp = g_new_geomf(mp, "%s", md->md_name); sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); mtx_init(&sc->sc_mtx, "multipath", NULL, MTX_DEF); memcpy(sc->sc_uuid, md->md_uuid, sizeof (sc->sc_uuid)); Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/nop/g_nop.c Tue Nov 20 12:32:18 2012 (r243333) @@ -215,7 +215,7 @@ g_nop_create(struct gctl_req *req, struc return (EEXIST); } } - gp = g_new_geomf(mp, name); + gp = g_new_geomf(mp, "%s", name); sc = g_malloc(sizeof(*sc), M_WAITOK); sc->sc_offset = offset; sc->sc_explicitsize = explicitsize; @@ -233,7 +233,7 @@ g_nop_create(struct gctl_req *req, struc gp->access = g_nop_access; gp->dumpconf = g_nop_dumpconf; - newpp = g_new_providerf(gp, gp->name); + newpp = g_new_providerf(gp, "%s", gp->name); newpp->mediasize = size; newpp->sectorsize = secsize; Modified: head/sys/geom/sched/g_sched.c ============================================================================== --- head/sys/geom/sched/g_sched.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/geom/sched/g_sched.c Tue Nov 20 12:32:18 2012 (r243333) @@ -1003,7 +1003,7 @@ g_sched_create(struct gctl_req *req, str } } - gp = g_new_geomf(mp, name); + gp = g_new_geomf(mp, "%s", name); dstgp = proxy ? pp->geom : gp; /* where do we link the provider */ sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); @@ -1029,7 +1029,7 @@ g_sched_create(struct gctl_req *req, str gp->access = g_sched_access; gp->dumpconf = g_sched_dumpconf; - newpp = g_new_providerf(dstgp, gp->name); + newpp = g_new_providerf(dstgp, "%s", gp->name); newpp->mediasize = pp->mediasize; newpp->sectorsize = pp->sectorsize; Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Nov 20 12:21:02 2012 (r243332) +++ head/sys/vm/swap_pager.c Tue Nov 20 12:32:18 2012 (r243333) @@ -2612,7 +2612,7 @@ swapongeom_ev(void *arg, int flags) } mtx_unlock(&sw_dev_mtx); if (gp == NULL) - gp = g_new_geomf(&g_swap_class, "swap", NULL); + gp = g_new_geomf(&g_swap_class, "swap"); cp = g_new_consumer(gp); g_attach(cp, pp); /* From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 12:43:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5F8FAEA0; Tue, 20 Nov 2012 12:43:12 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 228528FC12; Tue, 20 Nov 2012 12:43:10 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id 12so2470923wgr.31 for ; Tue, 20 Nov 2012 04:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=efdeaWj9lhvVdEPOUPkynFSzE8zXRmevFqty4rkcJ4c=; b=wgbHUkCue3YmXUV5VQ5eC0Ewx0Hqwn0IPr7FVqVBm9k5WBB4N8QE9LDAHvkBQDll/w 1EemqpgNtBSpQfu+IjfL5T58UmhziRMiZMHIEMO3uGdhuJYBCXr1Roc1LRjWDGQ+SEhx o6D89RweSl0xtR3PCLrZps4ox6bNyY4oppn0ggktGkiX6TX7HbViL/8DBa0og2P1VS/f joz8/nO+vPJXXSY6qYzbZ/ntskW0w9oFbFCTpMwhunMLAjX850Uc4Pb245rDlaVPU6QI g0GR4jEZnenTJJ6Tkdp5xTT5ldeDL7jRnikT5AiJgEUjTQV/LBiBSSViHB1rgkSezagG DuCw== Received: by 10.180.24.193 with SMTP id w1mr14207251wif.22.1353415390076; Tue, 20 Nov 2012 04:43:10 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPS id i2sm17615416wiw.3.2012.11.20.04.43.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 04:43:09 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 20 Nov 2012 13:43:08 +0100 From: Baptiste Daroussin To: Jaakko Heinonen Subject: Re: svn commit: r243328 - head/lib/libutil Message-ID: <20121120124307.GJ71195@ithaqua.etoilebsd.net> References: <201211200722.qAK7M7Im057617@svn.freebsd.org> <20121120122226.GA1828@a91-153-116-96.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYjDATHXTWnytHRU" Content-Disposition: inline In-Reply-To: <20121120122226.GA1828@a91-153-116-96.elisa-laajakaista.fi> 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 12:43:12 -0000 --zYjDATHXTWnytHRU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 20, 2012 at 02:22:26PM +0200, Jaakko Heinonen wrote: >=20 > Hi! >=20 > On 2012-11-20, Baptiste Daroussin wrote: > > change mode the group file to 0644 after a successfull rename(2) > >=20 > > int > > gr_mkdb(void) > > { > > - return (rename(tempname, group_file)); > > + int ret; > > + > > + ret =3D rename(tempname, group_file); > > + > > + if (ret =3D=3D 0) > > + chmod(group_file, 0644); > > + > > + return (ret); > > } >=20 > Rename+chmod is not an atomic operation. There is a window when the file > has wrong permissions. Also, you don't check the return value of > chmod(). Maybe chmod first and then rename? >=20 > --=20 > Jaakko Yes you are right chmod should probably be first. regards, Bapt --zYjDATHXTWnytHRU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCretsACgkQ8kTtMUmk6EwBDACbB16OGN7Ldql22OLC7wibz7H9 ECsAoL21HP7HC4tBF6Dej6jQM5bInlMZ =/UGf -----END PGP SIGNATURE----- --zYjDATHXTWnytHRU-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 13:07:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C95C46C7; Tue, 20 Nov 2012 13:07:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 539898FC0C; Tue, 20 Nov 2012 13:07:47 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAKD7c2u028790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Nov 2012 00:07:39 +1100 Date: Wed, 21 Nov 2012 00:07:38 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Attilio Rao Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs In-Reply-To: Message-ID: <20121120234822.J6178@besplex.bde.org> References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> <20121120230708.G6016@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=XbrRV/F5 c=1 sm=1 a=m-t6nEIf1F8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=t5VDnOqDOncA:10 a=6I5d2MoRAAAA:8 a=wMkmLcVF5XD_M-86SkUA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=kIvj0PshPjRlJRXl:21 a=aRJuftRBnZ_gBOK1:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 13:07:48 -0000 On Tue, 20 Nov 2012, Attilio Rao wrote: > On 11/20/12, Attilio Rao wrote: >> On 11/20/12, Bruce Evans wrote: >>> On Tue, 20 Nov 2012, Attilio Rao wrote: >>> >>>> On Tue, Nov 20, 2012 at 6:20 AM, Bruce Evans >>>> wrote: >>>>> On Mon, 19 Nov 2012, Attilio Rao wrote: >>>>> >>>>>> Log: >>>>>> r16312 is not any longer real since many years (likely since when VFS >>>>>> received granular locking) but the comment present in UFS has been >>>>>> copied all over other filesystems code incorrectly for several times. >>>>>> >>>>>> Removes comments that makes no sense now. >>>>> >>>>> >>>>> It still made sense (except for bitrot in the function name), but might >>>>> not >>>>> be true). The code made sense with it. Now the code makes no sense. >>>>> >>>>> >>>>>> Modified: head/sys/ufs/ffs/ffs_vfsops.c >>>>>> >>>>>> ============================================================================== >>>>>> --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 >>>>>> (r243310) >>>>>> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 >>>>>> (r243311) >>>>>> @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags >>>>>> ump = VFSTOUFS(mp); >>>>>> dev = ump->um_dev; >>>>>> fs = ump->um_fs; >>>>>> - >>>>>> - /* >>>>>> - * If this malloc() is performed after the getnewvnode() >>>>> >>>>> >>>>> This malloc() didn't match the code, which uses uma_zalloc(). Old >>>>> versions used MALLOC() in both the comment and the code. ffs's comment >>>>> was updated to say malloc() when the code was changed to use malloc(), >>>>> then rotted when the code was changed to use uma_zalloc(). In some >>>>> other file systems, the comment still said MALLOC(). >>>>> >>>>> >>>>>> - * it might block, leaving a vnode with a NULL v_data to be >>>>>> - * found by ffs_sync() if a sync happens to fire right then, >>>>>> - * which will cause a panic because ffs_sync() blindly >>>>>> - * dereferences vp->v_data (as well it should). >>>>>> - */ >>>>>> ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); >>>>>> >>>>>> /* Allocate a new vnode/inode. */ >>>>>> >>>>> >>>>> The code makes no sense now. The comment explains why ip is allocated >>>>> before vp, instead of in the natural, opposite order like it used to >>>>> be. Allocating things in an unnatural order requires extra code to >>>>> free ip when the allocation of vp fails. >>>> >>>> "Used to be" is very arguably. The code has been like its current form >>>> many more years than the opposite (16 against 3 I think). >>>> And the code makes perfectly sense if you know the history. So I don't >>>> agree with you. >>> >>> But it shouldn't be necessary to know the history of the code to >>> understand it. The code only makes sense if its comment is not removed, >>> or if you know the history of the code so that you can restore the >>> removed comment. However, if the comment makes no sense as you claim, >>> then the code that it it describes makes no sense. >> >> The "code that makes no sense" is basically the justification to have >> the allocation before the getnewvnode(). It makes no sense because the >> order makes no sense (you can allocate before or after getnewvnode(), >> you won't have v_data corruption as the comment claims). >> >> Hence the code makes no sense. > > Herm, s/code/comment. I think you are right that the comment makes no sense. A preemptible kernel may be preempted without it calling malloc() where it may block. Thus ffs_fsync() and anything else that looks at the inode must be doing something to avoid dereferencing v_data if the vnode is not fully constructed. This seems to be done by iterating over vnodes using MNT_VNODE_FOREACH_ACTIVE*() and not making incomplete vnodes active. ffs_fsync() still just blindly dereferences the inode. I think I am right that the code makes no sense. It is ordered like it is because placing the allocation of ip before the allocation of vp used to be enough to prevent v_data being dereferenced. This makes no sense when it isn't enough. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 13:27:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32FA2DFD; Tue, 20 Nov 2012 13:27:10 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 34A728FC0C; Tue, 20 Nov 2012 13:27:09 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so5655207lah.13 for ; Tue, 20 Nov 2012 05:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=NoZooaagrm81OBVc2kRWclAZfSJ8GKJmDIIWhAod3V8=; b=QAu5CKxT19Mfx8fhzb7HMVoczaUVgj3a3Zgp9eDWjV209KZSh1+61Pr9lNlwCk6fbr kHTCFHdPZ4MLRL6DmyFaZ0o3/Xp189JCIiquhcM0sy3SruCJlKfZ28NFBtb0V2rapq41 VQgxu+3o1zsNOR8TPP+GKtRSCJFH78u7fug78YEr1Rno7QPM/cXsSDBWFTC83zt1nmJA ZUfd8TGrfT+oGKEwWhB4TDqZnfLhMCy0PVqHjbpNXwJRbaaAdjcyNcuHrsrB8ViIMZYH q1fLZkzpBuEoLHRTLnt9qH7iT+OYlWAVOcsmyT596YdjvLFJkOCZONLNqeC5ZkVbgyLT WfaA== MIME-Version: 1.0 Received: by 10.112.98.37 with SMTP id ef5mr6510383lbb.84.1353418028065; Tue, 20 Nov 2012 05:27:08 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Tue, 20 Nov 2012 05:27:07 -0800 (PST) In-Reply-To: <20121120234822.J6178@besplex.bde.org> References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> <20121120230708.G6016@besplex.bde.org> <20121120234822.J6178@besplex.bde.org> Date: Tue, 20 Nov 2012 13:27:07 +0000 X-Google-Sender-Auth: B9xTgicB11pGlzZEzowSrwBXREk Message-ID: Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs From: Attilio Rao To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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: Tue, 20 Nov 2012 13:27:10 -0000 On 11/20/12, Bruce Evans wrote: > On Tue, 20 Nov 2012, Attilio Rao wrote: > >> On 11/20/12, Attilio Rao wrote: >>> On 11/20/12, Bruce Evans wrote: >>>> On Tue, 20 Nov 2012, Attilio Rao wrote: >>>> >>>>> On Tue, Nov 20, 2012 at 6:20 AM, Bruce Evans >>>>> wrote: >>>>>> On Mon, 19 Nov 2012, Attilio Rao wrote: >>>>>> >>>>>>> Log: >>>>>>> r16312 is not any longer real since many years (likely since when >>>>>>> VFS >>>>>>> received granular locking) but the comment present in UFS has been >>>>>>> copied all over other filesystems code incorrectly for several >>>>>>> times. >>>>>>> >>>>>>> Removes comments that makes no sense now. >>>>>> >>>>>> >>>>>> It still made sense (except for bitrot in the function name), but >>>>>> might >>>>>> not >>>>>> be true). The code made sense with it. Now the code makes no sense. >>>>>> >>>>>> >>>>>>> Modified: head/sys/ufs/ffs/ffs_vfsops.c >>>>>>> >>>>>>> ============================================================================== >>>>>>> --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 >>>>>>> (r243310) >>>>>>> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 >>>>>>> (r243311) >>>>>>> @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags >>>>>>> ump = VFSTOUFS(mp); >>>>>>> dev = ump->um_dev; >>>>>>> fs = ump->um_fs; >>>>>>> - >>>>>>> - /* >>>>>>> - * If this malloc() is performed after the getnewvnode() >>>>>> >>>>>> >>>>>> This malloc() didn't match the code, which uses uma_zalloc(). Old >>>>>> versions used MALLOC() in both the comment and the code. ffs's >>>>>> comment >>>>>> was updated to say malloc() when the code was changed to use >>>>>> malloc(), >>>>>> then rotted when the code was changed to use uma_zalloc(). In some >>>>>> other file systems, the comment still said MALLOC(). >>>>>> >>>>>> >>>>>>> - * it might block, leaving a vnode with a NULL v_data to be >>>>>>> - * found by ffs_sync() if a sync happens to fire right then, >>>>>>> - * which will cause a panic because ffs_sync() blindly >>>>>>> - * dereferences vp->v_data (as well it should). >>>>>>> - */ >>>>>>> ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); >>>>>>> >>>>>>> /* Allocate a new vnode/inode. */ >>>>>>> >>>>>> >>>>>> The code makes no sense now. The comment explains why ip is >>>>>> allocated >>>>>> before vp, instead of in the natural, opposite order like it used to >>>>>> be. Allocating things in an unnatural order requires extra code to >>>>>> free ip when the allocation of vp fails. >>>>> >>>>> "Used to be" is very arguably. The code has been like its current form >>>>> many more years than the opposite (16 against 3 I think). >>>>> And the code makes perfectly sense if you know the history. So I don't >>>>> agree with you. >>>> >>>> But it shouldn't be necessary to know the history of the code to >>>> understand it. The code only makes sense if its comment is not >>>> removed, >>>> or if you know the history of the code so that you can restore the >>>> removed comment. However, if the comment makes no sense as you claim, >>>> then the code that it it describes makes no sense. >>> >>> The "code that makes no sense" is basically the justification to have >>> the allocation before the getnewvnode(). It makes no sense because the >>> order makes no sense (you can allocate before or after getnewvnode(), >>> you won't have v_data corruption as the comment claims). >>> >>> Hence the code makes no sense. >> >> Herm, s/code/comment. > > I think you are right that the comment makes no sense. A preemptible > kernel may be preempted without it calling malloc() where it may block. > Thus ffs_fsync() and anything else that looks at the inode must be > doing something to avoid dereferencing v_data if the vnode is not fully > constructed. This seems to be done by iterating over vnodes using > MNT_VNODE_FOREACH_ACTIVE*() and not making incomplete vnodes active. > ffs_fsync() still just blindly dereferences the inode. > > I think I am right that the code makes no sense. It is ordered like > it is because placing the allocation of ip before the allocation of > vp used to be enough to prevent v_data being dereferenced. This makes > no sense when it isn't enough. In the past, before VFS got locking and kernel was single-threaded, the comment and code arranged in this way were sensitive and effective. As now this is not true anymore, there is no strict relationship between the getnewvnode() and sleeping points. It is important to remove stale comments because they confuse people, the porters and as you can see the code/comment has been cut&paste quite a bit around. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 13:38:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2353250; Tue, 20 Nov 2012 13:38:41 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5E0D28FC12; Tue, 20 Nov 2012 13:38:40 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so1556475wey.13 for ; Tue, 20 Nov 2012 05:38:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=b9b/Ucbj0s0UhbaL4nTbHb9u79XSKDR7INdsPq9nDsE=; b=OxRMs8zwd7Xz2llhBW5D9FNtmq4gVmaCJI4QqX3boK4+F4Ne32qtGeIUvyh1gSLlBp TAFaB6jmOKbJLdNBip8H6/W8xDHrKVCuBzkNjmQqNyIyP1PcV8s6grV/AN1Bol7+GHZW 675xKJgkthdSwbmO+z/KUEWToTOhU0uGjT3MdfQuO0P0DoXBGtAIqSbzdxkwktjsbvpU JCX/YnPvgx/KOJ7HnYVchTzrsEAnCpldW+QJFVzQJDBKDyWgf772Qr1m5bASqdQxc0cK HLV5XOKFnC3jm02Vd15et+gtBXSMFEHNCK3NzIK0zMDwuZwl55oD7Tuo2KN34PndTQiS co7Q== Received: by 10.216.226.213 with SMTP id b63mr3501989weq.183.1353418719307; Tue, 20 Nov 2012 05:38:39 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPS id en20sm20052691wid.4.2012.11.20.05.38.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 05:38:38 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 20 Nov 2012 14:38:37 +0100 From: Baptiste Daroussin To: Jaakko Heinonen Subject: Re: svn commit: r243328 - head/lib/libutil Message-ID: <20121120133837.GK71195@ithaqua.etoilebsd.net> References: <201211200722.qAK7M7Im057617@svn.freebsd.org> <20121120122226.GA1828@a91-153-116-96.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/ZYM6PqDyfNytx60" Content-Disposition: inline In-Reply-To: <20121120122226.GA1828@a91-153-116-96.elisa-laajakaista.fi> 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 13:38:42 -0000 --/ZYM6PqDyfNytx60 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 20, 2012 at 02:22:26PM +0200, Jaakko Heinonen wrote: >=20 > Hi! >=20 > On 2012-11-20, Baptiste Daroussin wrote: > > change mode the group file to 0644 after a successfull rename(2) > >=20 > > int > > gr_mkdb(void) > > { > > - return (rename(tempname, group_file)); > > + int ret; > > + > > + ret =3D rename(tempname, group_file); > > + > > + if (ret =3D=3D 0) > > + chmod(group_file, 0644); > > + > > + return (ret); > > } >=20 > Rename+chmod is not an atomic operation. There is a window when the file > has wrong permissions. Also, you don't check the return value of > chmod(). Maybe chmod first and then rename? >=20 > --=20 > Jaakko Does this looks better to you? http://people.freebsd.org/~bapt/gr_util.diff regards, Bapt --/ZYM6PqDyfNytx60 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCrh90ACgkQ8kTtMUmk6EzfsQCfVkPtjjtCQ+dtDWdHuiLSUv1I PrEAn1RGIPNR7vctapc25JWf3daeIChw =sc/T -----END PGP SIGNATURE----- --/ZYM6PqDyfNytx60-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 13:53:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD4309E2; Tue, 20 Nov 2012 13:53:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id D16438FC16; Tue, 20 Nov 2012 13:53:05 +0000 (UTC) Received: from mail28.syd.optusnet.com.au (mail28.syd.optusnet.com.au [211.29.133.169]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAKDqxWW029907; Wed, 21 Nov 2012 00:52:59 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail28.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAKDqlTi023074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Nov 2012 00:52:50 +1100 Date: Wed, 21 Nov 2012 00:52:47 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Hay Subject: Re: svn commit: r243228 - head/etc In-Reply-To: <20121120105858.GA73018@zibbi.meraka.csir.co.za> Message-ID: <20121121002013.S6273@besplex.bde.org> References: <201211181421.qAIEL5KT042019@svn.freebsd.org> <20121120105858.GA73018@zibbi.meraka.csir.co.za> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=fbv1UDsF c=1 sm=1 a=oqJYCRs2r9kA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=lBvS7PFwMUkA:10 a=TzaL9rleAAAA:8 a=HdQexq2s1fwZG_iFNzIA:9 a=CjuIK1q_8ugA:10 a=B2ksryrJphYA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: Chris Rees , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 13:53:07 -0000 On Tue, 20 Nov 2012, John Hay wrote: > On Sun, Nov 18, 2012 at 02:21:05PM +0000, Chris Rees wrote: >> Log: >> cp -R misses out dotfiles; use pax instead to copy file hierarchies >> >> PR: conf/99721 (based on) >> Submitted by: Florian Zavatzki >> Approved by: hrs >> MFC after: 1 month >> >> Modified: >> head/etc/rc.initdiskless >> >> Modified: head/etc/rc.initdiskless >> ============================================================================== >> --- head/etc/rc.initdiskless Sun Nov 18 14:05:28 2012 (r243227) >> +++ head/etc/rc.initdiskless Sun Nov 18 14:21:05 2012 (r243228) >> @@ -354,7 +354,7 @@ for i in ${templates} ; do >> subdir=${j##*/} >> if [ -d $j -a ! -f $j.cpio.gz ]; then >> create_md $subdir >> - cp -Rp $j/ /$subdir >> + (cd $j && pax -rw . /$subdir) >> fi >> done >> for j in /conf/$i/*.cpio.gz ; do > > Have you tested this on a diskless and readonly system? It looks like pax > need to write something in /tmp and it might not be writeable yet. I got > an error, after the first of /bin/pax not found and having to add that to > the list of files needed. It uses mkstemp(3), normally in /tmp but it honors $TMPDIR. It seems to always create 1 temporary file (even for copying a single regular file), and sometimes 2 temporary files. Both of the temporary files seem to be to hold metadata for file times and hashes, in case it is too large for memory. cp -Rp probably needs to do the same (except it is imperfect to unnecessarily assume that /tmp is writable), to fix its link and timestamp handling. BTW, I think it is a large bug that ed and vi create temporary files even before you change anything. Even view(1) (vi -R) wants to scribble on /var/tmp/vi.recover. At least it doesn't refuse to start if this is not writeable. ed(1) is considerably more broken. It - hard codes /tmp and doesn't use _PATH_TMP or honor $TMPDIR - always scribbles in /tmp - refuses to start if /tmp is not writeable. This makes ed(1) wlays broken in single user shells until '/' is mounted rw, although ed is the only editor that is sure to be there and the reason for using a single user shell is often that there is a problem with mounting '/' rw. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 13:54:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5077AB77; Tue, 20 Nov 2012 13:54:39 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id AD4608FC0C; Tue, 20 Nov 2012 13:54:38 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id B8BAB1397DD; Tue, 20 Nov 2012 15:54:33 +0200 (EET) Date: Tue, 20 Nov 2012 15:54:32 +0200 From: Jaakko Heinonen To: Baptiste Daroussin Subject: Re: svn commit: r243328 - head/lib/libutil Message-ID: <20121120135432.GA1799@a91-153-116-96.elisa-laajakaista.fi> References: <201211200722.qAK7M7Im057617@svn.freebsd.org> <20121120122226.GA1828@a91-153-116-96.elisa-laajakaista.fi> <20121120133837.GK71195@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121120133837.GK71195@ithaqua.etoilebsd.net> 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 13:54:39 -0000 On 2012-11-20, Baptiste Daroussin wrote: > Does this looks better to you? > http://people.freebsd.org/~bapt/gr_util.diff Yes. Thank you. -- Jaakko From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 14:03:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08EA1F5C; Tue, 20 Nov 2012 14:03:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E20588FC0C; Tue, 20 Nov 2012 14:03:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKE39l0032118; Tue, 20 Nov 2012 14:03:09 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKE39AM032117; Tue, 20 Nov 2012 14:03:09 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211201403.qAKE39AM032117@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 20 Nov 2012 14:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243334 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 14:03:10 -0000 Author: bapt Date: Tue Nov 20 14:03:09 2012 New Revision: 243334 URL: http://svnweb.freebsd.org/changeset/base/243334 Log: only rename(2) after chmod(2) has succeed report error if chmod(2) fails Reported by: jh Modified: head/lib/libutil/gr_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Tue Nov 20 12:32:18 2012 (r243333) +++ head/lib/libutil/gr_util.c Tue Nov 20 14:03:09 2012 (r243334) @@ -318,14 +318,10 @@ gr_copy(int ffd, int tfd, const struct g int gr_mkdb(void) { - int ret; + if (chmod(tempname, 0644) != 0) + return (-1); - ret = rename(tempname, group_file); - - if (ret == 0) - chmod(group_file, 0644); - - return (ret); + return (rename(tempname, group_file)); } /* From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 14:05:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0F8119A; Tue, 20 Nov 2012 14:05:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A6C5D8FC18; Tue, 20 Nov 2012 14:05:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKE5kKh032692; Tue, 20 Nov 2012 14:05:46 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKE5kK6032691; Tue, 20 Nov 2012 14:05:46 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211201405.qAKE5kK6032691@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 20 Nov 2012 14:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243335 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 14:05:46 -0000 Author: bapt Date: Tue Nov 20 14:05:46 2012 New Revision: 243335 URL: http://svnweb.freebsd.org/changeset/base/243335 Log: In NIS mode first chmod(2) the temporary file and is succeed then rename(2) Modified: head/usr.sbin/pw/pw_nis.c Modified: head/usr.sbin/pw/pw_nis.c ============================================================================== --- head/usr.sbin/pw/pw_nis.c Tue Nov 20 14:03:09 2012 (r243334) +++ head/usr.sbin/pw/pw_nis.c Tue Nov 20 14:05:46 2012 (r243335) @@ -66,10 +66,10 @@ pw_nisupdate(const char * path, struct p pw_fini(); err(1, "pw_copy()"); } + if (chmod(pw_tempname(), 0644) == -1) + err(1, "chmod()"); if (rename(pw_tempname(), path) == -1) err(1, "rename()"); - if (chmod(path, 0644) == -1) - err(1, "chmod()"); free(pw); pw_fini(); From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 14:09:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0271C383; Tue, 20 Nov 2012 14:09:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DBA928FC08; Tue, 20 Nov 2012 14:09:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKE9bdq033464; Tue, 20 Nov 2012 14:09:37 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKE9blU033463; Tue, 20 Nov 2012 14:09:37 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211201409.qAKE9blU033463@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 20 Nov 2012 14:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243336 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 14:09:38 -0000 Author: ae Date: Tue Nov 20 14:09:37 2012 New Revision: 243336 URL: http://svnweb.freebsd.org/changeset/base/243336 Log: Remove opt_inet.h, it isn't required here. MFC after: 1 week Modified: head/sys/netinet6/ip6_mroute.c Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Tue Nov 20 14:05:46 2012 (r243335) +++ head/sys/netinet6/ip6_mroute.c Tue Nov 20 14:09:37 2012 (r243336) @@ -81,7 +81,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_inet.h" #include "opt_inet6.h" #include From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 14:11:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C76C7517; Tue, 20 Nov 2012 14:11:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A9EDE8FC0C; Tue, 20 Nov 2012 14:11:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKEBRdP033871; Tue, 20 Nov 2012 14:11:27 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKEBRxN033870; Tue, 20 Nov 2012 14:11:27 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211201411.qAKEBRxN033870@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 20 Nov 2012 14:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243337 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 14:11:28 -0000 Author: ae Date: Tue Nov 20 14:11:27 2012 New Revision: 243337 URL: http://svnweb.freebsd.org/changeset/base/243337 Log: Connect ip6_mroute kernel module to the build. MFC after: 1 week Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Nov 20 14:09:37 2012 (r243336) +++ head/sys/modules/Makefile Tue Nov 20 14:11:27 2012 (r243337) @@ -150,6 +150,7 @@ SUBDIR= \ ${_ipfw} \ ipfw_nat \ ${_ipmi} \ + ip6_mroute_mod \ ip_mroute_mod \ ${_ips} \ ${_ipw} \ From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 14:11:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AA2D686; Tue, 20 Nov 2012 14:11:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 62D8D8FC16; Tue, 20 Nov 2012 14:11:46 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qAKEBb8E052568; Tue, 20 Nov 2012 16:11:37 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qAKEBb8E052568 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qAKEBbxX052567; Tue, 20 Nov 2012 16:11:37 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Nov 2012 16:11:37 +0200 From: Konstantin Belousov To: Attilio Rao Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs Message-ID: <20121120141137.GX73505@kib.kiev.ua> References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> <20121120230708.G6016@besplex.bde.org> <20121120234822.J6178@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7GRKew+LPhG+z9nO" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 14:11:47 -0000 --7GRKew+LPhG+z9nO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 20, 2012 at 01:27:07PM +0000, Attilio Rao wrote: > On 11/20/12, Bruce Evans wrote: > > On Tue, 20 Nov 2012, Attilio Rao wrote: > > > >> On 11/20/12, Attilio Rao wrote: > >>> On 11/20/12, Bruce Evans wrote: > >>>> On Tue, 20 Nov 2012, Attilio Rao wrote: > >>>> > >>>>> On Tue, Nov 20, 2012 at 6:20 AM, Bruce Evans > >>>>> wrote: > >>>>>> On Mon, 19 Nov 2012, Attilio Rao wrote: > >>>>>> > >>>>>>> Log: > >>>>>>> r16312 is not any longer real since many years (likely since when > >>>>>>> VFS > >>>>>>> received granular locking) but the comment present in UFS has be= en > >>>>>>> copied all over other filesystems code incorrectly for several > >>>>>>> times. > >>>>>>> > >>>>>>> Removes comments that makes no sense now. > >>>>>> > >>>>>> > >>>>>> It still made sense (except for bitrot in the function name), but > >>>>>> might > >>>>>> not > >>>>>> be true). The code made sense with it. Now the code makes no sen= se. > >>>>>> > >>>>>> > >>>>>>> Modified: head/sys/ufs/ffs/ffs_vfsops.c > >>>>>>> > >>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > >>>>>>> --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 > >>>>>>> (r243310) > >>>>>>> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 > >>>>>>> (r243311) > >>>>>>> @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags > >>>>>>> ump =3D VFSTOUFS(mp); > >>>>>>> dev =3D ump->um_dev; > >>>>>>> fs =3D ump->um_fs; > >>>>>>> - > >>>>>>> - /* > >>>>>>> - * If this malloc() is performed after the getnewvnode() > >>>>>> > >>>>>> > >>>>>> This malloc() didn't match the code, which uses uma_zalloc(). Old > >>>>>> versions used MALLOC() in both the comment and the code. ffs's > >>>>>> comment > >>>>>> was updated to say malloc() when the code was changed to use > >>>>>> malloc(), > >>>>>> then rotted when the code was changed to use uma_zalloc(). In some > >>>>>> other file systems, the comment still said MALLOC(). > >>>>>> > >>>>>> > >>>>>>> - * it might block, leaving a vnode with a NULL v_data to = be > >>>>>>> - * found by ffs_sync() if a sync happens to fire right th= en, > >>>>>>> - * which will cause a panic because ffs_sync() blindly > >>>>>>> - * dereferences vp->v_data (as well it should). > >>>>>>> - */ > >>>>>>> ip =3D uma_zalloc(uma_inode, M_WAITOK | M_ZERO); > >>>>>>> > >>>>>>> /* Allocate a new vnode/inode. */ > >>>>>>> > >>>>>> > >>>>>> The code makes no sense now. The comment explains why ip is > >>>>>> allocated > >>>>>> before vp, instead of in the natural, opposite order like it used = to > >>>>>> be. Allocating things in an unnatural order requires extra code = to > >>>>>> free ip when the allocation of vp fails. > >>>>> > >>>>> "Used to be" is very arguably. The code has been like its current f= orm > >>>>> many more years than the opposite (16 against 3 I think). > >>>>> And the code makes perfectly sense if you know the history. So I do= n't > >>>>> agree with you. > >>>> > >>>> But it shouldn't be necessary to know the history of the code to > >>>> understand it. The code only makes sense if its comment is not > >>>> removed, > >>>> or if you know the history of the code so that you can restore the > >>>> removed comment. However, if the comment makes no sense as you clai= m, > >>>> then the code that it it describes makes no sense. > >>> > >>> The "code that makes no sense" is basically the justification to have > >>> the allocation before the getnewvnode(). It makes no sense because the > >>> order makes no sense (you can allocate before or after getnewvnode(), > >>> you won't have v_data corruption as the comment claims). > >>> > >>> Hence the code makes no sense. > >> > >> Herm, s/code/comment. > > > > I think you are right that the comment makes no sense. A preemptible > > kernel may be preempted without it calling malloc() where it may block. > > Thus ffs_fsync() and anything else that looks at the inode must be > > doing something to avoid dereferencing v_data if the vnode is not fully > > constructed. This seems to be done by iterating over vnodes using > > MNT_VNODE_FOREACH_ACTIVE*() and not making incomplete vnodes active. > > ffs_fsync() still just blindly dereferences the inode. > > > > I think I am right that the code makes no sense. It is ordered like > > it is because placing the allocation of ip before the allocation of > > vp used to be enough to prevent v_data being dereferenced. This makes > > no sense when it isn't enough. >=20 > In the past, before VFS got locking and kernel was single-threaded, > the comment and code arranged in this way were sensitive and > effective. > As now this is not true anymore, there is no strict relationship > between the getnewvnode() and sleeping points. > It is important to remove stale comments because they confuse people, > the porters and as you can see the code/comment has been cut&paste > quite a bit around. >=20 Putting the issue of the comment making no sense at all aside, which is true but tangential to what I want to note. Although malloc(9) is not ordered with the vnode locks in the lock order, it is still good practice to not perform allocations under the vnode lock. The reason is that pagedaemon might need to clean and write pages, in particular, belonging to the vnodes. Generally, if you own vnode lock and do something which might kick pagedaemon, you are creating troubles for pagedaemon, which would attempt to lock the vnode with timeout, spending the precious time waiting for lock it cannot obtain. This is less an issue for the new vnode instantiation locations, because vnode cannot have resident pages yet. But it is good to follow the same pattern anywhere. --7GRKew+LPhG+z9nO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQq4+YAAoJEJDCuSvBvK1BRrYP/1O385SsRvkGyQN8TfTv2y0N BwfxUwaipWO9u9viEuDyrjPaIim3Bsh0fQdFaAQIio9C82jBxOCBIdedPoJsem5b GFzQ+CPPoHPpFuxxjYvozdzxSYw5X06TNh51eiBQn6ZcJLzfhnGHsfnZ3jhzxO6V CAtWXqndfP/NJOwT2chIeTo+cqNARbkCcLNvTjOEFVPYDHo0ijsh5a9KvMPxXioJ 5u14iRBZd0VzW0PriRe+HZUIKVbxAXMcKj9bn/3LlzgVtV5TFW4fkP9Y9LUVeP/J c1NK3Hxn57+9aon4+vxRjzXAVvod8WeOCwcp+PWKDVFPemTMk9eCdeQwP1VVcYhY HdbZvFGkjilMEGIVb4b8B+vJSAfZ1JISitNsyPOpVr6AplRKy6F7v5tXIWjGr4UH CaTElE8ANFBqzy5n3/x6+oUaLKFywZGaAEAafZ7NSqBD9WKzTS3IBMQRFwcBNUFn D+0PpvtlkbtlqtZvvw6NsGdM2AapBFtafLwxPULlJPlaaFYN3AbzDinFUUM23rPd SHnI0OEGjhHXbhUK/gfT/lw2qvFKkxcQTzbZbG5yicW+9IKocuknK1hVUIqNSaJb OyxTK3tk0HapGDMuTHiXrDW2QM5lkxuTyk0lMTA9vjOkpcCPd8wn5ggwvcg9WOau in9ebKya+iZfA1KgkX23 =vt9T -----END PGP SIGNATURE----- --7GRKew+LPhG+z9nO-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 14:13:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA17D91B; Tue, 20 Nov 2012 14:13:59 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C11C58FC0C; Tue, 20 Nov 2012 14:13:58 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so5704737lah.13 for ; Tue, 20 Nov 2012 06:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=zxCP/2yyXugqqoTdutzNEQJOQkrYK8xrIGoQC7eDmdA=; b=XWClroWTFlW/ppCi3ndeRYTwagqtz/VBm/XS8Rhp/jhoWiF+D6tI762PMu3C0uq9/D 68CIw5w6TySEkOQSgKJvq9OKohD3snM4XsqOq6D1v+UIjld1XWNylwR2B1zajefy9Uqi JDahzk3NkLkqjci5HxWE3V6J3pEhsy8TyxzeAYG3Adgrrt1FHAfLKHoASwnR6Ne6fZD7 GocpnxFY2SYYME0RIWnMViEANkQrWTHV4Ge/vXLvdGwsrY36/BqX55U2nr5hW3HSsM9L wwX5TPEoi9x6u0H+j9qDbaTngTTI7hgjqB5PluK0w3i9cESWpP0yoFCUpfhM2hZ3FXH1 8U/Q== MIME-Version: 1.0 Received: by 10.112.28.98 with SMTP id a2mr6350913lbh.110.1353420837470; Tue, 20 Nov 2012 06:13:57 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Tue, 20 Nov 2012 06:13:57 -0800 (PST) In-Reply-To: <20121120141137.GX73505@kib.kiev.ua> References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> <20121120230708.G6016@besplex.bde.org> <20121120234822.J6178@besplex.bde.org> <20121120141137.GX73505@kib.kiev.ua> Date: Tue, 20 Nov 2012 14:13:57 +0000 X-Google-Sender-Auth: RJFb9UFvLiKm-8PzwETwvzOKf_k Message-ID: Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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: Tue, 20 Nov 2012 14:13:59 -0000 On 11/20/12, Konstantin Belousov wrote: > On Tue, Nov 20, 2012 at 01:27:07PM +0000, Attilio Rao wrote: >> On 11/20/12, Bruce Evans wrote: >> > On Tue, 20 Nov 2012, Attilio Rao wrote: >> > >> >> On 11/20/12, Attilio Rao wrote: >> >>> On 11/20/12, Bruce Evans wrote: >> >>>> On Tue, 20 Nov 2012, Attilio Rao wrote: >> >>>> >> >>>>> On Tue, Nov 20, 2012 at 6:20 AM, Bruce Evans >> >>>>> wrote: >> >>>>>> On Mon, 19 Nov 2012, Attilio Rao wrote: >> >>>>>> >> >>>>>>> Log: >> >>>>>>> r16312 is not any longer real since many years (likely since >> >>>>>>> when >> >>>>>>> VFS >> >>>>>>> received granular locking) but the comment present in UFS has >> >>>>>>> been >> >>>>>>> copied all over other filesystems code incorrectly for several >> >>>>>>> times. >> >>>>>>> >> >>>>>>> Removes comments that makes no sense now. >> >>>>>> >> >>>>>> >> >>>>>> It still made sense (except for bitrot in the function name), but >> >>>>>> might >> >>>>>> not >> >>>>>> be true). The code made sense with it. Now the code makes no >> >>>>>> sense. >> >>>>>> >> >>>>>> >> >>>>>>> Modified: head/sys/ufs/ffs/ffs_vfsops.c >> >>>>>>> >> >>>>>>> ============================================================================== >> >>>>>>> --- head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 21:58:14 2012 >> >>>>>>> (r243310) >> >>>>>>> +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Nov 19 22:43:45 2012 >> >>>>>>> (r243311) >> >>>>>>> @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags >> >>>>>>> ump = VFSTOUFS(mp); >> >>>>>>> dev = ump->um_dev; >> >>>>>>> fs = ump->um_fs; >> >>>>>>> - >> >>>>>>> - /* >> >>>>>>> - * If this malloc() is performed after the getnewvnode() >> >>>>>> >> >>>>>> >> >>>>>> This malloc() didn't match the code, which uses uma_zalloc(). Old >> >>>>>> versions used MALLOC() in both the comment and the code. ffs's >> >>>>>> comment >> >>>>>> was updated to say malloc() when the code was changed to use >> >>>>>> malloc(), >> >>>>>> then rotted when the code was changed to use uma_zalloc(). In >> >>>>>> some >> >>>>>> other file systems, the comment still said MALLOC(). >> >>>>>> >> >>>>>> >> >>>>>>> - * it might block, leaving a vnode with a NULL v_data to >> >>>>>>> be >> >>>>>>> - * found by ffs_sync() if a sync happens to fire right >> >>>>>>> then, >> >>>>>>> - * which will cause a panic because ffs_sync() blindly >> >>>>>>> - * dereferences vp->v_data (as well it should). >> >>>>>>> - */ >> >>>>>>> ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); >> >>>>>>> >> >>>>>>> /* Allocate a new vnode/inode. */ >> >>>>>>> >> >>>>>> >> >>>>>> The code makes no sense now. The comment explains why ip is >> >>>>>> allocated >> >>>>>> before vp, instead of in the natural, opposite order like it used >> >>>>>> to >> >>>>>> be. Allocating things in an unnatural order requires extra code >> >>>>>> to >> >>>>>> free ip when the allocation of vp fails. >> >>>>> >> >>>>> "Used to be" is very arguably. The code has been like its current >> >>>>> form >> >>>>> many more years than the opposite (16 against 3 I think). >> >>>>> And the code makes perfectly sense if you know the history. So I >> >>>>> don't >> >>>>> agree with you. >> >>>> >> >>>> But it shouldn't be necessary to know the history of the code to >> >>>> understand it. The code only makes sense if its comment is not >> >>>> removed, >> >>>> or if you know the history of the code so that you can restore the >> >>>> removed comment. However, if the comment makes no sense as you >> >>>> claim, >> >>>> then the code that it it describes makes no sense. >> >>> >> >>> The "code that makes no sense" is basically the justification to have >> >>> the allocation before the getnewvnode(). It makes no sense because >> >>> the >> >>> order makes no sense (you can allocate before or after getnewvnode(), >> >>> you won't have v_data corruption as the comment claims). >> >>> >> >>> Hence the code makes no sense. >> >> >> >> Herm, s/code/comment. >> > >> > I think you are right that the comment makes no sense. A preemptible >> > kernel may be preempted without it calling malloc() where it may block. >> > Thus ffs_fsync() and anything else that looks at the inode must be >> > doing something to avoid dereferencing v_data if the vnode is not fully >> > constructed. This seems to be done by iterating over vnodes using >> > MNT_VNODE_FOREACH_ACTIVE*() and not making incomplete vnodes active. >> > ffs_fsync() still just blindly dereferences the inode. >> > >> > I think I am right that the code makes no sense. It is ordered like >> > it is because placing the allocation of ip before the allocation of >> > vp used to be enough to prevent v_data being dereferenced. This makes >> > no sense when it isn't enough. >> >> In the past, before VFS got locking and kernel was single-threaded, >> the comment and code arranged in this way were sensitive and >> effective. >> As now this is not true anymore, there is no strict relationship >> between the getnewvnode() and sleeping points. >> It is important to remove stale comments because they confuse people, >> the porters and as you can see the code/comment has been cut&paste >> quite a bit around. >> > > Putting the issue of the comment making no sense at all aside, which is > true but tangential to what I want to note. > > Although malloc(9) is not ordered with the vnode locks in the lock > order, it is still good practice to not perform allocations under the > vnode lock. The reason is that pagedaemon might need to clean and write > pages, in particular, belonging to the vnodes. Generally, if you own > vnode lock and do something which might kick pagedaemon, you are creating > troubles for pagedaemon, which would attempt to lock the vnode with > timeout, spending the precious time waiting for lock it cannot obtain. > > This is less an issue for the new vnode instantiation locations, because > vnode cannot have resident pages yet. But it is good to follow the same > pattern anywhere. Yes, I completely agree. Infact the code is not changed also to avoid pagedaemon hosing. However this is a different situation respect a "if you allocate while you hold the lock you will get a deadlock/race/corruption". Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 14:56:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B88AC5B for ; Tue, 20 Nov 2012 14:56:46 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5CB128FC15 for ; Tue, 20 Nov 2012 14:56:44 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so5751739lah.13 for ; Tue, 20 Nov 2012 06:56:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=nOjrUGDHvF6VJafK7ZuY7ae2zzYgy8ChbmUuWIV0Qlc=; b=Yp6rQoXV0iL7ZKkCs9uS/fJm4w18j9yDSMj46P4RBkOA8lJkMFLcjhIXvfdY7NEbtw mY/cPsqFDDF2Zd4Jrs0++5buDS0m9MWxcmqRa6CaJzoPCsknGPJbt2HcQOLcZRKeItR4 qVCVfjT6A7B7dQNdbstKF+qN+ITZ70re/0DoajUa9Edd+F74SUdtBkIDfZWqo4fAbcCs +thiDrcP8R5kaOhaszKtR1oS0hICgLOQtJ4VO/8wnpL74mzVS72peySxCJcfqSLYTVLF y7JwX856nknWAWIUHgU8isOUDWCNJ8sNlW3dfKdCXwkYNLfijQ1qsXVWuyuoPgXJ2byJ cDZA== Received: by 10.152.114.65 with SMTP id je1mr15068740lab.33.1353423403854; Tue, 20 Nov 2012 06:56:43 -0800 (PST) Received: from dhcp170-82-red.yandex.net ([2a02:6b8:0:401:8b3:d239:79b2:7bd7]) by mx.google.com with ESMTPS id p5sm1093206lbh.2.2012.11.20.06.56.42 (version=SSLv3 cipher=OTHER); Tue, 20 Nov 2012 06:56:42 -0800 (PST) Sender: Andrey Zonov Message-ID: <50AB9A26.8060807@FreeBSD.org> Date: Tue, 20 Nov 2012 18:56:38 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r242847 - in head/sys: i386/include kern References: <201211100208.qAA28e0v004842@svn.freebsd.org> <509DC25E.5030306@mu.org> <509E3162.5020702@FreeBSD.org> <509E7E7C.9000104@mu.org> <509E830D.5080006@mu.org> <509E847E.30509@mu.org> <509E8930.50800@mu.org> <509EA869.6030407@freebsd.org> <509ED439.8090607@mu.org> <509EDD93.3020001@freebsd.org> <50A8EB3E.6060807@FreeBSD.org> <50A8ECEE.9020908@freebsd.org> In-Reply-To: <50A8ECEE.9020908@freebsd.org> X-Enigmail-Version: 1.4.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB6ECCE4BE0691CAC46EE755B" X-Gm-Message-State: ALoCoQkbmC8MIj2zGS8HLt9aIOWVhCYUsCGaEMvQ3p/1aO5yA9Be60UQiEp7vnR1oaiCbnguDwNF Cc: src-committers@freebsd.org, Eitan Adler , Peter Wemm , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 14:56:46 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB6ECCE4BE0691CAC46EE755B Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 11/18/12 6:13 PM, Andre Oppermann wrote: > On 18.11.2012 15:05, Andrey Zonov wrote: >> On 11/11/12 3:04 AM, Andre Oppermann wrote: >>> On 10.11.2012 23:24, Alfred Perlstein wrote: >>>> On 11/10/12 11:18 AM, Andre Oppermann wrote: >>>>> On 10.11.2012 19:04, Peter Wemm wrote: >>>>>> This is complicated but we need a simple user visible view of it. = It >>>>>> really needs to be something like "nmbclusters defaults to 6% of >>>>>> physical ram, with machine dependent limits". The MD limits are b= ad >>>>>> enough, and using bogo-units like "maxusers" just makes it worse. >>>>> >>>>> Yes, that would be optimal. >>>>> >>>> No it would not. >>>> >>>> I used to be able to tell people "hey just try increasing maxusers" >>>> and they would and suddenly the >>>> box would be OK. >>>> >>>> Now I'll have to remember 3,4,5,10,20x tunable to increase? >>> >>> No. The whole mbuf and cluster stuff isn't allocated or reserved >>> at boot time. We simply need a limit to prevent it from exhausting >>> all available kvm / physical memory whichever is less. >>> >> >> For now, we have limit which does not allow to run even one igb(4) NIC= >> in 9k jumbo configuration. >=20 > My patch for mbuf* zone auto-sizing does fix that, or not? >=20 Are you talking about r242910? I have not tried it. --=20 Andrey Zonov --------------enigB6ECCE4BE0691CAC46EE755B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJQq5opAAoJEBWLemxX/CvTB8MH/Avd++t3itcuUYqVz1te6t2a 0bFIAid7UzySvk8pLjNUnLkXJsfc/P7p2A5QTYg2gbwXoQ+Fp2N2CxYoWBpAymba jzg2ZFvoihf3/pmKQfxx5T2P7EBWwnmSipVvU83n9I452f2m3nu4s+PLOsY0NOvC 8lGqLSAOOkbwvhUur6WKK4YeUC/F6K7uxEQaig7ibrkj86o9hRz0zY8+inBN1Pih eYnPPFWk7Bu1zNd85uBJDGw4xakycKk+iEEPaxCBouv9cplr2mqtEqG9Tqo5swIa Nl4+72dokqm0/fT3F4DiyZmnmOxny5INvGeJ09aquplZqvOeKv1zeNkOTjHmioE= =8Ugw -----END PGP SIGNATURE----- --------------enigB6ECCE4BE0691CAC46EE755B-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 14:57:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F1FBDE1; Tue, 20 Nov 2012 14:57:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail28.syd.optusnet.com.au (mail28.syd.optusnet.com.au [211.29.133.169]) by mx1.freebsd.org (Postfix) with ESMTP id CBBCD8FC12; Tue, 20 Nov 2012 14:57:49 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail28.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAKEvjXm018418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Nov 2012 01:57:46 +1100 Date: Wed, 21 Nov 2012 01:57:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Attilio Rao Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs In-Reply-To: Message-ID: <20121121012935.W6568@besplex.bde.org> References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> <20121120230708.G6016@besplex.bde.org> <20121120234822.J6178@besplex.bde.org> <20121120141137.GX73505@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=ZalFrbpA c=1 sm=1 a=m-t6nEIf1F8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=t5VDnOqDOncA:10 a=pGLkceISAAAA:8 a=piAdYN-yxvSvsG-XYukA:9 a=CjuIK1q_8ugA:10 a=MSl-tDqOz04A:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 14:57:50 -0000 On Tue, 20 Nov 2012, Attilio Rao wrote: > On 11/20/12, Konstantin Belousov wrote: >> On Tue, Nov 20, 2012 at 01:27:07PM +0000, Attilio Rao wrote: >>> On 11/20/12, Bruce Evans wrote: >>>> ... >>>> I think I am right that the code makes no sense. It is ordered like >>>> it is because placing the allocation of ip before the allocation of >>>> vp used to be enough to prevent v_data being dereferenced. This makes >>>> no sense when it isn't enough. >>> >>> In the past, before VFS got locking and kernel was single-threaded, >>> the comment and code arranged in this way were sensitive and >>> effective. >>> As now this is not true anymore, there is no strict relationship >>> between the getnewvnode() and sleeping points. >>> It is important to remove stale comments because they confuse people, >>> the porters and as you can see the code/comment has been cut&paste >>> quite a bit around. >> >> Putting the issue of the comment making no sense at all aside, which is >> true but tangential to what I want to note. >> >> Although malloc(9) is not ordered with the vnode locks in the lock >> order, it is still good practice to not perform allocations under the >> vnode lock. The reason is that pagedaemon might need to clean and write >> pages, in particular, belonging to the vnodes. Generally, if you own >> vnode lock and do something which might kick pagedaemon, you are creating >> troubles for pagedaemon, which would attempt to lock the vnode with >> timeout, spending the precious time waiting for lock it cannot obtain. >> >> This is less an issue for the new vnode instantiation locations, because >> vnode cannot have resident pages yet. But it is good to follow the same >> pattern anywhere. The comment could have been changed to one about this. Except it doesn't really apply here. Neither of the allocations is onder the vnode lock. > Yes, I completely agree. Infact the code is not changed also to avoid > pagedaemon hosing. > However this is a different situation respect a "if you allocate while > you hold the lock you will get a deadlock/race/corruption". The code is still nonsense since its order is unrelated to this too :-). The natural code and order is: o // no lock held here o allocate vp o allocate ip and any other stuff needed to complete vp o aquire exclusive lock o check that vp, ip and other stuff didn't go away o wire ip and other stuff into vp // shouldn't do more allocations here o release lock on return (?) but the current order for at least ffs is: o // no lock held here o // oops, actually we always (?) hold at least a shared lock here. Often // we need to promote to an exclusive lock. o allocate ip o allocate vp o aquire exclusive lock // no check that nothing went away?? A comment earlier still says that // we intentionally allow races earlier. Is that correct when we hold // at leasr a shared lock throughout? o wire ip into vp. Includes futher initializations of both. Hopefully these can't block. bread() the inode. Can block now. No worse than blocking for write(2) (?). o further zalloc()s for dinodes. Breaks kib's rule. It would be painful to have to release all the zalloc()ated data on earlier failures. At this point, we can still fail, but have initialized enough of the vnode to just fail without cleaning it up -- ufs_reclaim() will clean it. o further initializations, mostly not involving operations that can block. release lock on return (?) The allocation of ip is clearly special -- it contains state info that hopefully records the state of the initialization, and it must be wired into vp first so that desrtructors can see this info. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 15:23:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24BE29E4; Tue, 20 Nov 2012 15:23:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A0768FC17; Tue, 20 Nov 2012 15:23:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKFNMCc045046; Tue, 20 Nov 2012 15:23:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKFNMcd045045; Tue, 20 Nov 2012 15:23:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211201523.qAKFNMcd045045@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Nov 2012 15:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243339 - head/sys/modules/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 15:23:23 -0000 Author: kib Date: Tue Nov 20 15:23:22 2012 New Revision: 243339 URL: http://svnweb.freebsd.org/changeset/base/243339 Log: Fix module build after r243245. Modified: head/sys/modules/ufs/Makefile Modified: head/sys/modules/ufs/Makefile ============================================================================== --- head/sys/modules/ufs/Makefile Tue Nov 20 15:19:55 2012 (r243338) +++ head/sys/modules/ufs/Makefile Tue Nov 20 15:23:22 2012 (r243339) @@ -7,7 +7,8 @@ SRCS= opt_ddb.h opt_directio.h opt_ffs.h vnode_if.h ufs_acl.c ufs_bmap.c ufs_dirhash.c ufs_extattr.c \ ufs_gjournal.c ufs_inode.c ufs_lookup.c ufs_quota.c ufs_vfsops.c \ ufs_vnops.c ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_snapshot.c \ - ffs_softdep.c ffs_subr.c ffs_tables.c ffs_vfsops.c ffs_vnops.c + ffs_softdep.c ffs_subr.c ffs_suspend.c ffs_tables.c ffs_vfsops.c \ + ffs_vnops.c .if !defined(KERNBUILDDIR) CFLAGS+= -DSOFTUPDATES -DUFS_DIRHASH From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 15:25:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2D6EB63; Tue, 20 Nov 2012 15:25:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C7D468FC13; Tue, 20 Nov 2012 15:25:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKFP0pi045297; Tue, 20 Nov 2012 15:25:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKFP0Xq045296; Tue, 20 Nov 2012 15:25:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211201525.qAKFP0Xq045296@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Nov 2012 15:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243340 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 15:25:01 -0000 Author: kib Date: Tue Nov 20 15:25:00 2012 New Revision: 243340 URL: http://svnweb.freebsd.org/changeset/base/243340 Log: Remove the check and panic for an impossible condition. The NULL lowervp vnode v_vnlock would cause panic due to NULL pointer dereference much earlier. MFC after: 1 week Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Tue Nov 20 15:23:22 2012 (r243339) +++ head/sys/fs/nullfs/null_subr.c Tue Nov 20 15:25:00 2012 (r243340) @@ -251,8 +251,6 @@ null_nodeget(mp, lowervp, vpp) vp->v_type = lowervp->v_type; vp->v_data = xp; vp->v_vnlock = lowervp->v_vnlock; - if (vp->v_vnlock == NULL) - panic("null_nodeget: Passed a NULL vnlock.\n"); error = insmntque1(vp, mp, null_insmntque_dtr, xp); if (error != 0) return (error); From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 15:33:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6BE2D8D; Tue, 20 Nov 2012 15:33:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9AE678FC0C; Tue, 20 Nov 2012 15:33:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKFXmZC046545; Tue, 20 Nov 2012 15:33:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKFXm80046544; Tue, 20 Nov 2012 15:33:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211201533.qAKFXm80046544@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Nov 2012 15:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243341 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 15:33:48 -0000 Author: kib Date: Tue Nov 20 15:33:48 2012 New Revision: 243341 URL: http://svnweb.freebsd.org/changeset/base/243341 Log: Add a special meaning to the negative ticks argument for taskqueue_enqueue_timeout(). Do not rearm the callout if it is already armed and the ticks is negative. Otherwise rearm it to fire in abs(ticks) ticks in the future. The intended use is to call taskqueue_enqueue_timeout() for the given timeout_task with the same negative ticks argument. As result, the task is scheduled to execute not further than abs(ticks) ticks in future, and the consequent enqueues are coalesced until the already scheduled task is finished. Reviewed by: rwatson Tested by: Markus Gebert MFC after: 2 weeks Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Tue Nov 20 15:25:00 2012 (r243340) +++ head/sys/kern/subr_taskqueue.c Tue Nov 20 15:33:48 2012 (r243341) @@ -252,9 +252,13 @@ taskqueue_enqueue_timeout(struct taskque } else { queue->tq_callouts++; timeout_task->f |= DT_CALLOUT_ARMED; + if (ticks < 0) + ticks = -ticks; /* Ignore overflow. */ + } + if (ticks > 0) { + callout_reset(&timeout_task->c, ticks, + taskqueue_timeout_func, timeout_task); } - callout_reset(&timeout_task->c, ticks, taskqueue_timeout_func, - timeout_task); } TQ_UNLOCK(queue); return (res); From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 15:45:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F07091DD; Tue, 20 Nov 2012 15:45:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB7808FC08; Tue, 20 Nov 2012 15:45:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKFjmdR048121; Tue, 20 Nov 2012 15:45:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKFjmIk048120; Tue, 20 Nov 2012 15:45:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211201545.qAKFjmIk048120@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Nov 2012 15:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243342 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 15:45:49 -0000 Author: kib Date: Tue Nov 20 15:45:48 2012 New Revision: 243342 URL: http://svnweb.freebsd.org/changeset/base/243342 Log: Schedule garbage collection run for the in-flight rights passed over the unix domain sockets to the next tick, coalescing the serial calls until the collection fires. The thought is that more work for the collector could arise in the near time, allowing to clean more and not spend too much CPU on repeated collection when there is no garbage. Currently the collection task is fired immediately upon unix domain socket close if there are any rights in flight, which caused excessive CPU usage and too long blocking of the threads waiting for unp_list_lock and unp_link_rwlock in write mode. Robert noted that it would be nice if we could find some heuristic by which we decide whether to run GC a bit more quickly. E.g., if the number of UNIX domain sockets is close to its resource limit, but not quite. Reported and tested by: Markus Gebert Reviewed by: rwatson MFC after: 2 weeks Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Nov 20 15:33:48 2012 (r243341) +++ head/sys/kern/uipc_usrreq.c Tue Nov 20 15:45:48 2012 (r243342) @@ -131,7 +131,7 @@ static const struct sockaddr sun_noname * reentrance in the UNIX domain socket, file descriptor, and socket layer * code. See unp_gc() for a full description. */ -static struct task unp_gc_task; +static struct timeout_task unp_gc_task; /* * The close of unix domain sockets attached as SCM_RIGHTS is @@ -672,7 +672,7 @@ uipc_detach(struct socket *so) if (vp) vrele(vp); if (local_unp_rights) - taskqueue_enqueue(taskqueue_thread, &unp_gc_task); + taskqueue_enqueue_timeout(taskqueue_thread, &unp_gc_task, -1); } static int @@ -1784,7 +1784,7 @@ unp_init(void) LIST_INIT(&unp_shead); LIST_INIT(&unp_sphead); SLIST_INIT(&unp_defers); - TASK_INIT(&unp_gc_task, 0, unp_gc, NULL); + TIMEOUT_TASK_INIT(taskqueue_thread, &unp_gc_task, 0, unp_gc, NULL); TASK_INIT(&unp_defer_task, 0, unp_process_defers, NULL); UNP_LINK_LOCK_INIT(); UNP_LIST_LOCK_INIT(); From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 15:48:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE158485 for ; Tue, 20 Nov 2012 15:48:41 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1365C8FC17 for ; Tue, 20 Nov 2012 15:48:40 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so5811925lah.13 for ; Tue, 20 Nov 2012 07:48:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=vKGbtbr7BNVB457VfAUjAJFsjqJLV69DcD9gBdygb80=; b=NzcbMDPOVwdqL/kZTWlWhSwWSobBWQNBeoVYlrDaRF2286ZaLMyUw3PfC93RHuq6km EkQUeDM2SGtGDDjKbe+DcfVUrHNi1g0oetl8zyMkYu0ZDKwcn9pwA4b1BlHEN592P9oT xoJHm+wwPWz0cis/iThViZYQ6nGZEqNo+Cg8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=vKGbtbr7BNVB457VfAUjAJFsjqJLV69DcD9gBdygb80=; b=B09WghLumqb8SOhL95GeaVRjpB8lvKsEfsr19wA8xffh7KnOR1P8JG335Gh+MsNYaX Tb0kJpaZFCo4TBUA0QvW6f6BS+VszIO3FlSrFCCXssJsHp3bNw5SZiQU32qVNI5AD+n7 jit6BBy4QATDfbC7cNVkpIMuFE2UDFSnOYNu9+bjaWKqwh7ebZyx7wyW5Nekk6O9Zb/5 tBJ5JekP/lA+2fTaB1CPV29MrfcISJpD7DYTI4UH49xQRXqv3JaFkXPSOckoHYD90lzX EeHGIQ/0QPuWMk+4Sz/RnJsF1HninphF/ClZZ3efSJ3DT49iEJl1+93oHsVm0ExqQkRQ UmLg== Received: by 10.152.102.234 with SMTP id fr10mr15178345lab.28.1353426519569; Tue, 20 Nov 2012 07:48:39 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Tue, 20 Nov 2012 07:48:09 -0800 (PST) In-Reply-To: <20121120172226.R1115@besplex.bde.org> References: <201211200212.qAK2C1sT097754@svn.freebsd.org> <20121120172226.R1115@besplex.bde.org> From: Eitan Adler Date: Tue, 20 Nov 2012 10:48:09 -0500 X-Google-Sender-Auth: RiY8xUCfbdR2NihlOtYGkGyHQCk Message-ID: Subject: Re: svn commit: r243321 - head/usr.sbin/edquota To: Bruce Evans Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlk3VMroSWgyVnFGTAh0OUQiBUKQA/f5doOXBQsebNokL/sFhmAB8TNM39KdSP1ZLSbHJ2d Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 15:48:41 -0000 On 20 November 2012 02:03, Bruce Evans wrote: > On Tue, 20 Nov 2012, Eitan Adler wrote: > >> Log: >> Remove unneeded includes. >> >> Tested with "make universe"; there are no conditional features. > > > "make universe" can't find such features. Except inversely -- when it > doesn't find them, it usually means that there is a bug in the headers. [ thanks for the info. I'll go through it and parse it fully soon ] Just to explain. The above sentence means "I tested this with make universe" AND I checked to make sure that there were no #ifdefs or the like which might rely on these headers. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 15:58:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E368A715 for ; Tue, 20 Nov 2012 15:58:19 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4EB988FC16 for ; Tue, 20 Nov 2012 15:58:18 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so5822426lah.13 for ; Tue, 20 Nov 2012 07:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=yQDOZ1mnfNp5GAVi+cPTkh29hKjeoAuko6oel59hKRQ=; b=IuBufSSz6l1aDkvwayo6JH0vrj7lEOOnkOoiOsdW5+nWLgAaemtHla1HTMdzTP0oLl VyYqBOumiqnmG/qXDWrkvy6UIyKlemMxsm+/udlvq0rukuUxXFIwyl7RU6rTpzGKGmK0 OjqnmhgkTZuV9T5ityiUwHamEGb3XFANwxnDw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=yQDOZ1mnfNp5GAVi+cPTkh29hKjeoAuko6oel59hKRQ=; b=L10HzQ0jXhg5haeW5zlDARTfQP3KQ6i12qW4W8d5ZCWntRl/Mu2vZceZjzArq+hgzz GVblxN1s5LK6alMex0jSPQfPzP4kA5hJA9a+RVab+dKTnvTjUWJLpqDOQmXuTU705uuQ LuTpNupbLQp3z9k+QotLZSteC0xLe7hG9IPsFYJKxainJmi/zT1Oe7SgMNfD05eak1c1 9h7X+UuRmM4/FPwzdr2KyRCTLfiuFP66LybsEeXvzq/x5fc5NAztQKAVNsBRrwGwJro3 efsih49GEJs2ownj90vufVqNbyD+VMta7BNMymbR3SqYogdhEOBMVcl3q/03Tu+FGwtG 5LWA== Received: by 10.112.54.40 with SMTP id g8mr6691504lbp.49.1353427097958; Tue, 20 Nov 2012 07:58:17 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Tue, 20 Nov 2012 07:57:47 -0800 (PST) In-Reply-To: References: <201211192243.qAJMhjFF055708@svn.freebsd.org> <20121120162708.I924@besplex.bde.org> From: Eitan Adler Date: Tue, 20 Nov 2012 10:57:47 -0500 X-Google-Sender-Auth: bOcCt5fB7cKwhEbii2F8rINST3s Message-ID: Subject: Re: svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs To: attilio@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlSVFvfhbDOmNq8UVpqkzmB3FmwmFguvqkKxlqMX0EmpLwW2U7dyOYlFeRnRQXLF6/Ju0LQ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 15:58:20 -0000 On 20 November 2012 03:17, Attilio Rao wrote: > And the code makes perfectly sense if you know the history. One shouldn't have to know the history of the code to understand the present state. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 15:59:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3DB208C9 for ; Tue, 20 Nov 2012 15:59:44 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9FCB18FC16 for ; Tue, 20 Nov 2012 15:59:43 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so5823986lah.13 for ; Tue, 20 Nov 2012 07:59:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=kOVQHHPJB4ibOUySrNGj+yZtw6nR9vkbEKqoqFJCF+k=; b=b1Q4ZORyhJbtoFKxUb9GpM/J3O2H5VyXh7zJBFUbBrZSASZxalhsJSAW0MNlnFQNRA wDEVLHVuE8BMvkhl14aApKNJi72MevIy8d5JuHZPuh5f7GOw/kniCaJqrAnSr22aha/K qaRqzRo/RItKufyR5Fp/rCYg0f4zjz/emA/Ws= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=kOVQHHPJB4ibOUySrNGj+yZtw6nR9vkbEKqoqFJCF+k=; b=l7o9XffAwP6JoTuIyg+r2W8Dxjq7N+3moIAHw+cEkR2Lz/+AcZLjCkgR8goJL8hxEO +1mf3Uoct7c8q0u60L0btZAHn8Q7nBbnGm/wGmD5UHyIEEJRKUiAu0HnT85YE7vC6boU uMp+0+UVSMtJSrqONm18PrqB4o0lQM2A4MvtsccPzATDAtU2L88yDGdHSeVlkp5QsfMj YzlRm4Kp/prZSf0xzwCFzv/944O94BoNU4LCsNnXBbN6JnlbXxKFcl2oS+tgqMzQqNYg jfesc62vfRBidecfUhGAiDrdrYHqUBIXWNns5UOdSs33WK3Y2m+NIl64P36Oi7QM6XKx sOCA== Received: by 10.112.13.140 with SMTP id h12mr6672160lbc.12.1353427182462; Tue, 20 Nov 2012 07:59:42 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.166 with HTTP; Tue, 20 Nov 2012 07:59:12 -0800 (PST) In-Reply-To: <20121120133837.GK71195@ithaqua.etoilebsd.net> References: <201211200722.qAK7M7Im057617@svn.freebsd.org> <20121120122226.GA1828@a91-153-116-96.elisa-laajakaista.fi> <20121120133837.GK71195@ithaqua.etoilebsd.net> From: Eitan Adler Date: Tue, 20 Nov 2012 10:59:12 -0500 X-Google-Sender-Auth: f6YbkvaUPaHrDypDFFpqGlkypPM Message-ID: Subject: Re: svn commit: r243328 - head/lib/libutil To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQm3xQiRTTHRFV9DysF7xJzHj23jlC/md2F+JYoHbUFgt+mlEC+DLDOKXI4jEFPgecifJ1GK Cc: svn-src-head@freebsd.org, Jaakko Heinonen , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 15:59:44 -0000 On 20 November 2012 08:38, Baptiste Daroussin wrote: > On Tue, Nov 20, 2012 at 02:22:26PM +0200, Jaakko Heinonen wrote: >> >> Hi! >> >> On 2012-11-20, Baptiste Daroussin wrote: >> > change mode the group file to 0644 after a successfull rename(2) >> > >> > int >> > gr_mkdb(void) >> > { >> > - return (rename(tempname, group_file)); >> > + int ret; >> > + >> > + ret = rename(tempname, group_file); >> > + >> > + if (ret == 0) >> > + chmod(group_file, 0644); >> > + >> > + return (ret); >> > } >> >> Rename+chmod is not an atomic operation. There is a window when the file >> has wrong permissions. Also, you don't check the return value of >> chmod(). Maybe chmod first and then rename? >> >> -- >> Jaakko > > Does this looks better to you? > http://people.freebsd.org/~bapt/gr_util.diff This makes more sense. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 19:23:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6C002F0; Tue, 20 Nov 2012 19:23:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9BDA88FC08; Tue, 20 Nov 2012 19:23:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKJNis2080153; Tue, 20 Nov 2012 19:23:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKJNig1080152; Tue, 20 Nov 2012 19:23:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211201923.qAKJNig1080152@svn.freebsd.org> From: Ed Maste Date: Tue, 20 Nov 2012 19:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243346 - head/tools/regression/lib/libc/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 19:23:44 -0000 Author: emaste Date: Tue Nov 20 19:23:44 2012 New Revision: 243346 URL: http://svnweb.freebsd.org/changeset/base/243346 Log: Non-void function should return a value. Found by: clang Modified: head/tools/regression/lib/libc/resolv/resolv.c Modified: head/tools/regression/lib/libc/resolv/resolv.c ============================================================================== --- head/tools/regression/lib/libc/resolv/resolv.c Tue Nov 20 17:08:37 2012 (r243345) +++ head/tools/regression/lib/libc/resolv/resolv.c Tue Nov 20 19:23:44 2012 (r243346) @@ -226,7 +226,7 @@ resolvloop(void *p) { int *nhosts = (int *)p; if (*nhosts == 0) - return; + return NULL; do resolvone(*nhosts); while (--(*nhosts)); From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 21:02:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2C16992; Tue, 20 Nov 2012 21:02:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D3F848FC08; Tue, 20 Nov 2012 21:02:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKL200b093462; Tue, 20 Nov 2012 21:02:00 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKL20dZ093442; Tue, 20 Nov 2012 21:02:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201211202102.qAKL20dZ093442@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Nov 2012 21:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243347 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 21:02:01 -0000 Author: jkim Date: Tue Nov 20 21:01:59 2012 New Revision: 243347 URL: http://svnweb.freebsd.org/changeset/base/243347 Log: Merge ACPICA 20121114. Added: head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c - copied, changed from r243045, vendor-sys/acpica/dist/source/components/disassembler/dmdeferred.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/components/executer/exregion.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nsxfname.c head/sys/contrib/dev/acpica/components/resources/rscalc.c head/sys/contrib/dev/acpica/components/resources/rscreate.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/resources/rslist.c head/sys/contrib/dev/acpica/components/resources/rsmisc.c head/sys/contrib/dev/acpica/components/resources/rsxface.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utstate.c head/sys/contrib/dev/acpica/components/utilities/uttrack.c head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/disassembler/ (props changed) head/sys/contrib/dev/acpica/components/dispatcher/ (props changed) head/sys/contrib/dev/acpica/components/executer/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/resources/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/conf/files Tue Nov 20 21:01:59 2012 (r243347) @@ -294,6 +294,7 @@ contrib/dev/acpica/components/debugger/d contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbxface.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmbuffer.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmdeferred.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmnames.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmopcode.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmobject.c optional acpi acpi_debug Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/changes.txt Tue Nov 20 21:01:59 2012 (r243347) @@ -1,4 +1,94 @@ ---------------------------------------- +14 November 2012. Summary of changes for version 20121114: + +This release is available at https://www.acpica.org/downloads +The ACPI 5.0 specification is available at www.acpi.info + +1) ACPICA Kernel-resident Subsystem: + +Implemented a performance enhancement for ACPI/AML Package objects. This +change greatly increases the performance of Package objects within the +interpreter. It changes the processing of reference counts for packages by +optimizing for the most common case where the package sub-objects are +either Integers, Strings, or Buffers. Increases the overall performance of +the ASLTS test suite by 1.5X (Increases the Slack Mode performance by 2X.) +Chao Guan. ACPICA BZ 943. + +Implemented and deployed common macros to extract flag bits from resource +descriptors. Improves readability and maintainability of the code. Fixes a +problem with the UART serial bus descriptor for the number of data bits +flags (was incorrectly 2 bits, should be 3). + +Enhanced the ACPI_GETx and ACPI_SETx macros. Improved the implementation +of the macros and changed the SETx macros to the style of (destination, +source). Also added ACPI_CASTx companion macros. Lv Zheng. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Previous Release: + Non-Debug Version: 93.9K Code, 25.2K Data, 119.1K Total + Debug Version: 175.5K Code, 74.5K Data, 250.0K Total + Current Release: + Non-Debug Version: 94.3K Code, 25.3K Data, 119.6K Total + Debug Version: 175.5K Code, 74.5K Data, 250.0K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Added the new ACPI 5.0 interrupt sharing flags. This change +adds the ShareAndWake and ExclusiveAndWake flags which were added to the +Irq, Interrupt, and Gpio resource descriptors in ACPI 5.0. ACPICA BZ 986. + +Disassembler: Fixed a problem with external declaration generation. Fixes +a problem where an incorrect pathname could be generated for an external +declaration if the original reference to the object includes leading +carats (^). ACPICA BZ 984. + +Debugger: Completed a major update for the Disassemble command. +This command was out-of-date and did not properly disassemble control +methods that had any reasonable complexity. This fix brings the command up +to the same level as the rest of the disassembler. Adds one new file, +dmdeferred.c, which is existing code that is now common with the main +disassembler and the debugger disassemble command. ACPICA MZ 978. + +iASL: Moved the parser entry prototype to avoid a duplicate declaration. +Newer versions of Bison emit this prototype, so moved the prototype out of +the iASL header to where it is actually used in order to avoid a duplicate +declaration. + +iASL/Tools: Standardized use of the stream I/O functions: + 1) Ensure check for I/O error after every fopen/fread/fwrite + 2) Ensure proper order of size/count arguments for fread/fwrite + 3) Use test of (Actual != Requested) after all fwrite, and most fread + 4) Standardize I/O error messages +Improves reliability and maintainability of the code. Bob Moore, Lv Zheng. +ACPICA BZ 981. + +Disassembler: Prevent duplicate External() statements. During generation +of external statements, detect similar pathnames that are actually +duplicates such as these: + External (\ABCD) + External (ABCD) +Remove all leading '\' characters from pathnames during the external +statement generation so that duplicates will be detected and tossed. +ACPICA BZ 985. + +Tools: Replace low-level I/O with stream I/O functions. Replace +open/read/write/close with the stream I/O equivalents +fopen/fread/fwrite/fclose for portability and performance. Lv Zheng, Bob +Moore. + +AcpiBin: Fix for the dump-to-hex function. Now correctly output the table +name header so that AcpiXtract recognizes the output file/table. + +iASL: Remove obsolete -2 option flag. Originally intended to force the +compiler/disassembler into an ACPI 2.0 mode, this was never implemented +and the entire concept is now obsolete. + +---------------------------------------- 18 October 2012. Summary of changes for version 20121018: Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/common/adfile.c Tue Nov 20 21:01:59 2012 (r243347) @@ -124,19 +124,24 @@ AdWriteBuffer ( char *Buffer, UINT32 Length) { - FILE *fp; + FILE *File; ACPI_SIZE Actual; - fp = fopen (Filename, "wb"); - if (!fp) + File = fopen (Filename, "wb"); + if (!File) { - printf ("Couldn't open %s\n", Filename); + printf ("Could not open file %s\n", Filename); return (-1); } - Actual = fwrite (Buffer, (size_t) Length, 1, fp); - fclose (fp); + Actual = fwrite (Buffer, 1, (size_t) Length, File); + if (Actual != Length) + { + printf ("Could not write to file %s\n", Filename); + } + + fclose (File); return ((INT32) Actual); } Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/common/adisasm.c Tue Nov 20 21:01:59 2012 (r243347) @@ -88,17 +88,6 @@ AdCreateTableHeader ( char *Filename, ACPI_TABLE_HEADER *Table); -static ACPI_STATUS -AdDeferredParse ( - ACPI_PARSE_OBJECT *Op, - UINT8 *Aml, - UINT32 AmlLength); - -static ACPI_STATUS -AdParseDeferredOps ( - ACPI_PARSE_OBJECT *Root); - - /* Stubs for ASL compiler */ #ifndef ACPI_ASL_COMPILER @@ -753,207 +742,6 @@ AdDisplayTables ( /****************************************************************************** * - * FUNCTION: AdDeferredParse - * - * PARAMETERS: Op - Root Op of the deferred opcode - * Aml - Pointer to the raw AML - * AmlLength - Length of the AML - * - * RETURN: Status - * - * DESCRIPTION: Parse one deferred opcode - * (Methods, operation regions, etc.) - * - *****************************************************************************/ - -static ACPI_STATUS -AdDeferredParse ( - ACPI_PARSE_OBJECT *Op, - UINT8 *Aml, - UINT32 AmlLength) -{ - ACPI_WALK_STATE *WalkState; - ACPI_STATUS Status; - ACPI_PARSE_OBJECT *SearchOp; - ACPI_PARSE_OBJECT *StartOp; - UINT32 BaseAmlOffset; - ACPI_PARSE_OBJECT *ExtraOp; - - - ACPI_FUNCTION_TRACE (AdDeferredParse); - - - fprintf (stderr, "."); - - if (!Aml || !AmlLength) - { - return_ACPI_STATUS (AE_OK); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Parsing %s [%4.4s]\n", - Op->Common.AmlOpName, (char *) &Op->Named.Name)); - - WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL); - if (!WalkState) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, Aml, - AmlLength, NULL, ACPI_IMODE_LOAD_PASS1); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Parse the method */ - - WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE; - WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE; - Status = AcpiPsParseAml (WalkState); - - /* - * We need to update all of the Aml offsets, since the parser thought - * that the method began at offset zero. In reality, it began somewhere - * within the ACPI table, at the BaseAmlOffset. Walk the entire tree that - * was just created and update the AmlOffset in each Op - */ - BaseAmlOffset = (Op->Common.Value.Arg)->Common.AmlOffset + 1; - StartOp = (Op->Common.Value.Arg)->Common.Next; - SearchOp = StartOp; - - /* Walk the parse tree */ - - while (SearchOp) - { - SearchOp->Common.AmlOffset += BaseAmlOffset; - SearchOp = AcpiPsGetDepthNext (StartOp, SearchOp); - } - - /* - * Link the newly parsed subtree into the main parse tree - */ - switch (Op->Common.AmlOpcode) - { - case AML_BUFFER_OP: - case AML_PACKAGE_OP: - case AML_VAR_PACKAGE_OP: - - switch (Op->Common.AmlOpcode) - { - case AML_PACKAGE_OP: - ExtraOp = Op->Common.Value.Arg; - ExtraOp = ExtraOp->Common.Next; - Op->Common.Value.Arg = ExtraOp->Common.Value.Arg; - break; - - case AML_VAR_PACKAGE_OP: - case AML_BUFFER_OP: - default: - ExtraOp = Op->Common.Value.Arg; - Op->Common.Value.Arg = ExtraOp->Common.Value.Arg; - break; - } - - /* Must point all parents to the main tree */ - - StartOp = Op; - SearchOp = StartOp; - while (SearchOp) - { - if (SearchOp->Common.Parent == ExtraOp) - { - SearchOp->Common.Parent = Op; - } - SearchOp = AcpiPsGetDepthNext (StartOp, SearchOp); - } - break; - - default: - break; - } - - return_ACPI_STATUS (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AdParseDeferredOps - * - * PARAMETERS: Root - Root of the parse tree - * - * RETURN: Status - * - * DESCRIPTION: Parse the deferred opcodes (Methods, regions, etc.) - * - *****************************************************************************/ - -static ACPI_STATUS -AdParseDeferredOps ( - ACPI_PARSE_OBJECT *Root) -{ - ACPI_PARSE_OBJECT *Op = Root; - ACPI_STATUS Status = AE_OK; - const ACPI_OPCODE_INFO *OpInfo; - - - ACPI_FUNCTION_NAME (AdParseDeferredOps); - fprintf (stderr, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n"); - - while (Op) - { - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - if (!(OpInfo->Flags & AML_DEFER)) - { - Op = AcpiPsGetDepthNext (Root, Op); - continue; - } - - switch (Op->Common.AmlOpcode) - { - case AML_METHOD_OP: - case AML_BUFFER_OP: - case AML_PACKAGE_OP: - case AML_VAR_PACKAGE_OP: - - Status = AdDeferredParse (Op, Op->Named.Data, Op->Named.Length); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - break; - - case AML_REGION_OP: - case AML_DATA_REGION_OP: - case AML_CREATE_QWORD_FIELD_OP: - case AML_CREATE_DWORD_FIELD_OP: - case AML_CREATE_WORD_FIELD_OP: - case AML_CREATE_BYTE_FIELD_OP: - case AML_CREATE_BIT_FIELD_OP: - case AML_CREATE_FIELD_OP: - case AML_BANK_FIELD_OP: - - /* Nothing to do in these cases */ - - break; - - default: - ACPI_ERROR ((AE_INFO, "Unhandled deferred opcode [%s]", - Op->Common.AmlOpName)); - break; - } - - Op = AcpiPsGetDepthNext (Root, Op); - } - - fprintf (stderr, "\n"); - return (Status); -} - - -/****************************************************************************** - * * FUNCTION: AdGetLocalTables * * PARAMETERS: Filename - Not used @@ -1191,7 +979,9 @@ AdParseTable ( /* Pass 3: Parse control methods and link their parse trees into the main parse tree */ - Status = AdParseDeferredOps (AcpiGbl_ParseOpRoot); + fprintf (stderr, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n"); + Status = AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot); + fprintf (stderr, "\n"); /* Process Resource Templates */ Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/common/dmextern.c Tue Nov 20 21:01:59 2012 (r243347) @@ -153,10 +153,17 @@ AcpiDmNormalizeParentPrefix ( char *Fullpath; char *ParentPath; ACPI_SIZE Length; + UINT32 Index = 0; - /* Search upwards in the parse tree until we reach a namespace node */ + if (!Op) + { + return (NULL); + } + + /* Search upwards in the parse tree until we reach the next namespace node */ + Op = Op->Common.Parent; while (Op) { if (Op->Common.Node) @@ -205,6 +212,13 @@ AcpiDmNormalizeParentPrefix ( * for the required dot separator (ParentPath.Path) */ Length++; + + /* For External() statements, we do not want a leading '\' */ + + if (*ParentPath == AML_ROOT_PREFIX) + { + Index = 1; + } } Fullpath = ACPI_ALLOCATE_ZEROED (Length); @@ -219,7 +233,7 @@ AcpiDmNormalizeParentPrefix ( * * Copy the parent path */ - ACPI_STRCAT (Fullpath, ParentPath); + ACPI_STRCPY (Fullpath, &ParentPath[Index]); /* * Add dot separator @@ -366,7 +380,22 @@ AcpiDmAddToExternalList ( return; } - /* Externalize the ACPI path */ + /* + * We don't want External() statements to contain a leading '\'. + * This prevents duplicate external statements of the form: + * + * External (\ABCD) + * External (ABCD) + * + * This would cause a compile time error when the disassembled + * output file is recompiled. + */ + if ((*Path == AML_ROOT_PREFIX) && (Path[1])) + { + Path++; + } + + /* Externalize the ACPI pathname */ Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path, NULL, &ExternalPath); @@ -375,8 +404,10 @@ AcpiDmAddToExternalList ( return; } - /* Get the full pathname from root if "Path" has a parent prefix */ - + /* + * Get the full pathname from the root if "Path" has one or more + * parent prefixes (^). Note: path will not contain a leading '\'. + */ if (*Path == (UINT8) AML_PARENT_PREFIX) { Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath); Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Tue Nov 20 21:01:59 2012 (r243347) @@ -625,7 +625,7 @@ AcpiGetTagPathname ( Aml = ACPI_CAST_PTR (AML_RESOURCE, &Op->Named.Data[ResourceNode->Value]); - Status = AcpiUtValidateResource (Aml, &ResourceTableIndex); + Status = AcpiUtValidateResource (NULL, Aml, &ResourceTableIndex); if (ACPI_FAILURE (Status)) { return (NULL); @@ -938,7 +938,7 @@ AcpiDmFindResources ( * resource descriptors to the namespace, as children of the * buffer node. */ - if (ACPI_SUCCESS (AcpiDmIsResourceTemplate (Op))) + if (ACPI_SUCCESS (AcpiDmIsResourceTemplate (NULL, Op))) { Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE; AcpiDmAddResourcesToNamespace (Parent->Common.Node, Op); @@ -991,7 +991,7 @@ AcpiDmAddResourcesToNamespace ( * Insert each resource into the namespace * NextOp contains the Aml pointer and the Aml length */ - AcpiUtWalkAmlResources ((UINT8 *) NextOp->Named.Data, + AcpiUtWalkAmlResources (NULL, (UINT8 *) NextOp->Named.Data, (ACPI_SIZE) NextOp->Common.Value.Integer, AcpiDmAddResourceToNamespace, BufferNode); } Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Tue Nov 20 21:01:59 2012 (r243347) @@ -50,6 +50,15 @@ #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslcompile") +/* + * Main parser entry + * External is here in case the parser emits the same external in the + * generated header. (Newer versions of Bison) + */ +int +AslCompilerparse( + void); + /* Local prototypes */ static void @@ -274,7 +283,7 @@ FlConsumeAnsiComment ( BOOLEAN ClosingComment = FALSE; - while (fread (&Byte, 1, 1, Handle)) + while (fread (&Byte, 1, 1, Handle) == 1) { /* Scan until comment close is found */ @@ -317,7 +326,7 @@ FlConsumeNewComment ( UINT8 Byte; - while (fread (&Byte, 1, 1, Handle)) + while (fread (&Byte, 1, 1, Handle) == 1) { Status->Offset++; @@ -368,7 +377,7 @@ FlCheckForAscii ( /* Read the entire file */ - while (fread (&Byte, 1, 1, Handle)) + while (fread (&Byte, 1, 1, Handle) == 1) { /* Ignore comment fields (allow non-ascii within) */ Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Tue Nov 20 21:01:59 2012 (r243347) @@ -86,10 +86,6 @@ /* * Main ASL parser - generated from flex/bison, lex/yacc, etc. */ -int -AslCompilerparse( - void); - ACPI_PARSE_OBJECT * AslDoError ( void); Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Tue Nov 20 21:01:59 2012 (r243347) @@ -294,7 +294,7 @@ AePrintException ( else { RActual = fread (&SourceByte, 1, 1, SourceFile); - if (!RActual) + if (RActual != 1) { fprintf (OutputFile, "[*** iASL: Read error on source code temp file %s ***]", @@ -304,8 +304,20 @@ AePrintException ( { while (RActual && SourceByte && (SourceByte != '\n') && (Total < 256)) { - fwrite (&SourceByte, 1, 1, OutputFile); + if (fwrite (&SourceByte, 1, 1, OutputFile) != 1) + { + printf ("[*** iASL: Write error on output file ***]\n"); + return; + } + RActual = fread (&SourceByte, 1, 1, SourceFile); + if (RActual != 1) + { + fprintf (OutputFile, + "[*** iASL: Read error on source code temp file %s ***]", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); + return; + } Total++; } Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Tue Nov 20 21:01:59 2012 (r243347) @@ -143,15 +143,14 @@ FlOpenFile ( File = fopen (Filename, Mode); - - Gbl_Files[FileId].Filename = Filename; - Gbl_Files[FileId].Handle = File; - if (!File) { FlFileError (FileId, ASL_MSG_OPEN); AslAbort (); } + + Gbl_Files[FileId].Filename = Filename; + Gbl_Files[FileId].Handle = File; } @@ -216,7 +215,7 @@ FlReadFile ( /* Read and check for error */ Actual = fread (Buffer, 1, Length, Gbl_Files[FileId].Handle); - if (Actual != Length) + if (Actual < Length) { if (feof (Gbl_Files[FileId].Handle)) { @@ -659,16 +658,17 @@ FlOpenIncludeWithPrefix ( /* Attempt to open the file, push if successful */ IncludeFile = fopen (Pathname, "r"); - if (IncludeFile) + if (!IncludeFile) { - /* Push the include file on the open input file stack */ - - AslPushInputFileStack (IncludeFile, Pathname); - return (IncludeFile); + fprintf (stderr, "Could not open include file %s\n", Pathname); + ACPI_FREE (Pathname); + return (NULL); } - ACPI_FREE (Pathname); - return (NULL); + /* Push the include file on the open input file stack */ + + AslPushInputFileStack (IncludeFile, Pathname); + return (IncludeFile); } @@ -952,7 +952,7 @@ FlOpenMiscOutputFiles ( return (AE_OK); } - /* Create/Open a combined source output file */ + /* Create/Open a combined source output file */ Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE); if (!Filename) Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Tue Nov 20 21:01:59 2012 (r243347) @@ -137,7 +137,6 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessFlag, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE); -ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_Acpi2, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE); Modified: head/sys/contrib/dev/acpica/compiler/asllisting.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllisting.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/asllisting.c Tue Nov 20 21:01:59 2012 (r243347) @@ -135,6 +135,10 @@ LsTreeWriteWalk ( UINT32 Level, void *Context); +static UINT32 +LsReadAmlOutputFile ( + UINT8 *Buffer); + /******************************************************************************* * @@ -1282,6 +1286,38 @@ LsDoHexOutput ( /******************************************************************************* * + * FUNCTION: LsReadAmlOutputFile + * + * PARAMETERS: Buffer - Where to return data + * + * RETURN: None. + * + * DESCRIPTION: Read a line of the AML output prior to formatting the data + * + ******************************************************************************/ + +static UINT32 +LsReadAmlOutputFile ( + UINT8 *Buffer) +{ + UINT32 Actual; + + + Actual = fread (Buffer, 1, HEX_TABLE_LINE_SIZE, + Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + + if (ferror (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)) + { + FlFileError (ASL_FILE_AML_OUTPUT, ASL_MSG_READ); + AslAbort (); + } + + return (Actual); +} + + +/******************************************************************************* + * * FUNCTION: LsDoHexOutputC * * PARAMETERS: None @@ -1319,8 +1355,7 @@ LsDoHexOutputC ( { /* Read enough bytes needed for one output line */ - LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, - Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + LineLength = LsReadAmlOutputFile (FileData); if (!LineLength) { break; @@ -1407,8 +1442,7 @@ LsDoHexOutputAsl ( { /* Read enough bytes needed for one output line */ - LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, - Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + LineLength = LsReadAmlOutputFile (FileData); if (!LineLength) { break; @@ -1494,8 +1528,7 @@ LsDoHexOutputAsm ( { /* Read enough bytes needed for one output line */ - LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, - Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + LineLength = LsReadAmlOutputFile (FileData); if (!LineLength) { break; Modified: head/sys/contrib/dev/acpica/compiler/asllookup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllookup.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/asllookup.c Tue Nov 20 21:01:59 2012 (r243347) @@ -329,16 +329,19 @@ LsDoOneNamespaceObject ( case ACPI_TYPE_LOCAL_RESOURCE_FIELD: - if (Node->Flags & 0x80) + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, + " [Field Offset 0x%.4X Bits 0x%.4X Bytes] ", + Node->Value, Node->Value / 8); + + if (Node->Flags & ANOBJ_IS_REFERENCED) { FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, - " [Field Offset 0x%.4X Bits 0x%.4X Bytes]", - Node->Value, Node->Value / 8); + "Referenced"); } else { FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, - " [Field Offset 0x%.4X Bytes]", Node->Value); + "Name not referenced"); } break; Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Tue Nov 20 21:01:59 2012 (r243347) @@ -100,7 +100,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T:G^v^w|x:z" +#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T:G^v^w|x:z" /******************************************************************************* @@ -171,7 +171,6 @@ Options ( ACPI_OPTION ("-dc [file]", "Disassemble AML and immediately compile it"); ACPI_OPTION ("", "(Obtain DSDT from current system if no input file)"); ACPI_OPTION ("-e [f1,f2]", "Include ACPI table(s) for external symbol resolution"); - ACPI_OPTION ("-2", "Emit ACPI 2.0 compatible ASL code"); ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)"); ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file"); @@ -473,11 +472,6 @@ AslDoOptions ( break; - case '2': /* ACPI 2.0 compatibility mode */ - Gbl_Acpi2 = TRUE; - break; - - case 'b': /* Debug output options */ switch (AcpiGbl_Optarg[0]) { Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Tue Nov 20 21:01:59 2012 (r243347) @@ -337,6 +337,13 @@ AslDoOneFile ( return (Status); } +#if 0 + /* TBD: Handle additional output files for disassembler */ + + Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix); + LsDisplayNamespace (); +#endif + /* Shutdown compiler and ACPICA subsystem */ AeClearErrorLog (); Modified: head/sys/contrib/dev/acpica/compiler/dttemplate.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttemplate.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/dttemplate.c Tue Nov 20 21:01:59 2012 (r243347) @@ -280,6 +280,7 @@ DtCreateOneTemplate ( char *DisasmFilename; FILE *File; ACPI_STATUS Status = AE_OK; + ACPI_SIZE Actual; /* New file will have a .asl suffix */ @@ -334,18 +335,32 @@ DtCreateOneTemplate ( } else { - /* Special ACPI tables - DSDT, SSDT, FACS, RSDP */ + /* Special ACPI tables - DSDT, SSDT, FADT, RSDP */ AcpiOsPrintf (" */\n\n"); if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT)) { - fwrite (TemplateDsdt, sizeof (TemplateDsdt) -1, 1, File); + Actual = fwrite (TemplateDsdt, 1, sizeof (TemplateDsdt) -1, File); + if (Actual != sizeof (TemplateDsdt) -1) + { + fprintf (stderr, + "Could not write to output file %s\n", DisasmFilename); + Status = AE_ERROR; + goto Cleanup; + } } else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT)) { - fwrite (TemplateSsdt, sizeof (TemplateSsdt) -1, 1, File); + Actual = fwrite (TemplateSsdt, 1, sizeof (TemplateSsdt) -1, File); + if (Actual != sizeof (TemplateSsdt) -1) + { + fprintf (stderr, + "Could not write to output file %s\n", DisasmFilename); + Status = AE_ERROR; + goto Cleanup; + } } - else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS)) + else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS)) /* FADT */ { AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, TemplateFacs)); @@ -359,7 +374,8 @@ DtCreateOneTemplate ( { fprintf (stderr, "%4.4s, Unrecognized ACPI table signature\n", Signature); - return (AE_ERROR); + Status = AE_ERROR; + goto Cleanup; } } @@ -367,6 +383,7 @@ DtCreateOneTemplate ( "Created ACPI table template for [%4.4s], written to \"%s\"\n", Signature, DisasmFilename); +Cleanup: fclose (File); AcpiOsRedirectOutput (stdout); ACPI_FREE (DisasmFilename); Modified: head/sys/contrib/dev/acpica/compiler/prutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/prutils.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/compiler/prutils.c Tue Nov 20 21:01:59 2012 (r243347) @@ -337,16 +337,17 @@ PrOpenIncludeWithPrefix ( /* Attempt to open the file, push if successful */ IncludeFile = fopen (Pathname, "r"); - if (IncludeFile) + if (!IncludeFile) { - /* Push the include file on the open input file stack */ - - PrPushInputFileStack (IncludeFile, Pathname); - return (IncludeFile); + fprintf (stderr, "Could not open include file %s\n", Pathname); + ACPI_FREE (Pathname); + return (NULL); } - ACPI_FREE (Pathname); - return (NULL); + /* Push the include file on the open input file stack */ + + PrPushInputFileStack (IncludeFile, Pathname); + return (IncludeFile); } Modified: head/sys/contrib/dev/acpica/components/debugger/dbfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbfileio.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/components/debugger/dbfileio.c Tue Nov 20 21:01:59 2012 (r243347) @@ -135,17 +135,16 @@ AcpiDbOpenDebugFile ( AcpiDbCloseDebugFile (); AcpiGbl_DebugFile = fopen (Name, "w+"); - if (AcpiGbl_DebugFile) - { - AcpiOsPrintf ("Debug output file %s opened\n", Name); - ACPI_STRCPY (AcpiGbl_DbDebugFilename, Name); - AcpiGbl_DbOutputToFile = TRUE; - } - else + if (!AcpiGbl_DebugFile) { AcpiOsPrintf ("Could not open debug file %s\n", Name); + return; } + AcpiOsPrintf ("Debug output file %s opened\n", Name); + ACPI_STRCPY (AcpiGbl_DbDebugFilename, Name); + AcpiGbl_DbOutputToFile = TRUE; + #endif } #endif @@ -288,7 +287,7 @@ AcpiDbReadTable ( { /* Read the table header */ - if (fread (&TableHeader, 1, sizeof (TableHeader), fp) != + if (fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), fp) != sizeof (ACPI_TABLE_HEADER)) { AcpiOsPrintf ("Could not read the table header\n"); @@ -387,7 +386,6 @@ AcpiDbReadTable ( AcpiOsFree (*Table); *Table = NULL; *TableLength = 0; - return (AE_ERROR); } @@ -485,15 +483,15 @@ AcpiDbReadTableFromFile ( char *Filename, ACPI_TABLE_HEADER **Table) { - FILE *fp; + FILE *File; UINT32 TableLength; ACPI_STATUS Status; /* Open the file */ - fp = fopen (Filename, "rb"); - if (!fp) + File = fopen (Filename, "rb"); + if (!File) { AcpiOsPrintf ("Could not open input file %s\n", Filename); return (AE_ERROR); @@ -502,8 +500,8 @@ AcpiDbReadTableFromFile ( /* Get the entire file */ fprintf (stderr, "Loading Acpi table from file %s\n", Filename); - Status = AcpiDbReadTable (fp, Table, &TableLength); - fclose(fp); + Status = AcpiDbReadTable (File, Table, &TableLength); + fclose(File); if (ACPI_FAILURE (Status)) { Modified: head/sys/contrib/dev/acpica/components/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbinput.c Tue Nov 20 19:23:44 2012 (r243346) +++ head/sys/contrib/dev/acpica/components/debugger/dbinput.c Tue Nov 20 21:01:59 2012 (r243347) @@ -100,6 +100,7 @@ enum AcpiExDebuggerCommands CMD_CLOSE, CMD_DEBUG, CMD_DISASSEMBLE, + CMD_DISASM, CMD_DUMP, CMD_ENABLEACPI, CMD_EVALUATE, @@ -170,6 +171,7 @@ static const ACPI_DB_COMMAND_INFO Acpi {"CLOSE", 0}, {"DEBUG", 1}, {"DISASSEMBLE", 1}, + {"DISASM", 1}, {"DUMP", 1}, {"ENABLEACPI", 0}, {"EVALUATE", 1}, @@ -796,6 +798,7 @@ AcpiDbCommandDispatch ( break; case CMD_DISASSEMBLE: + case CMD_DISASM: (void) AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]); break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 21:26:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2FDD11BA; Tue, 20 Nov 2012 21:26:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1225D8FC14; Tue, 20 Nov 2012 21:26:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKLQDaJ097130; Tue, 20 Nov 2012 21:26:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKLQDoS097129; Tue, 20 Nov 2012 21:26:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211202126.qAKLQDoS097129@svn.freebsd.org> From: Dimitry Andric Date: Tue, 20 Nov 2012 21:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243348 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 20 Nov 2012 21:26:14 -0000 Author: dim Date: Tue Nov 20 21:26:13 2012 New Revision: 243348 URL: http://svnweb.freebsd.org/changeset/base/243348 Log: Do not expose LIBCXXRT and LIBCPLUSPLUS in bsd.libnames.mk, if WITHOUT_LIBCPLUSPLUS is specified. Submitted by: Garrett Cooper MFC after: 3 days Modified: head/share/mk/bsd.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Tue Nov 20 21:01:59 2012 (r243347) +++ head/share/mk/bsd.libnames.mk Tue Nov 20 21:26:13 2012 (r243348) @@ -28,8 +28,10 @@ LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxm LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a +.if ${MK_LIBCPLUSPLUS} != "no" LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a +.endif LIBC?= ${DESTDIR}${LIBDIR}/libc.a LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 00:31:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CBE958C; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9B88FC12; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0Vvt9024951; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0Vvde024949; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210031.qAL0Vvde024949@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243350 - stable/9/usr.bin/mktemp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 00:31:57 -0000 Author: eadler Date: Wed Nov 21 00:31:56 2012 New Revision: 243350 URL: http://svnweb.freebsd.org/changeset/base/243350 Log: MFC r243240: Use the macro for standard error return values. .Dd not bumped because there is no important content change. Obtained from: DragonflyBSD Approved by: cperciva (implicit) Modified: stable/9/usr.bin/mktemp/mktemp.1 Directory Properties: stable/9/usr.bin/mktemp/ (props changed) Modified: stable/9/usr.bin/mktemp/mktemp.1 ============================================================================== --- stable/9/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:14:03 2012 (r243349) +++ stable/9/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:56 2012 (r243350) @@ -158,10 +158,7 @@ Use of this option is not encouraged. .El .Sh EXIT STATUS -The -.Nm -utility -exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh EXAMPLES The following .Xr sh 1 From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 00:31:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F3AE58D; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6210E8FC13; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0VvtR024964; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0VvAY024963; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210031.qAL0VvAY024963@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243351 - stable/8/usr.bin/mktemp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 00:31:57 -0000 Author: eadler Date: Wed Nov 21 00:31:56 2012 New Revision: 243351 URL: http://svnweb.freebsd.org/changeset/base/243351 Log: MFC r243240: Use the macro for standard error return values. .Dd not bumped because there is no important content change. Obtained from: DragonflyBSD Approved by: cperciva (implicit) Modified: stable/8/usr.bin/mktemp/mktemp.1 Directory Properties: stable/8/usr.bin/mktemp/ (props changed) Modified: stable/8/usr.bin/mktemp/mktemp.1 ============================================================================== --- stable/8/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:56 2012 (r243350) +++ stable/8/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:56 2012 (r243351) @@ -162,10 +162,7 @@ Use of this option is not encouraged. .El .Sh EXIT STATUS -The -.Nm -utility -exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh EXAMPLES The following .Xr sh 1 From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 00:31:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2B4658E; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C80178FC14; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0Vvow024979; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0VvY0024978; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210031.qAL0VvY0024978@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243352 - stable/7/usr.bin/mktemp X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 00:31:58 -0000 Author: eadler Date: Wed Nov 21 00:31:57 2012 New Revision: 243352 URL: http://svnweb.freebsd.org/changeset/base/243352 Log: MFC r243240: Use the macro for standard error return values. .Dd not bumped because there is no important content change. Obtained from: DragonflyBSD Approved by: cperciva (implicit) Modified: stable/7/usr.bin/mktemp/mktemp.1 Directory Properties: stable/7/usr.bin/mktemp/ (props changed) Modified: stable/7/usr.bin/mktemp/mktemp.1 ============================================================================== --- stable/7/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:56 2012 (r243351) +++ stable/7/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:57 2012 (r243352) @@ -162,10 +162,7 @@ Use of this option is not encouraged. .El .Sh EXIT STATUS -The -.Nm -utility -exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh EXAMPLES The following .Xr sh 1 From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 00:40:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AA4CBD1; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0000C8FC1B; Wed, 21 Nov 2012 00:40:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0eQNm026867; Wed, 21 Nov 2012 00:40:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0eQgx026865; Wed, 21 Nov 2012 00:40:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210040.qAL0eQgx026865@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243353 - stable/8/share/man/man7 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 00:40:27 -0000 Author: eadler Date: Wed Nov 21 00:40:26 2012 New Revision: 243353 URL: http://svnweb.freebsd.org/changeset/base/243353 Log: MFC r243241: Modernize parts of the ports.7 manual page. Approved by: cperciva (implicit) Modified: stable/8/share/man/man7/ports.7 Directory Properties: stable/8/share/man/man7/ (props changed) Modified: stable/8/share/man/man7/ports.7 ============================================================================== --- stable/8/share/man/man7/ports.7 Wed Nov 21 00:31:57 2012 (r243352) +++ stable/8/share/man/man7/ports.7 Wed Nov 21 00:40:26 2012 (r243353) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2012 +.Dd November 18, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -41,7 +41,7 @@ Each .Em port contains any patches necessary to make the original application source code compile and run on -.Bx . +.Fx . Compiling an application is as simple as typing .Nm make Cm build @@ -56,19 +56,6 @@ simply type .Nm make Cm install to install the application. .Pp -It is possible to download and use ports from the -.Fx -repository -that are newer than the installed system; however it is important to -install the appropriate -.Dq "Upgrade Kit" -from -.Pa http://www.FreeBSD.org/ports/ -first! -The -.Xr portcheckout 1 Pq Pa ports/ports-mgmt/portcheckout -script (also a port, of course!) will help to download new ports. -.Pp For more information about using ports, see .Dq "Packages and Ports" in From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 00:40:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 667F0BD2; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB6A8FC1C; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0eRG8026890; Wed, 21 Nov 2012 00:40:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0eRWm026889; Wed, 21 Nov 2012 00:40:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210040.qAL0eRWm026889@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243354 - stable/7/share/man/man7 X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 00:40:27 -0000 Author: eadler Date: Wed Nov 21 00:40:26 2012 New Revision: 243354 URL: http://svnweb.freebsd.org/changeset/base/243354 Log: MFC r243241: Modernize parts of the ports.7 manual page. Approved by: cperciva (implicit) Modified: stable/7/share/man/man7/ports.7 Directory Properties: stable/7/share/man/man7/ (props changed) Modified: stable/7/share/man/man7/ports.7 ============================================================================== --- stable/7/share/man/man7/ports.7 Wed Nov 21 00:40:26 2012 (r243353) +++ stable/7/share/man/man7/ports.7 Wed Nov 21 00:40:26 2012 (r243354) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2012 +.Dd November 18, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -41,7 +41,7 @@ Each .Em port contains any patches necessary to make the original application source code compile and run on -.Bx . +.Fx . Compiling an application is as simple as typing .Nm make Cm build @@ -56,19 +56,6 @@ simply type .Nm make Cm install to install the application. .Pp -It is possible to download and use ports from the -.Fx -repository -that are newer than the installed system; however it is important to -install the appropriate -.Dq "Upgrade Kit" -from -.Pa http://www.FreeBSD.org/ports/ -first! -The -.Xr portcheckout 1 Pq Pa ports/ports-mgmt/portcheckout -script (also a port, of course!) will help to download new ports. -.Pp For more information about using ports, see .Dq "Packages and Ports" in From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 00:40:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B5AF0BD3; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9AD228FC1D; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0eR87026904; Wed, 21 Nov 2012 00:40:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0eRN1026903; Wed, 21 Nov 2012 00:40:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210040.qAL0eRN1026903@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243355 - stable/9/share/man/man7 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 00:40:27 -0000 Author: eadler Date: Wed Nov 21 00:40:27 2012 New Revision: 243355 URL: http://svnweb.freebsd.org/changeset/base/243355 Log: MFC r243241: Modernize parts of the ports.7 manual page. Approved by: cperciva (implicit) Modified: stable/9/share/man/man7/ports.7 Directory Properties: stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/ports.7 ============================================================================== --- stable/9/share/man/man7/ports.7 Wed Nov 21 00:40:26 2012 (r243354) +++ stable/9/share/man/man7/ports.7 Wed Nov 21 00:40:27 2012 (r243355) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2012 +.Dd November 18, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -41,7 +41,7 @@ Each .Em port contains any patches necessary to make the original application source code compile and run on -.Bx . +.Fx . Compiling an application is as simple as typing .Nm make Cm build @@ -56,19 +56,6 @@ simply type .Nm make Cm install to install the application. .Pp -It is possible to download and use ports from the -.Fx -repository -that are newer than the installed system; however it is important to -install the appropriate -.Dq "Upgrade Kit" -from -.Pa http://www.FreeBSD.org/ports/ -first! -The -.Xr portcheckout 1 Pq Pa ports/ports-mgmt/portcheckout -script (also a port, of course!) will help to download new ports. -.Pp For more information about using ports, see .Dq "Packages and Ports" in From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 01:01:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE73937F; Wed, 21 Nov 2012 01:01:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C04408FC12; Wed, 21 Nov 2012 01:01:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL11HjG030895; Wed, 21 Nov 2012 01:01:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL11HrK030894; Wed, 21 Nov 2012 01:01:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210101.qAL11HrK030894@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 01:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243356 - stable/9/sys/dev/uart X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 01:01:18 -0000 Author: eadler Date: Wed Nov 21 01:01:17 2012 New Revision: 243356 URL: http://svnweb.freebsd.org/changeset/base/243356 Log: MFC r243000: Add support for CIR1000 - Cirrus Logic V34 to the uart driver Approved by: cperciva (implicit) Modified: stable/9/sys/dev/uart/uart_bus_isa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/uart/uart_bus_isa.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_isa.c Wed Nov 21 00:40:27 2012 (r243355) +++ stable/9/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:17 2012 (r243356) @@ -79,6 +79,7 @@ static struct isa_pnp_id isa_ns8250_ids[ {0x0034490a, NULL}, /* BRI3400 - Internal ACF Modem */ {0x0094490a, NULL}, /* BRI9400 - Boca K56Flex PnP */ {0x00b4490a, NULL}, /* BRIB400 - Boca 56k PnP */ + {0x0010320d, NULL}, /* CIR1000 - Cirrus Logic V34 */ {0x0030320d, NULL}, /* CIR3000 - Cirrus Logic V43 */ {0x0100440e, NULL}, /* CRD0001 - Cardinal MVP288IV ? */ {0x01308c0e, NULL}, /* CTL3001 - Creative Labs Phoneblaster */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 01:01:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65A58380; Wed, 21 Nov 2012 01:01:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC448FC13; Wed, 21 Nov 2012 01:01:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL11Js9030965; Wed, 21 Nov 2012 01:01:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL11Jwq030963; Wed, 21 Nov 2012 01:01:19 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210101.qAL11Jwq030963@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 01:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243357 - stable/8/sys/dev/uart X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 01:01:19 -0000 Author: eadler Date: Wed Nov 21 01:01:18 2012 New Revision: 243357 URL: http://svnweb.freebsd.org/changeset/base/243357 Log: MFC r243000: Add support for CIR1000 - Cirrus Logic V34 to the uart driver Approved by: cperciva (implicit) Modified: stable/8/sys/dev/uart/uart_bus_isa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/uart/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus_isa.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:17 2012 (r243356) +++ stable/8/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:18 2012 (r243357) @@ -79,6 +79,7 @@ static struct isa_pnp_id isa_ns8250_ids[ {0x0034490a, NULL}, /* BRI3400 - Internal ACF Modem */ {0x0094490a, NULL}, /* BRI9400 - Boca K56Flex PnP */ {0x00b4490a, NULL}, /* BRIB400 - Boca 56k PnP */ + {0x0010320d, NULL}, /* CIR1000 - Cirrus Logic V34 */ {0x0030320d, NULL}, /* CIR3000 - Cirrus Logic V43 */ {0x0100440e, NULL}, /* CRD0001 - Cardinal MVP288IV ? */ {0x01308c0e, NULL}, /* CTL3001 - Creative Labs Phoneblaster */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 01:01:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CC21381; Wed, 21 Nov 2012 01:01:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 732ED8FC14; Wed, 21 Nov 2012 01:01:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL11JU3030973; Wed, 21 Nov 2012 01:01:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL11Jr9030972; Wed, 21 Nov 2012 01:01:19 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210101.qAL11Jr9030972@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 01:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243358 - stable/7/sys/dev/uart X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 01:01:19 -0000 Author: eadler Date: Wed Nov 21 01:01:19 2012 New Revision: 243358 URL: http://svnweb.freebsd.org/changeset/base/243358 Log: MFC r243000: Add support for CIR1000 - Cirrus Logic V34 to the uart driver Approved by: cperciva (implicit) Modified: stable/7/sys/dev/uart/uart_bus_isa.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/uart/uart_bus_isa.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:18 2012 (r243357) +++ stable/7/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:19 2012 (r243358) @@ -76,6 +76,7 @@ static struct isa_pnp_id isa_ns8250_ids[ {0x0034490a, NULL}, /* BRI3400 - Internal ACF Modem */ {0x0094490a, NULL}, /* BRI9400 - Boca K56Flex PnP */ {0x00b4490a, NULL}, /* BRIB400 - Boca 56k PnP */ + {0x0010320d, NULL}, /* CIR1000 - Cirrus Logic V34 */ {0x0030320d, NULL}, /* CIR3000 - Cirrus Logic V43 */ {0x0100440e, NULL}, /* CRD0001 - Cardinal MVP288IV ? */ {0x01308c0e, NULL}, /* CTL3001 - Creative Labs Phoneblaster */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 01:38:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06651B5A; Wed, 21 Nov 2012 01:38:41 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E09B38FC0C; Wed, 21 Nov 2012 01:38:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL1cerD038074; Wed, 21 Nov 2012 01:38:40 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL1ceeu038073; Wed, 21 Nov 2012 01:38:40 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201211210138.qAL1ceeu038073@svn.freebsd.org> From: Olivier Houchard Date: Wed, 21 Nov 2012 01:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243359 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 01:38:41 -0000 Author: cognet Date: Wed Nov 21 01:38:40 2012 New Revision: 243359 URL: http://svnweb.freebsd.org/changeset/base/243359 Log: Make sure the address starts on a cache line boundary. Modified: head/sys/arm/arm/pl310.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Wed Nov 21 01:01:19 2012 (r243358) +++ head/sys/arm/arm/pl310.c Wed Nov 21 01:38:40 2012 (r243359) @@ -180,9 +180,13 @@ static void pl310_wbinv_range(vm_paddr_t start, vm_size_t size) { + if (start & g_l2cache_align_mask) { + size += start & g_l2cache_align_mask; + start &= ~g_l2cache_align_mask; + } if (size & g_l2cache_align_mask) { size &= ~g_l2cache_align_mask; - size += g_l2cache_line_size; + size += g_l2cache_line_size; } #if 1 @@ -217,6 +221,10 @@ static void pl310_wb_range(vm_paddr_t start, vm_size_t size) { + if (start & g_l2cache_align_mask) { + size += start & g_l2cache_align_mask; + start &= ~g_l2cache_align_mask; + } if (size & g_l2cache_align_mask) { size &= ~g_l2cache_align_mask; size += g_l2cache_line_size; @@ -235,6 +243,10 @@ static void pl310_inv_range(vm_paddr_t start, vm_size_t size) { + if (start & g_l2cache_align_mask) { + size += start & g_l2cache_align_mask; + start &= ~g_l2cache_align_mask; + } if (size & g_l2cache_align_mask) { size &= ~g_l2cache_align_mask; size += g_l2cache_line_size; From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 06:26:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCE5679C; Wed, 21 Nov 2012 06:26:18 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A97C08FC0C; Wed, 21 Nov 2012 06:26:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL6QIs3085855; Wed, 21 Nov 2012 06:26:18 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL6QIbr085854; Wed, 21 Nov 2012 06:26:18 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201211210626.qAL6QIbr085854@svn.freebsd.org> From: Alan Cox Date: Wed, 21 Nov 2012 06:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243366 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 06:26:19 -0000 Author: alc Date: Wed Nov 21 06:26:18 2012 New Revision: 243366 URL: http://svnweb.freebsd.org/changeset/base/243366 Log: Correct an error in r230623. When both VM_ALLOC_NODUMP and VM_ALLOC_ZERO were specified to vm_page_alloc(), PG_NODUMP wasn't being set on the allocated page when it happened to be pre-zeroed. MFC after: 5 days Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Nov 21 04:54:02 2012 (r243365) +++ head/sys/vm/vm_page.c Wed Nov 21 06:26:18 2012 (r243366) @@ -1481,13 +1481,13 @@ vm_page_alloc(vm_object_t object, vm_pin * must be cleared before the free page queues lock is released. */ flags = 0; - if (req & VM_ALLOC_NODUMP) - flags |= PG_NODUMP; if (m->flags & PG_ZERO) { vm_page_zero_count--; if (req & VM_ALLOC_ZERO) flags = PG_ZERO; } + if (req & VM_ALLOC_NODUMP) + flags |= PG_NODUMP; m->flags = flags; mtx_unlock(&vm_page_queue_free_mtx); m->aflags = 0; From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 08:04:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80DB01FC; Wed, 21 Nov 2012 08:04:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6674E8FC08; Wed, 21 Nov 2012 08:04:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL84MQY000903; Wed, 21 Nov 2012 08:04:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL84Mx2000900; Wed, 21 Nov 2012 08:04:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211210804.qAL84Mx2000900@svn.freebsd.org> From: Adrian Chadd Date: Wed, 21 Nov 2012 08:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243370 - in head/sys/powerpc: aim wii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 08:04:22 -0000 Author: adrian Date: Wed Nov 21 08:04:21 2012 New Revision: 243370 URL: http://svnweb.freebsd.org/changeset/base/243370 Log: Setup BAT0 and BAT1 on the Wii. This is the missing piece for FreeBSD/Wii, but there's still a lot of work ahead. We have to reset the MMU in locore before continuing the boot process because we don't know how the boot loaders might have setup the BATs. We also disable the PCI BAT because there's no PCI bus on the Wii. Thanks to Nathan Whitehorn and Peter Grenhan for their help. Submitted by: Margarida Gouveia Added: head/sys/powerpc/wii/locore.S (contents, props changed) Modified: head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Wed Nov 21 07:56:38 2012 (r243369) +++ head/sys/powerpc/aim/locore32.S Wed Nov 21 08:04:21 2012 (r243370) @@ -64,6 +64,7 @@ #include #include #include +#include "opt_platform.h" #include "opt_kdtrace.h" @@ -129,7 +130,9 @@ __start: bdnz 1b sync isync - +#ifdef WII +#include +#endif /* Zero bss, in case we were started by something unhelpful */ li 0,0 lis 8,_edata@ha Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Wed Nov 21 07:56:38 2012 (r243369) +++ head/sys/powerpc/aim/mmu_oea.c Wed Nov 21 08:04:21 2012 (r243370) @@ -620,8 +620,17 @@ moea_cpu_bootstrap(mmu_t mmup, int ap) isync(); } - __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); - __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); +#ifdef WII + /* + * Special case for the Wii: don't install the PCI BAT. + */ + if (strcmp(installed_platform(), "wii") != 0) { +#endif + __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); + __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); +#ifdef WII + } +#endif isync(); __asm __volatile("mtibatu 1,%0" :: "r"(0)); @@ -660,26 +669,26 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k battable[0x0].batl = BATL(0x00000000, BAT_M, BAT_PP_RW); battable[0x0].batu = BATU(0x00000000, BAT_BL_256M, BAT_Vs); - /* - * Map PCI memory space. - */ - battable[0x8].batl = BATL(0x80000000, BAT_I|BAT_G, BAT_PP_RW); - battable[0x8].batu = BATU(0x80000000, BAT_BL_256M, BAT_Vs); + /* + * Map PCI memory space. + */ + battable[0x8].batl = BATL(0x80000000, BAT_I|BAT_G, BAT_PP_RW); + battable[0x8].batu = BATU(0x80000000, BAT_BL_256M, BAT_Vs); - battable[0x9].batl = BATL(0x90000000, BAT_I|BAT_G, BAT_PP_RW); - battable[0x9].batu = BATU(0x90000000, BAT_BL_256M, BAT_Vs); + battable[0x9].batl = BATL(0x90000000, BAT_I|BAT_G, BAT_PP_RW); + battable[0x9].batu = BATU(0x90000000, BAT_BL_256M, BAT_Vs); - battable[0xa].batl = BATL(0xa0000000, BAT_I|BAT_G, BAT_PP_RW); - battable[0xa].batu = BATU(0xa0000000, BAT_BL_256M, BAT_Vs); + battable[0xa].batl = BATL(0xa0000000, BAT_I|BAT_G, BAT_PP_RW); + battable[0xa].batu = BATU(0xa0000000, BAT_BL_256M, BAT_Vs); - battable[0xb].batl = BATL(0xb0000000, BAT_I|BAT_G, BAT_PP_RW); - battable[0xb].batu = BATU(0xb0000000, BAT_BL_256M, BAT_Vs); + battable[0xb].batl = BATL(0xb0000000, BAT_I|BAT_G, BAT_PP_RW); + battable[0xb].batu = BATU(0xb0000000, BAT_BL_256M, BAT_Vs); - /* - * Map obio devices. - */ - battable[0xf].batl = BATL(0xf0000000, BAT_I|BAT_G, BAT_PP_RW); - battable[0xf].batu = BATU(0xf0000000, BAT_BL_256M, BAT_Vs); + /* + * Map obio devices. + */ + battable[0xf].batl = BATL(0xf0000000, BAT_I|BAT_G, BAT_PP_RW); + battable[0xf].batu = BATU(0xf0000000, BAT_BL_256M, BAT_Vs); /* * Use an IBAT and a DBAT to map the bottom segment of memory @@ -694,9 +703,15 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k :: "r"(battable[0].batu), "r"(battable[0].batl)); mtmsr(msr); - /* map pci space */ - __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); - __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); +#ifdef WII + if (strcmp(installed_platform(), "wii") != 0) { +#endif + /* map pci space */ + __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); + __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); +#ifdef WII + } +#endif isync(); /* set global direct map flag */ Added: head/sys/powerpc/wii/locore.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/wii/locore.S Wed Nov 21 08:04:21 2012 (r243370) @@ -0,0 +1,131 @@ +/*- + * Copyright (C) 2012 Margarida Gouveia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +/* + * When we are invoked from Wii loaders, the state of the MMU and the BAT + * mappings can vary. In this file we try to reset the MMU to a state + * that lets us boot FreeBSD. + * + * N.B.: keep the BAT0 in sync with mmu_oea.c and never touch BAT1 later. + * + * This file is being included from aim/locore32.S. + */ + +#define MMU_REALMODE() \ + mfmsr %r12; \ + rlwinm %r12, %r12, 0, ~(PSL_DR|PSL_IR);\ + sync; \ + bl 1f; \ +1: \ + mflr %r11; \ + clrlwi %r11, %r11, 3; /* XXX why? */ \ + addi %r11, %r11, 2f - 1b; \ + mtsrr0 %r11; \ + mtsrr1 %r12; /* Disables the MMU */ \ + isync; \ + rfi; \ +2: + +#define MMU_VIRTUALMODE() \ + bl 3f; \ +3: \ + mflr %r11; \ + addi %r11, %r11, 4f - 3b; \ + mfmsr %r12; \ + ori %r12, %r12, PSL_DR|PSL_IR; \ + mtsrr0 %r11; \ + mtsrr1 %r12; /* Enables the MMU */ \ + isync; \ + rfi; \ +4: + + MMU_REALMODE() + + /* Reset standard BATs */ + li %r11, 0 + mtibatu 0, %r11 + mtibatl 0, %r11 + mtdbatu 0, %r11 + mtdbatl 0, %r11 + mtibatu 1, %r11 + mtibatl 1, %r11 + mtdbatu 1, %r11 + mtdbatl 1, %r11 + mtibatu 2, %r11 + mtibatl 2, %r11 + mtdbatu 2, %r11 + mtdbatl 2, %r11 + mtibatu 3, %r11 + mtibatl 3, %r11 + mtdbatu 3, %r11 + mtdbatl 3, %r11 + + /* Reset high BATs. IBAT[4-7][UL] + DBAT[4-7][UL] */ + mtspr 560, %r11 + mtspr 561, %r11 + mtspr 562, %r11 + mtspr 563, %r11 + mtspr 564, %r11 + mtspr 565, %r11 + mtspr 566, %r11 + mtspr 567, %r11 + mtspr 568, %r11 + mtspr 569, %r11 + mtspr 570, %r11 + mtspr 571, %r11 + mtspr 572, %r11 + mtspr 573, %r11 + mtspr 574, %r11 + mtspr 575, %r11 + + /* + * We need to setup BAT0 as in mmu_oea.c. + */ + li %r11, BATU(0x00000000, BAT_BL_256M, BAT_Vs) + li %r12, BATL(0x00000000, BAT_M, BAT_PP_RW) + mtdbatu 0, %r11 + mtdbatl 0, %r12 + mtibatu 0, %r11 + mtibatl 0, %r12 + isync + + /* + * We use BAT1 to be able to write I/O memory, including the + * framebuffer registers. + */ + /* BATU(0x0c000000, BAT_BL_32M, BAT_Vs) */ + lis %r11, 0x0c00 + ori %r11, %r11, BAT_BL_32M|BAT_Vs + /* BATL(0x0c000000, BAT_I|BAT_G, BAT_PP_RW) */ + lis %r12, 0x0c00 + ori %r12, %r12, BAT_I|BAT_G|BAT_PP_RW + mtdbatu 1, %r11 + mtdbatl 1, %r12 + isync + + MMU_VIRTUALMODE() From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 10:38:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5915A939; Wed, 21 Nov 2012 10:38:13 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4AE248FC15; Wed, 21 Nov 2012 10:38:11 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so4010782lbb.13 for ; Wed, 21 Nov 2012 02:38:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=voBT3Sui4j6G3jXvbvfbGqeU4R8Ml1ZwX51rr/1oFrk=; b=RHD/9UJlAJcYUvSoL6idiwALPL9vAg/FZaRi68OS6YULHv5bnX4DXxWtxM9PrCTt0b yP+p2dPLmqviZdJlS0nMNyfwAnSbrP4YdPGb+MUZqXvEGbmym0Pqzu/CPrIKRDimwQhI p58gDEMqJ/bAxRQOo+p8tp4OSprVAOpYGdyPhePc1odo8/VhEREXU9BrkeXcxE1aB5I+ VCJ4X9W6C1a0AVXJYOyjiqkjczsOiVXhFAaVyXO//X6Y3ULR3VJ2axBeK7n642QbttSQ ysn/zoHzZBG0wxdA2+QzOsoRIS8pivuY3aBDXu83ymmFvUtd9R6A3Ac1t3YAQSAEOnVs VhUw== MIME-Version: 1.0 Received: by 10.112.49.133 with SMTP id u5mr7258439lbn.105.1353494290707; Wed, 21 Nov 2012 02:38:10 -0800 (PST) Received: by 10.112.131.232 with HTTP; Wed, 21 Nov 2012 02:38:10 -0800 (PST) Received: by 10.112.131.232 with HTTP; Wed, 21 Nov 2012 02:38:10 -0800 (PST) In-Reply-To: <20121121002013.S6273@besplex.bde.org> References: <201211181421.qAIEL5KT042019@svn.freebsd.org> <20121120105858.GA73018@zibbi.meraka.csir.co.za> <20121121002013.S6273@besplex.bde.org> Date: Wed, 21 Nov 2012 10:38:10 +0000 Message-ID: Subject: Re: svn commit: r243228 - head/etc From: Chris Rees To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, John Hay , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 10:38:13 -0000 On 20 Nov 2012 13:53, "Bruce Evans" wrote: > > On Tue, 20 Nov 2012, John Hay wrote: > >> On Sun, Nov 18, 2012 at 02:21:05PM +0000, Chris Rees wrote: >>> >>> Log: >>> cp -R misses out dotfiles; use pax instead to copy file hierarchies >>> >>> PR: conf/99721 (based on) >>> Submitted by: Florian Zavatzki >>> Approved by: hrs >>> MFC after: 1 month >>> >>> Modified: >>> head/etc/rc.initdiskless >>> >>> Modified: head/etc/rc.initdiskless >>> ============================================================================== >>> --- head/etc/rc.initdiskless Sun Nov 18 14:05:28 2012 (r243227) >>> +++ head/etc/rc.initdiskless Sun Nov 18 14:21:05 2012 (r243228) >>> @@ -354,7 +354,7 @@ for i in ${templates} ; do >>> subdir=${j##*/} >>> if [ -d $j -a ! -f $j.cpio.gz ]; then >>> create_md $subdir >>> - cp -Rp $j/ /$subdir >>> + (cd $j && pax -rw . /$subdir) >>> fi >>> done >>> for j in /conf/$i/*.cpio.gz ; do >> >> >> Have you tested this on a diskless and readonly system? It looks like pax >> need to write something in /tmp and it might not be writeable yet. I got >> an error, after the first of /bin/pax not found and having to add that to >> the list of files needed. > > > It uses mkstemp(3), normally in /tmp but it honors $TMPDIR. It seems to > always create 1 temporary file (even for copying a single regular file), > and sometimes 2 temporary files. Both of the temporary files seem to be > to hold metadata for file times and hashes, in case it is too large for > memory. cp -Rp probably needs to do the same (except it is imperfect to > unnecessarily assume that /tmp is writable), to fix its link and timestamp > handling. > > BTW, I think it is a large bug that ed and vi create temporary files even > before you change anything. Even view(1) (vi -R) wants to scribble on > /var/tmp/vi.recover. At least it doesn't refuse to start if this is not > writeable. ed(1) is considerably more broken. It > - hard codes /tmp and doesn't use _PATH_TMP or honor $TMPDIR > - always scribbles in /tmp > - refuses to start if /tmp is not writeable. > This makes ed(1) wlays broken in single user shells until '/' is mounted > rw, although ed is the only editor that is sure to be there and the > reason for using a single user shell is often that there is a problem > with mounting '/' rw. *sigh* Hiroki Sato tested it, but i don't know if he had ro /. This appears to have caused a few problems, possibly more than the benefit of the change (hard links). I'm inclined to be a coward and just revert this later; anyone who can get there before me, feel free. When I'm done with the other rc PRs (haha) I'll look at fixing our cp. Chris From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 16:56:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFAE9134; Wed, 21 Nov 2012 16:56:47 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C453D8FC12; Wed, 21 Nov 2012 16:56:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qALGulEd095557; Wed, 21 Nov 2012 16:56:47 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qALGulru095555; Wed, 21 Nov 2012 16:56:47 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201211211656.qALGulru095555@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 21 Nov 2012 16:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243372 - in head: sbin/mdconfig sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 16:56:48 -0000 Author: jh Date: Wed Nov 21 16:56:47 2012 New Revision: 243372 URL: http://svnweb.freebsd.org/changeset/base/243372 Log: Disallow attaching preloaded memory disks via ioctl. - The feature is dangerous because the kernel code didn't check validity of the memory address provided from user space. - It seems that mdconfig(8) never really supported attaching preloaded memory disks. - Preloaded memory disks are automatically attached during md(4) initialization. Thus there shouldn't be much use for the feature. PR: kern/169683 Discussed on: freebsd-hackers Modified: head/sbin/mdconfig/mdconfig.c head/sys/dev/md/md.c Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Wed Nov 21 09:50:31 2012 (r243371) +++ head/sbin/mdconfig/mdconfig.c Wed Nov 21 16:56:47 2012 (r243372) @@ -84,7 +84,7 @@ usage(void) " mdconfig -r -u unit -s size [-o [no]force]\n" " mdconfig -l [-v] [-n] [-u unit]\n" " mdconfig file\n"); - fprintf(stderr, "\t\ttype = {malloc, preload, vnode, swap}\n"); + fprintf(stderr, "\t\ttype = {malloc, vnode, swap}\n"); fprintf(stderr, "\t\toption = {cluster, compress, reserve}\n"); fprintf(stderr, "\t\tsize = %%d (512 byte blocks), %%db (B),\n"); fprintf(stderr, "\t\t %%dk (kB), %%dm (MB), %%dg (GB) or\n"); @@ -148,8 +148,6 @@ main(int argc, char **argv) if (!strcmp(optarg, "malloc")) { mdio.md_type = MD_MALLOC; mdio.md_options |= MD_AUTOUNIT | MD_COMPRESS; - } else if (!strcmp(optarg, "preload")) { - mdio.md_type = MD_PRELOAD; } else if (!strcmp(optarg, "vnode")) { mdio.md_type = MD_VNODE; mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Nov 21 09:50:31 2012 (r243371) +++ head/sys/dev/md/md.c Wed Nov 21 16:56:47 2012 (r243372) @@ -854,27 +854,6 @@ mdinit(struct md_s *sc) DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); } -/* - * XXX: we should check that the range they feed us is mapped. - * XXX: we should implement read-only. - */ - -static int -mdcreate_preload(struct md_s *sc, struct md_ioctl *mdio) -{ - - if (mdio->md_options & ~(MD_AUTOUNIT | MD_FORCE)) - return (EINVAL); - if (mdio->md_base == 0) - return (EINVAL); - sc->flags = mdio->md_options & MD_FORCE; - /* Cast to pointer size, then to pointer to avoid warning */ - sc->pl_ptr = (u_char *)(uintptr_t)mdio->md_base; - sc->pl_len = (size_t)sc->mediasize; - return (0); -} - - static int mdcreate_malloc(struct md_s *sc, struct md_ioctl *mdio) { @@ -1238,8 +1217,12 @@ xmdctlioctl(struct cdev *dev, u_long cmd error = mdcreate_malloc(sc, mdio); break; case MD_PRELOAD: - sc->start = mdstart_preload; - error = mdcreate_preload(sc, mdio); + /* + * We disallow attaching preloaded memory disks via + * ioctl. Preloaded memory disks are automatically + * attached in g_md_init(). + */ + error = EOPNOTSUPP; break; case MD_VNODE: sc->start = mdstart_vnode; From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 17:05:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F089E784; Wed, 21 Nov 2012 17:05:57 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC9538FC13; Wed, 21 Nov 2012 17:05:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qALH5vdM097068; Wed, 21 Nov 2012 17:05:57 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qALH5v6j097067; Wed, 21 Nov 2012 17:05:57 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201211211705.qALH5v6j097067@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 21 Nov 2012 17:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243373 - head/sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 17:05:58 -0000 Author: jh Date: Wed Nov 21 17:05:57 2012 New Revision: 243373 URL: http://svnweb.freebsd.org/changeset/base/243373 Log: Print correct unit number when attaching preloaded memory disks. Retire now unused mdunits variable. Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Nov 21 16:56:47 2012 (r243372) +++ head/sys/dev/md/md.c Wed Nov 21 17:05:57 2012 (r243373) @@ -137,7 +137,6 @@ static g_access_t g_md_access; static void g_md_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp); -static int mdunits; static struct cdev *status_dev = 0; static struct sx md_sx; static struct unrhdr *md_uh; @@ -1309,7 +1308,7 @@ mdctlioctl(struct cdev *dev, u_long cmd, } static void -md_preloaded(u_char *image, size_t length) +md_preloaded(u_char *image, size_t length, const char *name) { struct md_s *sc; int error; @@ -1327,6 +1326,10 @@ md_preloaded(u_char *image, size_t lengt rootdevnames[0] = MD_ROOT_FSTYPE ":/dev/md0"; #endif mdinit(sc); + if (name != NULL) { + printf("%s%d: Preloaded image <%s> %zd bytes at %p\n", + MD_NAME, sc->unit, name, length, image); + } } static void @@ -1347,7 +1350,7 @@ g_md_init(struct g_class *mp __unused) md_uh = new_unrhdr(0, INT_MAX, NULL); #ifdef MD_ROOT_SIZE sx_xlock(&md_sx); - md_preloaded(mfs_root.start, sizeof(mfs_root.start)); + md_preloaded(mfs_root.start, sizeof(mfs_root.start), NULL); sx_xunlock(&md_sx); #endif /* XXX: are preload_* static or do they need Giant ? */ @@ -1363,10 +1366,8 @@ g_md_init(struct g_class *mp __unused) ptr = preload_fetch_addr(mod); len = preload_fetch_size(mod); if (ptr != NULL && len != 0) { - printf("%s%d: Preloaded image <%s> %d bytes at %p\n", - MD_NAME, mdunits, name, len, ptr); sx_xlock(&md_sx); - md_preloaded(ptr, len); + md_preloaded(ptr, len, name); sx_xunlock(&md_sx); } } From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 18:12:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9311995; Wed, 21 Nov 2012 18:12:28 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8EF068FC1B; Wed, 21 Nov 2012 18:12:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qALICS59006560; Wed, 21 Nov 2012 18:12:28 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qALICSOW006559; Wed, 21 Nov 2012 18:12:28 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201211211812.qALICSOW006559@svn.freebsd.org> From: Chris Rees Date: Wed, 21 Nov 2012 18:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243374 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 18:12:28 -0000 Author: crees (ports committer) Date: Wed Nov 21 18:12:28 2012 New Revision: 243374 URL: http://svnweb.freebsd.org/changeset/base/243374 Log: Revert r243228. This commit appears to cause more trouble than it was designed to avoid; the issue described in the PR was no longer an issue anyway. Modified: head/etc/rc.initdiskless Modified: head/etc/rc.initdiskless ============================================================================== --- head/etc/rc.initdiskless Wed Nov 21 17:05:57 2012 (r243373) +++ head/etc/rc.initdiskless Wed Nov 21 18:12:28 2012 (r243374) @@ -354,7 +354,7 @@ for i in ${templates} ; do subdir=${j##*/} if [ -d $j -a ! -f $j.cpio.gz ]; then create_md $subdir - (cd $j && pax -rw . /$subdir) + cp -Rp $j/ /$subdir fi done for j in /conf/$i/*.cpio.gz ; do From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 18:27:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82088FD1; Wed, 21 Nov 2012 18:27:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 65A9F8FC1B; Wed, 21 Nov 2012 18:27:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qALIR3qO008513; Wed, 21 Nov 2012 18:27:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qALIR3eu008509; Wed, 21 Nov 2012 18:27:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211211827.qALIR3eu008509@svn.freebsd.org> From: Dimitry Andric Date: Wed, 21 Nov 2012 18:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243375 - in stable/9/sys/ofed: drivers/infiniband/core drivers/infiniband/ulp/sdp include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 18:27:03 -0000 Author: dim Date: Wed Nov 21 18:27:02 2012 New Revision: 243375 URL: http://svnweb.freebsd.org/changeset/base/243375 Log: MFC r242933: Redo r242842, now actually fixing the warnings, as follows: - In sys/ofed/drivers/infiniband/core/cma.c, an enum struct member is interpreted as an int, so cast it to an int. - In sys/ofed/drivers/infiniband/core/ud_header.c, initialize the packet_length variable in ib_ud_header_init(), to prevent undefined behaviour. - In sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c, call rdma_notify() with the correct enum type and value. - In sys/ofed/include/linux/pci.h, change the PCI_DEVICE and PCI_VDEVICE macros to use C99 struct initializers, so additional members can be overridden. Reviewed by: delphij, Garrett Cooper Modified: stable/9/sys/ofed/drivers/infiniband/core/cma.c stable/9/sys/ofed/drivers/infiniband/core/ud_header.c stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c stable/9/sys/ofed/include/linux/pci.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/cma.c Wed Nov 21 18:12:28 2012 (r243374) +++ stable/9/sys/ofed/drivers/infiniband/core/cma.c Wed Nov 21 18:27:02 2012 (r243375) @@ -1312,7 +1312,7 @@ static int cma_iw_handler(struct iw_cm_i *sin = iw_event->local_addr; sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr; *sin = iw_event->remote_addr; - switch (iw_event->status) { + switch ((int)iw_event->status) { case 0: event.event = RDMA_CM_EVENT_ESTABLISHED; break; Modified: stable/9/sys/ofed/drivers/infiniband/core/ud_header.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/ud_header.c Wed Nov 21 18:12:28 2012 (r243374) +++ stable/9/sys/ofed/drivers/infiniband/core/ud_header.c Wed Nov 21 18:27:02 2012 (r243375) @@ -230,7 +230,7 @@ void ib_ud_header_init(int pay int immediate_present, struct ib_ud_header *header) { - u16 packet_length; + u16 packet_length = 0; memset(header, 0, sizeof *header); Modified: stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Wed Nov 21 18:12:28 2012 (r243374) +++ stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Wed Nov 21 18:27:02 2012 (r243375) @@ -590,7 +590,7 @@ sdp_rx_comp_work(struct work_struct *wor if (unlikely(!ssk->poll_cq)) { struct rdma_cm_id *id = ssk->id; if (id && id->qp) - rdma_notify(id, RDMA_CM_EVENT_ESTABLISHED); + rdma_notify(id, IB_EVENT_COMM_EST); goto out; } Modified: stable/9/sys/ofed/include/linux/pci.h ============================================================================== --- stable/9/sys/ofed/include/linux/pci.h Wed Nov 21 18:12:28 2012 (r243374) +++ stable/9/sys/ofed/include/linux/pci.h Wed Nov 21 18:27:02 2012 (r243375) @@ -73,10 +73,12 @@ struct pci_device_id { #define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 -#define PCI_VDEVICE(vendor, device) \ - PCI_VENDOR_ID_##vendor, (device), PCI_ANY_ID, PCI_ANY_ID, 0, 0 -#define PCI_DEVICE(vendor, device) \ - (vendor), (device), PCI_ANY_ID, PCI_ANY_ID, 0, 0 +#define PCI_VDEVICE(_vendor, _device) \ + .vendor = PCI_VENDOR_ID_##_vendor, .device = (_device), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID +#define PCI_DEVICE(_vendor, _device) \ + .vendor = (_vendor), .device = (_device), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID #define to_pci_dev(n) container_of(n, struct pci_dev, dev) From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 18:38:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15B3F526; Wed, 21 Nov 2012 18:38:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EDB978FC18; Wed, 21 Nov 2012 18:38:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qALIcugT010098; Wed, 21 Nov 2012 18:38:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qALIcuNv010090; Wed, 21 Nov 2012 18:38:56 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211211838.qALIcuNv010090@svn.freebsd.org> From: Dimitry Andric Date: Wed, 21 Nov 2012 18:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243376 - in stable/9/contrib/libc++: . include src src/support X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 18:38:57 -0000 Author: dim Date: Wed Nov 21 18:38:56 2012 New Revision: 243376 URL: http://svnweb.freebsd.org/changeset/base/243376 Log: MFC r241903: Import libc++ trunk r165949. Among other improvements and bug fixes, this has many visibility problems fixed, which should help with compiling certain ports that exercise C++11 mode (i.e. Firefox). Also, belatedly add the LICENSE.TXT and accompanying CREDITS.TXT files, which are referred to in all the source files. MFC r241907: Fix two -Wsystem-header warnings in libc++ that were exposed by the new ATF import. These have also been sent upstream. Added: stable/9/contrib/libc++/CREDITS.TXT - copied unchanged from r241903, head/contrib/libc++/CREDITS.TXT stable/9/contrib/libc++/LICENSE.TXT - copied unchanged from r241903, head/contrib/libc++/LICENSE.TXT Deleted: stable/9/contrib/libc++/src/support/ Modified: stable/9/contrib/libc++/include/__bit_reference stable/9/contrib/libc++/include/__config stable/9/contrib/libc++/include/__hash_table stable/9/contrib/libc++/include/__locale stable/9/contrib/libc++/include/__mutex_base stable/9/contrib/libc++/include/__tree stable/9/contrib/libc++/include/__tuple stable/9/contrib/libc++/include/__undef_min_max stable/9/contrib/libc++/include/algorithm stable/9/contrib/libc++/include/array stable/9/contrib/libc++/include/atomic stable/9/contrib/libc++/include/bitset stable/9/contrib/libc++/include/chrono stable/9/contrib/libc++/include/cmath stable/9/contrib/libc++/include/complex stable/9/contrib/libc++/include/condition_variable stable/9/contrib/libc++/include/cstddef stable/9/contrib/libc++/include/cstdio stable/9/contrib/libc++/include/cstdlib stable/9/contrib/libc++/include/deque stable/9/contrib/libc++/include/exception stable/9/contrib/libc++/include/forward_list stable/9/contrib/libc++/include/fstream stable/9/contrib/libc++/include/functional stable/9/contrib/libc++/include/future stable/9/contrib/libc++/include/ios stable/9/contrib/libc++/include/iosfwd stable/9/contrib/libc++/include/istream stable/9/contrib/libc++/include/iterator stable/9/contrib/libc++/include/list stable/9/contrib/libc++/include/locale stable/9/contrib/libc++/include/map stable/9/contrib/libc++/include/memory stable/9/contrib/libc++/include/mutex stable/9/contrib/libc++/include/new stable/9/contrib/libc++/include/ostream stable/9/contrib/libc++/include/queue stable/9/contrib/libc++/include/random stable/9/contrib/libc++/include/regex stable/9/contrib/libc++/include/stack stable/9/contrib/libc++/include/streambuf stable/9/contrib/libc++/include/string stable/9/contrib/libc++/include/system_error stable/9/contrib/libc++/include/thread stable/9/contrib/libc++/include/tuple stable/9/contrib/libc++/include/type_traits stable/9/contrib/libc++/include/unordered_map stable/9/contrib/libc++/include/utility stable/9/contrib/libc++/include/valarray stable/9/contrib/libc++/include/vector stable/9/contrib/libc++/src/condition_variable.cpp stable/9/contrib/libc++/src/debug.cpp stable/9/contrib/libc++/src/exception.cpp stable/9/contrib/libc++/src/future.cpp stable/9/contrib/libc++/src/ios.cpp stable/9/contrib/libc++/src/iostream.cpp stable/9/contrib/libc++/src/locale.cpp stable/9/contrib/libc++/src/memory.cpp stable/9/contrib/libc++/src/mutex.cpp stable/9/contrib/libc++/src/new.cpp stable/9/contrib/libc++/src/random.cpp stable/9/contrib/libc++/src/stdexcept.cpp stable/9/contrib/libc++/src/thread.cpp stable/9/contrib/libc++/src/typeinfo.cpp Directory Properties: stable/9/contrib/libc++/ (props changed) Copied: stable/9/contrib/libc++/CREDITS.TXT (from r241903, head/contrib/libc++/CREDITS.TXT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/libc++/CREDITS.TXT Wed Nov 21 18:38:56 2012 (r243376, copy of r241903, head/contrib/libc++/CREDITS.TXT) @@ -0,0 +1,76 @@ +This file is a partial list of people who have contributed to the LLVM/libc++ +project. If you have contributed a patch or made some other contribution to +LLVM/libc++, please submit a patch to this file to add yourself, and it will be +done! + +The list is sorted by surname and formatted to allow easy grepping and +beautification by scripts. The fields are: name (N), email (E), web-address +(W), PGP key ID and fingerprint (P), description (D), and snail-mail address +(S). + +N: Howard Hinnant +E: hhinnant@apple.com +D: Architect and primary author of libc++ + +N: Marshall Clow +E: mclow.lists@gmail.com +E: marshall@idio.com +D: Minor patches and bug fixes. + +N: Bjorn Reese +E: breese@users.sourceforge.net +D: Initial regex prototype + +N: David Chisnall +E: theraven at theravensnest dot org +D: FreeBSD and Solaris ports, libcxxrt support, some atomics work. + +N: Ruben Van Boxem +E: vanboxem dot ruben at gmail dot com +D: Initial Windows patches. + +N: Arvid Picciani +E: aep at exys dot org +D: Minor patches and musl port. + +N: Craig Silverstein +E: csilvers@google.com +D: Implemented Cityhash as the string hash function on 64-bit machines + +N: Google Inc. +D: Copyright owner and contributor of the CityHash algorithm + +N: Jeffrey Yasskin +E: jyasskin@gmail.com +E: jyasskin@google.com +D: Linux fixes. + +N: Jonathan Sauer +D: Minor patches, mostly related to constexpr + +N: Richard Smith +D: Minor patches. + +N: Andrew Morrow +E: andrew.c.morrow@gmail.com +D: Minor patches and Linux fixes. + +N: Hyeon-bin Jeong +E: tuhertz@gmail.com +D: Minor patches and bug fixes. + +N: Michel Morin +E: mimomorin@gmail.com +D: Minor patches to is_convertible. + +N: Dimitry Andric +E: dimitry@andric.com +D: Visibility fixes, minor FreeBSD portability patches. + +N: Holger Arnold +E: holgerar@gmail.com +D: Minor fix. + +N: Argyrios Kyrtzidis +E: kyrtzidis@apple.com +D: Bug fixes. Copied: stable/9/contrib/libc++/LICENSE.TXT (from r241903, head/contrib/libc++/LICENSE.TXT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/libc++/LICENSE.TXT Wed Nov 21 18:38:56 2012 (r243376, copy of r241903, head/contrib/libc++/LICENSE.TXT) @@ -0,0 +1,76 @@ +============================================================================== +libc++ License +============================================================================== + +The libc++ library is dual licensed under both the University of Illinois +"BSD-Like" license and the MIT license. As a user of this code you may choose +to use it under either license. As a contributor, you agree to allow your code +to be used under both. + +Full text of the relevant licenses is included below. + +============================================================================== + +University of Illinois/NCSA +Open Source License + +Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT + +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== + +Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. Modified: stable/9/contrib/libc++/include/__bit_reference ============================================================================== --- stable/9/contrib/libc++/include/__bit_reference Wed Nov 21 18:27:02 2012 (r243375) +++ stable/9/contrib/libc++/include/__bit_reference Wed Nov 21 18:38:56 2012 (r243376) @@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template class __bit_iterator; +template class __bit_iterator; template class __bit_const_reference; template @@ -131,13 +131,14 @@ public: __bit_const_reference(const __bit_reference<_Cp>& __x) _NOEXCEPT : __seg_(__x.__seg_), __mask_(__x.__mask_) {} - _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR operator bool() const _NOEXCEPT {return static_cast(*__seg_ & __mask_);} _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const _NOEXCEPT {return __bit_iterator<_Cp, true>(__seg_, static_cast(__ctz(__mask_)));} private: _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT : __seg_(__s), __mask_(__m) {} @@ -146,11 +147,11 @@ private: // find -template -__bit_iterator<_Cp, false> -__find_bool_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) +template +__bit_iterator<_Cp, _IsConst> +__find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_Cp, false> _It; + typedef __bit_iterator<_Cp, _IsConst> _It; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; // do first partial word @@ -180,11 +181,11 @@ __find_bool_true(__bit_iterator<_Cp, fal return _It(__first.__seg_, static_cast(__n)); } -template -__bit_iterator<_Cp, false> -__find_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) +template +__bit_iterator<_Cp, _IsConst> +__find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_Cp, false> _It; + typedef __bit_iterator<_Cp, _IsConst> _It; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; // do first partial word @@ -193,7 +194,7 @@ __find_bool_false(__bit_iterator<_Cp, fa __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); __storage_type __dn = _VSTD::min(__clz_f, __n); __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); - __storage_type __b = ~(*__first.__seg_ & __m); + __storage_type __b = ~*__first.__seg_ & __m; if (__b) return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); __n -= __dn; @@ -210,17 +211,17 @@ __find_bool_false(__bit_iterator<_Cp, fa if (__n > 0) { __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); - __storage_type __b = ~(*__first.__seg_ & __m); + __storage_type __b = ~*__first.__seg_ & __m; if (__b) return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); } return _It(__first.__seg_, static_cast(__n)); } -template +template inline _LIBCPP_INLINE_VISIBILITY -__bit_iterator<_Cp, false> -find(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, const _Tp& __value_) +__bit_iterator<_Cp, _IsConst> +find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_) { if (static_cast(__value_)) return __find_bool_true(__first, static_cast(__last - __first)); @@ -229,11 +230,11 @@ find(__bit_iterator<_Cp, false> __first, // count -template -typename __bit_iterator<_Cp, false>::difference_type -__count_bool_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) +template +typename __bit_iterator<_Cp, _IsConst>::difference_type +__count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_Cp, false> _It; + typedef __bit_iterator<_Cp, _IsConst> _It; typedef typename _It::__storage_type __storage_type; typedef typename _It::difference_type difference_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -260,11 +261,11 @@ __count_bool_true(__bit_iterator<_Cp, fa return __r; } -template -typename __bit_iterator<_Cp, false>::difference_type -__count_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) +template +typename __bit_iterator<_Cp, _IsConst>::difference_type +__count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_Cp, false> _It; + typedef __bit_iterator<_Cp, _IsConst> _It; typedef typename _It::__storage_type __storage_type; typedef typename _It::difference_type difference_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -275,7 +276,7 @@ __count_bool_false(__bit_iterator<_Cp, f __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); __storage_type __dn = _VSTD::min(__clz_f, __n); __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); - __r = _VSTD::__pop_count(~(*__first.__seg_ & __m)); + __r = _VSTD::__pop_count(~*__first.__seg_ & __m); __n -= __dn; ++__first.__seg_; } @@ -286,15 +287,15 @@ __count_bool_false(__bit_iterator<_Cp, f if (__n > 0) { __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); - __r += _VSTD::__pop_count(~(*__first.__seg_ & __m)); + __r += _VSTD::__pop_count(~*__first.__seg_ & __m); } return __r; } -template +template inline _LIBCPP_INLINE_VISIBILITY -typename __bit_iterator<_Cp, false>::difference_type -count(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, const _Tp& __value_) +typename __bit_iterator<_Cp, _IsConst>::difference_type +count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_) { if (static_cast(__value_)) return __count_bool_true(__first, static_cast(__last - __first)); @@ -926,12 +927,12 @@ rotate(__bit_iterator<_Cp, false> __firs // equal -template +template bool -__equal_unaligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1, - __bit_iterator<_Cp, true> __first2) +__equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, + __bit_iterator<_Cp, _IC2> __first2) { - typedef __bit_iterator<_Cp, true> _It; + typedef __bit_iterator<_Cp, _IC1> _It; typedef typename _It::difference_type difference_type; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -1008,12 +1009,12 @@ __equal_unaligned(__bit_iterator<_Cp, tr return true; } -template +template bool -__equal_aligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1, - __bit_iterator<_Cp, true> __first2) +__equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, + __bit_iterator<_Cp, _IC2> __first2) { - typedef __bit_iterator<_Cp, true> _It; + typedef __bit_iterator<_Cp, _IC1> _It; typedef typename _It::difference_type difference_type; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -1061,7 +1062,8 @@ equal(__bit_iterator<_Cp, _IC1> __first1 return __equal_unaligned(__first1, __last1, __first2); } -template +template class __bit_iterator { public: @@ -1232,19 +1234,23 @@ private: template friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>, __bit_iterator<_Dp, false>, __bit_iterator<_Dp, false>); - template friend bool __equal_aligned(__bit_iterator<_Dp, true>, - __bit_iterator<_Dp, true>, - __bit_iterator<_Dp, true>); - template friend bool __equal_unaligned(__bit_iterator<_Dp, true>, - __bit_iterator<_Dp, true>, - __bit_iterator<_Dp, true>); + template friend bool __equal_aligned(__bit_iterator<_Dp, _IC1>, + __bit_iterator<_Dp, _IC1>, + __bit_iterator<_Dp, _IC2>); + template friend bool __equal_unaligned(__bit_iterator<_Dp, _IC1>, + __bit_iterator<_Dp, _IC1>, + __bit_iterator<_Dp, _IC2>); template friend bool equal(__bit_iterator<_Dp, _IC1>, __bit_iterator<_Dp, _IC1>, __bit_iterator<_Dp, _IC2>); - template friend __bit_iterator<_Dp, false> __find_bool_true(__bit_iterator<_Dp, false>, + template friend __bit_iterator<_Dp, _IC> __find_bool_true(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); - template friend __bit_iterator<_Dp, false> __find_bool_false(__bit_iterator<_Dp, false>, + template friend __bit_iterator<_Dp, _IC> __find_bool_false(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); + template friend typename __bit_iterator<_Dp, _IC>::difference_type + __count_bool_true(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); + template friend typename __bit_iterator<_Dp, _IC>::difference_type + __count_bool_false(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); }; _LIBCPP_END_NAMESPACE_STD Modified: stable/9/contrib/libc++/include/__config ============================================================================== --- stable/9/contrib/libc++/include/__config Wed Nov 21 18:27:02 2012 (r243375) +++ stable/9/contrib/libc++/include/__config Wed Nov 21 18:38:56 2012 (r243376) @@ -15,7 +15,11 @@ #pragma GCC system_header #endif -#define _LIBCPP_VERSION 1001 +#ifdef __GNUC__ +#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__) +#endif + +#define _LIBCPP_VERSION 1101 #define _LIBCPP_ABI_VERSION 1 @@ -53,7 +57,8 @@ # define _LIBCPP_LITTLE_ENDIAN 1 # define _LIBCPP_BIG_ENDIAN 0 // Compiler intrinsics (GCC or MSVC) -# if (defined(_MSC_VER) && _MSC_VER >= 1400) || (__GNUC__ >= 4 && __GNUC_MINOR__ > 3) +# if (defined(_MSC_VER) && _MSC_VER >= 1400) \ + || (defined(__GNUC__) && _GNUC_VER > 403) # define _LIBCP_HAS_IS_BASE_OF # endif #endif // _WIN32 @@ -145,8 +150,10 @@ #if defined(__clang__) #if __has_feature(cxx_alignas) +# define _ALIGNAS_TYPE(x) alignas(x) # define _ALIGNAS(x) alignas(x) #else +# define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) # define _ALIGNAS(x) __attribute__((__aligned__(x))) #endif @@ -180,9 +187,9 @@ typedef __char32_t char32_t; #endif #if __has_feature(cxx_attributes) -# define _ATTRIBUTE(x) [[x]] +# define _LIBCPP_NORETURN [[noreturn]] #else -# define _ATTRIBUTE(x) __attribute__ ((x)) +# define _LIBCPP_NORETURN __attribute__ ((noreturn)) #endif #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS @@ -245,8 +252,9 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_NO_CONSTEXPR #endif -#if __FreeBSD__ +#if __FreeBSD__ && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L) #define _LIBCPP_HAS_QUICK_EXIT +#define _LIBCPP_HAS_C11_FEATURES #endif #if (__has_feature(cxx_noexcept)) @@ -274,8 +282,9 @@ namespace std { #elif defined(__GNUC__) #define _ALIGNAS(x) __attribute__((__aligned__(x))) +#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) -#define _ATTRIBUTE(x) __attribute__((x)) +#define _LIBCPP_NORETURN __attribute__((noreturn)) #if !__EXCEPTIONS #define _LIBCPP_NO_EXCEPTIONS @@ -305,15 +314,15 @@ namespace std { #define _LIBCPP_HAS_NO_TRAILING_RETURN #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS -#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#if _GNUC_VER < 403 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif -#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#if _GNUC_VER < 403 #define _LIBCPP_HAS_NO_STATIC_ASSERT #endif -#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) +#if _GNUC_VER < 404 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE #define _LIBCPP_HAS_NO_DECLTYPE #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS @@ -321,9 +330,9 @@ namespace std { #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_VARIADICS #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#endif // !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) +#endif // _GNUC_VER < 404 -#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) +#if _GNUC_VER < 406 #define _LIBCPP_HAS_NO_NULLPTR #endif @@ -347,7 +356,7 @@ using namespace _LIBCPP_NAMESPACE __attr #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS #define __alignof__ __alignof -#define _ATTRIBUTE __declspec +#define _LIBCPP_NORETURN __declspec(noreturn) #define _ALIGNAS(x) __declspec(align(x)) #define _LIBCPP_HAS_NO_VARIADICS @@ -389,6 +398,12 @@ template struct __static_asse #define _LIBCPP_CONSTEXPR constexpr #endif +#ifdef __GNUC__ +#define _NOALIAS __attribute__((malloc)) +#else +#define _NOALIAS +#endif + #ifndef __has_feature #define __has_feature(__x) 0 #endif @@ -404,6 +419,7 @@ template struct __static_asse #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ _ __v_; \ _LIBCPP_ALWAYS_INLINE x(_ __v) : __v_(__v) {} \ + _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<_>(__v)) {} \ _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ }; #else // _LIBCPP_HAS_NO_STRONG_ENUMS Modified: stable/9/contrib/libc++/include/__hash_table ============================================================================== --- stable/9/contrib/libc++/include/__hash_table Wed Nov 21 18:27:02 2012 (r243375) +++ stable/9/contrib/libc++/include/__hash_table Wed Nov 21 18:38:56 2012 (r243376) @@ -58,10 +58,31 @@ struct __hash_node value_type __value_; }; +inline _LIBCPP_INLINE_VISIBILITY +bool +__is_power2(size_t __bc) +{ + return __bc > 2 && !(__bc & (__bc - 1)); +} + +inline _LIBCPP_INLINE_VISIBILITY +size_t +__constrain_hash(size_t __h, size_t __bc) +{ + return !(__bc & (__bc - 1)) ? __h & (__bc - 1) : __h % __bc; +} + +inline _LIBCPP_INLINE_VISIBILITY +size_t +__next_pow2(size_t __n) +{ + return size_t(1) << (std::numeric_limits::digits - __clz(__n-1)); +} + template class __hash_table; -template class __hash_const_iterator; -template class __hash_map_iterator; -template class __hash_map_const_iterator; +template class _LIBCPP_VISIBLE __hash_const_iterator; +template class _LIBCPP_VISIBLE __hash_map_iterator; +template class _LIBCPP_VISIBLE __hash_map_const_iterator; template class _LIBCPP_VISIBLE unordered_map; @@ -240,7 +261,7 @@ public: __hash_local_iterator& operator++() { __node_ = __node_->__next_; - if (__node_ != nullptr && __node_->__hash_ % __bucket_count_ != __bucket_) + if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_) __node_ = nullptr; return *this; } @@ -330,7 +351,7 @@ public: __hash_const_local_iterator& operator++() { __node_ = __node_->__next_; - if (__node_ != nullptr && __node_->__hash_ % __bucket_count_ != __bucket_) + if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_) __node_ = nullptr; return *this; } @@ -637,7 +658,7 @@ public: template _LIBCPP_INLINE_VISIBILITY size_type bucket(const _Key& __k) const - {return hash_function()(__k) % bucket_count();} + {return __constrain_hash(hash_function()(__k), bucket_count());} template iterator find(const _Key& __x); @@ -871,7 +892,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> { if (size() > 0) { - __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] = + __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())); __u.__p1_.first().__next_ = nullptr; __u.size() = 0; @@ -895,7 +916,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> { __p1_.first().__next_ = __u.__p1_.first().__next_; __u.__p1_.first().__next_ = nullptr; - __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] = + __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())); size() = __u.size(); __u.size() = 0; @@ -992,7 +1013,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __p1_.first().__next_ = __u.__p1_.first().__next_; if (size() > 0) { - __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] = + __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())); __u.__p1_.first().__next_ = nullptr; __u.size() = 0; @@ -1190,12 +1211,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_t __chash; if (__bc != 0) { - __chash = __nd->__hash_ % __bc; + __chash = __constrain_hash(__nd->__hash_, __bc); __ndptr = __bucket_list_[__chash]; if (__ndptr != nullptr) { for (__ndptr = __ndptr->__next_; __ndptr != nullptr && - __ndptr->__hash_ % __bc == __chash; + __constrain_hash(__ndptr->__hash_, __bc) == __chash; __ndptr = __ndptr->__next_) { if (key_eq()(__ndptr->__value_, __nd->__value_)) @@ -1206,10 +1227,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> { if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + 1, + rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); - __chash = __nd->__hash_ % __bc; + __chash = __constrain_hash(__nd->__hash_, __bc); } // insert_after __bucket_list_[__chash], or __first_node if bucket is null __node_pointer __pn = __bucket_list_[__chash]; @@ -1221,7 +1242,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> // fix up __bucket_list_ __bucket_list_[__chash] = __pn; if (__nd->__next_ != nullptr) - __bucket_list_[__nd->__next_->__hash_ % __bc] = __nd; + __bucket_list_[__constrain_hash(__nd->__next_->__hash_, __bc)] = __nd; } else { @@ -1245,11 +1266,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_type __bc = bucket_count(); if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + 1, + rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); } - size_t __chash = __cp->__hash_ % __bc; + size_t __chash = __constrain_hash(__cp->__hash_, __bc); __node_pointer __pn = __bucket_list_[__chash]; if (__pn == nullptr) { @@ -1259,12 +1280,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> // fix up __bucket_list_ __bucket_list_[__chash] = __pn; if (__cp->__next_ != nullptr) - __bucket_list_[__cp->__next_->__hash_ % __bc] = __cp; + __bucket_list_[__constrain_hash(__cp->__next_->__hash_, __bc)] = __cp; } else { for (bool __found = false; __pn->__next_ != nullptr && - __pn->__next_->__hash_ % __bc == __chash; + __constrain_hash(__pn->__next_->__hash_, __bc) == __chash; __pn = __pn->__next_) { // __found key_eq() action @@ -1285,7 +1306,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __pn->__next_ = __cp; if (__cp->__next_ != nullptr) { - size_t __nhash = __cp->__next_->__hash_ % __bc; + size_t __nhash = __constrain_hash(__cp->__next_->__hash_, __bc); if (__nhash != __chash) __bucket_list_[__nhash] = __cp; } @@ -1306,11 +1327,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_type __bc = bucket_count(); if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + 1, + rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); } - size_t __chash = __cp->__hash_ % __bc; + size_t __chash = __constrain_hash(__cp->__hash_, __bc); __node_pointer __pp = __bucket_list_[__chash]; while (__pp->__next_ != __np) __pp = __pp->__next_; @@ -1333,12 +1354,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_t __chash; if (__bc != 0) { - __chash = __hash % __bc; + __chash = __constrain_hash(__hash, __bc); __nd = __bucket_list_[__chash]; if (__nd != nullptr) { for (__nd = __nd->__next_; __nd != nullptr && - __nd->__hash_ % __bc == __chash; + __constrain_hash(__nd->__hash_, __bc) == __chash; __nd = __nd->__next_) { if (key_eq()(__nd->__value_, __x)) @@ -1350,10 +1371,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __node_holder __h = __construct_node(__x, __hash); if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + 1, + rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); - __chash = __hash % __bc; + __chash = __constrain_hash(__hash, __bc); } // insert_after __bucket_list_[__chash], or __first_node if bucket is null __node_pointer __pn = __bucket_list_[__chash]; @@ -1365,7 +1386,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> // fix up __bucket_list_ __bucket_list_[__chash] = __pn; if (__h->__next_ != nullptr) - __bucket_list_[__h->__next_->__hash_ % __bc] = __h.get(); + __bucket_list_[__constrain_hash(__h->__next_->__hash_, __bc)] = __h.get(); } else { @@ -1489,16 +1510,20 @@ template ::rehash(size_type __n) { - __n = __next_prime(_VSTD::max(__n, size() > 0)); + if (__n == 1) + __n = 2; + else if (__n & (__n - 1)) + __n = __next_prime(__n); size_type __bc = bucket_count(); if (__n > __bc) __rehash(__n); - else + else if (__n < __bc) { __n = _VSTD::max ( __n, - __next_prime(size_t(ceil(float(size()) / max_load_factor()))) + __is_power2(__bc) ? __next_pow2(size_t(ceil(float(size()) / max_load_factor()))) : + __next_prime(size_t(ceil(float(size()) / max_load_factor()))) ); if (__n < __bc) __rehash(__n); @@ -1521,13 +1546,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __node_pointer __cp = __pp->__next_; if (__cp != nullptr) { - size_type __chash = __cp->__hash_ % __nbc; + size_type __chash = __constrain_hash(__cp->__hash_, __nbc); __bucket_list_[__chash] = __pp; size_type __phash = __chash; for (__pp = __cp, __cp = __cp->__next_; __cp != nullptr; __cp = __pp->__next_) { - __chash = __cp->__hash_ % __nbc; + __chash = __constrain_hash(__cp->__hash_, __nbc); if (__chash == __phash) __pp = __cp; else @@ -1565,12 +1590,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_type __bc = bucket_count(); if (__bc != 0) { - size_t __chash = __hash % __bc; + size_t __chash = __constrain_hash(__hash, __bc); __node_pointer __nd = __bucket_list_[__chash]; if (__nd != nullptr) { for (__nd = __nd->__next_; __nd != nullptr && - __nd->__hash_ % __bc == __chash; + __constrain_hash(__nd->__hash_, __bc) == __chash; __nd = __nd->__next_) { if (key_eq()(__nd->__value_, __k)) @@ -1590,12 +1615,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_type __bc = bucket_count(); if (__bc != 0) { - size_t __chash = __hash % __bc; + size_t __chash = __constrain_hash(__hash, __bc); __node_const_pointer __nd = __bucket_list_[__chash]; if (__nd != nullptr) { for (__nd = __nd->__next_; __nd != nullptr && - __nd->__hash_ % __bc == __chash; + __constrain_hash(__nd->__hash_, __bc) == __chash; __nd = __nd->__next_) { if (key_eq()(__nd->__value_, __k)) @@ -1734,7 +1759,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> // current node __node_pointer __cn = const_cast<__node_pointer>(__p.__node_); size_type __bc = bucket_count(); - size_t __chash = __cn->__hash_ % __bc; + size_t __chash = __constrain_hash(__cn->__hash_, __bc); // find previous node __node_pointer __pn = __bucket_list_[__chash]; for (; __pn->__next_ != __cn; __pn = __pn->__next_) @@ -1742,15 +1767,15 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> // Fix up __bucket_list_ // if __pn is not in same bucket (before begin is not in same bucket) && // if __cn->__next_ is not in same bucket (nullptr is not in same bucket) - if (__pn == _VSTD::addressof(__p1_.first()) || __pn->__hash_ % __bc != __chash) + if (__pn == _VSTD::addressof(__p1_.first()) || __constrain_hash(__pn->__hash_, __bc) != __chash) { - if (__cn->__next_ == nullptr || __cn->__next_->__hash_ % __bc != __chash) + if (__cn->__next_ == nullptr || __constrain_hash(__cn->__next_->__hash_, __bc) != __chash) __bucket_list_[__chash] = nullptr; } // if __cn->__next_ is not in same bucket (nullptr is in same bucket) if (__cn->__next_ != nullptr) { - size_t __nhash = __cn->__next_->__hash_ % __bc; + size_t __nhash = __constrain_hash(__cn->__next_->__hash_, __bc); if (__nhash != __chash) __bucket_list_[__nhash] = __pn; } @@ -1881,10 +1906,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __p2_.swap(__u.__p2_); __p3_.swap(__u.__p3_); if (size() > 0) - __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] = + __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())); if (__u.size() > 0) - __u.__bucket_list_[__u.__p1_.first().__next_->__hash_ % __u.bucket_count()] = + __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash_, __u.bucket_count())] = static_cast<__node_pointer>(_VSTD::addressof(__u.__p1_.first())); } @@ -1898,7 +1923,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> if (__np != nullptr) { for (__np = __np->__next_; __np != nullptr && - __np->__hash_ % __bc == __n; + __constrain_hash(__np->__hash_, __bc) == __n; __np = __np->__next_, ++__r) ; } Modified: stable/9/contrib/libc++/include/__locale ============================================================================== --- stable/9/contrib/libc++/include/__locale Wed Nov 21 18:27:02 2012 (r243375) +++ stable/9/contrib/libc++/include/__locale Wed Nov 21 18:38:56 2012 (r243376) @@ -31,17 +31,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD -class locale; +class _LIBCPP_VISIBLE locale; -template bool has_facet(const locale&) _NOEXCEPT; -template const _Facet& use_facet(const locale&); +template +_LIBCPP_INLINE_VISIBILITY +bool +has_facet(const locale&) _NOEXCEPT; + +template +_LIBCPP_INLINE_VISIBILITY +const _Facet& +use_facet(const locale&); class _LIBCPP_VISIBLE locale { public: // types: - class facet; - class id; + class _LIBCPP_VISIBLE facet; + class _LIBCPP_VISIBLE id; typedef int category; static const category // values assigned here are for exposition only @@ -119,7 +126,7 @@ class _LIBCPP_VISIBLE locale::id static int32_t __next_id; public: - _LIBCPP_INLINE_VISIBILITY id() {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR id() :__id_(0) {} private: void __init(); void operator=(const id&); // = delete; Modified: stable/9/contrib/libc++/include/__mutex_base ============================================================================== --- stable/9/contrib/libc++/include/__mutex_base Wed Nov 21 18:27:02 2012 (r243375) +++ stable/9/contrib/libc++/include/__mutex_base Wed Nov 21 18:38:56 2012 (r243376) @@ -38,7 +38,11 @@ class _LIBCPP_VISIBLE mutex public: _LIBCPP_INLINE_VISIBILITY - mutex() {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;} +#ifndef _LIBCPP_HAS_NO_CONSTEXPR + constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {} +#else + mutex() _NOEXCEPT {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;} +#endif ~mutex(); private: @@ -47,8 +51,8 @@ private: public: void lock(); - bool try_lock(); - void unlock(); + bool try_lock() _NOEXCEPT; + void unlock() _NOEXCEPT; typedef pthread_mutex_t* native_handle_type; _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;} @@ -58,17 +62,19 @@ struct _LIBCPP_VISIBLE defer_lock_t {}; struct _LIBCPP_VISIBLE try_to_lock_t {}; struct _LIBCPP_VISIBLE adopt_lock_t {}; -//constexpr -extern const -defer_lock_t defer_lock; - -//constexpr -extern const -try_to_lock_t try_to_lock; - -//constexpr -extern const -adopt_lock_t adopt_lock; +#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX) + +extern const defer_lock_t defer_lock; +extern const try_to_lock_t try_to_lock; +extern const adopt_lock_t adopt_lock; + +#else + +constexpr defer_lock_t defer_lock = defer_lock_t(); +constexpr try_to_lock_t try_to_lock = try_to_lock_t(); +constexpr adopt_lock_t adopt_lock = adopt_lock_t(); + +#endif template class _LIBCPP_VISIBLE lock_guard @@ -106,12 +112,12 @@ private: public: _LIBCPP_INLINE_VISIBILITY - unique_lock() : __m_(nullptr), __owns_(false) {} + unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {} _LIBCPP_INLINE_VISIBILITY explicit unique_lock(mutex_type& __m) : __m_(&__m), __owns_(true) {__m_->lock();} _LIBCPP_INLINE_VISIBILITY - unique_lock(mutex_type& __m, defer_lock_t) + unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT : __m_(&__m), __owns_(false) {} _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, try_to_lock_t) @@ -141,11 +147,11 @@ private: public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY - unique_lock(unique_lock&& __u) + unique_lock(unique_lock&& __u) _NOEXCEPT : __m_(__u.__m_), __owns_(__u.__owns_) {__u.__m_ = nullptr; __u.__owns_ = false;} _LIBCPP_INLINE_VISIBILITY - unique_lock& operator=(unique_lock&& __u) + unique_lock& operator=(unique_lock&& __u) _NOEXCEPT { if (__owns_) __m_->unlock(); @@ -190,13 +196,13 @@ public: void unlock(); _LIBCPP_INLINE_VISIBILITY - void swap(unique_lock& __u) + void swap(unique_lock& __u) _NOEXCEPT { _VSTD::swap(__m_, __u.__m_); _VSTD::swap(__owns_, __u.__owns_); } _LIBCPP_INLINE_VISIBILITY - mutex_type* release() + mutex_type* release() _NOEXCEPT { mutex_type* __m = __m_; __m_ = nullptr; @@ -205,12 +211,12 @@ public: } _LIBCPP_INLINE_VISIBILITY *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 22:04:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E0A2469D; Wed, 21 Nov 2012 22:04:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC0138FC0C; Wed, 21 Nov 2012 22:04:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qALM4ep7038319; Wed, 21 Nov 2012 22:04:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qALM4eVm038318; Wed, 21 Nov 2012 22:04:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211212204.qALM4eVm038318@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 21 Nov 2012 22:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243380 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 22:04:41 -0000 Author: hselasky Date: Wed Nov 21 22:04:40 2012 New Revision: 243380 URL: http://svnweb.freebsd.org/changeset/base/243380 Log: Fix uplcom clear stall logic for PL2303HX. Submitted by: Mark Johnston MFC after: 1 week Modified: head/sys/dev/usb/serial/uplcom.c Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Wed Nov 21 21:03:14 2012 (r243379) +++ head/sys/dev/usb/serial/uplcom.c Wed Nov 21 22:04:40 2012 (r243380) @@ -432,11 +432,21 @@ uplcom_attach(device_t dev) usbd_errstr(error)); goto detach; } - /* clear stall at first run */ - mtx_lock(&sc->sc_mtx); - usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); - usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); - mtx_unlock(&sc->sc_mtx); + + if (sc->sc_chiptype != TYPE_PL2303HX) { + /* HX variants seem to lock up after a clear stall request. */ + mtx_lock(&sc->sc_mtx); + usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); + mtx_unlock(&sc->sc_mtx); + } else { + if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, + UPLCOM_SET_REQUEST, 8, 0, 0) || + uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, + UPLCOM_SET_REQUEST, 9, 0, 0)) { + goto detach; + } + } error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, &uplcom_callback, &sc->sc_mtx); @@ -555,9 +565,6 @@ uplcom_pl2303_init(struct usb_device *ud if (err) return (EIO); - if (uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) - || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 9, 0, 0)) - return (EIO); return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 22:26:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09A53121; Wed, 21 Nov 2012 22:26:57 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id D0C1D8FC08; Wed, 21 Nov 2012 22:26:55 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id C9CE51C2; Wed, 21 Nov 2012 23:25:09 +0100 (CET) Date: Wed, 21 Nov 2012 23:28:08 +0100 From: Pawel Jakub Dawidek To: Eitan Adler Subject: Re: svn commit: r243320 - head/usr.bin/cut Message-ID: <20121121222808.GA1401@garage.freebsd.pl> References: <201211200157.qAK1vL49094329@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: <201211200157.qAK1vL49094329@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 22:26:57 -0000 --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 20, 2012 at 01:57:21AM +0000, Eitan Adler wrote: > Author: eadler > Date: Tue Nov 20 01:57:21 2012 > New Revision: 243320 > URL: http://svnweb.freebsd.org/changeset/base/243320 >=20 > Log: > Add 'w' flag to: > =20 > Use whitespace (spaces and tabs) as the delimiter. > Consecutive spaces and tabs count as one single field > separator. That's very useful. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --tThc/1wpZn/ma/RB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCtVXgACgkQForvXbEpPzRFaQCgu8cYN03d3aObu+zrKBHfhqE8 W6UAoOoBYB/AKtNw/ffq2zJNEwlXN+lf =VXHb -----END PGP SIGNATURE----- --tThc/1wpZn/ma/RB-- From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 22:37:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 587BF6D5; Wed, 21 Nov 2012 22:37:22 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 156838FC13; Wed, 21 Nov 2012 22:37:21 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 6718D1CC; Wed, 21 Nov 2012 23:35:36 +0100 (CET) Date: Wed, 21 Nov 2012 23:38:35 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r243341 - head/sys/kern Message-ID: <20121121223835.GB1401@garage.freebsd.pl> References: <201211201533.qAKFXm80046544@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CUfgB8w4ZwR/yMy5" Content-Disposition: inline In-Reply-To: <201211201533.qAKFXm80046544@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 22:37:22 -0000 --CUfgB8w4ZwR/yMy5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 20, 2012 at 03:33:48PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Nov 20 15:33:48 2012 > New Revision: 243341 > URL: http://svnweb.freebsd.org/changeset/base/243341 >=20 > Log: > Add a special meaning to the negative ticks argument for > taskqueue_enqueue_timeout(). Do not rearm the callout if it is > already armed and the ticks is negative. Otherwise rearm it to fire > in abs(ticks) ticks in the future. Can you document that in taskqueue(9)? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --CUfgB8w4ZwR/yMy5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCtV+sACgkQForvXbEpPzQ2xACglJCO/o/j2IRQ86fk6oPx3Zqu sFsAoLFomLJ2XcT77g4GOkBUx4/HFkJz =746k -----END PGP SIGNATURE----- --CUfgB8w4ZwR/yMy5-- From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 22:40:19 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF6A6929; Wed, 21 Nov 2012 22:40:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 57CA88FC0C; Wed, 21 Nov 2012 22:40:19 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qALMeER2040756; Thu, 22 Nov 2012 00:40:14 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qALMeER2040756 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qALMeE1L040752; Thu, 22 Nov 2012 00:40:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 22 Nov 2012 00:40:14 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r243341 - head/sys/kern Message-ID: <20121121224014.GG73505@kib.kiev.ua> References: <201211201533.qAKFXm80046544@svn.freebsd.org> <20121121223835.GB1401@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lvKm5YuWFrJmo0Ue" Content-Disposition: inline In-Reply-To: <20121121223835.GB1401@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 21 Nov 2012 22:40:20 -0000 --lvKm5YuWFrJmo0Ue Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 21, 2012 at 11:38:35PM +0100, Pawel Jakub Dawidek wrote: > On Tue, Nov 20, 2012 at 03:33:48PM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Tue Nov 20 15:33:48 2012 > > New Revision: 243341 > > URL: http://svnweb.freebsd.org/changeset/base/243341 > >=20 > > Log: > > Add a special meaning to the negative ticks argument for > > taskqueue_enqueue_timeout(). Do not rearm the callout if it is > > already armed and the ticks is negative. Otherwise rearm it to fire > > in abs(ticks) ticks in the future. >=20 > Can you document that in taskqueue(9)? Yes, I will, before the MFC. --lvKm5YuWFrJmo0Ue Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQrVhOAAoJEJDCuSvBvK1B5F4P/RF0sQuWo1qWg/iLROaKVns4 pFUr7ToFbwW8xMCnODT7vtwdsLLgqGHjsaSrflgbGRF/9HjX2Q6f0WSV+EJWtxpN u/Z8EIJQLaUyl3lsqo7wfna9XmMTS+oaGw9nDtakMGcOwsobORl/r3x+JYb4JQiY UnWL6HLMe1v9iGGqK6f/hko7xawv9sBaNKhQ3ixEHQIKznyH2imrD3HRDGg/0aPF oCY5BNUxCGjo+AS3kaXYj0YMEpuG8K/SaBYb9Bsg79BH/abi7OmHleG7CEEuNyUr dfp7LetR3tDH3Zi3eQQwlEzK9izeJhSuySPy0TmpX9M+PHsLGli10/7Liy6qs13y gNN9W5PPw5a3QvRKydjYGxL3TCzZqZraJ38xtSAgKQ42PVcz/hqZq/1SoZCOFKb0 2FtesDfp8xBBzK2cz0UoAXYUezqC8DNMWgNO8su6czDMCQlMF/ODr6a4wO2Jh+de 94ONw056dqdg9J4YGJOJK3VL7Jq2HjPxxSKyLwkUSm0bbhdk+xmU3C5Y0+0T+P9Y fGgOkgRLyZilXuFd1II53Voo1/3Z0N2+zjCKzQEPT+pyFeDIFyrtGI/mXg/ekYEE jmoqDJLa2YppLn7WdKKU69iH2aylsGIabfwpeJdfLQJwxwUZbgW5e4O6yBoHQG4k 12xLbuaA9gSCC7Fdu9DI =dZfh -----END PGP SIGNATURE----- --lvKm5YuWFrJmo0Ue-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 00:22:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E4ACA16; Thu, 22 Nov 2012 00:22:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 619A38FC0C; Thu, 22 Nov 2012 00:22:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM0MtBR060619; Thu, 22 Nov 2012 00:22:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM0MtUN060613; Thu, 22 Nov 2012 00:22:55 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211220022.qAM0MtUN060613@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 22 Nov 2012 00:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243382 - stable/9/sys/netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 00:22:55 -0000 Author: ae Date: Thu Nov 22 00:22:54 2012 New Revision: 243382 URL: http://svnweb.freebsd.org/changeset/base/243382 Log: MFC r243028: zoneid has unsigned type. MFC r243029: SCOPE6_LOCK protects V_sid_default, no need to acquire it without any access to V_sid_default. MFC r243031: if_afdata lock was converted from mutex to rwlock a long ago, so we can replace IF_AFDATA_LOCK() macro depending to the access type. MFC r243148: Reduce the overhead of locking, use IF_AFDATA_RLOCK() when we are doing simple lookups. Modified: stable/9/sys/netinet6/icmp6.c stable/9/sys/netinet6/in6_src.c stable/9/sys/netinet6/ip6_input.c stable/9/sys/netinet6/nd6.c stable/9/sys/netinet6/nd6_rtr.c stable/9/sys/netinet6/scope6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/icmp6.c ============================================================================== --- stable/9/sys/netinet6/icmp6.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/icmp6.c Thu Nov 22 00:22:54 2012 (r243382) @@ -2681,9 +2681,9 @@ icmp6_redirect_output(struct mbuf *m0, s struct nd_opt_hdr *nd_opt; char *lladdr; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = nd6_lookup(router_ll6, 0, ifp); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ln == NULL) goto nolladdropt; Modified: stable/9/sys/netinet6/in6_src.c ============================================================================== --- stable/9/sys/netinet6/in6_src.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/in6_src.c Thu Nov 22 00:22:54 2012 (r243382) @@ -608,9 +608,9 @@ selectroute(struct sockaddr_in6 *dstsock rt = ron->ro_rt; ifp = rt->rt_ifp; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); la = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)&sin6_next->sin6_addr); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (la != NULL) LLE_RUNLOCK(la); else { Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/ip6_input.c Thu Nov 22 00:22:54 2012 (r243382) @@ -685,10 +685,10 @@ passin: dst6.sin6_len = sizeof(struct sockaddr_in6); dst6.sin6_addr = ip6->ip6_dst; ifp = m->m_pkthdr.rcvif; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); lle = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)&dst6); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if ((lle != NULL) && (lle->la_flags & LLE_IFADDR)) { struct ifaddr *ifa; struct in6_ifaddr *ia6; Modified: stable/9/sys/netinet6/nd6.c ============================================================================== --- stable/9/sys/netinet6/nd6.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/nd6.c Thu Nov 22 00:22:54 2012 (r243382) @@ -978,12 +978,12 @@ nd6_is_addr_neighbor(struct sockaddr_in6 * Even if the address matches none of our addresses, it might be * in the neighbor cache. */ - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); if ((lle = nd6_lookup(&addr->sin6_addr, 0, ifp)) != NULL) { LLE_RUNLOCK(lle); rc = 1; } - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (rc); } @@ -1502,9 +1502,9 @@ nd6_ioctl(u_long cmd, caddr_t data, stru if ((error = in6_setscope(&nb_addr, ifp, NULL)) != 0) return (error); - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = nd6_lookup(&nb_addr, 0, ifp); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ln == NULL) { error = EINVAL; @@ -2223,9 +2223,9 @@ nd6_storelladdr(struct ifnet *ifp, struc /* * the entry should have been created in nd6_store_lladdr */ - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = lla_lookup(LLTABLE6(ifp), 0, dst); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if ((ln == NULL) || !(ln->la_flags & LLE_VALID)) { if (ln != NULL) LLE_RUNLOCK(ln); Modified: stable/9/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/9/sys/netinet6/nd6_rtr.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/nd6_rtr.c Thu Nov 22 00:22:54 2012 (r243382) @@ -643,13 +643,13 @@ defrouter_select(void) * the ordering rule of the list described in defrtrlist_update(). */ TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - IF_AFDATA_LOCK(dr->ifp); + IF_AFDATA_RLOCK(dr->ifp); if (selected_dr == NULL && (ln = nd6_lookup(&dr->rtaddr, 0, dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln)) { selected_dr = dr; } - IF_AFDATA_UNLOCK(dr->ifp); + IF_AFDATA_RUNLOCK(dr->ifp); if (ln != NULL) { LLE_RUNLOCK(ln); ln = NULL; @@ -677,13 +677,13 @@ defrouter_select(void) else selected_dr = TAILQ_NEXT(installed_dr, dr_entry); } else if (installed_dr) { - IF_AFDATA_LOCK(installed_dr->ifp); + IF_AFDATA_RLOCK(installed_dr->ifp); if ((ln = nd6_lookup(&installed_dr->rtaddr, 0, installed_dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln) && rtpref(selected_dr) <= rtpref(installed_dr)) { selected_dr = installed_dr; } - IF_AFDATA_UNLOCK(installed_dr->ifp); + IF_AFDATA_RUNLOCK(installed_dr->ifp); if (ln != NULL) LLE_RUNLOCK(ln); } @@ -1326,9 +1326,9 @@ find_pfxlist_reachable_router(struct nd_ int canreach; LIST_FOREACH(pfxrtr, &pr->ndpr_advrtrs, pfr_entry) { - IF_AFDATA_LOCK(pfxrtr->router->ifp); + IF_AFDATA_RLOCK(pfxrtr->router->ifp); ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, pfxrtr->router->ifp); - IF_AFDATA_UNLOCK(pfxrtr->router->ifp); + IF_AFDATA_RUNLOCK(pfxrtr->router->ifp); if (ln == NULL) continue; canreach = ND6_IS_LLINFO_PROBREACH(ln); Modified: stable/9/sys/netinet6/scope6.c ============================================================================== --- stable/9/sys/netinet6/scope6.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/scope6.c Thu Nov 22 00:22:54 2012 (r243382) @@ -121,11 +121,11 @@ scope6_set(struct ifnet *ifp, struct sco int error = 0; struct scope6_id *sid = NULL; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_WLOCK(ifp); sid = SID(ifp); if (!sid) { /* paranoid? */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -139,7 +139,6 @@ scope6_set(struct ifnet *ifp, struct sco * interface addresses, routing table entries, PCB entries... */ - SCOPE6_LOCK(); for (i = 0; i < 16; i++) { if (idlist->s6id_list[i] && idlist->s6id_list[i] != sid->s6id_list[i]) { @@ -149,8 +148,7 @@ scope6_set(struct ifnet *ifp, struct sco */ if (i == IPV6_ADDR_SCOPE_INTFACELOCAL && idlist->s6id_list[i] != ifp->if_index) { - IF_AFDATA_UNLOCK(ifp); - SCOPE6_UNLOCK(); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -162,8 +160,7 @@ scope6_set(struct ifnet *ifp, struct sco * IDs, but we check the consistency for * safety in later use. */ - IF_AFDATA_UNLOCK(ifp); - SCOPE6_UNLOCK(); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -175,8 +172,7 @@ scope6_set(struct ifnet *ifp, struct sco sid->s6id_list[i] = idlist->s6id_list[i]; } } - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_WUNLOCK(ifp); return (error); } @@ -184,20 +180,19 @@ scope6_set(struct ifnet *ifp, struct sco int scope6_get(struct ifnet *ifp, struct scope6_id *idlist) { - /* We only need to lock the interface's afdata for SID() to work. */ - IF_AFDATA_LOCK(ifp); - struct scope6_id *sid = SID(ifp); + struct scope6_id *sid; + /* We only need to lock the interface's afdata for SID() to work. */ + IF_AFDATA_RLOCK(ifp); + sid = SID(ifp); if (sid == NULL) { /* paranoid? */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (EINVAL); } - SCOPE6_LOCK(); *idlist = *sid; - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (0); } @@ -388,7 +383,7 @@ sa6_recoverscope(struct sockaddr_in6 *si zoneid = ntohs(sin6->sin6_addr.s6_addr16[1]); if (zoneid) { /* sanity check */ - if (zoneid < 0 || V_if_index < zoneid) + if (V_if_index < zoneid) return (ENXIO); if (!ifnet_byindex(zoneid)) return (ENXIO); @@ -414,7 +409,7 @@ in6_setscope(struct in6_addr *in6, struc u_int32_t zoneid = 0; struct scope6_id *sid; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); sid = SID(ifp); @@ -431,19 +426,17 @@ in6_setscope(struct in6_addr *in6, struc */ if (IN6_IS_ADDR_LOOPBACK(in6)) { if (!(ifp->if_flags & IFF_LOOPBACK)) { - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (EINVAL); } else { if (ret_id != NULL) *ret_id = 0; /* there's no ambiguity */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (0); } } scope = in6_addrscope(in6); - - SCOPE6_LOCK(); switch (scope) { case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */ zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL]; @@ -465,8 +458,7 @@ in6_setscope(struct in6_addr *in6, struc zoneid = 0; /* XXX: treat as global. */ break; } - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ret_id != NULL) *ret_id = zoneid; From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 00:25:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0326BB1; Thu, 22 Nov 2012 00:25:58 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85AD88FC0C; Thu, 22 Nov 2012 00:25:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM0Pw8Q060979; Thu, 22 Nov 2012 00:25:58 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM0PwVL060970; Thu, 22 Nov 2012 00:25:58 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211220025.qAM0PwVL060970@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 22 Nov 2012 00:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243383 - stable/8/sys/netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 00:25:58 -0000 Author: ae Date: Thu Nov 22 00:25:57 2012 New Revision: 243383 URL: http://svnweb.freebsd.org/changeset/base/243383 Log: MFC r243028: zoneid has unsigned type. MFC r243029: SCOPE6_LOCK protects V_sid_default, no need to acquire it without any access to V_sid_default. MFC r243031: if_afdata lock was converted from mutex to rwlock a long ago, so we can replace IF_AFDATA_LOCK() macro depending to the access type. MFC r243148: Reduce the overhead of locking, use IF_AFDATA_RLOCK() when we are doing simple lookups. Modified: stable/8/sys/netinet6/icmp6.c stable/8/sys/netinet6/in6_src.c stable/8/sys/netinet6/ip6_input.c stable/8/sys/netinet6/nd6.c stable/8/sys/netinet6/nd6_rtr.c stable/8/sys/netinet6/scope6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet6/icmp6.c ============================================================================== --- stable/8/sys/netinet6/icmp6.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/icmp6.c Thu Nov 22 00:25:57 2012 (r243383) @@ -2600,9 +2600,9 @@ icmp6_redirect_output(struct mbuf *m0, s struct nd_opt_hdr *nd_opt; char *lladdr; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = nd6_lookup(router_ll6, 0, ifp); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ln == NULL) goto nolladdropt; Modified: stable/8/sys/netinet6/in6_src.c ============================================================================== --- stable/8/sys/netinet6/in6_src.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/in6_src.c Thu Nov 22 00:25:57 2012 (r243383) @@ -608,9 +608,9 @@ selectroute(struct sockaddr_in6 *dstsock rt = ron->ro_rt; ifp = rt->rt_ifp; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); la = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)&sin6_next->sin6_addr); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (la != NULL) LLE_RUNLOCK(la); else { Modified: stable/8/sys/netinet6/ip6_input.c ============================================================================== --- stable/8/sys/netinet6/ip6_input.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/ip6_input.c Thu Nov 22 00:25:57 2012 (r243383) @@ -542,10 +542,10 @@ passin: dst6.sin6_len = sizeof(struct sockaddr_in6); dst6.sin6_addr = ip6->ip6_dst; ifp = m->m_pkthdr.rcvif; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); lle = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)&dst6); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if ((lle != NULL) && (lle->la_flags & LLE_IFADDR)) { struct ifaddr *ifa; struct in6_ifaddr *ia6; Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/nd6.c Thu Nov 22 00:25:57 2012 (r243383) @@ -977,12 +977,12 @@ nd6_is_addr_neighbor(struct sockaddr_in6 * Even if the address matches none of our addresses, it might be * in the neighbor cache. */ - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); if ((lle = nd6_lookup(&addr->sin6_addr, 0, ifp)) != NULL) { LLE_RUNLOCK(lle); rc = 1; } - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (rc); } @@ -1402,9 +1402,9 @@ nd6_ioctl(u_long cmd, caddr_t data, stru if ((error = in6_setscope(&nb_addr, ifp, NULL)) != 0) return (error); - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = nd6_lookup(&nb_addr, 0, ifp); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ln == NULL) { error = EINVAL; @@ -2096,9 +2096,9 @@ nd6_storelladdr(struct ifnet *ifp, struc /* * the entry should have been created in nd6_store_lladdr */ - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = lla_lookup(LLTABLE6(ifp), 0, dst); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if ((ln == NULL) || !(ln->la_flags & LLE_VALID)) { if (ln != NULL) LLE_RUNLOCK(ln); Modified: stable/8/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/8/sys/netinet6/nd6_rtr.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/nd6_rtr.c Thu Nov 22 00:25:57 2012 (r243383) @@ -647,13 +647,13 @@ defrouter_select(void) * the ordering rule of the list described in defrtrlist_update(). */ TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - IF_AFDATA_LOCK(dr->ifp); + IF_AFDATA_RLOCK(dr->ifp); if (selected_dr == NULL && (ln = nd6_lookup(&dr->rtaddr, 0, dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln)) { selected_dr = dr; } - IF_AFDATA_UNLOCK(dr->ifp); + IF_AFDATA_RUNLOCK(dr->ifp); if (ln != NULL) { LLE_RUNLOCK(ln); ln = NULL; @@ -681,13 +681,13 @@ defrouter_select(void) else selected_dr = TAILQ_NEXT(installed_dr, dr_entry); } else if (installed_dr) { - IF_AFDATA_LOCK(installed_dr->ifp); + IF_AFDATA_RLOCK(installed_dr->ifp); if ((ln = nd6_lookup(&installed_dr->rtaddr, 0, installed_dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln) && rtpref(selected_dr) <= rtpref(installed_dr)) { selected_dr = installed_dr; } - IF_AFDATA_UNLOCK(installed_dr->ifp); + IF_AFDATA_RUNLOCK(installed_dr->ifp); if (ln != NULL) LLE_RUNLOCK(ln); } @@ -1330,9 +1330,9 @@ find_pfxlist_reachable_router(struct nd_ int canreach; LIST_FOREACH(pfxrtr, &pr->ndpr_advrtrs, pfr_entry) { - IF_AFDATA_LOCK(pfxrtr->router->ifp); + IF_AFDATA_RLOCK(pfxrtr->router->ifp); ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, pfxrtr->router->ifp); - IF_AFDATA_UNLOCK(pfxrtr->router->ifp); + IF_AFDATA_RUNLOCK(pfxrtr->router->ifp); if (ln == NULL) continue; canreach = ND6_IS_LLINFO_PROBREACH(ln); Modified: stable/8/sys/netinet6/scope6.c ============================================================================== --- stable/8/sys/netinet6/scope6.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/scope6.c Thu Nov 22 00:25:57 2012 (r243383) @@ -121,11 +121,11 @@ scope6_set(struct ifnet *ifp, struct sco int error = 0; struct scope6_id *sid = NULL; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_WLOCK(ifp); sid = SID(ifp); if (!sid) { /* paranoid? */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -139,7 +139,6 @@ scope6_set(struct ifnet *ifp, struct sco * interface addresses, routing table entries, PCB entries... */ - SCOPE6_LOCK(); for (i = 0; i < 16; i++) { if (idlist->s6id_list[i] && idlist->s6id_list[i] != sid->s6id_list[i]) { @@ -149,8 +148,7 @@ scope6_set(struct ifnet *ifp, struct sco */ if (i == IPV6_ADDR_SCOPE_INTFACELOCAL && idlist->s6id_list[i] != ifp->if_index) { - IF_AFDATA_UNLOCK(ifp); - SCOPE6_UNLOCK(); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -162,8 +160,7 @@ scope6_set(struct ifnet *ifp, struct sco * IDs, but we check the consistency for * safety in later use. */ - IF_AFDATA_UNLOCK(ifp); - SCOPE6_UNLOCK(); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -175,8 +172,7 @@ scope6_set(struct ifnet *ifp, struct sco sid->s6id_list[i] = idlist->s6id_list[i]; } } - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_WUNLOCK(ifp); return (error); } @@ -184,20 +180,19 @@ scope6_set(struct ifnet *ifp, struct sco int scope6_get(struct ifnet *ifp, struct scope6_id *idlist) { - /* We only need to lock the interface's afdata for SID() to work. */ - IF_AFDATA_LOCK(ifp); - struct scope6_id *sid = SID(ifp); + struct scope6_id *sid; + /* We only need to lock the interface's afdata for SID() to work. */ + IF_AFDATA_RLOCK(ifp); + sid = SID(ifp); if (sid == NULL) { /* paranoid? */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (EINVAL); } - SCOPE6_LOCK(); *idlist = *sid; - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (0); } @@ -388,7 +383,7 @@ sa6_recoverscope(struct sockaddr_in6 *si zoneid = ntohs(sin6->sin6_addr.s6_addr16[1]); if (zoneid) { /* sanity check */ - if (zoneid < 0 || V_if_index < zoneid) + if (V_if_index < zoneid) return (ENXIO); if (!ifnet_byindex(zoneid)) return (ENXIO); @@ -414,7 +409,7 @@ in6_setscope(struct in6_addr *in6, struc u_int32_t zoneid = 0; struct scope6_id *sid; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); sid = SID(ifp); @@ -431,19 +426,17 @@ in6_setscope(struct in6_addr *in6, struc */ if (IN6_IS_ADDR_LOOPBACK(in6)) { if (!(ifp->if_flags & IFF_LOOPBACK)) { - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (EINVAL); } else { if (ret_id != NULL) *ret_id = 0; /* there's no ambiguity */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (0); } } scope = in6_addrscope(in6); - - SCOPE6_LOCK(); switch (scope) { case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */ zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL]; @@ -465,8 +458,7 @@ in6_setscope(struct in6_addr *in6, struc zoneid = 0; /* XXX: treat as global. */ break; } - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ret_id != NULL) *ret_id = zoneid; From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 03:54:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3280C0C; Thu, 22 Nov 2012 03:54:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D0EB48FC0C; Thu, 22 Nov 2012 03:54:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM3spSx087761; Thu, 22 Nov 2012 03:54:51 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM3spp2087760; Thu, 22 Nov 2012 03:54:51 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211220354.qAM3spp2087760@svn.freebsd.org> From: Ed Maste Date: Thu, 22 Nov 2012 03:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243387 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 03:54:52 -0000 Author: emaste Date: Thu Nov 22 03:54:51 2012 New Revision: 243387 URL: http://svnweb.freebsd.org/changeset/base/243387 Log: Use %u for unsigned serial number Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Thu Nov 22 03:45:14 2012 (r243386) +++ head/sys/dev/mmc/mmc.c Thu Nov 22 03:54:51 2012 (r243387) @@ -878,7 +878,7 @@ mmc_format_card_id_string(struct mmc_iva else snprintf(oidstr, sizeof(oidstr), "0x%04x", ivar->cid.oid); snprintf(ivar->card_id_string, sizeof(ivar->card_id_string), - "%s%s %s %d.%d SN %d MFG %02d/%04d by %d %s", + "%s%s %s %d.%d SN %u MFG %02d/%04d by %d %s", ivar->mode == mode_sd ? "SD" : "MMC", ivar->high_cap ? "HC" : "", ivar->cid.pnm, ivar->cid.prv >> 4, ivar->cid.prv & 0x0f, ivar->cid.psn, ivar->cid.mdt_month, ivar->cid.mdt_year, From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 04:50:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 908ED9F3; Thu, 22 Nov 2012 04:50:42 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7601C8FC13; Thu, 22 Nov 2012 04:50:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM4ogNA096217; Thu, 22 Nov 2012 04:50:42 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM4ogF5096216; Thu, 22 Nov 2012 04:50:42 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201211220450.qAM4ogF5096216@svn.freebsd.org> From: "Simon J. Gerraty" Date: Thu, 22 Nov 2012 04:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243392 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 04:50:42 -0000 Author: sjg Date: Thu Nov 22 04:50:42 2012 New Revision: 243392 URL: http://svnweb.freebsd.org/changeset/base/243392 Log: INSTALL_AS_USER: output of id -un will never match 0 so use id -u and USER for BINOWN etc. Approved by: marcel (mentor) Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu Nov 22 04:17:32 2012 (r243391) +++ head/share/mk/bsd.own.mk Thu Nov 22 04:50:42 2012 (r243392) @@ -678,11 +678,14 @@ CTFCONVERT_CMD= @: .endif .if ${MK_INSTALL_AS_USER} != "no" -_uid!= id -un +_uid!= id -u .if ${_uid} != 0 +.if !defined(USER) +USER!= id -un +.endif _gid!= id -gn .for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE -$xOWN= ${_uid} +$xOWN= ${USER} $xGRP= ${_gid} .endfor .endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 04:53:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 57B06C53; Thu, 22 Nov 2012 04:53:10 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3D3CF8FC08; Thu, 22 Nov 2012 04:53:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM4rArY096689; Thu, 22 Nov 2012 04:53:10 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM4rA7j096688; Thu, 22 Nov 2012 04:53:10 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201211220453.qAM4rA7j096688@svn.freebsd.org> From: "Simon J. Gerraty" Date: Thu, 22 Nov 2012 04:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243393 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 04:53:10 -0000 Author: sjg Date: Thu Nov 22 04:53:09 2012 New Revision: 243393 URL: http://svnweb.freebsd.org/changeset/base/243393 Log: If .PARSEDIR is defined we have bmake, and CTFCONVERT_CMD can be empty. PR: 172440 Approved by: marcel (mentor) Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu Nov 22 04:50:42 2012 (r243392) +++ head/share/mk/bsd.own.mk Thu Nov 22 04:53:09 2012 (r243393) @@ -671,7 +671,7 @@ MK_${var}:= no .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.elif defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300 +.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) CTFCONVERT_CMD= .else CTFCONVERT_CMD= @: From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 06:45:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40A3AE3E; Thu, 22 Nov 2012 06:45:29 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 086FB8FC0C; Thu, 22 Nov 2012 06:45:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM6jSZU015345; Thu, 22 Nov 2012 06:45:28 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM6jSL1015342; Thu, 22 Nov 2012 06:45:28 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211220645.qAM6jSL1015342@svn.freebsd.org> From: Martin Matuska Date: Thu, 22 Nov 2012 06:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r243395 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/man/man1m X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 06:45:29 -0000 Author: mm Date: Thu Nov 22 06:45:28 2012 New Revision: 243395 URL: http://svnweb.freebsd.org/changeset/base/243395 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13889:a67716f16746 (illumos zfs issue #3254) Modified: vendor-sys/illumos/dist/common/zfs/zfs_prop.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor-sys/illumos/dist/common/zfs/zfs_prop.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfs_prop.c Thu Nov 22 05:48:29 2012 (r243394) +++ vendor-sys/illumos/dist/common/zfs/zfs_prop.c Thu Nov 22 06:45:28 2012 (r243395) @@ -109,6 +109,7 @@ zfs_prop_init(void) { "discard", ZFS_ACL_DISCARD }, { "groupmask", ZFS_ACL_GROUPMASK }, { "passthrough", ZFS_ACL_PASSTHROUGH }, + { "restricted", ZFS_ACL_RESTRICTED }, { NULL } }; @@ -217,7 +218,8 @@ zfs_prop_init(void) "hidden | visible", "SNAPDIR", snapdir_table); zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, - "discard | groupmask | passthrough", "ACLMODE", acl_mode_table); + "discard | groupmask | passthrough | restricted", "ACLMODE", + acl_mode_table); zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "discard | noallow | restricted | passthrough | passthrough-x", Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Thu Nov 22 05:48:29 2012 (r243394) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Thu Nov 22 06:45:28 2012 (r243395) @@ -2982,6 +2982,12 @@ top: uint64_t acl_obj; new_mode = (pmode & S_IFMT) | (vap->va_mode & ~S_IFMT); + if (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_RESTRICTED && + !(zp->z_pflags & ZFS_ACL_TRIVIAL)) { + err = EPERM; + goto out; + } + if (err = zfs_acl_chmod_setattr(zp, &aclp, new_mode)) goto out; From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 06:45:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 539C4E3F; Thu, 22 Nov 2012 06:45:29 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 356A18FC13; Thu, 22 Nov 2012 06:45:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM6jTXe015351; Thu, 22 Nov 2012 06:45:29 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM6jTaX015350; Thu, 22 Nov 2012 06:45:29 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201211220645.qAM6jTaX015350@svn.freebsd.org> From: Martin Matuska Date: Thu, 22 Nov 2012 06:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r243395 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 06:45:29 -0000 Author: mm Date: Thu Nov 22 06:45:28 2012 New Revision: 243395 URL: http://svnweb.freebsd.org/changeset/base/243395 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13889:a67716f16746 (illumos zfs issue #3254) Modified: vendor/illumos/dist/man/man1m/zfs.1m Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/common/zfs/zfs_prop.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Thu Nov 22 05:48:29 2012 (r243394) +++ vendor/illumos/dist/man/man1m/zfs.1m Thu Nov 22 06:45:28 2012 (r243395) @@ -830,7 +830,7 @@ mode from the application. .sp .ne 2 .na -\fB\fBaclmode\fR=\fBdiscard\fR | \fBgroupmask\fR | \fBpassthrough\fR\fR +\fB\fBaclmode\fR=\fBdiscard\fR | \fBgroupmask\fR | \fBpassthrough\fR\fR | \fBrestricted\fR\fR .ad .sp .6 .RS 4n @@ -839,10 +839,18 @@ an \fBaclmode\fR property of \fBdiscard\ entries that do not represent the mode of the file. An \fBaclmode\fR property of \fBgroupmask\fR reduces permissions granted in all \fBALLOW\fR entries found in the \fBACL\fR such that they are no greater than the group permissions -specified by \fBchmod\fR. A file system with an \fBaclmode\fR property of +specified by \fBchmod\fR(2). A file system with an \fBaclmode\fR property of \fBpassthrough\fR indicates that no changes are made to the \fBACL\fR other -than creating or updating the necessary \fBACL\fR entries to -represent the new mode of the file or directory. +than creating or updating the necessary \fBACL\fR entries to represent the new +mode of the file or directory. An \fBaclmode\fR property of \fBrestricted\fR +will cause the \fBchmod\fR(2) operation to return an error when used on any +file or directory which has a non-trivial \fBACL\fR whose entries can not be +represented by a mode. \fBchmod\fR(2) is required to change the set user ID, +set group ID, or sticky bits on a file or directory, as they do not have +equivalent \fBACL\fR entries. In order to use \fBchmod\fR(2) on a file or +directory with a non-trivial \fBACL\fR when \fBaclmode\fR is set to +\fBrestricted\fR, you must first remove all \fBACL\fR entries which do not +represent the current mode. .RE .sp @@ -3939,7 +3947,7 @@ Interface Stability Committed \fBssh\fR(1), \fBiscsitadm\fR(1M), \fBmount\fR(1M), \fBshare\fR(1M), \fBsharemgr\fR(1M), \fBunshare\fR(1M), \fBzonecfg\fR(1M), \fBzpool\fR(1M), \fBchmod\fR(2), \fBstat\fR(2), \fBwrite\fR(2), \fBfsync\fR(3C), -\fBdfstab\fR(4), \fBattributes\fR(5) +\fBdfstab\fR(4), \fBacl\fR(5), \fBattributes\fR(5) .sp .LP See the \fBgzip\fR(1) man page, which is not part of the SunOS man page From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 08:58:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0E823A3; Thu, 22 Nov 2012 08:58:30 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4C088FC0C; Thu, 22 Nov 2012 08:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM8wTTm036936; Thu, 22 Nov 2012 08:58:29 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM8wTG4036930; Thu, 22 Nov 2012 08:58:29 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201211220858.qAM8wTG4036930@svn.freebsd.org> From: Davide Italiano Date: Thu, 22 Nov 2012 08:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243396 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 08:58:31 -0000 Author: davide Date: Thu Nov 22 08:58:29 2012 New Revision: 243396 URL: http://svnweb.freebsd.org/changeset/base/243396 Log: Until now, smbfs_fullpath() computed the full path starting from the vnode and following back the chain of n_parent pointers up to the root, without acquiring the locks of the n_parent vnodes analyzed during the computation. This is immediately wrong because if the vnode lock is not held there's no guarantee on the validity of the vnode pointer or the data. In order to fix, store the whole path in the smbnode structure so that smbfs_fullpath() can use this information. Discussed with: kib Reported and tested by: pho Sponsored by: iXsystems inc. Modified: head/sys/fs/smbfs/smbfs_io.c head/sys/fs/smbfs/smbfs_node.c head/sys/fs/smbfs/smbfs_node.h head/sys/fs/smbfs/smbfs_subr.c head/sys/fs/smbfs/smbfs_vfsops.c Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Thu Nov 22 06:45:28 2012 (r243395) +++ head/sys/fs/smbfs/smbfs_io.c Thu Nov 22 08:58:29 2012 (r243396) @@ -97,7 +97,7 @@ smbfs_readvdir(struct vnode *vp, struct bzero((caddr_t)&de, DE_SIZE); de.d_reclen = DE_SIZE; de.d_fileno = (offset == 0) ? np->n_ino : - (np->n_parent ? VTOSMB(np->n_parent)->n_ino : 2); + (np->n_parent ? np->n_parentino : 2); if (de.d_fileno == 0) de.d_fileno = 0x7ffffffd + offset; de.d_namlen = offset + 1; Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Thu Nov 22 06:45:28 2012 (r243395) +++ head/sys/fs/smbfs/smbfs_node.c Thu Nov 22 08:58:29 2012 (r243396) @@ -98,8 +98,9 @@ smbfs_vnode_cmp(struct vnode *vp, void * } static int -smbfs_node_alloc(struct mount *mp, struct vnode *dvp, - const char *name, int nmlen, struct smbfattr *fap, struct vnode **vpp) +smbfs_node_alloc(struct mount *mp, struct vnode *dvp, const char *dirnm, + int dirlen, const char *name, int nmlen, char sep, + struct smbfattr *fap, struct vnode **vpp) { struct vattr vattr; struct thread *td = curthread; /* XXX */ @@ -107,7 +108,8 @@ smbfs_node_alloc(struct mount *mp, struc struct smbnode *np, *dnp; struct vnode *vp, *vp2; struct smbcmp sc; - int error; + char *p, *rpath; + int error, rplen; sc.n_parent = dvp; sc.n_nmlen = nmlen; @@ -173,18 +175,36 @@ smbfs_node_alloc(struct mount *mp, struc return (error); vp = *vpp; np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); + rplen = dirlen; + if (sep != '\0') + rplen++; + rplen += nmlen; + rpath = malloc(rplen + 1, M_SMBNODENAME, M_WAITOK); + p = rpath; + bcopy(dirnm, p, dirlen); + p += dirlen; + if (sep != '\0') + *p++ = sep; + if (name != NULL) { + bcopy(name, p, nmlen); + p += nmlen; + } + MPASS(p == rpath + rplen); lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); /* Vnode initialization */ vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG; vp->v_data = np; np->n_vnode = vp; np->n_mount = VFSTOSMBFS(mp); + np->n_rpath = rpath; + np->n_rplen = rplen; np->n_nmlen = nmlen; np->n_name = smbfs_name_alloc(name, nmlen); np->n_ino = fap->fa_ino; if (dvp) { ASSERT_VOP_LOCKED(dvp, "smbfs_node_alloc"); np->n_parent = dvp; + np->n_parentino = VTOSMB(dvp)->n_ino; if (/*vp->v_type == VDIR &&*/ (dvp->v_vflag & VV_ROOT) == 0) { vref(dvp); np->n_flag |= NREFPARENT; @@ -209,14 +229,23 @@ int smbfs_nget(struct mount *mp, struct vnode *dvp, const char *name, int nmlen, struct smbfattr *fap, struct vnode **vpp) { - struct smbnode *np; + struct smbnode *dnp, *np; struct vnode *vp; - int error; + int error, sep; *vpp = NULL; - error = smbfs_node_alloc(mp, dvp, name, nmlen, fap, &vp); + dnp = (dvp) ? VTOSMB(dvp) : NULL; + sep = 0; + if (dnp != NULL) { + sep = SMBFS_DNP_SEP(dnp); + error = smbfs_node_alloc(mp, dvp, dnp->n_rpath, dnp->n_rplen, + name, nmlen, sep, fap, &vp); + } else + error = smbfs_node_alloc(mp, NULL, "\\", 1, name, nmlen, + sep, fap, &vp); if (error) return error; + MPASS(vp != NULL); np = VTOSMB(vp); if (fap) smbfs_attr_cacheenter(vp, fap); @@ -256,6 +285,8 @@ smbfs_reclaim(ap) vfs_hash_remove(vp); if (np->n_name) smbfs_name_free(np->n_name); + if (np->n_rpath) + free(np->n_rpath, M_SMBNODENAME); free(np, M_SMBNODE); vp->v_data = NULL; if (dvp != NULL) { Modified: head/sys/fs/smbfs/smbfs_node.h ============================================================================== --- head/sys/fs/smbfs/smbfs_node.h Thu Nov 22 06:45:28 2012 (r243395) +++ head/sys/fs/smbfs/smbfs_node.h Thu Nov 22 08:58:29 2012 (r243396) @@ -53,9 +53,12 @@ struct smbnode { struct timespec n_atime; /* last access time */ u_quad_t n_size; long n_ino; + long n_parentino; /* parent inode number */ int n_dosattr; u_int16_t n_fid; /* file handle */ int n_rwstate; /* granted access mode */ + int n_rplen; + char * n_rpath; u_char n_nmlen; u_char * n_name; struct smbfs_fctx * n_dirseq; /* ff context */ @@ -72,6 +75,8 @@ struct smbcmp { #define VTOSMB(vp) ((struct smbnode *)(vp)->v_data) #define SMBTOV(np) ((struct vnode *)(np)->n_vnode) +#define SMBFS_DNP_SEP(dnp) ((dnp->n_rplen > 1) ? '\\' : '\0') + struct vop_getpages_args; struct vop_inactive_args; struct vop_putpages_args; Modified: head/sys/fs/smbfs/smbfs_subr.c ============================================================================== --- head/sys/fs/smbfs/smbfs_subr.c Thu Nov 22 06:45:28 2012 (r243395) +++ head/sys/fs/smbfs/smbfs_subr.c Thu Nov 22 08:58:29 2012 (r243396) @@ -107,44 +107,6 @@ smb_dos2unixtime(u_int dd, u_int dt, u_i smb_time_server2local(tsp->tv_sec, tzoff, tsp); } -static int -smb_fphelp(struct mbchain *mbp, struct smb_vc *vcp, struct smbnode *np, - int caseopt) -{ - struct smbmount *smp= np->n_mount; - struct smbnode **npp = smp->sm_npstack; - int i, error = 0; - -/* simple_lock(&smp->sm_npslock);*/ - i = 0; - while (np->n_parent) { - if (i++ == SMBFS_MAXPATHCOMP) { -/* simple_unlock(&smp->sm_npslock);*/ - return ENAMETOOLONG; - } - *npp++ = np; - if ((np->n_flag & NREFPARENT) == 0) - break; - np = VTOSMB(np->n_parent); - } -/* if (i == 0) - return smb_put_dmem(mbp, vcp, "\\", 2, caseopt);*/ - while (i--) { - np = *--npp; - if (SMB_UNICODE_STRINGS(vcp)) - error = mb_put_uint16le(mbp, '\\'); - else - error = mb_put_uint8(mbp, '\\'); - if (error) - break; - error = smb_put_dmem(mbp, vcp, np->n_name, np->n_nmlen, caseopt); - if (error) - break; - } -/* simple_unlock(&smp->sm_npslock);*/ - return error; -} - int smbfs_fullpath(struct mbchain *mbp, struct smb_vc *vcp, struct smbnode *dnp, const char *name, int nmlen) @@ -160,23 +122,28 @@ smbfs_fullpath(struct mbchain *mbp, stru if (SMB_DIALECT(vcp) < SMB_DIALECT_LANMAN1_0) caseopt |= SMB_CS_UPPER; if (dnp != NULL) { - error = smb_fphelp(mbp, vcp, dnp, caseopt); - if (error) - return error; - } - if (name) { - if (SMB_UNICODE_STRINGS(vcp)) - error = mb_put_uint16le(mbp, '\\'); - else - error = mb_put_uint8(mbp, '\\'); - if (error) - return error; - error = smb_put_dmem(mbp, vcp, name, nmlen, caseopt); + error = smb_put_dmem(mbp, vcp, dnp->n_rpath, dnp->n_rplen, + caseopt); if (error) return error; + if (name) { + /* Put the separator */ + if (SMB_UNICODE_STRINGS(vcp)) + error = mb_put_uint16le(mbp, '\\'); + else + error = mb_put_uint8(mbp, '\\'); + if (error) + return error; + /* Put the name */ + error = smb_put_dmem(mbp, vcp, name, nmlen, caseopt); + if (error) + return error; + } } - error = mb_put_uint8(mbp, 0); - if (SMB_UNICODE_STRINGS(vcp) && error == 0) + /* Put NULL terminator. */ + if (SMB_UNICODE_STRINGS(vcp)) + error = mb_put_uint16le(mbp, 0); + else error = mb_put_uint8(mbp, 0); return error; } Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Thu Nov 22 06:45:28 2012 (r243395) +++ head/sys/fs/smbfs/smbfs_vfsops.c Thu Nov 22 08:58:29 2012 (r243396) @@ -320,7 +320,7 @@ smbfs_root(struct mount *mp, int flags, error = smbfs_smb_lookup(NULL, NULL, 0, &fattr, scred); if (error) goto out; - error = smbfs_nget(mp, NULL, "TheRooT", 7, &fattr, &vp); + error = smbfs_nget(mp, NULL, NULL, 0, &fattr, &vp); if (error) goto out; ASSERT_VOP_LOCKED(vp, "smbfs_root"); From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 09:13:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44AA8882; Thu, 22 Nov 2012 09:13:46 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 005D28FC0C; Thu, 22 Nov 2012 09:13:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM9DjE6040171; Thu, 22 Nov 2012 09:13:45 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM9DjNZ040168; Thu, 22 Nov 2012 09:13:45 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201211220913.qAM9DjNZ040168@svn.freebsd.org> From: Davide Italiano Date: Thu, 22 Nov 2012 09:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243397 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 09:13:46 -0000 Author: davide Date: Thu Nov 22 09:13:45 2012 New Revision: 243397 URL: http://svnweb.freebsd.org/changeset/base/243397 Log: - Remove reset of vpp pointer in some places as long as it's not really useful and has the side effect of obfuscating the code a bit. - Remove spurious references to simple_lock. Reported by: attilio [1] Sponsored by: iXsystems inc. Modified: head/sys/fs/smbfs/smbfs.h head/sys/fs/smbfs/smbfs_node.c head/sys/fs/smbfs/smbfs_vfsops.c Modified: head/sys/fs/smbfs/smbfs.h ============================================================================== --- head/sys/fs/smbfs/smbfs.h Thu Nov 22 08:58:29 2012 (r243396) +++ head/sys/fs/smbfs/smbfs.h Thu Nov 22 09:13:45 2012 (r243397) @@ -79,7 +79,6 @@ struct smbmount { uint64_t sm_flags; long sm_nextino; struct smb_share * sm_share; -/* struct simplelock sm_npslock;*/ struct smbnode * sm_npstack[SMBFS_MAXPATHCOMP]; int sm_caseopt; int sm_didrele; Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Thu Nov 22 08:58:29 2012 (r243396) +++ head/sys/fs/smbfs/smbfs_node.c Thu Nov 22 09:13:45 2012 (r243397) @@ -114,7 +114,6 @@ smbfs_node_alloc(struct mount *mp, struc sc.n_parent = dvp; sc.n_nmlen = nmlen; sc.n_name = name; - *vpp = NULL; if (smp->sm_root != NULL && dvp == NULL) { SMBERROR("do not allocate root vnode twice!\n"); return EINVAL; @@ -136,7 +135,6 @@ smbfs_node_alloc(struct mount *mp, struc vprint("smbfs_node_alloc: dead parent vnode", dvp); return EINVAL; } - *vpp = NULL; error = vfs_hash_get(mp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, td, vpp, smbfs_vnode_cmp, &sc); if (error) @@ -233,7 +231,6 @@ smbfs_nget(struct mount *mp, struct vnod struct vnode *vp; int error, sep; - *vpp = NULL; dnp = (dvp) ? VTOSMB(dvp) : NULL; sep = 0; if (dnp != NULL) { Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Thu Nov 22 08:58:29 2012 (r243396) +++ head/sys/fs/smbfs/smbfs_vfsops.c Thu Nov 22 09:13:45 2012 (r243397) @@ -207,7 +207,6 @@ smbfs_mount(struct mount *mp) vfs_flagopt(mp->mnt_optnew, "nolong", &smp->sm_flags, SMBFS_MOUNT_NO_LONG); -/* simple_lock_init(&smp->sm_npslock);*/ pc = mp->mnt_stat.f_mntfromname; pe = pc + sizeof(mp->mnt_stat.f_mntfromname); bzero(pc, MNAMELEN); From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 09:56:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F26E50A; Thu, 22 Nov 2012 09:56:14 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3467E8FC12; Thu, 22 Nov 2012 09:56:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM9uEwi046849; Thu, 22 Nov 2012 09:56:14 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM9uElS046848; Thu, 22 Nov 2012 09:56:14 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201211220956.qAM9uElS046848@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 22 Nov 2012 09:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243398 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 09:56:14 -0000 Author: pluknet Date: Thu Nov 22 09:56:13 2012 New Revision: 243398 URL: http://svnweb.freebsd.org/changeset/base/243398 Log: core(5) references sysctl debug.num_cores, but it is really debug.ncores. PR: docs/173831 MFC after: 1 week Modified: head/share/man/man5/core.5 Modified: head/share/man/man5/core.5 ============================================================================== --- head/share/man/man5/core.5 Thu Nov 22 09:13:45 2012 (r243397) +++ head/share/man/man5/core.5 Thu Nov 22 09:56:13 2012 (r243398) @@ -32,7 +32,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 22, 2010 +.Dd November 22, 2012 .Dt CORE 5 .Os .Sh NAME @@ -78,7 +78,7 @@ name: Machine hostname. .It Em \&%I An index starting at zero until the sysctl -.Em debug.num_cores +.Em debug.ncores is reached. This can be useful for limiting the number of corefiles generated by a particular process. .It Em \&%N From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 10:24:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 866F38E8; Thu, 22 Nov 2012 10:24:30 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6B92E8FC14; Thu, 22 Nov 2012 10:24:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMAOURq051886; Thu, 22 Nov 2012 10:24:30 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMAOUfu051885; Thu, 22 Nov 2012 10:24:30 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201211221024.qAMAOUfu051885@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 22 Nov 2012 10:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243399 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 10:24:30 -0000 Author: pluknet Date: Thu Nov 22 10:24:30 2012 New Revision: 243399 URL: http://svnweb.freebsd.org/changeset/base/243399 Log: [mdoc] remove hard sentence breaks. MFC after: 3 days Modified: head/share/man/man5/core.5 Modified: head/share/man/man5/core.5 ============================================================================== --- head/share/man/man5/core.5 Thu Nov 22 09:56:13 2012 (r243398) +++ head/share/man/man5/core.5 Thu Nov 22 10:24:30 2012 (r243399) @@ -79,7 +79,8 @@ Machine hostname. .It Em \&%I An index starting at zero until the sysctl .Em debug.ncores -is reached. This can be useful for limiting the number of corefiles +is reached. +This can be useful for limiting the number of corefiles generated by a particular process. .It Em \&%N process name. @@ -117,9 +118,11 @@ When COMPRESS_USER_CORES is included the if core files will be compressed: .Bl -tag -width "kern.compress_user_cores_gzlevel" -compact -offset "12345" .It Em kern.compress_user_cores_gzlevel -Gzip compression level. Defaults to -1. +Gzip compression level. +Defaults to -1. .It Em kern.compress_user_cores -Actually compress user cores. Core files will have the suffix +Actually compress user cores. +Core files will have the suffix .Em .gz appended to them. .El From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 10:36:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 53F22D31; Thu, 22 Nov 2012 10:36:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 384528FC08; Thu, 22 Nov 2012 10:36:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMAaBcl053860; Thu, 22 Nov 2012 10:36:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMAaBWj053858; Thu, 22 Nov 2012 10:36:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211221036.qAMAaBWj053858@svn.freebsd.org> From: Andriy Gapon Date: Thu, 22 Nov 2012 10:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243400 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 10:36:11 -0000 Author: avg Date: Thu Nov 22 10:36:10 2012 New Revision: 243400 URL: http://svnweb.freebsd.org/changeset/base/243400 Log: remove vop_lookup_pre and vop_lookup_post Suggested by: kib MFC after: 5 days Modified: head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Nov 22 10:24:30 2012 (r243399) +++ head/sys/kern/vfs_subr.c Thu Nov 22 10:36:10 2012 (r243400) @@ -4095,16 +4095,6 @@ vop_strategy_pre(void *ap) } void -vop_lookup_pre(void *ap) -{ -} - -void -vop_lookup_post(void *ap, int rc) -{ -} - -void vop_lock_pre(void *ap) { #ifdef DEBUG_VFS_LOCKS Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Thu Nov 22 10:24:30 2012 (r243399) +++ head/sys/kern/vnode_if.src Thu Nov 22 10:36:10 2012 (r243400) @@ -65,8 +65,6 @@ vop_islocked { %% lookup dvp L L L %% lookup vpp - L - -%! lookup pre vop_lookup_pre -%! lookup post vop_lookup_post # XXX - the lookup locking protocol defies simple description and depends # on the flags and operation fields in the (cnp) structure. Note From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 12:11:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C97D109; Thu, 22 Nov 2012 12:11:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3FF58FC16; Thu, 22 Nov 2012 12:11:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMCBXR4072429; Thu, 22 Nov 2012 12:11:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMCBXSJ072398; Thu, 22 Nov 2012 12:11:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211221211.qAMCBXSJ072398@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 22 Nov 2012 12:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243401 - in stable/9/sys: conf contrib/pf/net modules/dummynet modules/ipfw modules/ipfw_nat net netgraph netinet/ipfw netpfil netpfil/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 12:11:34 -0000 Author: glebius Date: Thu Nov 22 12:11:32 2012 New Revision: 243401 URL: http://svnweb.freebsd.org/changeset/base/243401 Log: Partially merge r240494, which moved netinet/ipfw to netpfil/ipfw, to make it easier to merge ipfw commits back to stable/9. Added: stable/9/sys/netpfil/ stable/9/sys/netpfil/ipfw/ - copied from r243400, stable/9/sys/netinet/ipfw/ Deleted: stable/9/sys/netinet/ipfw/ Modified: stable/9/sys/conf/files stable/9/sys/contrib/pf/net/pf.c stable/9/sys/modules/dummynet/Makefile stable/9/sys/modules/ipfw/Makefile stable/9/sys/modules/ipfw_nat/Makefile stable/9/sys/net/if_bridge.c stable/9/sys/net/if_ethersubr.c stable/9/sys/netgraph/ng_ipfw.c stable/9/sys/netpfil/ipfw/dn_heap.c stable/9/sys/netpfil/ipfw/dn_sched_fifo.c stable/9/sys/netpfil/ipfw/dn_sched_prio.c stable/9/sys/netpfil/ipfw/dn_sched_qfq.c stable/9/sys/netpfil/ipfw/dn_sched_rr.c stable/9/sys/netpfil/ipfw/dn_sched_wf2q.c stable/9/sys/netpfil/ipfw/ip_dn_glue.c stable/9/sys/netpfil/ipfw/ip_dn_io.c stable/9/sys/netpfil/ipfw/ip_dummynet.c stable/9/sys/netpfil/ipfw/ip_fw2.c stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c stable/9/sys/netpfil/ipfw/ip_fw_log.c stable/9/sys/netpfil/ipfw/ip_fw_nat.c stable/9/sys/netpfil/ipfw/ip_fw_pfil.c stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c stable/9/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/conf/files Thu Nov 22 12:11:32 2012 (r243401) @@ -2842,26 +2842,9 @@ netinet/in_proto.c optional inet | inet compile-with "${NORMAL_C} -I$S/contrib/pf" netinet/in_rmx.c optional inet netinet/ip_divert.c optional inet ipdivert ipfirewall -netinet/ipfw/dn_heap.c optional inet dummynet -netinet/ipfw/dn_sched_fifo.c optional inet dummynet -netinet/ipfw/dn_sched_prio.c optional inet dummynet -netinet/ipfw/dn_sched_qfq.c optional inet dummynet -netinet/ipfw/dn_sched_rr.c optional inet dummynet -netinet/ipfw/dn_sched_wf2q.c optional inet dummynet -netinet/ipfw/ip_dummynet.c optional inet dummynet -netinet/ipfw/ip_dn_io.c optional inet dummynet -netinet/ipfw/ip_dn_glue.c optional inet dummynet netinet/ip_ecn.c optional inet | inet6 netinet/ip_encap.c optional inet | inet6 netinet/ip_fastfwd.c optional inet -netinet/ipfw/ip_fw2.c optional inet ipfirewall \ - compile-with "${NORMAL_C} -I$S/contrib/pf" -netinet/ipfw/ip_fw_dynamic.c optional inet ipfirewall -netinet/ipfw/ip_fw_log.c optional inet ipfirewall -netinet/ipfw/ip_fw_pfil.c optional inet ipfirewall -netinet/ipfw/ip_fw_sockopt.c optional inet ipfirewall -netinet/ipfw/ip_fw_table.c optional inet ipfirewall -netinet/ipfw/ip_fw_nat.c optional inet ipfirewall_nat netinet/ip_icmp.c optional inet | inet6 netinet/ip_input.c optional inet netinet/ip_ipsec.c optional inet ipsec @@ -2969,6 +2952,23 @@ netncp/ncp_nls.c optional ncp netncp/ncp_rq.c optional ncp netncp/ncp_sock.c optional ncp netncp/ncp_subr.c optional ncp +netpfil/ipfw/dn_heap.c optional inet dummynet +netpfil/ipfw/dn_sched_fifo.c optional inet dummynet +netpfil/ipfw/dn_sched_prio.c optional inet dummynet +netpfil/ipfw/dn_sched_qfq.c optional inet dummynet +netpfil/ipfw/dn_sched_rr.c optional inet dummynet +netpfil/ipfw/dn_sched_wf2q.c optional inet dummynet +netpfil/ipfw/ip_dummynet.c optional inet dummynet +netpfil/ipfw/ip_dn_io.c optional inet dummynet +netpfil/ipfw/ip_dn_glue.c optional inet dummynet +netpfil/ipfw/ip_fw2.c optional inet ipfirewall \ + compile-with "${NORMAL_C} -I$S/contrib/pf" +netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall +netpfil/ipfw/ip_fw_log.c optional inet ipfirewall +netpfil/ipfw/ip_fw_pfil.c optional inet ipfirewall +netpfil/ipfw/ip_fw_sockopt.c optional inet ipfirewall +netpfil/ipfw/ip_fw_table.c optional inet ipfirewall +netpfil/ipfw/ip_fw_nat.c optional inet ipfirewall_nat netsmb/smb_conn.c optional netsmb netsmb/smb_crypt.c optional netsmb netsmb/smb_dev.c optional netsmb Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/contrib/pf/net/pf.c Thu Nov 22 12:11:32 2012 (r243401) @@ -122,7 +122,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef __FreeBSD__ #include -#include /* XXX: only for DIR_IN/DIR_OUT */ +#include /* XXX: only for DIR_IN/DIR_OUT */ #endif #ifndef __FreeBSD__ Modified: stable/9/sys/modules/dummynet/Makefile ============================================================================== --- stable/9/sys/modules/dummynet/Makefile Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/modules/dummynet/Makefile Thu Nov 22 12:11:32 2012 (r243401) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../netinet/ipfw +.PATH: ${.CURDIR}/../../netpfil/ipfw KMOD= dummynet SRCS= ip_dummynet.c SRCS+= ip_dn_glue.c ip_dn_io.c Modified: stable/9/sys/modules/ipfw/Makefile ============================================================================== --- stable/9/sys/modules/ipfw/Makefile Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/modules/ipfw/Makefile Thu Nov 22 12:11:32 2012 (r243401) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../netinet/ipfw +.PATH: ${.CURDIR}/../../netpfil/ipfw KMOD= ipfw SRCS= ip_fw2.c ip_fw_pfil.c Modified: stable/9/sys/modules/ipfw_nat/Makefile ============================================================================== --- stable/9/sys/modules/ipfw_nat/Makefile Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/modules/ipfw_nat/Makefile Thu Nov 22 12:11:32 2012 (r243401) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../netinet/ipfw +.PATH: ${.CURDIR}/../../netpfil/ipfw KMOD= ipfw_nat SRCS= ip_fw_nat.c Modified: stable/9/sys/net/if_bridge.c ============================================================================== --- stable/9/sys/net/if_bridge.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/net/if_bridge.c Thu Nov 22 12:11:32 2012 (r243401) @@ -132,7 +132,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include /* * Size of the route hash table. Must be a power of two. Modified: stable/9/sys/net/if_ethersubr.c ============================================================================== --- stable/9/sys/net/if_ethersubr.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/net/if_ethersubr.c Thu Nov 22 12:11:32 2012 (r243401) @@ -72,7 +72,7 @@ #include #include #include -#include +#include #endif #ifdef INET6 #include Modified: stable/9/sys/netgraph/ng_ipfw.c ============================================================================== --- stable/9/sys/netgraph/ng_ipfw.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netgraph/ng_ipfw.c Thu Nov 22 12:11:32 2012 (r243401) @@ -48,11 +48,12 @@ #include #include #include -#include #include #include #include +#include + #include #include #include Modified: stable/9/sys/netpfil/ipfw/dn_heap.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_heap.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_heap.c Thu Nov 22 12:11:32 2012 (r243401) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifndef log #define log(x, arg...) #endif Modified: stable/9/sys/netpfil/ipfw/dn_sched_fifo.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_sched_fifo.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_sched_fifo.c Thu Nov 22 12:11:32 2012 (r243401) @@ -40,9 +40,9 @@ #include /* ipfw_rule_ref */ #include /* flow_id */ #include -#include -#include -#include +#include +#include +#include #else #include #endif Modified: stable/9/sys/netpfil/ipfw/dn_sched_prio.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_sched_prio.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_sched_prio.c Thu Nov 22 12:11:32 2012 (r243401) @@ -39,9 +39,9 @@ #include /* ipfw_rule_ref */ #include /* flow_id */ #include -#include -#include -#include +#include +#include +#include #else #include #endif Modified: stable/9/sys/netpfil/ipfw/dn_sched_qfq.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_sched_qfq.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_sched_qfq.c Thu Nov 22 12:11:32 2012 (r243401) @@ -40,9 +40,9 @@ #include /* ipfw_rule_ref */ #include /* flow_id */ #include -#include -#include -#include +#include +#include +#include #else #include #endif Modified: stable/9/sys/netpfil/ipfw/dn_sched_rr.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_sched_rr.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_sched_rr.c Thu Nov 22 12:11:32 2012 (r243401) @@ -40,9 +40,9 @@ #include /* ipfw_rule_ref */ #include /* flow_id */ #include -#include -#include -#include +#include +#include +#include #else #include #endif Modified: stable/9/sys/netpfil/ipfw/dn_sched_wf2q.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_sched_wf2q.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_sched_wf2q.c Thu Nov 22 12:11:32 2012 (r243401) @@ -41,9 +41,9 @@ #include /* ipfw_rule_ref */ #include /* flow_id */ #include -#include -#include -#include +#include +#include +#include #else #include #endif Modified: stable/9/sys/netpfil/ipfw/ip_dn_glue.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_dn_glue.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_dn_glue.c Thu Nov 22 12:11:32 2012 (r243401) @@ -50,11 +50,12 @@ #include #include /* ip_output(), IP_FORWARDING */ #include -#include -#include #include -#include -#include + +#include +#include +#include +#include /* FREEBSD7.2 ip_dummynet.h r191715*/ Modified: stable/9/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_dn_io.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_dn_io.c Thu Nov 22 12:11:32 2012 (r243401) @@ -54,17 +54,16 @@ __FBSDID("$FreeBSD$"); #include /* ip_len, ip_off */ #include /* ip_output(), IP_FORWARDING */ #include -#include -#include #include -#include -#include - #include /* various ether_* routines */ - #include /* for ip6_input, ip6_output prototypes */ #include +#include +#include +#include +#include + /* * We keep a private variable for the simulation time, but we could * probably use an existing one ("softticks" in sys/kern/kern_timeout.c) Modified: stable/9/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_dummynet.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_dummynet.c Thu Nov 22 12:11:32 2012 (r243401) @@ -52,11 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include /* ip_output(), IP_FORWARDING */ #include -#include -#include #include -#include -#include + +#include +#include +#include +#include /* which objects to copy */ #define DN_C_LINK 0x01 Modified: stable/9/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw2.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw2.c Thu Nov 22 12:11:32 2012 (r243401) @@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -86,6 +85,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include + #include /* XXX for in_cksum */ #ifdef MAC Modified: stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_dynamic.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Nov 22 12:11:32 2012 (r243401) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include /* ip_defttl */ #include -#include #include #include @@ -67,6 +66,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include + #include /* XXX for in_cksum */ #ifdef MAC Modified: stable/9/sys/netpfil/ipfw/ip_fw_log.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_log.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_log.c Thu Nov 22 12:11:32 2012 (r243401) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -65,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include /* ip6_sprintf() */ #endif +#include + #ifdef MAC #include #endif Modified: stable/9/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_nat.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_nat.c Thu Nov 22 12:11:32 2012 (r243401) @@ -46,10 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include +#include + #include /* XXX for in_cksum */ static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); Modified: stable/9/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_pfil.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_pfil.c Thu Nov 22 12:11:32 2012 (r243401) @@ -59,9 +59,11 @@ __FBSDID("$FreeBSD$"); #include #include #endif -#include + #include +#include + #include static VNET_DEFINE(int, fw_enable) = 1; Modified: stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_sockopt.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Nov 22 12:11:32 2012 (r243401) @@ -60,7 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include /* hooks */ #include -#include + +#include #ifdef MAC #include Modified: stable/9/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_table.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_table.c Thu Nov 22 12:11:32 2012 (r243401) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* ip_fw.h requires IFNAMSIZ */ #include #include @@ -61,8 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include /* struct ipfw_rule_ref */ #include -#include /* LIST_HEAD */ -#include + +#include #ifdef MAC #include From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 13:50:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F170A6E; Thu, 22 Nov 2012 13:50:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 359D68FC17; Thu, 22 Nov 2012 13:50:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMDoqlN090694; Thu, 22 Nov 2012 13:50:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMDoqxw090693; Thu, 22 Nov 2012 13:50:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211221350.qAMDoqxw090693@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 22 Nov 2012 13:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243402 - stable/9/bin/sh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 13:50:52 -0000 Author: jilles Date: Thu Nov 22 13:50:51 2012 New Revision: 243402 URL: http://svnweb.freebsd.org/changeset/base/243402 Log: MFC r242766: sh: Fix two issues when an alias is redefined: * The last character is not displayed. * If the alias ends with itself (as a word), an infinite memory-eating loop occurs. If an alias is defined initially, a space is appended to avoid recursion but this did not happen when an alias was later modified. PR: bin/173418 Submitted by: Daniel F. Modified: stable/9/bin/sh/alias.c Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/alias.c ============================================================================== --- stable/9/bin/sh/alias.c Thu Nov 22 12:11:32 2012 (r243401) +++ stable/9/bin/sh/alias.c Thu Nov 22 13:50:51 2012 (r243402) @@ -68,7 +68,18 @@ setalias(const char *name, const char *v if (equal(name, ap->name)) { INTOFF; ckfree(ap->val); + /* See HACK below. */ +#ifdef notyet ap->val = savestr(val); +#else + { + size_t len = strlen(val); + ap->val = ckmalloc(len + 2); + memcpy(ap->val, val, len); + ap->val[len] = ' '; + ap->val[len+1] = '\0'; + } +#endif INTON; return; } From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 13:51:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C271BE9; Thu, 22 Nov 2012 13:51:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66D348FC0C; Thu, 22 Nov 2012 13:51:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMDpx7A090940; Thu, 22 Nov 2012 13:51:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMDpxBT090937; Thu, 22 Nov 2012 13:51:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211221351.qAMDpxBT090937@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 22 Nov 2012 13:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243403 - in stable/9/tools/regression/bin/sh: builtins parser X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 13:51:59 -0000 Author: jilles Date: Thu Nov 22 13:51:58 2012 New Revision: 243403 URL: http://svnweb.freebsd.org/changeset/base/243403 Log: MFC r242767,r243252: sh: Add tests for modifying an alias (r242766/r243402). Added: stable/9/tools/regression/bin/sh/builtins/alias3.0 - copied unchanged from r242767, head/tools/regression/bin/sh/builtins/alias3.0 stable/9/tools/regression/bin/sh/builtins/alias3.0.stdout - copied unchanged from r242767, head/tools/regression/bin/sh/builtins/alias3.0.stdout stable/9/tools/regression/bin/sh/parser/alias10.0 - copied, changed from r242767, head/tools/regression/bin/sh/parser/alias10.0 Modified: Directory Properties: stable/9/tools/regression/bin/sh/ (props changed) Copied: stable/9/tools/regression/bin/sh/builtins/alias3.0 (from r242767, head/tools/regression/bin/sh/builtins/alias3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/alias3.0 Thu Nov 22 13:51:58 2012 (r243403, copy of r242767, head/tools/regression/bin/sh/builtins/alias3.0) @@ -0,0 +1,12 @@ +# $FreeBSD$ +set -e + +unalias -a +alias foo=bar +alias bar= +alias quux="1 2 3" +alias foo=bar +alias bar= +alias quux="1 2 3" +alias +alias foo Copied: stable/9/tools/regression/bin/sh/builtins/alias3.0.stdout (from r242767, head/tools/regression/bin/sh/builtins/alias3.0.stdout) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/alias3.0.stdout Thu Nov 22 13:51:58 2012 (r243403, copy of r242767, head/tools/regression/bin/sh/builtins/alias3.0.stdout) @@ -0,0 +1,4 @@ +bar='' +foo=bar +quux='1 2 3' +foo=bar Copied and modified: stable/9/tools/regression/bin/sh/parser/alias10.0 (from r242767, head/tools/regression/bin/sh/parser/alias10.0) ============================================================================== --- head/tools/regression/bin/sh/parser/alias10.0 Thu Nov 8 13:36:19 2012 (r242767, copy source) +++ stable/9/tools/regression/bin/sh/parser/alias10.0 Thu Nov 22 13:51:58 2012 (r243403) @@ -1,5 +1,9 @@ # $FreeBSD$ +# This test may start consuming memory indefinitely if it fails. +ulimit -t 5 2>/dev/null +ulimit -v 100000 2>/dev/null + alias echo='echo' alias echo='echo' [ "`eval echo b`" = b ] From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 14:40:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E85C98CA; Thu, 22 Nov 2012 14:40:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF1DC8FC13; Thu, 22 Nov 2012 14:40:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMEeQq1000394; Thu, 22 Nov 2012 14:40:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMEeQq8000393; Thu, 22 Nov 2012 14:40:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211221440.qAMEeQq8000393@svn.freebsd.org> From: Andriy Gapon Date: Thu, 22 Nov 2012 14:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243404 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 14:40:27 -0000 Author: avg Date: Thu Nov 22 14:40:26 2012 New Revision: 243404 URL: http://svnweb.freebsd.org/changeset/base/243404 Log: acpi_cpu: use fixed resource ids for cx state i/o resources ... instead of the ever increasing ones. Also, do free old resources when allocating new ones when cx states change. Tested by: Tom Lislegaard Obtained from: jkim MFC after: 1 week Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Thu Nov 22 13:51:58 2012 (r243403) +++ head/sys/dev/acpica/acpi_cpu.c Thu Nov 22 14:40:26 2012 (r243404) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -68,6 +69,7 @@ struct acpi_cx { uint32_t trans_lat; /* Transition latency (usec). */ uint32_t power; /* Power consumed (mW). */ int res_type; /* Resource type for p_lvlx. */ + int res_rid; /* Resource ID for p_lvlx. */ }; #define MAX_CX_STATES 8 @@ -91,7 +93,6 @@ struct acpi_cpu_softc { int cpu_cx_lowest; int cpu_cx_lowest_lim; char cpu_cx_supported[64]; - int cpu_rid; }; struct acpi_cpu_device { @@ -648,10 +649,10 @@ acpi_cpu_generic_cx_probe(struct acpi_cp gas.BitWidth = 8; if (AcpiGbl_FADT.C2Latency <= 100) { gas.Address = sc->cpu_p_blk + 4; - acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->res_type, &sc->cpu_rid, + cx_ptr->res_rid = 0; + acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->res_type, &cx_ptr->res_rid, &gas, &cx_ptr->p_lvlx, RF_SHAREABLE); if (cx_ptr->p_lvlx != NULL) { - sc->cpu_rid++; cx_ptr->type = ACPI_STATE_C2; cx_ptr->trans_lat = AcpiGbl_FADT.C2Latency; cx_ptr++; @@ -665,10 +666,10 @@ acpi_cpu_generic_cx_probe(struct acpi_cp /* Validate and allocate resources for C3 (P_LVL3). */ if (AcpiGbl_FADT.C3Latency <= 1000 && !(cpu_quirks & CPU_QUIRK_NO_C3)) { gas.Address = sc->cpu_p_blk + 5; - acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->res_type, &sc->cpu_rid, &gas, - &cx_ptr->p_lvlx, RF_SHAREABLE); + cx_ptr->res_rid = 1; + acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->res_type, &cx_ptr->res_rid, + &gas, &cx_ptr->p_lvlx, RF_SHAREABLE); if (cx_ptr->p_lvlx != NULL) { - sc->cpu_rid++; cx_ptr->type = ACPI_STATE_C3; cx_ptr->trans_lat = AcpiGbl_FADT.C3Latency; cx_ptr++; @@ -770,19 +771,18 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s break; } -#ifdef notyet /* Free up any previous register. */ if (cx_ptr->p_lvlx != NULL) { - bus_release_resource(sc->cpu_dev, 0, 0, cx_ptr->p_lvlx); + bus_release_resource(sc->cpu_dev, cx_ptr->res_type, cx_ptr->res_rid, + cx_ptr->p_lvlx); cx_ptr->p_lvlx = NULL; } -#endif /* Allocate the control register for C2 or C3. */ - acpi_PkgGas(sc->cpu_dev, pkg, 0, &cx_ptr->res_type, &sc->cpu_rid, + cx_ptr->res_rid = sc->cpu_cx_count; + acpi_PkgGas(sc->cpu_dev, pkg, 0, &cx_ptr->res_type, &cx_ptr->res_rid, &cx_ptr->p_lvlx, RF_SHAREABLE); if (cx_ptr->p_lvlx) { - sc->cpu_rid++; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "acpi_cpu%d: Got C%d - %d latency\n", device_get_unit(sc->cpu_dev), cx_ptr->type, From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 15:19:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D4185E8; Thu, 22 Nov 2012 15:19:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 311098FC18; Thu, 22 Nov 2012 15:19:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMFJs0o007468; Thu, 22 Nov 2012 15:19:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMFJroe007462; Thu, 22 Nov 2012 15:19:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201211221519.qAMFJroe007462@svn.freebsd.org> From: Ed Schouten Date: Thu, 22 Nov 2012 15:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243405 - in stable/9: include lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 15:19:54 -0000 Author: ed Date: Thu Nov 22 15:19:53 2012 New Revision: 243405 URL: http://svnweb.freebsd.org/changeset/base/243405 Log: MFC r229848: Add aligned_alloc(3). The C11 folks reinvented the wheel by introducing an aligned version of malloc(3) called aligned_alloc(3), instead of posix_memalign(3). Instead of returning the allocation by reference, it returns the address, just like malloc(3). I'm MFCing this now, as it seems aligned_alloc(3) is needed to make the new version of libc++ work, which was merged back to FreeBSD 9 in r243376. Requested by: dim Added: stable/9/lib/libc/stdlib/aligned_alloc.3 - copied unchanged from r229848, head/lib/libc/stdlib/aligned_alloc.3 Deleted: stable/9/lib/libc/stdlib/posix_memalign.3 Modified: stable/9/include/stdlib.h stable/9/lib/libc/stdlib/Makefile.inc stable/9/lib/libc/stdlib/Symbol.map stable/9/lib/libc/stdlib/malloc.c Directory Properties: stable/9/include/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/include/stdlib.h ============================================================================== --- stable/9/include/stdlib.h Thu Nov 22 14:40:26 2012 (r243404) +++ stable/9/include/stdlib.h Thu Nov 22 15:19:53 2012 (r243405) @@ -155,6 +155,7 @@ _Noreturn void _Exit(int); * If we're in a mode greater than C99, expose C1x functions. */ #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L +void * aligned_alloc(size_t, size_t); _Noreturn void quick_exit(int); int at_quick_exit(void (*)(void)); Modified: stable/9/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/9/lib/libc/stdlib/Makefile.inc Thu Nov 22 14:40:26 2012 (r243404) +++ stable/9/lib/libc/stdlib/Makefile.inc Thu Nov 22 15:19:53 2012 (r243405) @@ -18,17 +18,18 @@ SYM_MAPS+= ${.CURDIR}/stdlib/Symbol.map # machine-dependent stdlib sources .sinclude "${.CURDIR}/${LIBC_ARCH}/stdlib/Makefile.inc" -MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 \ - at_quick_exit.3 bsearch.3 \ +MAN+= a64l.3 abort.3 abs.3 aligned_alloc.3 alloca.3 atexit.3 atof.3 \ + atoi.3 atol.3 at_quick_exit.3 bsearch.3 \ div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \ hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 llabs.3 lldiv.3 \ - lsearch.3 malloc.3 memory.3 posix_memalign.3 ptsname.3 qsort.3 \ + lsearch.3 malloc.3 memory.3 ptsname.3 qsort.3 \ quick_exit.3 \ radixsort.3 rand.3 random.3 \ realpath.3 strfmon.3 strtod.3 strtol.3 strtonum.3 strtoul.3 system.3 \ tsearch.3 MLINKS+=a64l.3 l64a.3 a64l.3 l64a_r.3 +MLINKS+=aligned_alloc.3 posix_memalign.3 MLINKS+=atol.3 atoll.3 MLINKS+=exit.3 _Exit.3 MLINKS+=getenv.3 putenv.3 getenv.3 setenv.3 getenv.3 unsetenv.3 Modified: stable/9/lib/libc/stdlib/Symbol.map ============================================================================== --- stable/9/lib/libc/stdlib/Symbol.map Thu Nov 22 14:40:26 2012 (r243404) +++ stable/9/lib/libc/stdlib/Symbol.map Thu Nov 22 15:19:53 2012 (r243405) @@ -93,6 +93,7 @@ FBSD_1.0 { }; FBSD_1.3 { + aligned_alloc; atof_l; atoi_l; atol_l; Copied: stable/9/lib/libc/stdlib/aligned_alloc.3 (from r229848, head/lib/libc/stdlib/aligned_alloc.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/stdlib/aligned_alloc.3 Thu Nov 22 15:19:53 2012 (r243405, copy of r229848, head/lib/libc/stdlib/aligned_alloc.3) @@ -0,0 +1,126 @@ +.\" Copyright (C) 2006 Jason Evans . +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY +.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 7, 2011 +.Dt ALIGNED_ALLOC 3 +.Os +.Sh NAME +.Nm aligned_alloc , +.Nm posix_memalign +.Nd aligned memory allocation +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft void * +.Fn aligned_alloc "size_t alignment" "size_t size" +.Ft int +.Fn posix_memalign "void **ptr" "size_t alignment" "size_t size" +.Sh DESCRIPTION +The +.Fn aligned_alloc +and +.Fn posix_memalign +functions allocate +.Fa size +bytes of memory such that the allocation's base address is an even multiple of +.Fa alignment . +The +.Fn aligned_alloc +function returns the allocation, while the +.Fn posix_memalign +function stores the allocation in the value pointed to by +.Fa ptr . +.Pp +The requested +.Fa alignment +must be a power of 2 at least as large as +.Fn sizeof "void *" . +.Pp +Memory that is allocated via +.Fn aligned_alloc +and +.Fn posix_memalign +can be used as an argument in subsequent calls to +.Xr realloc 3 , +.Xr reallocf 3 , +and +.Xr free 3 . +.Sh RETURN VALUES +The +.Fn aligned_alloc +function returns a pointer to the allocation if successful; otherwise a +NULL pointer is returned and +.Va errno +is set to an error value. +.Pp +The +.Fn posix_memalign +function returns the value 0 if successful; otherwise it returns an error value. +.Sh ERRORS +The +.Fn aligned_alloc +and +.Fn posix_memalign +functions will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa alignment +parameter is not a power of 2 at least as large as +.Fn sizeof "void *" . +.It Bq Er ENOMEM +Memory allocation error. +.El +.Sh SEE ALSO +.Xr free 3 , +.Xr malloc 3 , +.Xr realloc 3 , +.Xr reallocf 3 , +.Xr valloc 3 +.Sh STANDARDS +The +.Fn aligned_alloc +function conforms to +.St -isoC-2011 . +.Pp +The +.Fn posix_memalign +function conforms to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn posix_memalign +function first appeared in +.Fx 7.0 . +.Pp +The +.Fn aligned_alloc +function first appeared in +.Fx 10.0 . Modified: stable/9/lib/libc/stdlib/malloc.c ============================================================================== --- stable/9/lib/libc/stdlib/malloc.c Thu Nov 22 14:40:26 2012 (r243404) +++ stable/9/lib/libc/stdlib/malloc.c Thu Nov 22 15:19:53 2012 (r243405) @@ -6046,6 +6046,20 @@ RETURN: } void * +aligned_alloc(size_t alignment, size_t size) +{ + void *memptr; + int ret; + + ret = posix_memalign(&memptr, alignment, size); + if (ret != 0) { + errno = ret; + return (NULL); + } + return (memptr); +} + +void * calloc(size_t num, size_t size) { void *ret; From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 16:20:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7302277F; Thu, 22 Nov 2012 16:20:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58ACC8FC18; Thu, 22 Nov 2012 16:20:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMGK9Hj018867; Thu, 22 Nov 2012 16:20:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMGK9wW018866; Thu, 22 Nov 2012 16:20:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211221620.qAMGK9wW018866@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Nov 2012 16:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243408 - stable/9/sys/dev/md X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 16:20:09 -0000 Author: kib Date: Thu Nov 22 16:20:08 2012 New Revision: 243408 URL: http://svnweb.freebsd.org/changeset/base/243408 Log: MFC r242744: Zero the newly allocated md(4) swap-backed page to prevent random kernel memory leakage to userspace. Modified: stable/9/sys/dev/md/md.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/md/md.c ============================================================================== --- stable/9/sys/dev/md/md.c Thu Nov 22 16:14:41 2012 (r243407) +++ stable/9/sys/dev/md/md.c Thu Nov 22 16:20:08 2012 (r243408) @@ -677,6 +677,15 @@ mdstart_swap(struct md_s *sc, struct bio sched_unpin(); vm_page_wakeup(m); break; + } else if (rv == VM_PAGER_FAIL) { + /* + * Pager does not have the page. Zero + * the allocated page, and mark it as + * valid. Do not set dirty, the page + * can be recreated if thrown out. + */ + bzero((void *)sf_buf_kva(sf), PAGE_SIZE); + m->valid = VM_PAGE_BITS_ALL; } bcopy((void *)(sf_buf_kva(sf) + offs), p, len); cpu_flush_dcache(p, len); From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 22:52:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FCB6FF; Thu, 22 Nov 2012 22:52:16 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21E2F8FC16; Thu, 22 Nov 2012 22:52:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMMqFBh080181; Thu, 22 Nov 2012 22:52:15 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMMqFu9080179; Thu, 22 Nov 2012 22:52:15 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201211222252.qAMMqFu9080179@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 22 Nov 2012 22:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243417 - releng/7.4 releng/7.4/contrib/bind9/bin/named releng/7.4/contrib/bind9/lib/dns releng/7.4/contrib/bind9/lib/dns/include/dns releng/7.4/sys/compat/linux releng/7.4/sys/conf rel... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 22:52:16 -0000 Author: simon Date: Thu Nov 22 22:52:15 2012 New Revision: 243417 URL: http://svnweb.freebsd.org/changeset/base/243417 Log: Fix multiple Denial of Service vulnerabilities with named(8). Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. Security: FreeBSD-SA-12:06.bind Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4244, CVE-2012-5166, CVE-2012-4445, CVE-2012-4576 Approved by: re Approved by: security-officer Modified: stable/8/contrib/wpa/src/eap_server/eap_tls_common.c stable/8/sys/compat/linux/linux_ioctl.c Changes in other areas also in this revision: Modified: releng/7.4/UPDATING releng/7.4/contrib/bind9/bin/named/query.c releng/7.4/contrib/bind9/lib/dns/include/dns/rdata.h releng/7.4/contrib/bind9/lib/dns/master.c releng/7.4/contrib/bind9/lib/dns/rdata.c releng/7.4/sys/compat/linux/linux_ioctl.c releng/7.4/sys/conf/newvers.sh releng/8.3/UPDATING releng/8.3/contrib/bind9/bin/named/query.c releng/8.3/contrib/bind9/lib/dns/include/dns/rdata.h releng/8.3/contrib/bind9/lib/dns/master.c releng/8.3/contrib/bind9/lib/dns/rdata.c releng/8.3/contrib/wpa/src/eap_server/eap_tls_common.c releng/8.3/sys/compat/linux/linux_ioctl.c releng/8.3/sys/conf/newvers.sh releng/9.0/UPDATING releng/9.0/contrib/bind9/bin/named/query.c releng/9.0/contrib/bind9/lib/dns/include/dns/rdata.h releng/9.0/contrib/bind9/lib/dns/master.c releng/9.0/contrib/bind9/lib/dns/rdata.c releng/9.0/contrib/wpa/src/eap_server/eap_server_tls_common.c releng/9.0/sys/compat/linux/linux_ioctl.c releng/9.0/sys/conf/newvers.sh releng/9.1/contrib/wpa/src/eap_server/eap_server_tls_common.c releng/9.1/sys/compat/linux/linux_ioctl.c stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c stable/9/sys/compat/linux/linux_ioctl.c Modified: stable/8/contrib/wpa/src/eap_server/eap_tls_common.c ============================================================================== --- stable/8/contrib/wpa/src/eap_server/eap_tls_common.c Thu Nov 22 22:10:10 2012 (r243416) +++ stable/8/contrib/wpa/src/eap_server/eap_tls_common.c Thu Nov 22 22:52:15 2012 (r243417) @@ -220,6 +220,13 @@ static int eap_server_tls_process_fragme " over 64 kB)"); return -1; } + if (len > message_length) { + wpa_printf(MSG_INFO, "SSL: Too much data (%d bytes) in " + "first fragment of frame (TLS Message " + "Length %d bytes)", + (int) len, (int) message_length); + return -1; + } data->in_buf = wpabuf_alloc(message_length); if (data->in_buf == NULL) { Modified: stable/8/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/8/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:10:10 2012 (r243416) +++ stable/8/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) @@ -2253,8 +2253,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); CURVNET_RESTORE(); From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 22:52:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19E68100; Thu, 22 Nov 2012 22:52:17 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF58C8FC18; Thu, 22 Nov 2012 22:52:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMMqGC0080215; Thu, 22 Nov 2012 22:52:16 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMMqG3o080186; Thu, 22 Nov 2012 22:52:16 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201211222252.qAMMqG3o080186@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 22 Nov 2012 22:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r243417 - releng/7.4 releng/7.4/contrib/bind9/bin/named releng/7.4/contrib/bind9/lib/dns releng/7.4/contrib/bind9/lib/dns/include/dns releng/7.4/sys/compat/linux releng/7.4/sys/conf rel... X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 22:52:17 -0000 Author: simon Date: Thu Nov 22 22:52:15 2012 New Revision: 243417 URL: http://svnweb.freebsd.org/changeset/base/243417 Log: Fix multiple Denial of Service vulnerabilities with named(8). Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. Security: FreeBSD-SA-12:06.bind Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4244, CVE-2012-5166, CVE-2012-4445, CVE-2012-4576 Approved by: re Approved by: security-officer Modified: releng/7.4/UPDATING releng/7.4/contrib/bind9/bin/named/query.c releng/7.4/contrib/bind9/lib/dns/include/dns/rdata.h releng/7.4/contrib/bind9/lib/dns/master.c releng/7.4/contrib/bind9/lib/dns/rdata.c releng/7.4/sys/compat/linux/linux_ioctl.c releng/7.4/sys/conf/newvers.sh releng/8.3/UPDATING releng/8.3/contrib/bind9/bin/named/query.c releng/8.3/contrib/bind9/lib/dns/include/dns/rdata.h releng/8.3/contrib/bind9/lib/dns/master.c releng/8.3/contrib/bind9/lib/dns/rdata.c releng/8.3/contrib/wpa/src/eap_server/eap_tls_common.c releng/8.3/sys/compat/linux/linux_ioctl.c releng/8.3/sys/conf/newvers.sh releng/9.0/UPDATING releng/9.0/contrib/bind9/bin/named/query.c releng/9.0/contrib/bind9/lib/dns/include/dns/rdata.h releng/9.0/contrib/bind9/lib/dns/master.c releng/9.0/contrib/bind9/lib/dns/rdata.c releng/9.0/contrib/wpa/src/eap_server/eap_server_tls_common.c releng/9.0/sys/compat/linux/linux_ioctl.c releng/9.0/sys/conf/newvers.sh releng/9.1/contrib/wpa/src/eap_server/eap_server_tls_common.c releng/9.1/sys/compat/linux/linux_ioctl.c Changes in other areas also in this revision: Modified: stable/8/contrib/wpa/src/eap_server/eap_tls_common.c stable/8/sys/compat/linux/linux_ioctl.c stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c stable/9/sys/compat/linux/linux_ioctl.c Modified: releng/7.4/UPDATING ============================================================================== --- releng/7.4/UPDATING Thu Nov 22 22:10:10 2012 (r243416) +++ releng/7.4/UPDATING Thu Nov 22 22:52:15 2012 (r243417) @@ -8,6 +8,11 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20121122: p11 FreeBSD-SA-12:06.bind FreeBSD-SA-12:08.linux + Fix multiple Denial of Service vulnerabilities with named(8). + + Fix Linux compatibility layer input validation error. + 20120806: p10 FreeBSD-SA-12:05.bind Fix named(8) DNSSEC validation Denial of Service. Modified: releng/7.4/contrib/bind9/bin/named/query.c ============================================================================== --- releng/7.4/contrib/bind9/bin/named/query.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/7.4/contrib/bind9/bin/named/query.c Thu Nov 22 22:52:15 2012 (r243417) @@ -999,13 +999,6 @@ query_isduplicate(ns_client_t *client, d mname = NULL; } - /* - * If the dns_name_t we're looking up is already in the message, - * we don't want to trigger the caller's name replacement logic. - */ - if (name == mname) - mname = NULL; - *mnamep = mname; CTRACE("query_isduplicate: false: done"); @@ -1199,6 +1192,7 @@ query_addadditional(void *arg, dns_name_ if (dns_rdataset_isassociated(rdataset) && !query_isduplicate(client, fname, type, &mname)) { if (mname != NULL) { + INSIST(mname != fname); query_releasename(client, &fname); fname = mname; } else @@ -1259,11 +1253,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_a, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1302,11 +1298,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_aaaa, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1817,6 +1815,7 @@ query_addadditional2(void *arg, dns_name crdataset->type == dns_rdatatype_aaaa) { if (!query_isduplicate(client, fname, crdataset->type, &mname)) { + if (mname != fname) { if (mname != NULL) { /* * A different type of this name is @@ -1833,6 +1832,7 @@ query_addadditional2(void *arg, dns_name mname0 = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_UNLINK(cfname.list, crdataset, link); ISC_LIST_APPEND(fname->list, crdataset, link); added_something = ISC_TRUE; Modified: releng/7.4/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- releng/7.4/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 22:10:10 2012 (r243416) +++ releng/7.4/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 22:52:15 2012 (r243417) @@ -127,6 +127,17 @@ struct dns_rdata { #define DNS_RDATA_UPDATE 0x0001 /*%< update pseudo record */ /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: releng/7.4/contrib/bind9/lib/dns/master.c ============================================================================== --- releng/7.4/contrib/bind9/lib/dns/master.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/7.4/contrib/bind9/lib/dns/master.c Thu Nov 22 22:52:15 2012 (r243417) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: releng/7.4/contrib/bind9/lib/dns/rdata.c ============================================================================== --- releng/7.4/contrib/bind9/lib/dns/rdata.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/7.4/contrib/bind9/lib/dns/rdata.c Thu Nov 22 22:52:15 2012 (r243417) @@ -403,6 +403,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -433,6 +434,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -440,8 +449,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -576,6 +584,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -648,10 +657,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -758,6 +770,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -772,10 +785,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: releng/7.4/sys/compat/linux/linux_ioctl.c ============================================================================== --- releng/7.4/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/7.4/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) @@ -2207,8 +2207,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); return (error); Modified: releng/7.4/sys/conf/newvers.sh ============================================================================== --- releng/7.4/sys/conf/newvers.sh Thu Nov 22 22:10:10 2012 (r243416) +++ releng/7.4/sys/conf/newvers.sh Thu Nov 22 22:52:15 2012 (r243417) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.4" -BRANCH="RELEASE-p10" +BRANCH="RELEASE-p11" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/8.3/UPDATING ============================================================================== --- releng/8.3/UPDATING Thu Nov 22 22:10:10 2012 (r243416) +++ releng/8.3/UPDATING Thu Nov 22 22:52:15 2012 (r243417) @@ -15,6 +15,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20121122: p5 FreeBSD-SA-12:06.bind FreeBSD-SA-12:07.hostapd + FreeBSD-SA-12:08.linux + Fix multiple Denial of Service vulnerabilities with named(8). + + Fix insufficient message length validation for EAP-TLS messages. + + Fix Linux compatibility layer input validation error. + 20120806: p4 FreeBSD-SA-12:05.bind Fix named(8) DNSSEC validation Denial of Service. Modified: releng/8.3/contrib/bind9/bin/named/query.c ============================================================================== --- releng/8.3/contrib/bind9/bin/named/query.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/8.3/contrib/bind9/bin/named/query.c Thu Nov 22 22:52:15 2012 (r243417) @@ -1024,13 +1024,6 @@ query_isduplicate(ns_client_t *client, d mname = NULL; } - /* - * If the dns_name_t we're looking up is already in the message, - * we don't want to trigger the caller's name replacement logic. - */ - if (name == mname) - mname = NULL; - *mnamep = mname; CTRACE("query_isduplicate: false: done"); @@ -1228,6 +1221,7 @@ query_addadditional(void *arg, dns_name_ if (dns_rdataset_isassociated(rdataset) && !query_isduplicate(client, fname, type, &mname)) { if (mname != NULL) { + INSIST(mname != fname); query_releasename(client, &fname); fname = mname; } else @@ -1288,11 +1282,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_a, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1331,11 +1327,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_aaaa, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1847,6 +1845,7 @@ query_addadditional2(void *arg, dns_name crdataset->type == dns_rdatatype_aaaa) { if (!query_isduplicate(client, fname, crdataset->type, &mname)) { + if (mname != fname) { if (mname != NULL) { /* * A different type of this name is @@ -1863,6 +1862,7 @@ query_addadditional2(void *arg, dns_name mname0 = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_UNLINK(cfname.list, crdataset, link); ISC_LIST_APPEND(fname->list, crdataset, link); added_something = ISC_TRUE; Modified: releng/8.3/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- releng/8.3/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 22:10:10 2012 (r243416) +++ releng/8.3/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 22:52:15 2012 (r243417) @@ -128,6 +128,17 @@ struct dns_rdata { #define DNS_RDATA_OFFLINE 0x0002 /*%< RRSIG has a offline key. */ /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: releng/8.3/contrib/bind9/lib/dns/master.c ============================================================================== --- releng/8.3/contrib/bind9/lib/dns/master.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/8.3/contrib/bind9/lib/dns/master.c Thu Nov 22 22:52:15 2012 (r243417) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: releng/8.3/contrib/bind9/lib/dns/rdata.c ============================================================================== --- releng/8.3/contrib/bind9/lib/dns/rdata.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/8.3/contrib/bind9/lib/dns/rdata.c Thu Nov 22 22:52:15 2012 (r243417) @@ -410,6 +410,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -440,6 +441,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -447,8 +456,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -583,6 +591,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -655,10 +664,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -766,6 +778,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -780,10 +793,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: releng/8.3/contrib/wpa/src/eap_server/eap_tls_common.c ============================================================================== --- releng/8.3/contrib/wpa/src/eap_server/eap_tls_common.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/8.3/contrib/wpa/src/eap_server/eap_tls_common.c Thu Nov 22 22:52:15 2012 (r243417) @@ -220,6 +220,13 @@ static int eap_server_tls_process_fragme " over 64 kB)"); return -1; } + if (len > message_length) { + wpa_printf(MSG_INFO, "SSL: Too much data (%d bytes) in " + "first fragment of frame (TLS Message " + "Length %d bytes)", + (int) len, (int) message_length); + return -1; + } data->in_buf = wpabuf_alloc(message_length); if (data->in_buf == NULL) { Modified: releng/8.3/sys/compat/linux/linux_ioctl.c ============================================================================== --- releng/8.3/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/8.3/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) @@ -2253,8 +2253,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); CURVNET_RESTORE(); Modified: releng/8.3/sys/conf/newvers.sh ============================================================================== --- releng/8.3/sys/conf/newvers.sh Thu Nov 22 22:10:10 2012 (r243416) +++ releng/8.3/sys/conf/newvers.sh Thu Nov 22 22:52:15 2012 (r243417) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.3" -BRANCH="RELEASE-p4" +BRANCH="RELEASE-p5" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.0/UPDATING ============================================================================== --- releng/9.0/UPDATING Thu Nov 22 22:10:10 2012 (r243416) +++ releng/9.0/UPDATING Thu Nov 22 22:52:15 2012 (r243417) @@ -9,6 +9,14 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20121122: p5 FreeBSD-SA-12:06.bind FreeBSD-SA-12:07.hostapd + FreeBSD-SA-12:08.linux + Fix multiple Denial of Service vulnerabilities with named(8). + + Fix insufficient message length validation for EAP-TLS messages. + + Fix Linux compatibility layer input validation error. + 20120806: p4 FreeBSD-SA-12:05.bind Fix named(8) DNSSEC validation Denial of Service. Modified: releng/9.0/contrib/bind9/bin/named/query.c ============================================================================== --- releng/9.0/contrib/bind9/bin/named/query.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/9.0/contrib/bind9/bin/named/query.c Thu Nov 22 22:52:15 2012 (r243417) @@ -1137,13 +1137,6 @@ query_isduplicate(ns_client_t *client, d mname = NULL; } - /* - * If the dns_name_t we're looking up is already in the message, - * we don't want to trigger the caller's name replacement logic. - */ - if (name == mname) - mname = NULL; - *mnamep = mname; CTRACE("query_isduplicate: false: done"); @@ -1341,6 +1334,7 @@ query_addadditional(void *arg, dns_name_ if (dns_rdataset_isassociated(rdataset) && !query_isduplicate(client, fname, type, &mname)) { if (mname != NULL) { + INSIST(mname != fname); query_releasename(client, &fname); fname = mname; } else @@ -1401,11 +1395,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_a, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1444,11 +1440,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_aaaa, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1960,6 +1958,7 @@ query_addadditional2(void *arg, dns_name crdataset->type == dns_rdatatype_aaaa) { if (!query_isduplicate(client, fname, crdataset->type, &mname)) { + if (mname != fname) { if (mname != NULL) { /* * A different type of this name is @@ -1976,6 +1975,7 @@ query_addadditional2(void *arg, dns_name mname0 = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_UNLINK(cfname.list, crdataset, link); ISC_LIST_APPEND(fname->list, crdataset, link); added_something = ISC_TRUE; Modified: releng/9.0/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- releng/9.0/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 22:10:10 2012 (r243416) +++ releng/9.0/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 22:52:15 2012 (r243417) @@ -147,6 +147,17 @@ struct dns_rdata { (((rdata)->flags & ~(DNS_RDATA_UPDATE|DNS_RDATA_OFFLINE)) == 0) /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: releng/9.0/contrib/bind9/lib/dns/master.c ============================================================================== --- releng/9.0/contrib/bind9/lib/dns/master.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/9.0/contrib/bind9/lib/dns/master.c Thu Nov 22 22:52:15 2012 (r243417) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: releng/9.0/contrib/bind9/lib/dns/rdata.c ============================================================================== --- releng/9.0/contrib/bind9/lib/dns/rdata.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/9.0/contrib/bind9/lib/dns/rdata.c Thu Nov 22 22:52:15 2012 (r243417) @@ -425,6 +425,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -455,6 +456,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -462,8 +471,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -598,6 +606,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -670,10 +679,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -781,6 +793,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -795,10 +808,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: releng/9.0/contrib/wpa/src/eap_server/eap_server_tls_common.c ============================================================================== --- releng/9.0/contrib/wpa/src/eap_server/eap_server_tls_common.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/9.0/contrib/wpa/src/eap_server/eap_server_tls_common.c Thu Nov 22 22:52:15 2012 (r243417) @@ -225,6 +225,14 @@ static int eap_server_tls_process_fragme return -1; } + if (len > message_length) { + wpa_printf(MSG_INFO, "SSL: Too much data (%d bytes) in " + "first fragment of frame (TLS Message " + "Length %d bytes)", + (int) len, (int) message_length); + return -1; + } + data->tls_in = wpabuf_alloc(message_length); if (data->tls_in == NULL) { wpa_printf(MSG_DEBUG, "SSL: No memory for message"); Modified: releng/9.0/sys/compat/linux/linux_ioctl.c ============================================================================== --- releng/9.0/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/9.0/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) @@ -2260,8 +2260,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); CURVNET_RESTORE(); Modified: releng/9.0/sys/conf/newvers.sh ============================================================================== --- releng/9.0/sys/conf/newvers.sh Thu Nov 22 22:10:10 2012 (r243416) +++ releng/9.0/sys/conf/newvers.sh Thu Nov 22 22:52:15 2012 (r243417) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.0" -BRANCH="RELEASE-p4" +BRANCH="RELEASE-p5" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.1/contrib/wpa/src/eap_server/eap_server_tls_common.c ============================================================================== --- releng/9.1/contrib/wpa/src/eap_server/eap_server_tls_common.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/9.1/contrib/wpa/src/eap_server/eap_server_tls_common.c Thu Nov 22 22:52:15 2012 (r243417) @@ -225,6 +225,14 @@ static int eap_server_tls_process_fragme return -1; } + if (len > message_length) { + wpa_printf(MSG_INFO, "SSL: Too much data (%d bytes) in " + "first fragment of frame (TLS Message " + "Length %d bytes)", + (int) len, (int) message_length); + return -1; + } + data->tls_in = wpabuf_alloc(message_length); if (data->tls_in == NULL) { wpa_printf(MSG_DEBUG, "SSL: No memory for message"); Modified: releng/9.1/sys/compat/linux/linux_ioctl.c ============================================================================== --- releng/9.1/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:10:10 2012 (r243416) +++ releng/9.1/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) @@ -2260,8 +2260,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); CURVNET_RESTORE(); From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 22:52:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 45226103; Thu, 22 Nov 2012 22:52:17 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 282A38FC19; Thu, 22 Nov 2012 22:52:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMMqHKM080222; Thu, 22 Nov 2012 22:52:17 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMMqHTU080220; Thu, 22 Nov 2012 22:52:17 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201211222252.qAMMqHTU080220@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 22 Nov 2012 22:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243417 - releng/7.4 releng/7.4/contrib/bind9/bin/named releng/7.4/contrib/bind9/lib/dns releng/7.4/contrib/bind9/lib/dns/include/dns releng/7.4/sys/compat/linux releng/7.4/sys/conf rel... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 22:52:17 -0000 Author: simon Date: Thu Nov 22 22:52:15 2012 New Revision: 243417 URL: http://svnweb.freebsd.org/changeset/base/243417 Log: Fix multiple Denial of Service vulnerabilities with named(8). Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. Security: FreeBSD-SA-12:06.bind Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4244, CVE-2012-5166, CVE-2012-4445, CVE-2012-4576 Approved by: re Approved by: security-officer Modified: stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c stable/9/sys/compat/linux/linux_ioctl.c Changes in other areas also in this revision: Modified: releng/7.4/UPDATING releng/7.4/contrib/bind9/bin/named/query.c releng/7.4/contrib/bind9/lib/dns/include/dns/rdata.h releng/7.4/contrib/bind9/lib/dns/master.c releng/7.4/contrib/bind9/lib/dns/rdata.c releng/7.4/sys/compat/linux/linux_ioctl.c releng/7.4/sys/conf/newvers.sh releng/8.3/UPDATING releng/8.3/contrib/bind9/bin/named/query.c releng/8.3/contrib/bind9/lib/dns/include/dns/rdata.h releng/8.3/contrib/bind9/lib/dns/master.c releng/8.3/contrib/bind9/lib/dns/rdata.c releng/8.3/contrib/wpa/src/eap_server/eap_tls_common.c releng/8.3/sys/compat/linux/linux_ioctl.c releng/8.3/sys/conf/newvers.sh releng/9.0/UPDATING releng/9.0/contrib/bind9/bin/named/query.c releng/9.0/contrib/bind9/lib/dns/include/dns/rdata.h releng/9.0/contrib/bind9/lib/dns/master.c releng/9.0/contrib/bind9/lib/dns/rdata.c releng/9.0/contrib/wpa/src/eap_server/eap_server_tls_common.c releng/9.0/sys/compat/linux/linux_ioctl.c releng/9.0/sys/conf/newvers.sh releng/9.1/contrib/wpa/src/eap_server/eap_server_tls_common.c releng/9.1/sys/compat/linux/linux_ioctl.c stable/8/contrib/wpa/src/eap_server/eap_tls_common.c stable/8/sys/compat/linux/linux_ioctl.c Modified: stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c ============================================================================== --- stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c Thu Nov 22 22:10:10 2012 (r243416) +++ stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c Thu Nov 22 22:52:15 2012 (r243417) @@ -225,6 +225,14 @@ static int eap_server_tls_process_fragme return -1; } + if (len > message_length) { + wpa_printf(MSG_INFO, "SSL: Too much data (%d bytes) in " + "first fragment of frame (TLS Message " + "Length %d bytes)", + (int) len, (int) message_length); + return -1; + } + data->tls_in = wpabuf_alloc(message_length); if (data->tls_in == NULL) { wpa_printf(MSG_DEBUG, "SSL: No memory for message"); Modified: stable/9/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/9/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:10:10 2012 (r243416) +++ stable/9/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) @@ -2260,8 +2260,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); CURVNET_RESTORE(); From owner-svn-src-all@FreeBSD.ORG Thu Nov 22 23:15:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6782586B; Thu, 22 Nov 2012 23:15:39 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47EFA8FC08; Thu, 22 Nov 2012 23:15:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMNFd3i088463; Thu, 22 Nov 2012 23:15:39 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMNFdcO088458; Thu, 22 Nov 2012 23:15:39 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201211222315.qAMNFdcO088458@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 22 Nov 2012 23:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243418 - in stable/7: contrib/bind9/bin/named contrib/bind9/lib/dns contrib/bind9/lib/dns/include/dns sys/compat/linux X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 22 Nov 2012 23:15:39 -0000 Author: simon Date: Thu Nov 22 23:15:38 2012 New Revision: 243418 URL: http://svnweb.freebsd.org/changeset/base/243418 Log: Fix multiple Denial of Service vulnerabilities with named(8). Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. This commit includes stable/7 which was missed in r243417. Security: FreeBSD-SA-12:06.bind Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4244, CVE-2012-5166, CVE-2012-4445, CVE-2012-4576 Approved by: re Approved by: security-officer Modified: stable/7/contrib/bind9/bin/named/query.c stable/7/contrib/bind9/lib/dns/include/dns/rdata.h stable/7/contrib/bind9/lib/dns/master.c stable/7/contrib/bind9/lib/dns/rdata.c stable/7/sys/compat/linux/linux_ioctl.c Modified: stable/7/contrib/bind9/bin/named/query.c ============================================================================== --- stable/7/contrib/bind9/bin/named/query.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/bin/named/query.c Thu Nov 22 23:15:38 2012 (r243418) @@ -999,13 +999,6 @@ query_isduplicate(ns_client_t *client, d mname = NULL; } - /* - * If the dns_name_t we're looking up is already in the message, - * we don't want to trigger the caller's name replacement logic. - */ - if (name == mname) - mname = NULL; - *mnamep = mname; CTRACE("query_isduplicate: false: done"); @@ -1199,6 +1192,7 @@ query_addadditional(void *arg, dns_name_ if (dns_rdataset_isassociated(rdataset) && !query_isduplicate(client, fname, type, &mname)) { if (mname != NULL) { + INSIST(mname != fname); query_releasename(client, &fname); fname = mname; } else @@ -1259,11 +1253,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_a, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1302,11 +1298,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_aaaa, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1817,6 +1815,7 @@ query_addadditional2(void *arg, dns_name crdataset->type == dns_rdatatype_aaaa) { if (!query_isduplicate(client, fname, crdataset->type, &mname)) { + if (mname != fname) { if (mname != NULL) { /* * A different type of this name is @@ -1833,6 +1832,7 @@ query_addadditional2(void *arg, dns_name mname0 = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_UNLINK(cfname.list, crdataset, link); ISC_LIST_APPEND(fname->list, crdataset, link); added_something = ISC_TRUE; Modified: stable/7/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- stable/7/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 23:15:38 2012 (r243418) @@ -127,6 +127,17 @@ struct dns_rdata { #define DNS_RDATA_UPDATE 0x0001 /*%< update pseudo record */ /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: stable/7/contrib/bind9/lib/dns/master.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/master.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/lib/dns/master.c Thu Nov 22 23:15:38 2012 (r243418) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: stable/7/contrib/bind9/lib/dns/rdata.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/rdata.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/lib/dns/rdata.c Thu Nov 22 23:15:38 2012 (r243418) @@ -403,6 +403,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -433,6 +434,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -440,8 +449,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -576,6 +584,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -648,10 +657,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -758,6 +770,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -772,10 +785,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: stable/7/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/7/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/sys/compat/linux/linux_ioctl.c Thu Nov 22 23:15:38 2012 (r243418) @@ -2207,8 +2207,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); return (error); From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 01:41:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 744A0CDE; Fri, 23 Nov 2012 01:41:30 +0000 (UTC) (envelope-from jbeich@tormail.org) Received: from outgoing.tormail.org (outgoing.tormail.org [82.221.96.22]) by mx1.freebsd.org (Postfix) with ESMTP id 108AB8FC13; Fri, 23 Nov 2012 01:41:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=internal.tormail.org) by outgoing.tormail.org with esmtp (Exim 4.72) (envelope-from ) id 1TbiGl-0005qN-Ma; Fri, 23 Nov 2012 04:41:28 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tormail.org; s=tm; h=Message-Id:X-TorMail-User:Content-Type:MIME-Version:References:Date:In-Reply-To:Subject:Cc:To:From; bh=LNe3w2WNX6HPN9KweU05r+RjT0aMj2WyaUHXxQY3C24=; b=Dq0up6QIiL8W5PMHtTJSysat/WNjHfgvCzZo7GpFduBQcqo0y1A9qVYUiZmUGzwSH8sTyVOzOkLluIbYEhgIYvIAJWnOaK0UP7Fj9qBtswluW6k/Q8zNa4Vz+789x6S5TEIAXmdd1GmZ1nlW/V9OPRcNsI94FndL2cF/bOvpjGM=; Received: from jbeich by internal.tormail.org with local (Exim 4.63) (envelope-from ) id 1TbiFB-000KtT-Hd; Fri, 23 Nov 2012 01:39:51 +0000 From: Jan Beich To: Jung-uk Kim Subject: Re: svn commit: r243310 - head/share/mk In-Reply-To: <201211192158.qAJLwEUR048991@svn.freebsd.org> (Jung-uk Kim's message of "Mon, 19 Nov 2012 21:58:14 +0000 (UTC)") Date: Thu, 22 Nov 2012 19:04:14 -0500 References: <201211192158.qAJLwEUR048991@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain X-TorMail-User: jbeich Message-Id: <1TbiFB-000KtT-Hd@internal.tormail.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 01:41:30 -0000 Jung-uk Kim writes: > Author: jkim > Date: Mon Nov 19 21:58:14 2012 > New Revision: 243310 > URL: http://svnweb.freebsd.org/changeset/base/243310 > > Log: > Add x86 CPUs supported by clang on head. > > Reviewed by: arch (silence) > X-MFC: r242624 No penryn? My core2 supports sse41. $ clang -v -march=native foo.c ... -target-cpu penryn ... $ gcc47 -v -march=native foo.c ... -march=core2 ... $ clang -march=penryn foo.c $ gcc47 -march=penryn foo.c foo.c:1:0: error: bad value (penryn) for -march= switch $ gcc47 -march=core2 -dM -E - Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FB49F0F; Fri, 23 Nov 2012 01:48:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 339628FC08; Fri, 23 Nov 2012 01:48:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN1mWZI011745; Fri, 23 Nov 2012 01:48:32 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN1mW1X011743; Fri, 23 Nov 2012 01:48:32 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201211230148.qAN1mW1X011743@svn.freebsd.org> From: Colin Percival Date: Fri, 23 Nov 2012 01:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243419 - in head: contrib/wpa/src/eap_server sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 01:48:32 -0000 Author: cperciva Date: Fri Nov 23 01:48:31 2012 New Revision: 243419 URL: http://svnweb.freebsd.org/changeset/base/243419 Log: MFS security patches which seem to have accidentally not reached HEAD: Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4445, CVE-2012-4576 With hat: so@ Modified: head/contrib/wpa/src/eap_server/eap_server_tls_common.c head/sys/compat/linux/linux_ioctl.c Modified: head/contrib/wpa/src/eap_server/eap_server_tls_common.c ============================================================================== --- head/contrib/wpa/src/eap_server/eap_server_tls_common.c Thu Nov 22 23:15:38 2012 (r243418) +++ head/contrib/wpa/src/eap_server/eap_server_tls_common.c Fri Nov 23 01:48:31 2012 (r243419) @@ -225,6 +225,14 @@ static int eap_server_tls_process_fragme return -1; } + if (len > message_length) { + wpa_printf(MSG_INFO, "SSL: Too much data (%d bytes) in " + "first fragment of frame (TLS Message " + "Length %d bytes)", + (int) len, (int) message_length); + return -1; + } + data->tls_in = wpabuf_alloc(message_length); if (data->tls_in == NULL) { wpa_printf(MSG_DEBUG, "SSL: No memory for message"); Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Thu Nov 22 23:15:38 2012 (r243418) +++ head/sys/compat/linux/linux_ioctl.c Fri Nov 23 01:48:31 2012 (r243419) @@ -2260,8 +2260,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); CURVNET_RESTORE(); From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 03:24:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D231DD9; Fri, 23 Nov 2012 03:24:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4881D8FC14; Fri, 23 Nov 2012 03:24:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN3OrXH026758; Fri, 23 Nov 2012 03:24:53 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN3OreT026757; Fri, 23 Nov 2012 03:24:53 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211230324.qAN3OreT026757@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Nov 2012 03:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243420 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 03:24:53 -0000 Author: gonzo Date: Fri Nov 23 03:24:52 2012 New Revision: 243420 URL: http://svnweb.freebsd.org/changeset/base/243420 Log: Make FDT blob compatible with Raspberry Pi firmware. Rasperry Pi firmware has a set of hardcoded pathes it uses to fill FDT with system-specific information like display resolution, memory size, UART and SDHCI clocks, ethernet MAC address. Handle two of them: - Add placeholder for ethernet MAC address - Move display node out of "axi" node Modified: head/sys/boot/fdt/dts/bcm2835-rpi-b.dts Modified: head/sys/boot/fdt/dts/bcm2835-rpi-b.dts ============================================================================== --- head/sys/boot/fdt/dts/bcm2835-rpi-b.dts Fri Nov 23 01:48:31 2012 (r243419) +++ head/sys/boot/fdt/dts/bcm2835-rpi-b.dts Fri Nov 23 03:24:52 2012 (r243420) @@ -478,26 +478,37 @@ interrupt-parent = <&intc>; #address-cells = <1>; #size-cells = <0>; + hub { + compatible = "usb,hub", "usb,device"; + reg = <0x00000001>; + #address-cells = <1>; + #size-cells = <0>; + ethernet { + compatible = "net,ethernet", "usb,device"; + reg = <0x00000001>; + mac-address = [00 00 00 00 00 00]; + }; + }; }; - display { - compatible = "broadcom,bcm2835-fb", "broadcom,bcm2708-fb"; - - broadcom,vc-mailbox = <&vc_mbox>; - broadcom,vc-channel = <1>; - - broadcom,width = <0>; /* Set by VideoCore */ - broadcom,height = <0>; /* Set by VideoCore */ - broadcom,depth = <0>; /* Set by VideoCore */ - }; }; - memory { device_type = "memory"; reg = <0 0x08000000>; /* 128MB */ }; + display { + compatible = "broadcom,bcm2835-fb", "broadcom,bcm2708-fb"; + + broadcom,vc-mailbox = <&vc_mbox>; + broadcom,vc-channel = <1>; + + broadcom,width = <0>; /* Set by VideoCore */ + broadcom,height = <0>; /* Set by VideoCore */ + broadcom,depth = <0>; /* Set by VideoCore */ + }; + leds { compatible = "gpio-leds"; From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 03:34:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F70532A; Fri, 23 Nov 2012 03:34:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 634498FC08; Fri, 23 Nov 2012 03:34:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN3YD31028016; Fri, 23 Nov 2012 03:34:13 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN3YDdR028015; Fri, 23 Nov 2012 03:34:13 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211230334.qAN3YDdR028015@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Nov 2012 03:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243421 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 03:34:13 -0000 Author: gonzo Date: Fri Nov 23 03:34:12 2012 New Revision: 243421 URL: http://svnweb.freebsd.org/changeset/base/243421 Log: Look for MAC address in FDT tree nodes that are usb network devices and have either "mac-address" or "local-mac-addrress" property. Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Fri Nov 23 03:24:52 2012 (r243420) +++ head/sys/dev/usb/net/if_smsc.c Fri Nov 23 03:34:12 2012 (r243421) @@ -82,6 +82,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_platform.h" + +#ifdef FDT +#include +#include +#include +#endif + #include #include #include @@ -1516,6 +1524,64 @@ smsc_ioctl(struct ifnet *ifp, u_long cmd return (rc); } +#ifdef FDT +/** + * Get MAC address from FDT blob. Firmware or loader should fill + * mac-address or local-mac-address property Returns 0 if MAC address + * obtained, error code otherwise + */ +static int +smsc_fdt_find_mac(unsigned char *mac) +{ + phandle_t child, parent, root; + int len; + + root = OF_finddevice("/"); + len = 0; + parent = root; + + /* Traverse through entire tree to find nodes usb ethernet nodes */ + for (child = OF_child(parent); child != 0; child = OF_peer(child)) { + + /* Find a 'leaf'. Start the search from this node. */ + while (OF_child(child)) { + parent = child; + child = OF_child(child); + } + + if (fdt_is_compatible(child, "net,ethernet") && + fdt_is_compatible(child, "usb,device")) { + + /* Check if there is property */ + if ((len = OF_getproplen(child, "local-mac-address")) > 0) { + if (len != ETHER_ADDR_LEN) + return (EINVAL); + + OF_getprop(child, "local-mac-address", mac, + ETHER_ADDR_LEN); + return (0); + } + + if ((len = OF_getproplen(child, "mac-address")) > 0) { + if (len != ETHER_ADDR_LEN) + return (EINVAL); + + OF_getprop(child, "mac-address", mac, + ETHER_ADDR_LEN); + return (0); + } + } + + if (OF_peer(child) == 0) { + /* No more siblings. */ + child = parent; + parent = OF_parent(child); + } + } + + return (ENXIO); +} +#endif /** * smsc_attach_post - Called after the driver attached to the USB interface @@ -1563,8 +1629,11 @@ smsc_attach_post(struct usb_ether *ue) if (!ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { err = smsc_eeprom_read(sc, 0x01, sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN); +#ifdef FDT + if ((err != 0) || (!ETHER_IS_VALID(sc->sc_ue.ue_eaddr))) + err = smsc_fdt_find_mac(sc->sc_ue.ue_eaddr); +#endif if ((err != 0) || (!ETHER_IS_VALID(sc->sc_ue.ue_eaddr))) { - read_random(sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN); sc->sc_ue.ue_eaddr[0] &= ~0x01; /* unicast */ sc->sc_ue.ue_eaddr[0] |= 0x02; /* locally administered */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 04:28:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5058FB39; Fri, 23 Nov 2012 04:28:14 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 352EA8FC08; Fri, 23 Nov 2012 04:28:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN4SELC036197; Fri, 23 Nov 2012 04:28:14 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN4SEeN036196; Fri, 23 Nov 2012 04:28:14 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211230428.qAN4SEeN036196@svn.freebsd.org> From: Juli Mallett Date: Fri, 23 Nov 2012 04:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243422 - head/sys/dev/gxemul/cons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 04:28:14 -0000 Author: jmallett Date: Fri Nov 23 04:28:13 2012 New Revision: 243422 URL: http://svnweb.freebsd.org/changeset/base/243422 Log: Use MIPS_PHYS_TO_DIRECT_UNCACHED rather than a homegrown version which is not compatible with 32-bit kernels. Modified: head/sys/dev/gxemul/cons/gxemul_cons.c Modified: head/sys/dev/gxemul/cons/gxemul_cons.c ============================================================================== --- head/sys/dev/gxemul/cons/gxemul_cons.c Fri Nov 23 03:34:12 2012 (r243421) +++ head/sys/dev/gxemul/cons/gxemul_cons.c Fri Nov 23 04:28:13 2012 (r243422) @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include +#include + #define GC_LOCK_INIT() mtx_init(&gc_lock, "gc_lock", NULL, MTX_SPIN) #define GC_LOCK() do { \ @@ -97,8 +99,6 @@ static void gxemul_cons_timeout(void *) * XXXRW: Should be using FreeBSD's bus routines here, but they are not * available until later in the boot. */ -#define MIPS_XKPHYS_UNCACHED_BASE 0x9000000000000000 - typedef uint64_t paddr_t; typedef uint64_t vaddr_t; @@ -106,7 +106,7 @@ static inline vaddr_t mips_phys_to_uncached(paddr_t phys) { - return (phys | MIPS_XKPHYS_UNCACHED_BASE); + return (MIPS_PHYS_TO_DIRECT_UNCACHED(phys)); } static inline uint8_t From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 04:30:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D8C9CC4; Fri, 23 Nov 2012 04:30:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 836708FC12; Fri, 23 Nov 2012 04:30:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN4Us2a036669; Fri, 23 Nov 2012 04:30:54 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN4Usau036668; Fri, 23 Nov 2012 04:30:54 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211230430.qAN4Usau036668@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Nov 2012 04:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243423 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 04:30:54 -0000 Author: gonzo Date: Fri Nov 23 04:30:54 2012 New Revision: 243423 URL: http://svnweb.freebsd.org/changeset/base/243423 Log: Multiple fixes for BCM2835 framebuffer - Get resolution settings from FDT blob - Properly handle 24 and 16 bits per pixel - Add colors support for text console Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Fri Nov 23 04:28:13 2012 (r243422) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Fri Nov 23 04:30:54 2012 (r243423) @@ -68,8 +68,35 @@ __FBSDID("$FreeBSD$"); #define BCMFB_FONT_HEIGHT 16 +struct argb { + uint8_t a; + uint8_t r; + uint8_t g; + uint8_t b; +}; + +static struct argb bcmfb_palette[16] = { + {0x00, 0x00, 0x00, 0x00}, + {0x00, 0x00, 0x00, 0xaa}, + {0x00, 0x00, 0xaa, 0x00}, + {0x00, 0x00, 0xaa, 0xaa}, + {0x00, 0xaa, 0x00, 0x00}, + {0x00, 0xaa, 0x00, 0xaa}, + {0x00, 0xaa, 0x55, 0x00}, + {0x00, 0xaa, 0xaa, 0xaa}, + {0x00, 0x55, 0x55, 0x55}, + {0x00, 0x55, 0x55, 0xff}, + {0x00, 0x55, 0xff, 0x55}, + {0x00, 0x55, 0xff, 0xff}, + {0x00, 0xff, 0x55, 0x55}, + {0x00, 0xff, 0x55, 0xff}, + {0x00, 0xff, 0xff, 0x55}, + {0x00, 0xff, 0xff, 0xff} +}; + #define FB_WIDTH 640 #define FB_HEIGHT 480 +#define FB_DEPTH 24 struct bcm_fb_config { uint32_t xres; @@ -107,6 +134,7 @@ struct video_adapter_softc { unsigned int height; unsigned int width; + unsigned int depth; unsigned int stride; unsigned int xmargin; @@ -126,6 +154,8 @@ static struct video_adapter_softc va_sof static int bcm_fb_probe(device_t); static int bcm_fb_attach(device_t); static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err); +static void bcmfb_update_margins(video_adapter_t *adp); +static int bcmfb_configure(int); static void bcm_fb_init(void *arg) @@ -134,15 +164,34 @@ bcm_fb_init(void *arg) struct video_adapter_softc *va_sc = &va_softc; int err; volatile struct bcm_fb_config* fb_config = sc->fb_config; + phandle_t node; + pcell_t cell; + + node = ofw_bus_get_node(sc->dev); + + fb_config->xres = 0; + fb_config->yres = 0; + fb_config->bpp = 0; + + if ((OF_getprop(node, "broadcom,width", &cell, sizeof(cell))) > 0) + fb_config->xres = (int)fdt32_to_cpu(cell); + if (fb_config->xres == 0) + fb_config->xres = FB_WIDTH; + + if ((OF_getprop(node, "broadcom,height", &cell, sizeof(cell))) > 0) + fb_config->yres = (uint32_t)fdt32_to_cpu(cell); + if (fb_config->yres == 0) + fb_config->yres = FB_HEIGHT; + + if ((OF_getprop(node, "broadcom,depth", &cell, sizeof(cell))) > 0) + fb_config->bpp = (uint32_t)fdt32_to_cpu(cell); + if (fb_config->bpp == 0) + fb_config->bpp = FB_DEPTH; - /* TODO: replace it with FDT stuff */ - fb_config->xres = FB_WIDTH; - fb_config->yres = FB_HEIGHT; fb_config->vxres = 0; fb_config->vyres = 0; fb_config->xoffset = 0; fb_config->yoffset = 0; - fb_config->bpp = 24; fb_config->base = 0; fb_config->pitch = 0; fb_config->screen_size = 0; @@ -154,7 +203,7 @@ bcm_fb_init(void *arg) bus_dmamap_sync(sc->dma_tag, sc->dma_map, BUS_DMASYNC_POSTREAD); - if (err == 0) { + if (fb_config->base != 0) { device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", fb_config->xres, fb_config->yres, fb_config->vxres, fb_config->vyres, @@ -166,14 +215,19 @@ bcm_fb_init(void *arg) fb_config->pitch, fb_config->base, fb_config->screen_size); - if (fb_config->base) { - va_sc->fb_addr = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); - va_sc->fb_size = fb_config->screen_size; - va_sc->stride = fb_config->pitch; - } + va_sc->fb_addr = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); + va_sc->fb_size = fb_config->screen_size; + va_sc->depth = fb_config->bpp; + va_sc->stride = fb_config->pitch; + + va_sc->width = fb_config->xres; + va_sc->height = fb_config->yres; + bcmfb_update_margins(&va_sc->va); } - else + else { device_printf(sc->dev, "Failed to set framebuffer info\n"); + return; + } config_intrhook_disestablish(&sc->init_hook); } @@ -181,7 +235,7 @@ bcm_fb_init(void *arg) static int bcm_fb_probe(device_t dev) { - int error; + int error = 0; if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-fb")) return (ENXIO); @@ -190,10 +244,10 @@ bcm_fb_probe(device_t dev) error = sc_probe_unit(device_get_unit(dev), device_get_flags(dev) | SC_AUTODETECT_KBD); - if (error != 0) return (error); + return (BUS_PROBE_DEFAULT); } @@ -293,12 +347,11 @@ static driver_t bcm_fb_driver = { sizeof(struct bcmsc_softc), }; -DRIVER_MODULE(bcm2835fb, simplebus, bcm_fb_driver, bcm_fb_devclass, 0, 0); +DRIVER_MODULE(bcm2835fb, fdtbus, bcm_fb_driver, bcm_fb_devclass, 0, 0); /* * Video driver routines and glue. */ -static int bcmfb_configure(int); static vi_probe_t bcmfb_probe; static vi_init_t bcmfb_init; static vi_get_info_t bcmfb_get_info; @@ -374,22 +427,62 @@ RENDERER_MODULE(bcmfb, gfb_set); static uint16_t bcmfb_static_window[ROW*COL]; extern u_char dflt_font_16[]; +/* + * Update videoadapter settings after changing resolution + */ +static void +bcmfb_update_margins(video_adapter_t *adp) +{ + struct video_adapter_softc *sc; + video_info_t *vi; + + sc = (struct video_adapter_softc *)adp; + vi = &adp->va_info; + + sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2; + sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2; +} + static int bcmfb_configure(int flags) { - struct video_adapter_softc *sc; + struct video_adapter_softc *va_sc; + + va_sc = &va_softc; + phandle_t display, root; + pcell_t cell; - sc = &va_softc; + if (va_sc->initialized) + return (0); - if (sc->initialized) - return 0; + va_sc->width = 0; + va_sc->height = 0; + + /* + * It seems there is no way to let syscons framework know + * that framebuffer resolution has changed. So just try + * to fetch data from FDT and go with defaults if failed + */ + root = OF_finddevice("/"); + if ((root != 0) && + (display = fdt_find_compatible(root, "broadcom,bcm2835-fb", 1))) { + if ((OF_getprop(display, "broadcom,width", + &cell, sizeof(cell))) > 0) + va_sc->width = (int)fdt32_to_cpu(cell); + + if ((OF_getprop(display, "broadcom,height", + &cell, sizeof(cell))) > 0) + va_sc->height = (int)fdt32_to_cpu(cell); + } - sc->height = FB_HEIGHT; - sc->width = FB_WIDTH; + if (va_sc->width == 0) + va_sc->width = FB_WIDTH; + if (va_sc->height == 0) + va_sc->height = FB_HEIGHT; - bcmfb_init(0, &sc->va, 0); + bcmfb_init(0, &va_sc->va, 0); - sc->initialized = 1; + va_sc->initialized = 1; return (0); } @@ -415,6 +508,7 @@ bcmfb_init(int unit, video_adapter_t *ad sc->font = dflt_font_16; vi->vi_cheight = BCMFB_FONT_HEIGHT; vi->vi_cwidth = 8; + vi->vi_width = sc->width/8; vi->vi_height = sc->height/vi->vi_cheight; @@ -429,6 +523,7 @@ bcmfb_init(int unit, video_adapter_t *ad sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2; sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2; + adp->va_window = (vm_offset_t) bcmfb_static_window; adp->va_flags |= V_ADP_FONT /* | V_ADP_COLOR | V_ADP_MODECHANGE */; @@ -541,6 +636,12 @@ static int bcmfb_blank_display(video_adapter_t *adp, int mode) { + struct video_adapter_softc *sc; + + sc = (struct video_adapter_softc *)adp; + if (sc && sc->fb_addr) + memset((void*)sc->fb_addr, 0, sc->fb_size); + return (0); } @@ -638,6 +739,7 @@ bcmfb_putc(video_adapter_t *adp, vm_offs uint8_t *addr; u_char *p; uint8_t fg, bg, color; + uint16_t rgb; sc = (struct video_adapter_softc *)adp; @@ -651,11 +753,8 @@ bcmfb_putc(video_adapter_t *adp, vm_offs + (row + sc->ymargin)*(sc->stride) + 3 * (col + sc->xmargin); - /* - * FIXME: hardcoded - */ - bg = 0x00; - fg = 0x80; + fg = a & 0xf ; + bg = (a >> 8) & 0xf; for (i = 0; i < BCMFB_FONT_HEIGHT; i++) { for (j = 0, k = 7; j < 8; j++, k--) { @@ -664,9 +763,28 @@ bcmfb_putc(video_adapter_t *adp, vm_offs else color = fg; - addr[3*j] = color; - addr[3*j+1] = color; - addr[3*j+2] = color; + switch (sc->depth) { + case 32: + addr[4*j+0] = bcmfb_palette[color].r; + addr[4*j+1] = bcmfb_palette[color].g; + addr[4*j+2] = bcmfb_palette[color].b; + addr[4*j+3] = bcmfb_palette[color].a; + break; + case 24: + addr[3*j] = bcmfb_palette[color].r; + addr[3*j+1] = bcmfb_palette[color].g; + addr[3*j+2] = bcmfb_palette[color].b; + break; + case 16: + rgb = (bcmfb_palette[color].r >> 3) << 10; + rgb |= (bcmfb_palette[color].g >> 3) << 5; + rgb |= (bcmfb_palette[color].b >> 3); + addr[2*j] = (rgb >> 8) & 0xff; + addr[2*j + 1] = rgb & 0xff; + default: + /* Not supported yet */ + break; + } } addr += (sc->stride); From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 05:32:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D2E80556; Fri, 23 Nov 2012 05:32:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B71668FC08; Fri, 23 Nov 2012 05:32:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN5WOZ5045768; Fri, 23 Nov 2012 05:32:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN5WOJY045763; Fri, 23 Nov 2012 05:32:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211230532.qAN5WOJY045763@svn.freebsd.org> From: Adrian Chadd Date: Fri, 23 Nov 2012 05:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243424 - in head/sys/dev/ath/ath_hal: . ar5212 ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 05:32:25 -0000 Author: adrian Date: Fri Nov 23 05:32:24 2012 New Revision: 243424 URL: http://svnweb.freebsd.org/changeset/base/243424 Log: Implement a HAL method to set a 64 bit TSF value. TODO: implement it (and test) for the AR5210/AR5211. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Nov 23 04:30:54 2012 (r243423) +++ head/sys/dev/ath/ath_hal/ah.h Fri Nov 23 05:32:24 2012 (r243424) @@ -1388,6 +1388,7 @@ struct ath_hal { void __ahdecl(*ah_gpioSetIntr)(struct ath_hal*, u_int, uint32_t); uint32_t __ahdecl(*ah_getTsf32)(struct ath_hal*); uint64_t __ahdecl(*ah_getTsf64)(struct ath_hal*); + void __ahdecl(*ah_setTsf64)(struct ath_hal *, uint64_t); void __ahdecl(*ah_resetTsf)(struct ath_hal*); HAL_BOOL __ahdecl(*ah_detectCardPresent)(struct ath_hal*); void __ahdecl(*ah_updateMibCounters)(struct ath_hal*, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Nov 23 04:30:54 2012 (r243423) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Nov 23 05:32:24 2012 (r243424) @@ -111,6 +111,7 @@ static const struct ath_hal_private ar52 .ah_gpioSetIntr = ar5212GpioSetIntr, .ah_getTsf32 = ar5212GetTsf32, .ah_getTsf64 = ar5212GetTsf64, + .ah_setTsf64 = ar5212SetTsf64, .ah_resetTsf = ar5212ResetTsf, .ah_detectCardPresent = ar5212DetectCardPresent, .ah_updateMibCounters = ar5212UpdateMibCounters, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Nov 23 04:30:54 2012 (r243423) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Nov 23 05:32:24 2012 (r243424) @@ -142,6 +142,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_gpioSet = ar5416GpioSet; ah->ah_gpioSetIntr = ar5416GpioSetIntr; ah->ah_getTsf64 = ar5416GetTsf64; + ah->ah_setTsf64 = ar5416SetTsf64; ah->ah_resetTsf = ar5416ResetTsf; ah->ah_getRfGain = ar5416GetRfgain; ah->ah_setAntennaSwitch = ar5416SetAntennaSwitch; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Nov 23 04:30:54 2012 (r243423) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Nov 23 05:32:24 2012 (r243424) @@ -131,6 +131,21 @@ ar5416GetTsf64(struct ath_hal *ah) void ar5416SetTsf64(struct ath_hal *ah, uint64_t tsf64) { + /* XXX check if this is correct! */ +#if 0 + int i; + uint32_t v; + + for (i = 0; i < 10; i++) { + v = OS_REG_READ(ah, AR_SLP32_MODE); + if ((v & AR_SLP32_TSF_WRITE_STATUS) == 0) + break; + OS_DELAY(10); + } + if (i == 10) + ath_hal_printf(ah, "%s: couldn't slew things right!\n", __func__); +#endif + OS_REG_WRITE(ah, AR_TSF_L32, tsf64 & 0xffffffff); OS_REG_WRITE(ah, AR_TSF_U32, (tsf64 >> 32) & 0xffffffff); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 05:33:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC2366C3; Fri, 23 Nov 2012 05:33:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B16D08FC08; Fri, 23 Nov 2012 05:33:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN5X1bU045913; Fri, 23 Nov 2012 05:33:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN5X1pF045912; Fri, 23 Nov 2012 05:33:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211230533.qAN5X1pF045912@svn.freebsd.org> From: Adrian Chadd Date: Fri, 23 Nov 2012 05:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243425 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 05:33:01 -0000 Author: adrian Date: Fri Nov 23 05:33:01 2012 New Revision: 243425 URL: http://svnweb.freebsd.org/changeset/base/243425 Log: Add the HAL wrapper for settsf64. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Nov 23 05:32:24 2012 (r243424) +++ head/sys/dev/ath/if_athvar.h Fri Nov 23 05:33:01 2012 (r243425) @@ -969,6 +969,8 @@ void ath_intr(void *); OS_REG_READ(_ah, AR_TSF_L32) #define ath_hal_gettsf64(_ah) \ ((*(_ah)->ah_getTsf64)((_ah))) +#define ath_hal_settsf64(_ah, _val) \ + ((*(_ah)->ah_setTsf64)((_ah), (_val))) #define ath_hal_resettsf(_ah) \ ((*(_ah)->ah_resetTsf)((_ah))) #define ath_hal_rxena(_ah) \ From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 05:38:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5A31862; Fri, 23 Nov 2012 05:38:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B0ED58FC15; Fri, 23 Nov 2012 05:38:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN5ccji046683; Fri, 23 Nov 2012 05:38:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN5ccsl046682; Fri, 23 Nov 2012 05:38:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211230538.qAN5ccsl046682@svn.freebsd.org> From: Adrian Chadd Date: Fri, 23 Nov 2012 05:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243426 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 05:38:39 -0000 Author: adrian Date: Fri Nov 23 05:38:38 2012 New Revision: 243426 URL: http://svnweb.freebsd.org/changeset/base/243426 Log: Fix up the nexttbtt -> TSF delta calculation to not wrap ridiculously on the 802.11n NICs. The 802.11n NICs return a TBTT value that continues far past the 16 bit HAL_BEACON_PERIOD time (in TU.) The code would constrain nextslot to HAL_BEACON_PERIOD, but it wasn't constraining nexttbtt - the pre-11n NICs would only return TU values from 0 -> HAL_BEACON_PERIOD. Thus, when nexttbtt exceeded 64 milliseconds, it would not wrap (but nextslot did) which lead to a huge tsfdelta. So until the slot calculation is converted to work in TSF rather than a mix of TSF and TU, "make" the nexttbtt values match the TU assumptions for pre-11n NICs. This fixes the crazy deltatsf calculations but it doesn't fix the non-convergent tsfdelta issue. That'll be fixed in a subsequent commit. Modified: head/sys/dev/ath/if_ath_tdma.c Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Fri Nov 23 05:33:01 2012 (r243425) +++ head/sys/dev/ath/if_ath_tdma.c Fri Nov 23 05:38:38 2012 (r243426) @@ -336,7 +336,21 @@ ath_tdma_update(struct ieee80211_node *n * adjustments are done by pulling the TSF forward and possibly * rewriting the beacon timers. */ - nexttbtt = ath_hal_getnexttbtt(ah); + /* + * The logic here assumes the nexttbtt counter is in TSF + * but the prr-11n NICs are in TU. The HAL shifts them + * to TSF but there's two important differences: + * + * + The TU->TSF values have 0's for the low 9 bits, and + * + The counter wraps at TU_TO_TSF(HAL_BEACON_PERIOD + 1) for + * the pre-11n NICs, but not for the 11n NICs. + * + * So for now, just make sure the nexttbtt value we get + * matches the second issue or once nexttbtt exceeds this + * value, tsfdelta ends up becoming very negative and all + * of the adjustments get very messed up. + */ + nexttbtt = ath_hal_getnexttbtt(ah) % (TU_TO_TSF(HAL_BEACON_PERIOD + 1)); tsfdelta = (int32_t)((nextslot % TU_TO_TSF(HAL_BEACON_PERIOD + 1)) - nexttbtt); DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 05:52:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE33BA7F; Fri, 23 Nov 2012 05:52:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B899D8FC0C; Fri, 23 Nov 2012 05:52:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN5qMds048599; Fri, 23 Nov 2012 05:52:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN5qM9k048598; Fri, 23 Nov 2012 05:52:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211230552.qAN5qM9k048598@svn.freebsd.org> From: Adrian Chadd Date: Fri, 23 Nov 2012 05:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243427 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 05:52:23 -0000 Author: adrian Date: Fri Nov 23 05:52:22 2012 New Revision: 243427 URL: http://svnweb.freebsd.org/changeset/base/243427 Log: Use a 64 bit TSF write to update the TSF adjust, rather than a 32 bit TSF write. The TSF_L32 update is fine for the AR5413 (and later, I guess) 11abg NICs however on the 11n NICs this didn't work. The TSF writes were causing a much larger time to be skipped, leading to the timing to never converge. I've tested this 64 bit TSF read, adjust and write on both the 11n NICs and the AR5413 NIC I've been using for testing. It works fine on each. This patch allows the AR5416/AR9280 to be used as a TDMA member. I don't yet know why the AR9280 is ~7uS accurate rather than ~3uS; I'll look into it soon. Tested: * AR5413, TDMA slave (~ 3us accuracy) * AR5416, TDMA slave (~ 3us accuracy) * AR9280, TDMA slave (~ 7us accuracy) Modified: head/sys/dev/ath/if_ath_tdma.c Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Fri Nov 23 05:38:38 2012 (r243426) +++ head/sys/dev/ath/if_ath_tdma.c Fri Nov 23 05:52:22 2012 (r243427) @@ -406,7 +406,11 @@ ath_tdma_update(struct ieee80211_node *n sc->sc_stats.ast_tdma_timers++; } if (tsfdelta > 0) { - ath_hal_adjusttsf(ah, tsfdelta); + uint64_t tsf; + + /* XXX should just teach ath_hal_adjusttsf() to do this */ + tsf = ath_hal_gettsf64(ah); + ath_hal_settsf64(ah, tsf + tsfdelta); sc->sc_stats.ast_tdma_tsf++; } ath_tdma_beacon_send(sc, vap); /* prepare response */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 07:58:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B89B82E0; Fri, 23 Nov 2012 07:58:12 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D6598FC08; Fri, 23 Nov 2012 07:58:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN7wCgW067438; Fri, 23 Nov 2012 07:58:12 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN7wCes067437; Fri, 23 Nov 2012 07:58:12 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211230758.qAN7wCes067437@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Nov 2012 07:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243434 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 07:58:12 -0000 Author: gonzo Date: Fri Nov 23 07:58:12 2012 New Revision: 243434 URL: http://svnweb.freebsd.org/changeset/base/243434 Log: Now that we have working USB keyboard add ukbd to the syscons-enabling part of config Modified: head/sys/arm/conf/RPI-B Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Fri Nov 23 07:35:50 2012 (r243433) +++ head/sys/arm/conf/RPI-B Fri Nov 23 07:58:12 2012 (r243434) @@ -79,6 +79,7 @@ device pty # device kbdmux # options SC_DFLT_FONT # compile font in # makeoptions SC_DFLT_FONT=cp437 +# device ukbd device sdhci device mmc From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 08:22:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5D7867F; Fri, 23 Nov 2012 08:22:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9F1C58FC0C; Fri, 23 Nov 2012 08:22:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN8M688071267; Fri, 23 Nov 2012 08:22:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN8M6Ww071264; Fri, 23 Nov 2012 08:22:06 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211230822.qAN8M6Ww071264@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 23 Nov 2012 08:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243435 - in head: share/man/man4 sys/dev/usb/quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 08:22:06 -0000 Author: hselasky Date: Fri Nov 23 08:22:06 2012 New Revision: 243435 URL: http://svnweb.freebsd.org/changeset/base/243435 Log: Remove no longer needed quirk. Submitted by: Mark Johnston Modified: head/share/man/man4/usb_quirk.4 head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/quirk/usb_quirk.h Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Fri Nov 23 07:58:12 2012 (r243434) +++ head/share/man/man4/usb_quirk.4 Fri Nov 23 08:22:06 2012 (r243435) @@ -76,8 +76,6 @@ mouse sends an unknown leading byte mouse has Z-axis reversed .It UQ_NO_STRINGS string descriptors are broken -.It UQ_OPEN_CLEARSTALL -device needs clear endpoint stall .It UQ_POWER_CLAIM hub lies about power status .It UQ_SPUR_BUT_UP Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Nov 23 07:58:12 2012 (r243434) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Nov 23 08:22:06 2012 (r243435) @@ -508,7 +508,6 @@ static const char *usb_quirk_str[USB_QUI [UQ_MS_LEADING_BYTE] = "UQ_MS_LEADING_BYTE", [UQ_MS_REVZ] = "UQ_MS_REVZ", [UQ_NO_STRINGS] = "UQ_NO_STRINGS", - [UQ_OPEN_CLEARSTALL] = "UQ_OPEN_CLEARSTALL", [UQ_POWER_CLAIM] = "UQ_POWER_CLAIM", [UQ_SPUR_BUT_UP] = "UQ_SPUR_BUT_UP", [UQ_SWAP_UNICODE] = "UQ_SWAP_UNICODE", Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Fri Nov 23 07:58:12 2012 (r243434) +++ head/sys/dev/usb/quirk/usb_quirk.h Fri Nov 23 08:22:06 2012 (r243435) @@ -54,7 +54,6 @@ enum { UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */ UQ_MS_REVZ, /* mouse has Z-axis reversed */ UQ_NO_STRINGS, /* string descriptors are broken */ - UQ_OPEN_CLEARSTALL, /* device needs clear endpoint stall */ UQ_POWER_CLAIM, /* hub lies about power status */ UQ_SPUR_BUT_UP, /* spurious mouse button up events */ UQ_SWAP_UNICODE, /* has some Unicode strings swapped */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 08:23:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4BEE7F6; Fri, 23 Nov 2012 08:23:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E98D8FC08; Fri, 23 Nov 2012 08:23:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN8NrKs071523; Fri, 23 Nov 2012 08:23:53 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN8Nra0071521; Fri, 23 Nov 2012 08:23:53 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211230823.qAN8Nra0071521@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 23 Nov 2012 08:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243436 - stable/9/sys/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 08:23:53 -0000 Author: glebius Date: Fri Nov 23 08:23:53 2012 New Revision: 243436 URL: http://svnweb.freebsd.org/changeset/base/243436 Log: Sync lagg(4) with head, merging r240742, r241619: r240742 | glebius | 2012-09-20 14:05:10 +0400 (чт, 20 сен 2012) | 4 lines Convert lagg(4) to use if_transmit instead of if_start. In collaboration with: thompsa, sbruno, fabient r241619 | emax | 2012-10-17 02:43:14 +0400 (ср, 17 окт 2012) | 5 lines report total number of ports for each lagg(4) interface via net.link.lagg.X.count sysctl Modified: stable/9/sys/net/if_lagg.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Fri Nov 23 08:22:06 2012 (r243435) +++ stable/9/sys/net/if_lagg.c Fri Nov 23 08:23:53 2012 (r243436) @@ -110,7 +110,8 @@ static int lagg_ether_cmdmulti(struct la static int lagg_setflag(struct lagg_port *, int, int, int (*func)(struct ifnet *, int)); static int lagg_setflags(struct lagg_port *, int status); -static void lagg_start(struct ifnet *); +static int lagg_transmit(struct ifnet *, struct mbuf *); +static void lagg_qflush(struct ifnet *); static int lagg_media_change(struct ifnet *); static void lagg_media_status(struct ifnet *, struct ifmediareq *); static struct lagg_port *lagg_link_active(struct lagg_softc *, @@ -284,6 +285,9 @@ lagg_clone_create(struct if_clone *ifc, SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, "Use flow id for load sharing"); + SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "count", CTLTYPE_INT|CTLFLAG_RD, &sc->sc_count, sc->sc_count, + "Total number of ports"); /* Hash all layers by default */ sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; @@ -312,15 +316,12 @@ lagg_clone_create(struct if_clone *ifc, if_initname(ifp, ifc->ifc_name, unit); ifp->if_type = IFT_ETHER; ifp->if_softc = sc; - ifp->if_start = lagg_start; + ifp->if_transmit = lagg_transmit; + ifp->if_qflush = lagg_qflush; ifp->if_init = lagg_init; ifp->if_ioctl = lagg_ioctl; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); - ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; - IFQ_SET_READY(&ifp->if_snd); - /* * Attach as an ordinary ethernet device, childs will be attached * as special device IFT_IEEE8023ADLAG. @@ -1222,35 +1223,45 @@ lagg_setflags(struct lagg_port *lp, int return (0); } -static void -lagg_start(struct ifnet *ifp) +static int +lagg_transmit(struct ifnet *ifp, struct mbuf *m) { struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; - struct mbuf *m; - int error = 0; + int error, len, mcast; + + len = m->m_pkthdr.len; + mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; LAGG_RLOCK(sc); /* We need a Tx algorithm and at least one port */ if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) { - IF_DRAIN(&ifp->if_snd); LAGG_RUNLOCK(sc); - return; + m_freem(m); + ifp->if_oerrors++; + return (ENXIO); } - for (;; error = 0) { - IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) - break; - - ETHER_BPF_MTAP(ifp, m); + ETHER_BPF_MTAP(ifp, m); - error = (*sc->sc_start)(sc, m); - if (error == 0) - ifp->if_opackets++; - else - ifp->if_oerrors++; - } + error = (*sc->sc_start)(sc, m); LAGG_RUNLOCK(sc); + + if (error == 0) { + ifp->if_opackets++; + ifp->if_omcasts += mcast; + ifp->if_obytes += len; + } else + ifp->if_oerrors++; + + return (error); +} + +/* + * The ifp->if_qflush entry point for lagg(4) is no-op. + */ +static void +lagg_qflush(struct ifnet *ifp __unused) +{ } static struct mbuf * From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 08:44:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C17D0E74; Fri, 23 Nov 2012 08:44:36 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A6C958FC13; Fri, 23 Nov 2012 08:44:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN8iaeC074259; Fri, 23 Nov 2012 08:44:36 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN8iaRQ074258; Fri, 23 Nov 2012 08:44:36 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211230844.qAN8iaRQ074258@svn.freebsd.org> From: Kevin Lo Date: Fri, 23 Nov 2012 08:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243437 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 08:44:36 -0000 Author: kevlo Date: Fri Nov 23 08:44:36 2012 New Revision: 243437 URL: http://svnweb.freebsd.org/changeset/base/243437 Log: Catch up with r243046. KTR buffer can be changed at runtime. Modified: head/share/man/man4/ktr.4 Modified: head/share/man/man4/ktr.4 ============================================================================== --- head/share/man/man4/ktr.4 Fri Nov 23 08:23:53 2012 (r243436) +++ head/share/man/man4/ktr.4 Fri Nov 23 08:44:36 2012 (r243437) @@ -53,7 +53,7 @@ The .Dv KTR_ENTRIES option sets the size of the buffer of events. The size of the buffer in the currently running kernel can be found via the -read-only sysctl +sysctl .Va debug.ktr.entries . By default the buffer contains 1024 entries. .Ss Event Masking From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 08:47:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 25DC68F; Fri, 23 Nov 2012 08:47:58 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 094C78FC12; Fri, 23 Nov 2012 08:47:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN8lvM1074719; Fri, 23 Nov 2012 08:47:57 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN8lv8a074718; Fri, 23 Nov 2012 08:47:57 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211230847.qAN8lv8a074718@svn.freebsd.org> From: Kevin Lo Date: Fri, 23 Nov 2012 08:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243438 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 08:47:58 -0000 Author: kevlo Date: Fri Nov 23 08:47:57 2012 New Revision: 243438 URL: http://svnweb.freebsd.org/changeset/base/243438 Log: According to r221124, the default NFS server and client are no longer experimental. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Nov 23 08:44:36 2012 (r243437) +++ head/sys/conf/NOTES Fri Nov 23 08:47:57 2012 (r243438) @@ -1007,8 +1007,8 @@ options FUSE #FUSE support module options MSDOSFS #MS DOS File System (FAT, FAT32) options NFSSERVER #Network File System server options NFSLOCKD #Network Lock Manager -options NFSCL #experimental NFS client with NFSv4 -options NFSD #experimental NFS server with NFSv4 +options NFSCL #New Network Filesystem Client +options NFSD #New Network Filesystem Server options KGSSAPI #Kernel GSSAPI implementation options NULLFS #NULL filesystem From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 10:14:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42302DB3; Fri, 23 Nov 2012 10:14:55 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26D478FC0C; Fri, 23 Nov 2012 10:14:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANAEswO090139; Fri, 23 Nov 2012 10:14:54 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANAEsS6090137; Fri, 23 Nov 2012 10:14:54 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201211231014.qANAEsS6090137@svn.freebsd.org> From: Kevin Lo Date: Fri, 23 Nov 2012 10:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243439 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 10:14:55 -0000 Author: kevlo Date: Fri Nov 23 10:14:54 2012 New Revision: 243439 URL: http://svnweb.freebsd.org/changeset/base/243439 Log: Document that getpeername(2) and getsockname(2) can fail with EINVAL. Reviewed by: glebius Modified: head/lib/libc/sys/getpeername.2 head/lib/libc/sys/getsockname.2 Modified: head/lib/libc/sys/getpeername.2 ============================================================================== --- head/lib/libc/sys/getpeername.2 Fri Nov 23 08:47:57 2012 (r243438) +++ head/lib/libc/sys/getpeername.2 Fri Nov 23 10:14:54 2012 (r243439) @@ -67,6 +67,10 @@ The argument is not a valid descriptor. .It Bq Er ECONNRESET The connection has been reset by the peer. +.It Bq Er EINVAL +The value of the +.Fa namelen +argument is not valid. .It Bq Er ENOTSOCK The argument .Fa s Modified: head/lib/libc/sys/getsockname.2 ============================================================================== --- head/lib/libc/sys/getsockname.2 Fri Nov 23 08:47:57 2012 (r243438) +++ head/lib/libc/sys/getsockname.2 Fri Nov 23 10:14:54 2012 (r243439) @@ -66,6 +66,10 @@ The argument is not a valid descriptor. .It Bq Er ECONNRESET The connection has been reset by the peer. +.It Bq Er EINVAL +The value of the +.Fa namelen +argument is not valid. .It Bq Er ENOTSOCK The argument .Fa s From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 11:19:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A7C93B22; Fri, 23 Nov 2012 11:19:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 874458FC13; Fri, 23 Nov 2012 11:19:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANBJigH001779; Fri, 23 Nov 2012 11:19:44 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANBJi3O001767; Fri, 23 Nov 2012 11:19:44 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211231119.qANBJi3O001767@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 23 Nov 2012 11:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243440 - in stable/9/sys: dev/bxe dev/e1000 dev/ixgbe dev/mxge dev/oce dev/vxge net ofed/drivers/net/mlx4 sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 11:19:44 -0000 Author: glebius Date: Fri Nov 23 11:19:43 2012 New Revision: 243440 URL: http://svnweb.freebsd.org/changeset/base/243440 Log: Merge r241037 from head: The drbr(9) API appeared to be so unclear, that most drivers in tree used it incorrectly, which lead to inaccurate overrated if_obytes accounting. The drbr(9) used to update ifnet stats on drbr_enqueue(), which is not accurate since enqueuing doesn't imply successful processing by driver. Dequeuing neither mean that. Most drivers also called drbr_stats_update() which did accounting again, leading to doubled if_obytes statistics. And in case of severe transmitting, when a packet could be several times enqueued and dequeued it could have been accounted several times. o Thus, make drbr(9) API thinner. Now drbr(9) merely chooses between ALTQ queueing or buf_ring(9) queueing. - It doesn't touch the buf_ring stats any more. - It doesn't touch ifnet stats anymore. - drbr_stats_update() no longer exists. o buf_ring(9) handles its stats itself: - It handles br_drops itself. - br_prod_bytes stats are dropped. Rationale: no one ever reads them but update of a common counter on every packet negatively affects performance due to excessive cache invalidation. - buf_ring_enqueue_bytes() reduced to buf_ring_enqueue(), since we no longer account bytes. o Drivers handle their stats theirselves: if_obytes, if_omcasts. o mlx4(4), igb(4), em(4), vxge(4), oce(4) and ixv(4) no longer use drbr_stats_update(), and update ifnet stats theirselves. o bxe(4) was the most correct driver, it didn't call drbr_stats_update(), thus it was the only driver accurate under moderate load. Now it also maintains stats itself. o ixgbe(4) had already taken stats from hardware, so just - drop software stats updating. - take multicast packet count from hardware as well. o mxge(4) just no longer needs NO_SLOW_STATS define. o cxgb(4), cxgbe(4) need no change, since they obtain stats from hardware. Reviewed by: jfv, gnn Modified: stable/9/sys/dev/bxe/if_bxe.c stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/e1000/if_igb.c stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixv.c stable/9/sys/dev/mxge/if_mxge.c stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/vxge/vxge.c stable/9/sys/net/if_var.h stable/9/sys/ofed/drivers/net/mlx4/en_tx.c stable/9/sys/sys/buf_ring.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) Modified: stable/9/sys/dev/bxe/if_bxe.c ============================================================================== --- stable/9/sys/dev/bxe/if_bxe.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/bxe/if_bxe.c Fri Nov 23 11:19:43 2012 (r243440) @@ -9552,6 +9552,11 @@ bxe_tx_mq_start_locked(struct ifnet *ifp /* The transmit frame was enqueued successfully. */ tx_count++; + /* Update stats */ + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; + /* Send a copy of the frame to any BPF listeners. */ BPF_MTAP(ifp, next); Modified: stable/9/sys/dev/e1000/if_em.c ============================================================================== --- stable/9/sys/dev/e1000/if_em.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/e1000/if_em.c Fri Nov 23 11:19:43 2012 (r243440) @@ -922,7 +922,9 @@ em_mq_start_locked(struct ifnet *ifp, st break; } enq++; - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/e1000/if_igb.c Fri Nov 23 11:19:43 2012 (r243440) @@ -1006,7 +1006,9 @@ igb_mq_start_locked(struct ifnet *ifp, s break; } enq++; - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/ixgbe/ixgbe.c Fri Nov 23 11:19:43 2012 (r243440) @@ -841,7 +841,6 @@ ixgbe_mq_start_locked(struct ifnet *ifp, break; } enqueued++; - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) @@ -5258,6 +5257,7 @@ ixgbe_update_stats_counters(struct adapt ifp->if_ibytes = adapter->stats.gorc; ifp->if_obytes = adapter->stats.gotc; ifp->if_imcasts = adapter->stats.mprc; + ifp->if_omcasts = adapter->stats.mptc; ifp->if_collisions = 0; /* Rx Errors */ Modified: stable/9/sys/dev/ixgbe/ixv.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixv.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/ixgbe/ixv.c Fri Nov 23 11:19:43 2012 (r243440) @@ -636,7 +636,9 @@ ixv_mq_start_locked(struct ifnet *ifp, s break; } enqueued++; - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) Modified: stable/9/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/9/sys/dev/mxge/if_mxge.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/mxge/if_mxge.c Fri Nov 23 11:19:43 2012 (r243440) @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* count xmits ourselves, rather than via drbr */ -#define NO_SLOW_STATS #include #include #include Modified: stable/9/sys/dev/oce/oce_if.c ============================================================================== --- stable/9/sys/dev/oce/oce_if.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/oce/oce_if.c Fri Nov 23 11:19:43 2012 (r243440) @@ -1222,7 +1222,9 @@ oce_multiq_transmit(struct ifnet *ifp, s } break; } - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; ETHER_BPF_MTAP(ifp, next); next = drbr_dequeue(ifp, br); } Modified: stable/9/sys/dev/vxge/vxge.c ============================================================================== --- stable/9/sys/dev/vxge/vxge.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/vxge/vxge.c Fri Nov 23 11:19:43 2012 (r243440) @@ -709,7 +709,9 @@ vxge_mq_send_locked(ifnet_t ifp, vxge_vp VXGE_DRV_STATS(vpath, tx_again); break; } - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/net/if_var.h Fri Nov 23 11:19:43 2012 (r243440) @@ -589,22 +589,10 @@ do { \ } while (0) #ifdef _KERNEL -static __inline void -drbr_stats_update(struct ifnet *ifp, int len, int mflags) -{ -#ifndef NO_SLOW_STATS - ifp->if_obytes += len; - if (mflags & M_MCAST) - ifp->if_omcasts++; -#endif -} - static __inline int drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m) { int error = 0; - int len = m->m_pkthdr.len; - int mflags = m->m_flags; #ifdef ALTQ if (ALTQ_IS_ENABLED(&ifp->if_snd)) { @@ -612,12 +600,10 @@ drbr_enqueue(struct ifnet *ifp, struct b return (error); } #endif - if ((error = buf_ring_enqueue_bytes(br, m, len)) == ENOBUFS) { - br->br_drops++; + error = buf_ring_enqueue(br, m); + if (error) m_freem(m); - } else - drbr_stats_update(ifp, len, mflags); - + return (error); } Modified: stable/9/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_tx.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/ofed/drivers/net/mlx4/en_tx.c Fri Nov 23 11:19:43 2012 (r243440) @@ -948,7 +948,9 @@ mlx4_en_transmit_locked(struct ifnet *de break; } enqueued++; - drbr_stats_update(dev, next->m_pkthdr.len, next->m_flags); + dev->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + dev->if_omcasts++; /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(dev, next); if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) Modified: stable/9/sys/sys/buf_ring.h ============================================================================== --- stable/9/sys/sys/buf_ring.h Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/sys/buf_ring.h Fri Nov 23 11:19:43 2012 (r243440) @@ -48,7 +48,6 @@ struct buf_ring { int br_prod_mask; uint64_t br_drops; uint64_t br_prod_bufs; - uint64_t br_prod_bytes; /* * Pad out to next L2 cache line */ @@ -74,7 +73,7 @@ struct buf_ring { * */ static __inline int -buf_ring_enqueue_bytes(struct buf_ring *br, void *buf, int nbytes) +buf_ring_enqueue(struct buf_ring *br, void *buf) { uint32_t prod_head, prod_next; uint32_t cons_tail; @@ -95,6 +94,7 @@ buf_ring_enqueue_bytes(struct buf_ring * prod_next = (prod_head + 1) & br->br_prod_mask; if (prod_next == cons_tail) { + br->br_drops++; critical_exit(); return (ENOBUFS); } @@ -117,19 +117,11 @@ buf_ring_enqueue_bytes(struct buf_ring * while (br->br_prod_tail != prod_head) cpu_spinwait(); br->br_prod_bufs++; - br->br_prod_bytes += nbytes; br->br_prod_tail = prod_next; critical_exit(); return (0); } -static __inline int -buf_ring_enqueue(struct buf_ring *br, void *buf) -{ - - return (buf_ring_enqueue_bytes(br, buf, 0)); -} - /* * multi-consumer safe dequeue * From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 11:21:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 30C49CB2; Fri, 23 Nov 2012 11:21:59 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 14C048FC15; Fri, 23 Nov 2012 11:21:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANBLw7R002211; Fri, 23 Nov 2012 11:21:58 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANBLw56002209; Fri, 23 Nov 2012 11:21:58 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211231121.qANBLw56002209@svn.freebsd.org> From: Hiroki Sato Date: Fri, 23 Nov 2012 11:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243441 - head/usr.sbin/ifmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 11:21:59 -0000 Author: hrs Date: Fri Nov 23 11:21:58 2012 New Revision: 243441 URL: http://svnweb.freebsd.org/changeset/base/243441 Log: - Use sin6_scope_id instead of sin6_addr.s6_addr[2]. - Support a flag for ALLOW/BLOCK in source-specific multicast (RFC 4604). Modified: head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Fri Nov 23 11:19:43 2012 (r243440) +++ head/usr.sbin/ifmcstat/ifmcstat.c Fri Nov 23 11:21:58 2012 (r243441) @@ -167,7 +167,7 @@ static const char * inm_mode(u_int mode) #endif #ifdef INET6 static void in6_ifinfo(struct mld_ifinfo *); -static const char * inet6_n2a(struct in6_addr *); +static const char * inet6_n2a(struct in6_addr *, uint32_t); #endif int main(int, char **); @@ -459,7 +459,8 @@ if6_addrlist(struct ifaddr *ifap) if (sa.sa_family != PF_INET6) goto nextifap; KREAD(ifap, &if6a, struct in6_ifaddr); - printf("\tinet6 %s\n", inet6_n2a(&if6a.ia_addr.sin6_addr)); + printf("\tinet6 %s\n", inet6_n2a(&if6a.ia_addr.sin6_addr, + if6a.ia_addr.sin6_scope_id)); /* * Print per-link MLD information, if available. */ @@ -514,7 +515,7 @@ in6_multientry(struct in6_multi *mc) struct in6_multi multi; KREAD(mc, &multi, struct in6_multi); - printf("\t\tgroup %s", inet6_n2a(&multi.in6m_addr)); + printf("\t\tgroup %s", inet6_n2a(&multi.in6m_addr, 0)); printf(" refcnt %u\n", multi.in6m_refcount); return (multi.in6m_entry.le_next); @@ -751,7 +752,7 @@ in6_ifinfo(struct mld_ifinfo *mli) printf("mldv?(%d)", mli->mli_version); break; } - printb(" flags", mli->mli_flags, "\020\1SILENT"); + printb(" flags", mli->mli_flags, "\020\1SILENT\2USEALLOW"); if (mli->mli_version == MLD_VERSION_2) { printf(" rv %u qi %u qri %u uri %u", mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri); @@ -764,26 +765,17 @@ in6_ifinfo(struct mld_ifinfo *mli) } static const char * -inet6_n2a(struct in6_addr *p) +inet6_n2a(struct in6_addr *p, uint32_t scope_id) { static char buf[NI_MAXHOST]; struct sockaddr_in6 sin6; - u_int32_t scopeid; const int niflags = NI_NUMERICHOST; memset(&sin6, 0, sizeof(sin6)); sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_addr = *p; - if (IN6_IS_ADDR_LINKLOCAL(p) || IN6_IS_ADDR_MC_LINKLOCAL(p) || - IN6_IS_ADDR_MC_NODELOCAL(p)) { - scopeid = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); - if (scopeid) { - sin6.sin6_scope_id = scopeid; - sin6.sin6_addr.s6_addr[2] = 0; - sin6.sin6_addr.s6_addr[3] = 0; - } - } + sin6.sin6_scope_id = scope_id; if (getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len, buf, sizeof(buf), NULL, 0, niflags) == 0) { return (buf); @@ -1115,7 +1107,8 @@ ifmcstat_getifmaddrs(void) #ifdef INET6 { const char *p = - inet6_n2a(&pifasa->sin6.sin6_addr); + inet6_n2a(&pifasa->sin6.sin6_addr, + pifasa->sin6.sin6_scope_id); strlcpy(addrbuf, p, sizeof(addrbuf)); break; } @@ -1196,7 +1189,8 @@ next_ifnet: /* Print this group address. */ #ifdef INET6 if (pgsa->sa.sa_family == AF_INET6) { - const char *p = inet6_n2a(&pgsa->sin6.sin6_addr); + const char *p = inet6_n2a(&pgsa->sin6.sin6_addr, + pgsa->sin6.sin6_scope_id); strlcpy(addrbuf, p, sizeof(addrbuf)); } else #endif From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 11:23:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED14CE23; Fri, 23 Nov 2012 11:23:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D09418FC0C; Fri, 23 Nov 2012 11:23:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANBNFq9002505; Fri, 23 Nov 2012 11:23:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANBNFZJ002504; Fri, 23 Nov 2012 11:23:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211231123.qANBNFZJ002504@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 23 Nov 2012 11:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243442 - stable/9/sys/dev/drm2 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 11:23:16 -0000 Author: glebius Date: Fri Nov 23 11:23:15 2012 New Revision: 243442 URL: http://svnweb.freebsd.org/changeset/base/243442 Log: Merge r242467 from head: - If DRM_DEBUG_DEFAULT_ON is defined, then initialize drm_debug_flagi to all supported debugging bits. - If DRM_DEBUG_DEFAULT_ON isn't defined, then initialize drm_debug_flag to zero. DRM_DEBUG_DEFAULT_ON is defined when module is build with -DDEBUG_DRM or if kernel config has 'options DEBUG_DRM'. Reviewed by: kib Modified: stable/9/sys/dev/drm2/drm_drv.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/drm_drv.c ============================================================================== --- stable/9/sys/dev/drm2/drm_drv.c Fri Nov 23 11:21:58 2012 (r243441) +++ stable/9/sys/dev/drm2/drm_drv.c Fri Nov 23 11:23:15 2012 (r243442) @@ -44,9 +44,10 @@ __FBSDID("$FreeBSD$"); #include #ifdef DRM_DEBUG_DEFAULT_ON -int drm_debug_flag = 1; +int drm_debug_flag = (DRM_DEBUGBITS_DEBUG | DRM_DEBUGBITS_KMS | + DRM_DEBUGBITS_FAILED_IOCTL); #else -int drm_debug_flag = 2; +int drm_debug_flag = 0; #endif int drm_notyet_flag = 0; From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 12:12:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DE471EF; Fri, 23 Nov 2012 12:12:07 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6842A8FC16; Fri, 23 Nov 2012 12:12:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANCC7FY010334; Fri, 23 Nov 2012 12:12:07 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANCC7xU010332; Fri, 23 Nov 2012 12:12:07 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201211231212.qANCC7xU010332@svn.freebsd.org> From: Hiroki Sato Date: Fri, 23 Nov 2012 12:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243443 - in head: . sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 12:12:07 -0000 Author: hrs Date: Fri Nov 23 12:12:06 2012 New Revision: 243443 URL: http://svnweb.freebsd.org/changeset/base/243443 Log: Document sin6_scope_id handling change and bump FreeBSD_version to 1000025. Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Nov 23 11:23:15 2012 (r243442) +++ head/UPDATING Fri Nov 23 12:12:06 2012 (r243443) @@ -24,6 +24,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20121117: + The sin6_scope_id member variable in struct sockaddr_in6 is now + filled by the kernel before passing the structure to the userland via + sysctl or routing socket. This means the KAME-specific embedded scope + id in sin6_addr.s6_addr[2] is always cleared in userland application. + This behavior can be controlled by net.inet6.ip6.deembed_scopeid. + __FreeBSD_version is bumped to 1000025. + 20121105: On i386 and amd64 systems WITH_CLANG_IS_CC is now the default. This means that the world and kernel will be compiled with clang Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Nov 23 11:23:15 2012 (r243442) +++ head/sys/sys/param.h Fri Nov 23 12:12:06 2012 (r243443) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000024 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000025 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 13:04:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09812DCB; Fri, 23 Nov 2012 13:04:39 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E355C8FC0C; Fri, 23 Nov 2012 13:04:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAND4cCs017761; Fri, 23 Nov 2012 13:04:38 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAND4c5X017760; Fri, 23 Nov 2012 13:04:38 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231304.qAND4c5X017760@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243444 - stable/9/sys/boot/pc98/libpc98 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 13:04:39 -0000 Author: nyan Date: Fri Nov 23 13:04:38 2012 New Revision: 243444 URL: http://svnweb.freebsd.org/changeset/base/243444 Log: MFC: r242864 i386 comconsole: don't loop forever if hardware doesn't respond. Modified: stable/9/sys/boot/pc98/libpc98/comconsole.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/libpc98/comconsole.c ============================================================================== --- stable/9/sys/boot/pc98/libpc98/comconsole.c Fri Nov 23 12:12:06 2012 (r243443) +++ stable/9/sys/boot/pc98/libpc98/comconsole.c Fri Nov 23 13:04:38 2012 (r243444) @@ -63,7 +63,6 @@ static void comc_setup(int speed, int po static int comc_speed_set(struct env_var *ev, int flags, const void *value); -static int comc_started; static int comc_curspeed; static int comc_port = COMPORT; static uint32_t comc_locator; @@ -87,9 +86,6 @@ comc_probe(struct console *cp) int speed, port; uint32_t locator; - /* XXX check the BIOS equipment list? */ - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); - if (comc_curspeed == 0) { comc_curspeed = COMSPEED; /* @@ -137,18 +133,19 @@ comc_probe(struct console *cp) env_setenv("comconsole_pcidev", EV_VOLATILE, env, comc_pcidev_set, env_nounset); } + comc_setup(comc_curspeed, comc_port); } static int comc_init(int arg) { - if (comc_started && arg == 0) - return 0; - comc_started = 1; comc_setup(comc_curspeed, comc_port); - return(0); + if ((comconsole.c_flags & (C_PRESENTIN | C_PRESENTOUT)) == + (C_PRESENTIN | C_PRESENTOUT)) + return (CMD_OK); + return (CMD_ERROR); } static void @@ -166,13 +163,13 @@ comc_putchar(int c) static int comc_getchar(void) { - return(comc_ischar() ? inb(comc_port + com_data) : -1); + return (comc_ischar() ? inb(comc_port + com_data) : -1); } static int comc_ischar(void) { - return(inb(comc_port + com_lsr) & LSR_RXRDY); + return (inb(comc_port + com_lsr) & LSR_RXRDY); } static int @@ -185,7 +182,8 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } - if (comc_started && comc_curspeed != speed) + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -203,7 +201,8 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } - if (comc_started && comc_port != port) { + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_port != port) { comc_setup(comc_curspeed, port); set_hw_console_hint(); } @@ -305,7 +304,8 @@ comc_pcidev_set(struct env_var *ev, int printf("Invalid pcidev\n"); return (CMD_ERROR); } - if (comc_started && comc_locator != locator) { + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_locator != locator) { error = comc_pcidev_handle(locator); if (error != CMD_OK) return (error); @@ -317,6 +317,8 @@ comc_pcidev_set(struct env_var *ev, int static void comc_setup(int speed, int port) { + static int TRY_COUNT = 1000000; + int tries; comc_curspeed = speed; comc_port = port; @@ -327,9 +329,15 @@ comc_setup(int speed, int port) outb(comc_port + com_cfcr, COMC_FMT); outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); + tries = 0; do inb(comc_port + com_data); - while (inb(comc_port + com_lsr) & LSR_RXRDY); + while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); + + if (tries < TRY_COUNT) + comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); + else + comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); } static int From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 13:09:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6CB6FFB; Fri, 23 Nov 2012 13:09:20 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A176D8FC12; Fri, 23 Nov 2012 13:09:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAND9KDA018636; Fri, 23 Nov 2012 13:09:20 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAND9K9t018633; Fri, 23 Nov 2012 13:09:20 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231309.qAND9K9t018633@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243445 - in stable/9/sys/boot/pc98: boot2 btx/btx X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 13:09:21 -0000 Author: nyan Date: Fri Nov 23 13:09:20 2012 New Revision: 243445 URL: http://svnweb.freebsd.org/changeset/base/243445 Log: MFC: r242863 add detection of serial console presence to btx and boot2-like blocks. Modified: stable/9/sys/boot/pc98/boot2/boot2.c stable/9/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:04:38 2012 (r243444) +++ stable/9/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:09:20 2012 (r243445) @@ -555,8 +555,10 @@ parse() } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) - sio_init(115200 / comspeed); + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } } else { for (q = arg--; *q && *q != '('; q++); if (*q) { Modified: stable/9/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/9/sys/boot/pc98/btx/btx/btx.S Fri Nov 23 13:04:38 2012 (r243444) +++ stable/9/sys/boot/pc98/btx/btx/btx.S Fri Nov 23 13:09:20 2012 (r243445) @@ -840,7 +840,7 @@ putstr: lodsb # Load char .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD /* - * void sio_init(void) + * int sio_init(void) */ sio_init: movw $SIO_PRT+0x3,%dx # Data format reg movb $SIO_FMT|0x80,%al # Set format @@ -856,14 +856,19 @@ sio_init: movw $SIO_PRT+0x3,%dx # Data movb $0x3,%al # Set RTS, outb %al,(%dx) # DTR incl %edx # Line status reg + call sio_getc.1 # Get character /* - * void sio_flush(void) + * int sio_flush(void) */ -sio_flush.0: call sio_getc.1 # Get character -sio_flush: call sio_ischar # Check for character - jnz sio_flush.0 # Till none - ret # To caller +sio_flush: xorl %eax,%eax # Return value + xorl %ecx,%ecx # Timeout + movb $0x80,%ch # counter +sio_flush.1: call sio_ischar # Check for character + jz sio_flush.2 # Till none + loop sio_flush.1 # or counter is zero + movb $1, %al # Exhausted all tries +sio_flush.2: ret # To caller /* * void sio_putc(int c) From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 13:17:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9740D30A; Fri, 23 Nov 2012 13:17:18 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C06A8FC12; Fri, 23 Nov 2012 13:17:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDHIIC020061; Fri, 23 Nov 2012 13:17:18 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDHIH1020060; Fri, 23 Nov 2012 13:17:18 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231317.qANDHIH1020060@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243446 - stable/9/sys/boot/pc98 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 13:17:18 -0000 Author: nyan Date: Fri Nov 23 13:17:18 2012 New Revision: 243446 URL: http://svnweb.freebsd.org/changeset/base/243446 Log: MFC: r242855, r242865 - use -march=i386 for both i386 and amd64 builds. - cosmetic changes to reduce diffs against i386. Modified: stable/9/sys/boot/pc98/Makefile.inc Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/9/sys/boot/pc98/Makefile.inc Fri Nov 23 13:09:20 2012 (r243445) +++ stable/9/sys/boot/pc98/Makefile.inc Fri Nov 23 13:17:18 2012 (r243446) @@ -5,9 +5,9 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float \ - -Os -DPC98 +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= -Os -DPC98 LDFLAGS+= -nostdlib # BTX components From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 13:18:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA340587; Fri, 23 Nov 2012 13:18:26 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF4C88FC14; Fri, 23 Nov 2012 13:18:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDIQFU020244; Fri, 23 Nov 2012 13:18:26 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDIQw6020243; Fri, 23 Nov 2012 13:18:26 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231318.qANDIQw6020243@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243447 - stable/8/sys/boot/pc98 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 13:18:26 -0000 Author: nyan Date: Fri Nov 23 13:18:26 2012 New Revision: 243447 URL: http://svnweb.freebsd.org/changeset/base/243447 Log: MFC: r242855, r242865 - use -march=i386 for both i386 and amd64 builds. - cosmetic changes to reduce diffs against i386. Modified: stable/8/sys/boot/pc98/Makefile.inc Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/8/sys/boot/pc98/Makefile.inc Fri Nov 23 13:17:18 2012 (r243446) +++ stable/8/sys/boot/pc98/Makefile.inc Fri Nov 23 13:18:26 2012 (r243447) @@ -5,9 +5,9 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -Os -DPC98 +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 +CFLAGS+= -Os -DPC98 LDFLAGS+= -nostdlib # BTX components From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 13:35:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBFB08C1; Fri, 23 Nov 2012 13:35:18 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC50E8FC12; Fri, 23 Nov 2012 13:35:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDZId9022951; Fri, 23 Nov 2012 13:35:18 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDZIL1022945; Fri, 23 Nov 2012 13:35:18 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231335.qANDZIL1022945@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243448 - in stable/9/sys/boot/pc98: boot2 btx/btxldr btx/lib cdboot libpc98 loader X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 13:35:19 -0000 Author: nyan Date: Fri Nov 23 13:35:17 2012 New Revision: 243448 URL: http://svnweb.freebsd.org/changeset/base/243448 Log: MFC: r239063, r239064, r239069, r240852, r240854 - boot2: bunch of variables are turned into uint8_t. - boot2: Remove unnecessary initializations. - loader: replace ugly inb/outb re-implementations with cpufunc.h. - Reduce diffs against i386. Modified: stable/9/sys/boot/pc98/boot2/boot2.c stable/9/sys/boot/pc98/btx/btxldr/btxldr.S stable/9/sys/boot/pc98/btx/lib/btxcsu.S stable/9/sys/boot/pc98/cdboot/cdboot.S stable/9/sys/boot/pc98/libpc98/Makefile stable/9/sys/boot/pc98/loader/main.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:35:17 2012 (r243448) @@ -126,13 +126,13 @@ static struct dsk { unsigned unit; unsigned head; unsigned sec; - unsigned slice; - unsigned part; + uint8_t slice; + uint8_t part; unsigned start; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; -static const char *kname = NULL; -static uint32_t opts = 0; +static const char *kname; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -618,7 +618,8 @@ dskread(void *buf, unsigned lba, unsigne struct pc98_partition *dp; struct disklabel *d; char *sec; - unsigned sl, i; + unsigned i; + uint8_t sl; u_char *p; if (!dsk_meta) { Modified: stable/9/sys/boot/pc98/btx/btxldr/btxldr.S ============================================================================== --- stable/9/sys/boot/pc98/btx/btxldr/btxldr.S Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/btx/btxldr/btxldr.S Fri Nov 23 13:35:17 2012 (r243448) @@ -15,13 +15,13 @@ * $FreeBSD$ */ +#include + /* * Prototype BTX loader program, written in a couple of hours. The * real thing should probably be more flexible, and in C. */ -#include - /* * Memory locations. */ Modified: stable/9/sys/boot/pc98/btx/lib/btxcsu.S ============================================================================== --- stable/9/sys/boot/pc98/btx/lib/btxcsu.S Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/btx/lib/btxcsu.S Fri Nov 23 13:35:17 2012 (r243448) @@ -15,12 +15,12 @@ # $FreeBSD$ +#include + # # BTX C startup code (ELF). # -#include - # # Globals. # Modified: stable/9/sys/boot/pc98/cdboot/cdboot.S ============================================================================== --- stable/9/sys/boot/pc98/cdboot/cdboot.S Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/cdboot/cdboot.S Fri Nov 23 13:35:17 2012 (r243448) @@ -30,14 +30,14 @@ # $FreeBSD$ -#include - # # Basically, we first create a set of boot arguments to pass to the loaded # binary. Then we attempt to load /boot/loader from the CD we were booted # off of. # +#include + # # Memory locations. # Modified: stable/9/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/9/sys/boot/pc98/libpc98/Makefile Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/libpc98/Makefile Fri Nov 23 13:35:17 2012 (r243448) @@ -37,7 +37,8 @@ CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ +CFLAGS+= -I${.CURDIR}/../../common \ + -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../i386/libi386 \ -I${.CURDIR}/../../.. -I. # the location of libstand Modified: stable/9/sys/boot/pc98/loader/main.c ============================================================================== --- stable/9/sys/boot/pc98/loader/main.c Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/loader/main.c Fri Nov 23 13:35:17 2012 (r243448) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -207,9 +208,9 @@ main(void) static void extract_currdev(void) { - struct i386_devdesc new_currdev; - int major; - int biosdev = -1; + struct i386_devdesc new_currdev; + int major; + int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ new_currdev.d_dev = &biosdisk; @@ -255,7 +256,7 @@ extract_currdev(void) } } new_currdev.d_type = new_currdev.d_dev->dv_type; - + /* * If we are booting off of a BIOS disk and we didn't succeed in determining * which one we booted off of, just use disk0: as a reasonable default. @@ -266,6 +267,7 @@ extract_currdev(void) "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev); new_currdev.d_unit = 0; } + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, @@ -306,33 +308,17 @@ command_heap(int argc, char *argv[]) return(CMD_OK); } -/* ISA bus access functions for PnP, derived from */ -static int +/* ISA bus access functions for PnP. */ +static int isa_inb(int port) { - u_char data; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); - } else { - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - } - return(data); + + return (inb(port)); } static void isa_outb(int port, int value) { - u_char al = value; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port))); - } else { - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); - } -} + outb(port, value); +} From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 13:36:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5823A44; Fri, 23 Nov 2012 13:36:09 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA3B38FC13; Fri, 23 Nov 2012 13:36:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDa9r1023138; Fri, 23 Nov 2012 13:36:09 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDa9kI023132; Fri, 23 Nov 2012 13:36:09 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231336.qANDa9kI023132@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243449 - in stable/8/sys/boot/pc98: boot2 btx/btxldr btx/lib cdboot libpc98 loader X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 13:36:10 -0000 Author: nyan Date: Fri Nov 23 13:36:09 2012 New Revision: 243449 URL: http://svnweb.freebsd.org/changeset/base/243449 Log: MFC: r239063, r239064, r239069, r240852, r240854 - boot2: bunch of variables are turned into uint8_t. - boot2: Remove unnecessary initializations. - loader: replace ugly inb/outb re-implementations with cpufunc.h. - Reduce diffs against i386. Modified: stable/8/sys/boot/pc98/boot2/boot2.c stable/8/sys/boot/pc98/btx/btxldr/btxldr.S stable/8/sys/boot/pc98/btx/lib/btxcsu.S stable/8/sys/boot/pc98/cdboot/cdboot.S stable/8/sys/boot/pc98/libpc98/Makefile stable/8/sys/boot/pc98/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:36:09 2012 (r243449) @@ -126,13 +126,13 @@ static struct dsk { unsigned unit; unsigned head; unsigned sec; - unsigned slice; - unsigned part; + uint8_t slice; + uint8_t part; unsigned start; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; -static const char *kname = NULL; -static uint32_t opts = 0; +static const char *kname; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -616,7 +616,8 @@ dskread(void *buf, unsigned lba, unsigne struct pc98_partition *dp; struct disklabel *d; char *sec; - unsigned sl, i; + unsigned i; + uint8_t sl; u_char *p; if (!dsk_meta) { Modified: stable/8/sys/boot/pc98/btx/btxldr/btxldr.S ============================================================================== --- stable/8/sys/boot/pc98/btx/btxldr/btxldr.S Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/btx/btxldr/btxldr.S Fri Nov 23 13:36:09 2012 (r243449) @@ -15,13 +15,13 @@ * $FreeBSD$ */ +#include + /* * Prototype BTX loader program, written in a couple of hours. The * real thing should probably be more flexible, and in C. */ -#include - /* * Memory locations. */ Modified: stable/8/sys/boot/pc98/btx/lib/btxcsu.S ============================================================================== --- stable/8/sys/boot/pc98/btx/lib/btxcsu.S Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/btx/lib/btxcsu.S Fri Nov 23 13:36:09 2012 (r243449) @@ -15,12 +15,12 @@ # $FreeBSD$ +#include + # # BTX C startup code (ELF). # -#include - # # Globals. # Modified: stable/8/sys/boot/pc98/cdboot/cdboot.S ============================================================================== --- stable/8/sys/boot/pc98/cdboot/cdboot.S Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/cdboot/cdboot.S Fri Nov 23 13:36:09 2012 (r243449) @@ -30,14 +30,14 @@ # $FreeBSD$ -#include - # # Basically, we first create a set of boot arguments to pass to the loaded # binary. Then we attempt to load /boot/loader from the CD we were booted # off of. # +#include + # # Memory locations. # Modified: stable/8/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/8/sys/boot/pc98/libpc98/Makefile Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/libpc98/Makefile Fri Nov 23 13:36:09 2012 (r243449) @@ -37,7 +37,8 @@ CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ +CFLAGS+= -I${.CURDIR}/../../common \ + -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../i386/libi386 \ -I${.CURDIR}/../../.. -I. # the location of libstand Modified: stable/8/sys/boot/pc98/loader/main.c ============================================================================== --- stable/8/sys/boot/pc98/loader/main.c Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/loader/main.c Fri Nov 23 13:36:09 2012 (r243449) @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include "bootstrap.h" @@ -190,9 +192,9 @@ main(void) static void extract_currdev(void) { - struct i386_devdesc new_currdev; - int major; - int biosdev = -1; + struct i386_devdesc new_currdev; + int major; + int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ new_currdev.d_dev = &biosdisk; @@ -238,7 +240,7 @@ extract_currdev(void) } } new_currdev.d_type = new_currdev.d_dev->dv_type; - + /* * If we are booting off of a BIOS disk and we didn't succeed in determining * which one we booted off of, just use disk0: as a reasonable default. @@ -249,6 +251,7 @@ extract_currdev(void) "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev); new_currdev.d_unit = 0; } + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, @@ -289,33 +292,17 @@ command_heap(int argc, char *argv[]) return(CMD_OK); } -/* ISA bus access functions for PnP, derived from */ -static int +/* ISA bus access functions for PnP. */ +static int isa_inb(int port) { - u_char data; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); - } else { - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - } - return(data); + + return (inb(port)); } static void isa_outb(int port, int value) { - u_char al = value; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port))); - } else { - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); - } -} + outb(port, value); +} From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 13:43:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C19AE2C; Fri, 23 Nov 2012 13:43:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 61B9A8FC15; Fri, 23 Nov 2012 13:43:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDhq6A024217; Fri, 23 Nov 2012 13:43:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDhqoQ024215; Fri, 23 Nov 2012 13:43:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211231343.qANDhqoQ024215@svn.freebsd.org> From: Alexander Motin Date: Fri, 23 Nov 2012 13:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243450 - head/sys/dev/sound/pcm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 13:43:52 -0000 Author: mav Date: Fri Nov 23 13:43:51 2012 New Revision: 243450 URL: http://svnweb.freebsd.org/changeset/base/243450 Log: Move sndbuf_setmap() output about buffer addresses from the general verbose output to sound verbose output, where all other sndbuf messages live. Modified: head/sys/dev/sound/pcm/buffer.c Modified: head/sys/dev/sound/pcm/buffer.c ============================================================================== --- head/sys/dev/sound/pcm/buffer.c Fri Nov 23 13:36:09 2012 (r243449) +++ head/sys/dev/sound/pcm/buffer.c Fri Nov 23 13:43:51 2012 (r243450) @@ -70,7 +70,7 @@ sndbuf_setmap(void *arg, bus_dma_segment { struct snd_dbuf *b = (struct snd_dbuf *)arg; - if (bootverbose) { + if (snd_verbose > 3) { device_printf(b->dev, "sndbuf_setmap %lx, %lx; ", (u_long)segs[0].ds_addr, (u_long)segs[0].ds_len); printf("%p -> %lx\n", b->buf, (u_long)segs[0].ds_addr); From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 13:55:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32B793D3; Fri, 23 Nov 2012 13:55:39 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17E748FC08; Fri, 23 Nov 2012 13:55:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDtc7K026076; Fri, 23 Nov 2012 13:55:38 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDtc0o026075; Fri, 23 Nov 2012 13:55:38 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231355.qANDtc0o026075@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243452 - stable/9/sys/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 13:55:39 -0000 Author: nyan Date: Fri Nov 23 13:55:38 2012 New Revision: 243452 URL: http://svnweb.freebsd.org/changeset/base/243452 Log: MFC: r242870 Fix build mpboot.s with clang. Modified: stable/9/sys/conf/Makefile.pc98 Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/Makefile.pc98 ============================================================================== --- stable/9/sys/conf/Makefile.pc98 Fri Nov 23 13:47:41 2012 (r243451) +++ stable/9/sys/conf/Makefile.pc98 Fri Nov 23 13:55:38 2012 (r243452) @@ -34,6 +34,10 @@ MACHINE=pc98 MKMODULESENV+= MACHINE=${MACHINE} +# XXX: clang integrated-as doesn't grok .codeNN directives yet +ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS} +ASM_CFLAGS+= ${ASM_CFLAGS.${.IMPSRC:T}} + %BEFORE_DEPEND %OBJS From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 14:16:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58D9EA71; Fri, 23 Nov 2012 14:16:56 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5188FC13; Fri, 23 Nov 2012 14:16:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANEGuMQ029866; Fri, 23 Nov 2012 14:16:56 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANEGu6j029859; Fri, 23 Nov 2012 14:16:56 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231416.qANEGu6j029859@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 14:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243455 - in stable/9/sys: dev/ct dev/snc pc98/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 14:16:56 -0000 Author: nyan Date: Fri Nov 23 14:16:55 2012 New Revision: 243455 URL: http://svnweb.freebsd.org/changeset/base/243455 Log: MFC: r242866, r242871 Use ANSI prototype to fix build with clang. Modified: stable/9/sys/dev/ct/bshw_machdep.c stable/9/sys/dev/ct/ct.c stable/9/sys/dev/ct/ct_isa.c stable/9/sys/dev/ct/ct_machdep.h stable/9/sys/dev/snc/dp83932.c stable/9/sys/dev/snc/dp83932subr.c stable/9/sys/dev/snc/if_snc.c stable/9/sys/dev/snc/if_snc_cbus.c stable/9/sys/pc98/include/bus.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ct/bshw_machdep.c ============================================================================== --- stable/9/sys/dev/ct/bshw_machdep.c Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/ct/bshw_machdep.c Fri Nov 23 14:16:55 2012 (r243455) @@ -112,9 +112,7 @@ typedef unsigned long vaddr_t; * GENERIC MACHDEP FUNCTIONS *********************************************************/ void -bshw_synch_setup(ct, ti) - struct ct_softc *ct; - struct targ_info *ti; +bshw_synch_setup(struct ct_softc *ct, struct targ_info *ti) { struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_targ_info *cti = (void *) ti; @@ -133,8 +131,7 @@ bshw_synch_setup(ct, ti) } void -bshw_bus_reset(ct) - struct ct_softc *ct; +bshw_bus_reset(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -182,9 +179,7 @@ bshw_bus_reset(ct) /* probe */ int -bshw_read_settings(chp, bs) - struct ct_bus_access_handle *chp; - struct bshw_softc *bs; +bshw_read_settings(struct ct_bus_access_handle *chp, struct bshw_softc *bs) { static int irq_tbl[] = { 3, 5, 6, 9, 12, 13 }; @@ -216,8 +211,7 @@ static __inline void bshw_lc_smit_stop(s static int bshw_lc_smit_fstat(struct ct_softc *, int, int); static __inline void -bshw_lc_smit_stop(ct) - struct ct_softc *ct; +bshw_lc_smit_stop(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -226,10 +220,7 @@ bshw_lc_smit_stop(ct) } static __inline void -bshw_lc_smit_start(ct, count, direction) - struct ct_softc *ct; - int count; - u_int direction; +bshw_lc_smit_start(struct ct_softc *ct, int count, u_int direction) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t pval, val; @@ -245,9 +236,7 @@ bshw_lc_smit_start(ct, count, direction) } static int -bshw_lc_smit_fstat(ct, wc, read) - struct ct_softc *ct; - int wc, read; +bshw_lc_smit_fstat(struct ct_softc *ct, int wc, int read) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t stat; @@ -277,8 +266,7 @@ bshw_lc_smit_fstat(ct, wc, read) } void -bshw_smit_xfer_stop(ct) - struct ct_softc *ct; +bshw_smit_xfer_stop(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct bshw_softc *bs = ct->ct_hw; @@ -324,8 +312,7 @@ bad: } int -bshw_smit_xfer_start(ct) - struct ct_softc *ct; +bshw_smit_xfer_start(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -428,8 +415,7 @@ static void bshw_dmastart(struct ct_soft static void bshw_dmadone(struct ct_softc *); int -bshw_dma_xfer_start(ct) - struct ct_softc *ct; +bshw_dma_xfer_start(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct sc_p *sp = &slp->sl_scp; @@ -490,8 +476,7 @@ bshw_dma_xfer_start(ct) } void -bshw_dma_xfer_stop(ct) - struct ct_softc *ct; +bshw_dma_xfer_stop(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct sc_p *sp = &slp->sl_scp; @@ -554,10 +539,8 @@ bshw_dma_xfer_stop(ct) static bus_addr_t dmapageport[4] = { 0x27, 0x21, 0x23, 0x25 }; static __inline void -bshw_dma_write_1(chp, port, val) - struct ct_bus_access_handle *chp; - bus_addr_t port; - u_int8_t val; +bshw_dma_write_1(struct ct_bus_access_handle *chp, bus_addr_t port, + u_int8_t val) { CT_BUS_WEIGHT(chp); @@ -565,8 +548,7 @@ bshw_dma_write_1(chp, port, val) } static void -bshw_dmastart(ct) - struct ct_softc *ct; +bshw_dmastart(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct bshw_softc *bs = ct->ct_hw; @@ -612,8 +594,7 @@ bshw_dmastart(ct) } static void -bshw_dmadone(ct) - struct ct_softc *ct; +bshw_dmadone(struct ct_softc *ct) { struct bshw_softc *bs = ct->ct_hw; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -640,8 +621,7 @@ static void bshw_dma_start_elecom(struct static void bshw_dma_stop_elecom(struct ct_softc *); static int -bshw_dma_init_texa(ct) - struct ct_softc *ct; +bshw_dma_init_texa(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t regval; @@ -656,8 +636,7 @@ bshw_dma_init_texa(ct) } static int -bshw_dma_init_sc98(ct) - struct ct_softc *ct; +bshw_dma_init_sc98(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -683,8 +662,7 @@ bshw_dma_init_sc98(ct) } static void -bshw_dma_start_sc98(ct) - struct ct_softc *ct; +bshw_dma_start_sc98(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -693,8 +671,7 @@ bshw_dma_start_sc98(ct) } static void -bshw_dma_stop_sc98(ct) - struct ct_softc *ct; +bshw_dma_stop_sc98(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -703,8 +680,7 @@ bshw_dma_stop_sc98(ct) } static void -bshw_dma_start_elecom(ct) - struct ct_softc *ct; +bshw_dma_start_elecom(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t tmp = ct_cr_read_1(chp, 0x4c); @@ -713,8 +689,7 @@ bshw_dma_start_elecom(ct) } static void -bshw_dma_stop_elecom(ct) - struct ct_softc *ct; +bshw_dma_stop_elecom(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t tmp = ct_cr_read_1(chp, 0x4c); Modified: stable/9/sys/dev/ct/ct.c ============================================================================== --- stable/9/sys/dev/ct/ct.c Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/ct/ct.c Fri Nov 23 14:16:55 2012 (r243455) @@ -192,9 +192,7 @@ struct scsi_low_funcs ct_funcs = { * HW functions **************************************************/ static __inline void -cthw_phase_bypass(ct, ph) - struct ct_softc *ct; - u_int8_t ph; +cthw_phase_bypass(struct ct_softc *ct, u_int8_t ph) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -203,8 +201,7 @@ cthw_phase_bypass(ct, ph) } static void -cthw_bus_reset(ct) - struct ct_softc *ct; +cthw_bus_reset(struct ct_softc *ct) { /* @@ -215,10 +212,8 @@ cthw_bus_reset(ct) } static int -cthw_chip_reset(chp, chiprevp, chipclk, hostid) - struct ct_bus_access_handle *chp; - int *chiprevp; - int chipclk, hostid; +cthw_chip_reset(struct ct_bus_access_handle *chp, int *chiprevp, int chipclk, + int hostid) { #define CT_SELTIMEOUT_20MHz_REGV (0x80) u_int8_t aux, regv; @@ -313,8 +308,7 @@ out: } static struct ct_synch_data * -ct_make_synch_table(ct) - struct ct_softc *ct; +ct_make_synch_table(struct ct_softc *ct) { struct ct_synch_data *sdtp, *sdp; u_int base, i, period; @@ -357,11 +351,8 @@ ct_make_synch_table(ct) * Attach & Probe **************************************************/ int -ctprobesubr(chp, dvcfg, hsid, chipclk, chiprevp) - struct ct_bus_access_handle *chp; - u_int dvcfg, chipclk; - int hsid; - int *chiprevp; +ctprobesubr(struct ct_bus_access_handle *chp, u_int dvcfg, int hsid, + u_int chipclk, int *chiprevp) { #if 0 @@ -385,8 +376,7 @@ ctprint(aux, name) } void -ctattachsubr(ct) - struct ct_softc *ct; +ctattachsubr(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; @@ -401,8 +391,7 @@ ctattachsubr(ct) * SCSI LOW interface functions **************************************************/ static void -cthw_attention(ct) - struct ct_softc *ct; +cthw_attention(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -419,8 +408,7 @@ cthw_attention(ct) } static void -ct_attention(ct) - struct ct_softc *ct; +ct_attention(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; @@ -437,10 +425,7 @@ ct_attention(ct) } static int -ct_targ_init(ct, ti, action) - struct ct_softc *ct; - struct targ_info *ti; - int action; +ct_targ_init(struct ct_softc *ct, struct targ_info *ti, int action) { struct ct_targ_info *cti = (void *) ti; @@ -477,9 +462,7 @@ ct_targ_init(ct, ti, action) } static int -ct_world_start(ct, fdone) - struct ct_softc *ct; - int fdone; +ct_world_start(struct ct_softc *ct, int fdone) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -510,9 +493,7 @@ ct_world_start(ct, fdone) } static int -ct_start_selection(ct, cb) - struct ct_softc *ct; - struct slccb *cb; +ct_start_selection(struct ct_softc *ct, struct slccb *cb) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -584,10 +565,7 @@ ct_start_selection(ct, cb) } static int -ct_msg(ct, ti, msg) - struct ct_softc *ct; - struct targ_info *ti; - u_int msg; +ct_msg(struct ct_softc *ct, struct targ_info *ti, u_int msg) { struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_targ_info *cti = (void *) ti; @@ -639,11 +617,8 @@ ct_msg(ct, ti, msg) * *************************************************/ static int -ct_xfer(ct, data, len, direction, statp) - struct ct_softc *ct; - u_int8_t *data; - int len, direction; - u_int *statp; +ct_xfer(struct ct_softc *ct, u_int8_t *data, int len, int direction, + u_int *statp) { struct ct_bus_access_handle *chp = &ct->sc_ch; int wc; @@ -703,8 +678,7 @@ ct_xfer(ct, data, len, direction, statp) #define CT_PADDING_BUF_SIZE 32 static void -ct_io_xfer(ct) - struct ct_softc *ct; +ct_io_xfer(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -756,9 +730,7 @@ struct ct_err ct_cmderr[] = { }; static void -ct_phase_error(ct, scsi_status) - struct ct_softc *ct; - u_int8_t scsi_status; +ct_phase_error(struct ct_softc *ct, u_int8_t scsi_status) { struct scsi_low_softc *slp = &ct->sc_sclow; struct targ_info *ti = slp->sl_Tnexus; @@ -804,9 +776,7 @@ ct_phase_error(ct, scsi_status) * ### SCSI PHASE SEQUENCER ### **************************************************/ static int -ct_reselected(ct, scsi_status) - struct ct_softc *ct; - u_int8_t scsi_status; +ct_reselected(struct ct_softc *ct, u_int8_t scsi_status) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -849,9 +819,7 @@ ct_reselected(ct, scsi_status) } static int -ct_target_nexus_establish(ct, lun, dir) - struct ct_softc *ct; - int lun, dir; +ct_target_nexus_establish(struct ct_softc *ct, int lun, int dir) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -871,8 +839,7 @@ ct_target_nexus_establish(ct, lun, dir) } static int -ct_lun_nexus_establish(ct) - struct ct_softc *ct; +ct_lun_nexus_establish(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -883,8 +850,7 @@ ct_lun_nexus_establish(ct) } static int -ct_ccb_nexus_establish(ct) - struct ct_softc *ct; +ct_ccb_nexus_establish(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -910,8 +876,7 @@ ct_ccb_nexus_establish(ct) } static int -ct_unbusy(ct) - struct ct_softc *ct; +ct_unbusy(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -934,8 +899,7 @@ ct_unbusy(ct) } static int -ct_catch_intr(ct) - struct ct_softc *ct; +ct_catch_intr(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; int wc; @@ -953,8 +917,7 @@ ct_catch_intr(ct) } int -ctintr(arg) - void *arg; +ctintr(void *arg) { struct ct_softc *ct = arg; struct scsi_low_softc *slp = &ct->sc_sclow; Modified: stable/9/sys/dev/ct/ct_isa.c ============================================================================== --- stable/9/sys/dev/ct/ct_isa.c Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/ct/ct_isa.c Fri Nov 23 14:16:55 2012 (r243455) @@ -394,16 +394,14 @@ ct_dmamap(void *arg, bus_dma_segment_t * } static void -ct_isa_bus_access_weight(chp) - struct ct_bus_access_handle *chp; +ct_isa_bus_access_weight(struct ct_bus_access_handle *chp) { outb(0x5f, 0); } static void -ct_isa_dmasync_before(ct) - struct ct_softc *ct; +ct_isa_dmasync_before(struct ct_softc *ct) { if (need_pre_dma_flush) @@ -411,8 +409,7 @@ ct_isa_dmasync_before(ct) } static void -ct_isa_dmasync_after(ct) - struct ct_softc *ct; +ct_isa_dmasync_after(struct ct_softc *ct) { if (need_post_dma_flush) Modified: stable/9/sys/dev/ct/ct_machdep.h ============================================================================== --- stable/9/sys/dev/ct/ct_machdep.h Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/ct/ct_machdep.h Fri Nov 23 14:16:55 2012 (r243455) @@ -90,8 +90,7 @@ static __inline void cthw_set_count (struct ct_bus_access_handle *, u_int); static __inline u_int8_t -ct_stat_read_1(chp) - struct ct_bus_access_handle *chp; +ct_stat_read_1(struct ct_bus_access_handle *chp) { u_int8_t regv; @@ -101,9 +100,7 @@ ct_stat_read_1(chp) } static __inline void -cthw_set_count(chp, count) - struct ct_bus_access_handle *chp; - u_int count; +cthw_set_count(struct ct_bus_access_handle *chp, u_int count) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -119,8 +116,7 @@ cthw_set_count(chp, count) } static __inline u_int -cthw_get_count(chp) - struct ct_bus_access_handle *chp; +cthw_get_count(struct ct_bus_access_handle *chp) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -138,10 +134,7 @@ cthw_get_count(chp) } static __inline void -ct_write_cmds(chp, cmd, len) - struct ct_bus_access_handle *chp; - u_int8_t *cmd; - int len; +ct_write_cmds(struct ct_bus_access_handle *chp, u_int8_t *cmd, int len) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -157,9 +150,7 @@ ct_write_cmds(chp, cmd, len) } static __inline u_int8_t -ct_cr_read_1(chp, offs) - struct ct_bus_access_handle *chp; - bus_addr_t offs; +ct_cr_read_1(struct ct_bus_access_handle *chp, bus_addr_t offs) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -173,10 +164,7 @@ ct_cr_read_1(chp, offs) } static __inline void -ct_cr_write_1(chp, offs, val) - struct ct_bus_access_handle *chp; - bus_addr_t offs; - u_int8_t val; +ct_cr_write_1(struct ct_bus_access_handle *chp, bus_addr_t offs, u_int8_t val) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -188,8 +176,7 @@ ct_cr_write_1(chp, offs, val) } static __inline u_int8_t -ct_cmdp_read_1(chp) - struct ct_bus_access_handle *chp; +ct_cmdp_read_1(struct ct_bus_access_handle *chp) { u_int8_t regv; @@ -199,9 +186,7 @@ ct_cmdp_read_1(chp) } static __inline void -ct_cmdp_write_1(chp, val) - struct ct_bus_access_handle *chp; - u_int8_t val; +ct_cmdp_write_1(struct ct_bus_access_handle *chp, u_int8_t val) { bus_space_write_1(chp->ch_iot, chp->ch_ioh, cmd_port, val); Modified: stable/9/sys/dev/snc/dp83932.c ============================================================================== --- stable/9/sys/dev/snc/dp83932.c Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/snc/dp83932.c Fri Nov 23 14:16:55 2012 (r243455) @@ -142,10 +142,8 @@ int sncdebug = 0; int -sncconfig(sc, media, nmedia, defmedia, myea) - struct snc_softc *sc; - int *media, nmedia, defmedia; - u_int8_t *myea; +sncconfig(struct snc_softc *sc, int *media, int nmedia, int defmedia, + u_int8_t *myea) { struct ifnet *ifp; int i; @@ -196,8 +194,7 @@ sncconfig(sc, media, nmedia, defmedia, m } void -sncshutdown(arg) - void *arg; +sncshutdown(void *arg) { struct snc_softc *sc = arg; @@ -209,8 +206,7 @@ sncshutdown(arg) * Media change callback. */ int -snc_mediachange(ifp) - struct ifnet *ifp; +snc_mediachange(struct ifnet *ifp) { struct snc_softc *sc = ifp->if_softc; int error; @@ -228,9 +224,7 @@ snc_mediachange(ifp) * Media status callback. */ void -snc_mediastatus(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +snc_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) { struct snc_softc *sc = ifp->if_softc; @@ -249,10 +243,7 @@ snc_mediastatus(ifp, ifmr) static int -sncioctl(ifp, cmd, data) - struct ifnet *ifp; - u_long cmd; - caddr_t data; +sncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ifreq *ifr; struct snc_softc *sc = ifp->if_softc; @@ -318,8 +309,7 @@ sncioctl(ifp, cmd, data) * Encapsulate a packet of type family for the local net. */ static void -sncstart(ifp) - struct ifnet *ifp; +sncstart(struct ifnet *ifp) { struct snc_softc *sc = ifp->if_softc; @@ -329,8 +319,7 @@ sncstart(ifp) } static void -sncstart_locked(ifp) - struct ifnet *ifp; +sncstart_locked(struct ifnet *ifp) { struct snc_softc *sc = ifp->if_softc; struct mbuf *m; @@ -391,16 +380,14 @@ outloop: * hardware/software errors. */ static void -sncreset(sc) - struct snc_softc *sc; +sncreset(struct snc_softc *sc) { sncstop(sc); sncinit_locked(sc); } static void -sncinit(xsc) - void *xsc; +sncinit(void *xsc) { struct snc_softc *sc = xsc; @@ -477,8 +464,7 @@ sncinit_locked(struct snc_softc *sc) * part way through. */ static int -sncstop(sc) - struct snc_softc *sc; +sncstop(struct snc_softc *sc) { struct mtd *mtd; @@ -537,10 +523,7 @@ sncwatchdog(void *arg) * stuff packet into sonic */ static u_int -sonicput(sc, m0, mtd_next) - struct snc_softc *sc; - struct mbuf *m0; - int mtd_next; +sonicput(struct snc_softc *sc, struct mbuf *m0, int mtd_next) { struct mtd *mtdp; struct mbuf *m; @@ -630,8 +613,7 @@ sonicput(sc, m0, mtd_next) * CAM support */ static void -caminitialise(sc) - struct snc_softc *sc; +caminitialise(struct snc_softc *sc) { u_int32_t v_cda = sc->v_cda; int i; @@ -654,10 +636,7 @@ caminitialise(sc) } static void -camentry(sc, entry, ea) - int entry; - u_char *ea; - struct snc_softc *sc; +camentry(struct snc_softc *sc, int entry, u_char *ea) { u_int32_t v_cda = sc->v_cda; int camoffset = entry * CDA_CAMDESC; @@ -671,8 +650,7 @@ camentry(sc, entry, ea) } static void -camprogram(sc) - struct snc_softc *sc; +camprogram(struct snc_softc *sc) { struct ifmultiaddr *ifma; struct ifnet *ifp; @@ -733,8 +711,7 @@ camprogram(sc) #ifdef SNCDEBUG static void -camdump(sc) - struct snc_softc *sc; +camdump(struct snc_softc *sc) { int i; @@ -759,8 +736,7 @@ camdump(sc) #endif static void -initialise_tda(sc) - struct snc_softc *sc; +initialise_tda(struct snc_softc *sc) { struct mtd *mtd; int i; @@ -781,8 +757,7 @@ initialise_tda(sc) } static void -initialise_rda(sc) - struct snc_softc *sc; +initialise_rda(struct snc_softc *sc) { int i; u_int32_t vv_rda = 0; @@ -810,8 +785,7 @@ initialise_rda(sc) } static void -initialise_rra(sc) - struct snc_softc *sc; +initialise_rra(struct snc_softc *sc) { int i; u_int v; @@ -843,8 +817,7 @@ initialise_rra(sc) } void -sncintr(arg) - void *arg; +sncintr(void *arg) { struct snc_softc *sc = (struct snc_softc *)arg; int isr; @@ -913,8 +886,7 @@ sncintr(arg) * Transmit interrupt routine */ static void -sonictxint(sc) - struct snc_softc *sc; +sonictxint(struct snc_softc *sc) { struct mtd *mtd; u_int32_t txp; @@ -991,8 +963,7 @@ sonictxint(sc) * Receive interrupt routine */ static void -sonicrxint(sc) - struct snc_softc *sc; +sonicrxint(struct snc_softc *sc) { u_int32_t rda; int orra; @@ -1085,10 +1056,7 @@ sonicrxint(sc) * appropriate protocol handler */ static int -sonic_read(sc, pkt, len) - struct snc_softc *sc; - u_int32_t pkt; - int len; +sonic_read(struct snc_softc *sc, u_int32_t pkt, int len) { struct ifnet *ifp = sc->sc_ifp; struct ether_header *et; @@ -1132,10 +1100,7 @@ sonic_read(sc, pkt, len) * munge the received packet into an mbuf chain */ static struct mbuf * -sonic_get(sc, pkt, datalen) - struct snc_softc *sc; - u_int32_t pkt; - int datalen; +sonic_get(struct snc_softc *sc, u_int32_t pkt, int datalen) { struct mbuf *m, *top, **mp; int len; @@ -1195,8 +1160,7 @@ sonic_get(sc, pkt, datalen) * Enable power on the interface. */ int -snc_enable(sc) - struct snc_softc *sc; +snc_enable(struct snc_softc *sc) { #ifdef SNCDEBUG @@ -1218,8 +1182,7 @@ snc_enable(sc) * Disable power on the interface. */ void -snc_disable(sc) - struct snc_softc *sc; +snc_disable(struct snc_softc *sc) { #ifdef SNCDEBUG Modified: stable/9/sys/dev/snc/dp83932subr.c ============================================================================== --- stable/9/sys/dev/snc/dp83932subr.c Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/snc/dp83932subr.c Fri Nov 23 14:16:55 2012 (r243455) @@ -73,9 +73,7 @@ static __inline u_int16_t snc_nec16_sele * to accept packets. */ int -sncsetup(sc, lladdr) - struct snc_softc *sc; - u_int8_t *lladdr; +sncsetup(struct snc_softc *sc, u_int8_t *lladdr) { u_int32_t p, pp; int i; @@ -172,8 +170,7 @@ sncsetup(sc, lladdr) * check if a specified irq is acceptable. */ u_int8_t -snc_nec16_validate_irq(irq) - int irq; +snc_nec16_validate_irq(int irq) { const u_int8_t encoded_irq[16] = { -1, -1, -1, 0, -1, 1, 2, -1, -1, 3, 4, -1, 5, 6, -1, -1 @@ -186,9 +183,7 @@ snc_nec16_validate_irq(irq) * specify irq to board. */ int -snc_nec16_register_irq(sc, irq) - struct snc_softc *sc; - int irq; +snc_nec16_register_irq(struct snc_softc *sc, int irq) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -212,8 +207,7 @@ snc_nec16_register_irq(sc, irq) * check if a specified memory base address is acceptable. */ int -snc_nec16_validate_mem(maddr) - int maddr; +snc_nec16_validate_mem(int maddr) { /* Check on Normal mode with max range, only */ @@ -230,9 +224,7 @@ snc_nec16_validate_mem(maddr) * specify memory base address to board and map to first bank. */ int -snc_nec16_register_mem(sc, maddr) - struct snc_softc *sc; - int maddr; +snc_nec16_register_mem(struct snc_softc *sc, int maddr) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -260,11 +252,8 @@ snc_nec16_register_mem(sc, maddr) } int -snc_nec16_check_memory(iot, ioh, memt, memh) - bus_space_tag_t iot; - bus_space_handle_t ioh; - bus_space_tag_t memt; - bus_space_handle_t memh; +snc_nec16_check_memory(bus_space_tag_t iot, bus_space_handle_t ioh, + bus_space_tag_t memt, bus_space_handle_t memh) { u_int16_t val; int i, j; @@ -341,14 +330,9 @@ snc_nec16_check_memory(iot, ioh, memt, m } int -snc_nec16_detectsubr(iot, ioh, memt, memh, irq, maddr, type) - bus_space_tag_t iot; - bus_space_handle_t ioh; - bus_space_tag_t memt; - bus_space_handle_t memh; - int irq; - int maddr; - u_int8_t type; +snc_nec16_detectsubr(bus_space_tag_t iot, bus_space_handle_t ioh, + bus_space_tag_t memt, bus_space_handle_t memh, int irq, int maddr, + u_int8_t type) { u_int16_t cr; u_int8_t ident; @@ -413,8 +397,7 @@ snc_nec16_detectsubr(iot, ioh, memt, mem #define SNC_NEC_SERIES_PNP_CBUS2 0x3d u_int8_t * -snc_nec16_detect_type(myea) - u_int8_t *myea; +snc_nec16_detect_type(u_int8_t *myea) { u_int32_t vendor = (myea[0] << 16) | (myea[1] << 8) | myea[2]; u_int8_t series = myea[3]; @@ -459,10 +442,8 @@ snc_nec16_detect_type(myea) } int -snc_nec16_get_enaddr(iot, ioh, myea) - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t *myea; +snc_nec16_get_enaddr(bus_space_tag_t iot, bus_space_handle_t ioh, + u_int8_t *myea) { u_int8_t eeprom[SNEC_EEPROM_SIZE]; u_int8_t rom_sum, sum = 0x00; @@ -493,9 +474,7 @@ snc_nec16_get_enaddr(iot, ioh, myea) * read from NEC/SONIC NIC register. */ u_int16_t -snc_nec16_nic_get(sc, reg) - struct snc_softc *sc; - u_int8_t reg; +snc_nec16_nic_get(struct snc_softc *sc, u_int8_t reg) { u_int16_t val; @@ -510,10 +489,7 @@ snc_nec16_nic_get(sc, reg) * write to NEC/SONIC NIC register. */ void -snc_nec16_nic_put(sc, reg, val) - struct snc_softc *sc; - u_int8_t reg; - u_int16_t val; +snc_nec16_nic_put(struct snc_softc *sc, u_int8_t reg, u_int16_t val) { /* select SONIC register */ @@ -527,10 +503,7 @@ snc_nec16_nic_put(sc, reg, val) * where exists specified (internal buffer memory) offset. */ static __inline u_int16_t -snc_nec16_select_bank(sc, base, offset) - struct snc_softc *sc; - u_int32_t base; - u_int32_t offset; +snc_nec16_select_bank(struct snc_softc *sc, u_int32_t base, u_int32_t offset) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -565,11 +538,8 @@ snc_nec16_select_bank(sc, base, offset) * write to SONIC descriptors. */ void -snc_nec16_writetodesc(sc, base, offset, val) - struct snc_softc *sc; - u_int32_t base; - u_int32_t offset; - u_int16_t val; +snc_nec16_writetodesc(struct snc_softc *sc, u_int32_t base, u_int32_t offset, + u_int16_t val) { bus_space_tag_t memt = sc->sc_memt; bus_space_handle_t memh = sc->sc_memh; @@ -584,10 +554,7 @@ snc_nec16_writetodesc(sc, base, offset, * read from SONIC descriptors. */ u_int16_t -snc_nec16_readfromdesc(sc, base, offset) - struct snc_softc *sc; - u_int32_t base; - u_int32_t offset; +snc_nec16_readfromdesc(struct snc_softc *sc, u_int32_t base, u_int32_t offset) { bus_space_tag_t memt = sc->sc_memt; bus_space_handle_t memh = sc->sc_memh; @@ -602,11 +569,8 @@ snc_nec16_readfromdesc(sc, base, offset) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 15:31:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBB22AAF; Fri, 23 Nov 2012 15:31:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C11E78FC18; Fri, 23 Nov 2012 15:31:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANFV0I0041256; Fri, 23 Nov 2012 15:31:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANFV0B4041255; Fri, 23 Nov 2012 15:31:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211231531.qANFV0B4041255@svn.freebsd.org> From: Alexander Motin Date: Fri, 23 Nov 2012 15:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243459 - head/sys/dev/sound/pcm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 15:31:00 -0000 Author: mav Date: Fri Nov 23 15:31:00 2012 New Revision: 243459 URL: http://svnweb.freebsd.org/changeset/base/243459 Log: Remove "clone manager: " message from verbose dmesg. It is pointless to print values that are statically hardcoded few lines above that. Modified: head/sys/dev/sound/pcm/sound.c Modified: head/sys/dev/sound/pcm/sound.c ============================================================================== --- head/sys/dev/sound/pcm/sound.c Fri Nov 23 14:53:28 2012 (r243458) +++ head/sys/dev/sound/pcm/sound.c Fri Nov 23 15:31:00 2012 (r243459) @@ -1074,13 +1074,6 @@ pcm_register(device_t dev, void *devinfo SND_CLONE_GC_ENABLE | SND_CLONE_GC_UNREF | SND_CLONE_GC_LASTREF | SND_CLONE_GC_EXPIRED); - if (bootverbose != 0 || snd_verbose > 3) { - device_printf(dev, - "clone manager: deadline=%dms flags=0x%08x\n", - snd_clone_getdeadline(d->clones), - snd_clone_getflags(d->clones)); - } - CHN_INIT(d, channels.pcm); CHN_INIT(d, channels.pcm.busy); CHN_INIT(d, channels.pcm.opened); From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 15:42:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF80EF10; Fri, 23 Nov 2012 15:42:25 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB7FC8FC08; Fri, 23 Nov 2012 15:42:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANFgP8i042873; Fri, 23 Nov 2012 15:42:25 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANFgPvI042872; Fri, 23 Nov 2012 15:42:25 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231542.qANFgPvI042872@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 15:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243460 - stable/9/sys/pc98/pc98 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 15:42:26 -0000 Author: nyan Date: Fri Nov 23 15:42:25 2012 New Revision: 243460 URL: http://svnweb.freebsd.org/changeset/base/243460 Log: MFC: r240855, r242867, r242868, r242869 MFi386: r237445 Commit changes missed from r237435. Properly calculate the signal trampoline addresses after the shared page is enabled. Handle FreeBSD ABIs without shared page support too. MFi386: r238792 Introduce curpcb magic variable. MFi386: r211924 Register an interrupt vector for DTrace return probes. Fix some KASSERTs. They are missing changes from r208833, r227394 and r227442. Reduce diffs against i386. Modified: stable/9/sys/pc98/pc98/machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/pc98/pc98/machdep.c ============================================================================== --- stable/9/sys/pc98/pc98/machdep.c Fri Nov 23 15:31:00 2012 (r243459) +++ stable/9/sys/pc98/pc98/machdep.c Fri Nov 23 15:42:25 2012 (r243460) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_mp_watchdog.h" #include "opt_npx.h" #include "opt_perfmon.h" +#include "opt_kdtrace.h" #include #include @@ -407,7 +408,13 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, } regs->tf_esp = (int)fp; - regs->tf_eip = PS_STRINGS - szosigcode; + if (p->p_sysent->sv_sigcode_base != 0) { + regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode - + szosigcode; + } else { + /* a.out sysentvec does not use shared page */ + regs->tf_eip = p->p_sysent->sv_psstrings - szosigcode; + } regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -534,7 +541,8 @@ freebsd4_sendsig(sig_t catcher, ksiginfo } regs->tf_esp = (int)sfp; - regs->tf_eip = PS_STRINGS - szfreebsd4_sigcode; + regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode - + szfreebsd4_sigcode; regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -685,7 +693,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, } regs->tf_esp = (int)sfp; - regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_eip = p->p_sysent->sv_sigcode_base; regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -1207,7 +1215,7 @@ cpu_idle(int busy) CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); -#ifdef MP_WATCHDOG +#if defined(MP_WATCHDOG) ap_watchdog(PCPU_GET(cpuid)); #endif /* If we are busy - try to use fast methods. */ @@ -1385,7 +1393,7 @@ exec_setregs(struct thread *td, struct i pcb->pcb_dr3 = 0; pcb->pcb_dr6 = 0; pcb->pcb_dr7 = 0; - if (pcb == PCPU_GET(curpcb)) { + if (pcb == curpcb) { /* * Clear the debug registers on the running * CPU, otherwise they will end up affecting @@ -1743,7 +1751,11 @@ extern inthand_t IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(fpusegm), IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), - IDTVEC(xmm), IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); + IDTVEC(xmm), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif + IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); #ifdef DDB /* @@ -2123,6 +2135,8 @@ do_next: for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); + + PT_UPDATES_FLUSH(); } void @@ -2262,6 +2276,10 @@ init386(first) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386TGT, SEL_UPL, + GSEL(GCODE_SEL, SEL_KPL)); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (int) idt; @@ -2614,7 +2632,8 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - KASSERT(td == curthread || TD_IS_SUSPENDED(td), + KASSERT(td == curthread || TD_IS_SUSPENDED(td) || + P_SHOULDSTOP(td->td_proc), ("not suspended thread %p", td)); #ifdef DEV_NPX npxgetregs(td); @@ -2783,6 +2802,7 @@ static void fpstate_drop(struct thread *td) { + KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu")); critical_enter(); #ifdef DEV_NPX if (PCPU_GET(fpcurthread) == td) From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 15:44:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF211123; Fri, 23 Nov 2012 15:44:04 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D48E78FC08; Fri, 23 Nov 2012 15:44:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANFi4vc043206; Fri, 23 Nov 2012 15:44:04 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANFi4cH043205; Fri, 23 Nov 2012 15:44:04 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231544.qANFi4cH043205@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 15:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243461 - stable/8/sys/pc98/pc98 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 15:44:05 -0000 Author: nyan Date: Fri Nov 23 15:44:04 2012 New Revision: 243461 URL: http://svnweb.freebsd.org/changeset/base/243461 Log: MFC: r225977, r242867, r242868, r242869 MFi386: r225936 Add some improvements in the idle table callbacks: - Replace instances of manual assembly instruction "hlt" call with halt() function calling. - In cpu_idle_mwait() avoid races in check to sched_runnable() using the same pattern used in cpu_idle_hlt() with the 'hlt' instruction. - Add comments explaining the logic behind the pattern used in cpu_idle_hlt() and other idle callbacks. MFi386: r211924 Register an interrupt vector for DTrace return probes. Fix some KASSERTs. They are missing changes from r208833, r227394 and r227442. Reduce diffs against i386. Modified: stable/8/sys/pc98/pc98/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/pc98/ (props changed) Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Fri Nov 23 15:42:25 2012 (r243460) +++ stable/8/sys/pc98/pc98/machdep.c Fri Nov 23 15:44:04 2012 (r243461) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "opt_maxmem.h" #include "opt_npx.h" #include "opt_perfmon.h" +#include "opt_kdtrace.h" #include #include @@ -1122,7 +1123,7 @@ void cpu_halt(void) { for (;;) - __asm__ ("hlt"); + halt(); } static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ @@ -1141,9 +1142,22 @@ cpu_idle_hlt(int busy) state = (int *)PCPU_PTR(monitorbuf); *state = STATE_SLEEPING; + /* - * We must absolutely guarentee that hlt is the next instruction - * after sti or we introduce a timing window. + * Since we may be in a critical section from cpu_idle(), if + * an interrupt fires during that critical section we may have + * a pending preemption. If the CPU halts, then that thread + * may not execute until a later interrupt awakens the CPU. + * To handle this race, check for a runnable thread after + * disabling interrupts and immediately return if one is + * found. Also, we must absolutely guarentee that hlt is + * the next instruction after sti. This ensures that any + * interrupt that fires after the call to disable_intr() will + * immediately awaken the CPU from hlt. Finally, please note + * that on x86 this works fine because of interrupts enabled only + * after the instruction following sti takes place, while IF is set + * to 1 immediately, allowing hlt instruction to acknowledge the + * interrupt. */ disable_intr(); if (sched_runnable()) @@ -1169,11 +1183,19 @@ cpu_idle_mwait(int busy) state = (int *)PCPU_PTR(monitorbuf); *state = STATE_MWAIT; - if (!sched_runnable()) { - cpu_monitor(state, 0, 0); - if (*state == STATE_MWAIT) - cpu_mwait(0, MWAIT_C1); + + /* See comments in cpu_idle_hlt(). */ + disable_intr(); + if (sched_runnable()) { + enable_intr(); + *state = STATE_RUNNING; + return; } + cpu_monitor(state, 0, 0); + if (*state == STATE_MWAIT) + __asm __volatile("sti; mwait" : : "a" (MWAIT_C1), "c" (0)); + else + enable_intr(); *state = STATE_RUNNING; } @@ -1185,6 +1207,12 @@ cpu_idle_spin(int busy) state = (int *)PCPU_PTR(monitorbuf); *state = STATE_RUNNING; + + /* + * The sched_runnable() call is racy but as long as there is + * a loop missing it one time will have just a little impact if any + * (and it is much better than missing the check at all). + */ for (i = 0; i < 1000; i++) { if (sched_runnable()) return; @@ -1198,7 +1226,7 @@ void cpu_idle(int busy) { -#ifdef SMP +#if defined(SMP) if (mp_grab_cpu_hlt()) return; #endif @@ -1708,7 +1736,11 @@ extern inthand_t IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(fpusegm), IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), - IDTVEC(xmm), IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); + IDTVEC(xmm), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif + IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); #ifdef DDB /* @@ -2088,6 +2120,8 @@ do_next: for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); + + PT_UPDATES_FLUSH(); } void @@ -2227,6 +2261,10 @@ init386(first) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386TGT, SEL_UPL, + GSEL(GCODE_SEL, SEL_KPL)); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (int) idt; @@ -2563,7 +2601,8 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - KASSERT(td == curthread || TD_IS_SUSPENDED(td), + KASSERT(td == curthread || TD_IS_SUSPENDED(td) || + P_SHOULDSTOP(td->td_proc), ("not suspended thread %p", td)); #ifdef DEV_NPX npxgetregs(td); @@ -2732,6 +2771,7 @@ static void fpstate_drop(struct thread *td) { + KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu")); critical_enter(); #ifdef DEV_NPX if (PCPU_GET(fpcurthread) == td) From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 17:22:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4525FE92; Fri, 23 Nov 2012 17:22:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2BB688FC08; Fri, 23 Nov 2012 17:22:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANHMdqR059245; Fri, 23 Nov 2012 17:22:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANHMdUQ059244; Fri, 23 Nov 2012 17:22:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201211231722.qANHMdUQ059244@svn.freebsd.org> From: Warner Losh Date: Fri, 23 Nov 2012 17:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243462 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 17:22:39 -0000 Author: imp Date: Fri Nov 23 17:22:38 2012 New Revision: 243462 URL: http://svnweb.freebsd.org/changeset/base/243462 Log: Strip trailing newline. Modified: head/sys/arm/ti/ti_machdep.c Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Fri Nov 23 15:44:04 2012 (r243461) +++ head/sys/arm/ti/ti_machdep.c Fri Nov 23 17:22:38 2012 (r243462) @@ -137,4 +137,3 @@ cpu_reset() printf("Reset failed!\n"); while (1); } - From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 17:27:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD40C9E; Fri, 23 Nov 2012 17:27:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F66C8FC12; Fri, 23 Nov 2012 17:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANHR91Q059952; Fri, 23 Nov 2012 17:27:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANHR9Xs059951; Fri, 23 Nov 2012 17:27:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201211231727.qANHR9Xs059951@svn.freebsd.org> From: Warner Losh Date: Fri, 23 Nov 2012 17:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243463 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 17:27:10 -0000 Author: imp Date: Fri Nov 23 17:27:09 2012 New Revision: 243463 URL: http://svnweb.freebsd.org/changeset/base/243463 Log: The tramp stuff isn't dependent on DDB, so always add these to the CLEANFILES list. Modified: head/sys/conf/Makefile.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Fri Nov 23 17:22:38 2012 (r243462) +++ head/sys/conf/Makefile.arm Fri Nov 23 17:27:09 2012 (r243463) @@ -127,12 +127,10 @@ MKMODULESENV+= MACHINE=${MACHINE} CLEAN+= ldscript.$M ${KERNEL_KO}.bin ldscript.$M.noheader -.if ${DDB_ENABLED} != "" CLEAN+= ${KERNEL_KO}.tramp ${KERNEL_KO}.tramp.bin ldscript.$M.tramp \ ldscript.$M.tramp.noheader ${KERNEL_KO}.gz.tramp \ ${KERNEL_KO}.gz.tramp.bin -.endif ldscript.$M: $S/conf/ldscript.$M cat $S/conf/ldscript.$M|sed s/KERNPHYSADDR/${KERNPHYSADDR}/g| \ sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 19:20:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9368F96A; Fri, 23 Nov 2012 19:20:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 763FD8FC1D; Fri, 23 Nov 2012 19:20:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANJKcEb077847; Fri, 23 Nov 2012 19:20:38 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANJKcZv077846; Fri, 23 Nov 2012 19:20:38 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211231920.qANJKcZv077846@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Nov 2012 19:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243464 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 19:20:38 -0000 Author: gonzo Date: Fri Nov 23 19:20:38 2012 New Revision: 243464 URL: http://svnweb.freebsd.org/changeset/base/243464 Log: Style fixes - Remove C++ - style comments - Use proper device name in panic messages Modified: head/sys/dev/gpio/gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Fri Nov 23 17:27:09 2012 (r243463) +++ head/sys/dev/gpio/gpiobus.c Fri Nov 23 19:20:38 2012 (r243464) @@ -271,7 +271,6 @@ static int gpiobus_child_location_str(device_t bus, device_t child, char *buf, size_t buflen) { - // struct gpiobus_ivar *devi = GPIOBUS_IVAR(child); snprintf(buf, buflen, "pins=?"); return (0); @@ -349,7 +348,7 @@ gpiobus_acquire_bus(device_t busdev, dev GPIOBUS_ASSERT_LOCKED(sc); if (sc->sc_owner) - panic("rb_cpldbus: cannot serialize the access to device."); + panic("gpiobus: cannot serialize the access to device."); sc->sc_owner = child; } @@ -362,9 +361,9 @@ gpiobus_release_bus(device_t busdev, dev GPIOBUS_ASSERT_LOCKED(sc); if (!sc->sc_owner) - panic("rb_cpldbus: releasing unowned bus."); + panic("gpiobus: releasing unowned bus."); if (sc->sc_owner != child) - panic("rb_cpldbus: you don't own the bus. game over."); + panic("gpiobus: you don't own the bus. game over."); sc->sc_owner = NULL; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 20:04:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 480DEFDC; Fri, 23 Nov 2012 20:04:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 297078FC12; Fri, 23 Nov 2012 20:04:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANK4etT084694; Fri, 23 Nov 2012 20:04:40 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANK4eIM084691; Fri, 23 Nov 2012 20:04:40 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201211232004.qANK4eIM084691@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 23 Nov 2012 20:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243465 - in head/sys/arm: broadcom/bcm2835 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 20:04:40 -0000 Author: gonzo Date: Fri Nov 23 20:04:39 2012 New Revision: 243465 URL: http://svnweb.freebsd.org/changeset/base/243465 Log: Add Raspberry Pi GPIO driver Submitted by: Luiz Otavio O Souza Added: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/conf/RPI-B Added: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Fri Nov 23 20:04:39 2012 (r243465) @@ -0,0 +1,656 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012 Luiz Otavio O Souza. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "gpio_if.h" + +#undef DEBUG + +#ifdef DEBUG +#define dprintf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define dprintf(fmt, args...) +#endif + +#define BCM_GPIO_PINS 54 +#define BCM_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ + GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) + +struct bcm_gpio_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource * sc_mem_res; + struct resource * sc_irq_res; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + void * sc_intrhand; + int sc_gpio_npins; + int sc_ro_npins; + int sc_ro_pins[BCM_GPIO_PINS]; + struct gpio_pin sc_gpio_pins[BCM_GPIO_PINS]; +}; + +enum bcm_gpio_fsel { + BCM_GPIO_INPUT, + BCM_GPIO_OUTPUT, + BCM_GPIO_ALT5, + BCM_GPIO_ALT4, + BCM_GPIO_ALT0, + BCM_GPIO_ALT1, + BCM_GPIO_ALT2, + BCM_GPIO_ALT3, +}; + +enum bcm_gpio_pud { + BCM_GPIO_NONE, + BCM_GPIO_PULLDOWN, + BCM_GPIO_PULLUP, +}; + +#define BCM_GPIO_LOCK(_sc) mtx_lock(&_sc->sc_mtx) +#define BCM_GPIO_UNLOCK(_sc) mtx_unlock(&_sc->sc_mtx) + +#define BCM_GPIO_GPFSEL(_bank) 0x00 + _bank * 4 +#define BCM_GPIO_GPSET(_bank) 0x1c + _bank * 4 +#define BCM_GPIO_GPCLR(_bank) 0x28 + _bank * 4 +#define BCM_GPIO_GPLEV(_bank) 0x34 + _bank * 4 +#define BCM_GPIO_GPPUD(_bank) 0x94 +#define BCM_GPIO_GPPUDCLK(_bank) 0x98 + _bank * 4 + +#define BCM_GPIO_WRITE(_sc, _off, _val) \ + bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) +#define BCM_GPIO_READ(_sc, _off) \ + bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) + +static int +bcm_gpio_pin_is_ro(struct bcm_gpio_softc *sc, int pin) +{ + int i; + + for (i = 0; i < sc->sc_ro_npins; i++) + if (pin == sc->sc_ro_pins[i]) + return (1); + return (0); +} + +static uint32_t +bcm_gpio_get_function(struct bcm_gpio_softc *sc, uint32_t pin) +{ + uint32_t bank, data, offset; + + /* Five banks, 10 pins per bank, 3 bits per pin. */ + bank = pin / 10; + offset = (pin - bank * 10) * 3; + + BCM_GPIO_LOCK(sc); + data = (BCM_GPIO_READ(sc, BCM_GPIO_GPFSEL(bank)) >> offset) & 7; + BCM_GPIO_UNLOCK(sc); + +#ifdef DEBUG + device_printf(sc->sc_dev, "pin %d function: ", pin); + switch (data) { + case BCM_GPIO_INPUT: + printf("input\n"); + break; + case BCM_GPIO_OUTPUT: + printf("output\n"); + break; + case BCM_GPIO_ALT0: + printf("alt0\n"); + break; + case BCM_GPIO_ALT1: + printf("alt1\n"); + break; + case BCM_GPIO_ALT2: + printf("alt2\n"); + break; + case BCM_GPIO_ALT3: + printf("alt3\n"); + break; + case BCM_GPIO_ALT4: + printf("alt4\n"); + break; + case BCM_GPIO_ALT5: + printf("alt5\n"); + break; + } +#endif + + switch (data) { + case BCM_GPIO_INPUT: + return (GPIO_PIN_INPUT); + case BCM_GPIO_OUTPUT: + return (GPIO_PIN_OUTPUT); + } + + return (0); +} + +static void +bcm_gpio_set_function(struct bcm_gpio_softc *sc, uint32_t pin, uint32_t f) +{ + uint32_t bank, data, offset; + + /* Five banks, 10 pins per bank, 3 bits per pin. */ + bank = pin / 10; + offset = (pin - bank * 10) * 3; + + BCM_GPIO_LOCK(sc); + data = BCM_GPIO_READ(sc, BCM_GPIO_GPFSEL(bank)); + data &= ~(7 << offset); + data |= (f << offset); + BCM_GPIO_WRITE(sc, BCM_GPIO_GPFSEL(bank), data); + BCM_GPIO_UNLOCK(sc); +} + +static void +bcm_gpio_set_pud(struct bcm_gpio_softc *sc, uint32_t pin, uint32_t state) +{ + uint32_t bank, offset; + + bank = pin / 32; + offset = pin - 32 * bank; + + BCM_GPIO_LOCK(sc); + BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUD(0), state); + DELAY(10); + BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), (1 << offset)); + DELAY(10); + BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUD(0), 0); + BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), 0); + BCM_GPIO_UNLOCK(sc); +} + +static void +bcm_gpio_pin_configure(struct bcm_gpio_softc *sc, struct gpio_pin *pin, + unsigned int flags) +{ + + /* + * Manage input/output. + */ + if (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) { + pin->gp_flags &= ~(GPIO_PIN_INPUT|GPIO_PIN_OUTPUT); + if (flags & GPIO_PIN_OUTPUT) { + pin->gp_flags |= GPIO_PIN_OUTPUT; + bcm_gpio_set_function(sc, pin->gp_pin, + BCM_GPIO_OUTPUT); + } else { + pin->gp_flags |= GPIO_PIN_INPUT; + bcm_gpio_set_function(sc, pin->gp_pin, + BCM_GPIO_INPUT); + } + } + + /* Manage Pull-up/pull-down. */ + pin->gp_flags &= ~(GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN); + if (flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) { + if (flags & GPIO_PIN_PULLUP) { + pin->gp_flags |= GPIO_PIN_PULLUP; + bcm_gpio_set_pud(sc, pin->gp_pin, BCM_GPIO_PULLUP); + } else { + pin->gp_flags |= GPIO_PIN_PULLDOWN; + bcm_gpio_set_pud(sc, pin->gp_pin, BCM_GPIO_PULLDOWN); + } + } else + bcm_gpio_set_pud(sc, pin->gp_pin, BCM_GPIO_NONE); +} + +static int +bcm_gpio_pin_max(device_t dev, int *maxpin) +{ + + *maxpin = BCM_GPIO_PINS - 1; + return (0); +} + +static int +bcm_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct bcm_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + BCM_GPIO_LOCK(sc); + *caps = sc->sc_gpio_pins[i].gp_caps; + BCM_GPIO_UNLOCK(sc); + + return (0); +} + +static int +bcm_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct bcm_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + BCM_GPIO_LOCK(sc); + *flags = sc->sc_gpio_pins[i].gp_flags; + BCM_GPIO_UNLOCK(sc); + + return (0); +} + +static int +bcm_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct bcm_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + BCM_GPIO_LOCK(sc); + memcpy(name, sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME); + BCM_GPIO_UNLOCK(sc); + + return (0); +} + +static int +bcm_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct bcm_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + /* We never touch on read-only/reserved pins. */ + if (bcm_gpio_pin_is_ro(sc, pin)) + return (EINVAL); + + /* Filter out unwanted flags. */ + if ((flags &= sc->sc_gpio_pins[i].gp_caps) != flags) + return (EINVAL); + + /* Can't mix input/output together. */ + if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == + (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) + return (EINVAL); + + /* Can't mix pull-up/pull-down together. */ + if ((flags & (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) == + (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) + return (EINVAL); + + bcm_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags); + + return (0); +} + +static int +bcm_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct bcm_gpio_softc *sc = device_get_softc(dev); + uint32_t bank, offset; + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + /* We never write to read-only/reserved pins. */ + if (bcm_gpio_pin_is_ro(sc, pin)) + return (EINVAL); + + bank = pin / 32; + offset = pin - 32 * bank; + + BCM_GPIO_LOCK(sc); + if (value) + BCM_GPIO_WRITE(sc, BCM_GPIO_GPSET(bank), (1 << offset)); + else + BCM_GPIO_WRITE(sc, BCM_GPIO_GPCLR(bank), (1 << offset)); + BCM_GPIO_UNLOCK(sc); + + return (0); +} + +static int +bcm_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct bcm_gpio_softc *sc = device_get_softc(dev); + uint32_t bank, offset, reg_data; + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + bank = pin / 32; + offset = pin - 32 * bank; + + BCM_GPIO_LOCK(sc); + reg_data = BCM_GPIO_READ(sc, BCM_GPIO_GPLEV(bank)); + BCM_GPIO_UNLOCK(sc); + *val = (reg_data & (1 << offset)) ? 1 : 0; + + return (0); +} + +static int +bcm_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct bcm_gpio_softc *sc = device_get_softc(dev); + uint32_t bank, data, offset; + int i; + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + /* We never write to read-only/reserved pins. */ + if (bcm_gpio_pin_is_ro(sc, pin)) + return (EINVAL); + + bank = pin / 32; + offset = pin - 32 * bank; + + BCM_GPIO_LOCK(sc); + data = BCM_GPIO_READ(sc, BCM_GPIO_GPLEV(bank)); + if (data & (1 << offset)) + BCM_GPIO_WRITE(sc, BCM_GPIO_GPCLR(bank), (1 << offset)); + else + BCM_GPIO_WRITE(sc, BCM_GPIO_GPSET(bank), (1 << offset)); + BCM_GPIO_UNLOCK(sc); + + return (0); +} + +static int +bcm_gpio_get_ro_pins(struct bcm_gpio_softc *sc) +{ + int i, len; + pcell_t pins[BCM_GPIO_PINS]; + phandle_t gpio; + + /* Find the gpio node to start. */ + gpio = ofw_bus_get_node(sc->sc_dev); + + len = OF_getproplen(gpio, "broadcom,read-only"); + if (len < 0 || len > sizeof(pins)) + return (-1); + + if (OF_getprop(gpio, "broadcom,read-only", &pins, len) < 0) + return (-1); + + sc->sc_ro_npins = len / sizeof(pcell_t); + + device_printf(sc->sc_dev, "read-only pins: "); + for (i = 0; i < sc->sc_ro_npins; i++) { + sc->sc_ro_pins[i] = fdt32_to_cpu(pins[i]); + if (i > 0) + printf(","); + printf("%d", sc->sc_ro_pins[i]); + } + if (i > 0) + printf("."); + printf("\n"); + + return (0); +} + +static int +bcm_gpio_get_reserved_pins(struct bcm_gpio_softc *sc) +{ + int i, j, len, npins; + pcell_t pins[BCM_GPIO_PINS]; + phandle_t gpio, node, reserved; + char name[32]; + + /* Get read-only pins. */ + if (bcm_gpio_get_ro_pins(sc) != 0) + return (-1); + + /* Find the gpio/reserved pins node to start. */ + gpio = ofw_bus_get_node(sc->sc_dev); + node = OF_child(gpio); + + /* + * Find reserved node + */ + reserved = 0; + while ((node != 0) && (reserved == 0)) { + len = OF_getprop(node, "name", name, + sizeof(name) - 1); + name[len] = 0; + if (strcmp(name, "reserved") == 0) + reserved = node; + node = OF_peer(node); + } + + if (reserved == 0) + return (-1); + + /* Get the reserved pins. */ + len = OF_getproplen(reserved, "broadcom,pins"); + if (len < 0 || len > sizeof(pins)) + return (-1); + + if (OF_getprop(reserved, "broadcom,pins", &pins, len) < 0) + return (-1); + + npins = len / sizeof(pcell_t); + + j = 0; + device_printf(sc->sc_dev, "reserved pins: "); + for (i = 0; i < npins; i++) { + if (i > 0) + printf(","); + printf("%d", fdt32_to_cpu(pins[i])); + /* Some pins maybe already on the list of read-only pins. */ + if (bcm_gpio_pin_is_ro(sc, fdt32_to_cpu(pins[i]))) + continue; + sc->sc_ro_pins[j++ + sc->sc_ro_npins] = fdt32_to_cpu(pins[i]); + } + sc->sc_ro_npins += j; + if (i > 0) + printf("."); + printf("\n"); + + return (0); +} + +static int +bcm_gpio_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-gpio")) + return (ENXIO); + + device_set_desc(dev, "BCM2708/2835 GPIO controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_gpio_attach(device_t dev) +{ + struct bcm_gpio_softc *sc = device_get_softc(dev); + int i, j, rid; + phandle_t gpio; + + sc->sc_dev = dev; + + mtx_init(&sc->sc_mtx, "bcm gpio", "gpio", MTX_DEF); + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + sc->sc_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + /* Find our node. */ + gpio = ofw_bus_get_node(sc->sc_dev); + + if (!OF_hasprop(gpio, "gpio-controller")) + /* Node is not a GPIO controller. */ + goto fail; + + /* + * Find the read-only pins. These are pins we never touch or bad + * things could happen. + */ + if (bcm_gpio_get_reserved_pins(sc) == -1) + goto fail; + + /* Initialize the software controlled pins. */ + for (i = 0, j = 0; j < BCM_GPIO_PINS - 1; j++) { + if (bcm_gpio_pin_is_ro(sc, j)) + continue; + snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, + "pin %d", j); + sc->sc_gpio_pins[i].gp_pin = j; + sc->sc_gpio_pins[i].gp_caps = BCM_GPIO_DEFAULT_CAPS; + sc->sc_gpio_pins[i].gp_flags = bcm_gpio_get_function(sc, j); + i++; + } + sc->sc_gpio_npins = i; + + device_add_child(dev, "gpioc", device_get_unit(dev)); + device_add_child(dev, "gpiobus", device_get_unit(dev)); + return (bus_generic_attach(dev)); + +fail: + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + return (ENXIO); +} + +static int +bcm_gpio_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t bcm_gpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcm_gpio_probe), + DEVMETHOD(device_attach, bcm_gpio_attach), + DEVMETHOD(device_detach, bcm_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_pin_max, bcm_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, bcm_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, bcm_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, bcm_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, bcm_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, bcm_gpio_pin_get), + DEVMETHOD(gpio_pin_set, bcm_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, bcm_gpio_pin_toggle), + + DEVMETHOD_END +}; + +static devclass_t bcm_gpio_devclass; + +static driver_t bcm_gpio_driver = { + "gpio", + bcm_gpio_methods, + sizeof(struct bcm_gpio_softc), +}; + +DRIVER_MODULE(bcm_gpio, simplebus, bcm_gpio_driver, bcm_gpio_devclass, 0, 0); Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Fri Nov 23 19:20:38 2012 (r243464) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Fri Nov 23 20:04:39 2012 (r243465) @@ -1,6 +1,7 @@ # $FreeBSD$ arm/broadcom/bcm2835/bcm2835_fb.c optional sc +arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio arm/broadcom/bcm2835/bcm2835_intr.c standard arm/broadcom/bcm2835/bcm2835_machdep.c standard arm/broadcom/bcm2835/bcm2835_mbox.c standard Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Fri Nov 23 19:20:38 2012 (r243464) +++ head/sys/arm/conf/RPI-B Fri Nov 23 20:04:39 2012 (r243465) @@ -85,6 +85,9 @@ device sdhci device mmc device mmcsd +device gpio +device gpioled + options KDB options DDB #Enable the kernel debugger options INVARIANTS #Enable calls of extra sanity checking From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 21:27:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEF512DC; Fri, 23 Nov 2012 21:27:26 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3FE98FC1C; Fri, 23 Nov 2012 21:27:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANLRQnB098045; Fri, 23 Nov 2012 21:27:26 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANLRQfC098042; Fri, 23 Nov 2012 21:27:26 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201211232127.qANLRQfC098042@svn.freebsd.org> From: Remko Lodder Date: Fri, 23 Nov 2012 21:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243466 - stable/8/sbin/ifconfig X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 21:27:26 -0000 Author: remko Date: Fri Nov 23 21:27:26 2012 New Revision: 243466 URL: http://svnweb.freebsd.org/changeset/base/243466 Log: MFC r232486 Add an ifconfig carp option that enables users to set the state of the carp cluster. This is a direct commit to stable/9 because -HEAD's code is very different. I discussed this with Gleb and the reason for this is that since we do not touch the kernel itself and are not adding very weird or confusing things, we can commit this to the stable branch directly. The options 'master' and 'backup' are now available, which enables the administrator to force a node into the backup or master state on the cluster. Ofcourse preempt has to be disabled otherwise the master node will become master again. One can do that with: sysctl net.inet.carp.preempt=0 After that one can schedule maintenance on the node normally running as the master and such. PR: 100956 Discussed with: glebius Modified: stable/8/sbin/ifconfig/ifcarp.c stable/8/sbin/ifconfig/ifconfig.8 Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/ifcarp.c ============================================================================== --- stable/8/sbin/ifconfig/ifcarp.c Fri Nov 23 20:04:39 2012 (r243465) +++ stable/8/sbin/ifconfig/ifcarp.c Fri Nov 23 21:27:26 2012 (r243466) @@ -57,6 +57,7 @@ void setcarp_advbase(const char *,int, i void setcarp_advskew(const char *, int, int, const struct afswtch *rafp); void setcarp_passwd(const char *, int, int, const struct afswtch *rafp); void setcarp_vhid(const char *, int, int, const struct afswtch *rafp); +void setcarp_state(const char *, int, int, const struct afswtch *rafp); void carp_status(int s) @@ -175,11 +176,34 @@ setcarp_advbase(const char *val, int d, return; } +void setcarp_state(const char *val, int d, int s, const struct afswtch *afp) +{ + struct carpreq carpr; + int i; + + bzero((char *)&carpr, sizeof(struct carpreq)); + ifr.ifr_data = (caddr_t)&carpr; + + if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1) + err(1, "SIOCGVH"); + + for (i = 0; i <= CARP_MAXSTATE; i++) { + if (!strcasecmp(val, carp_states[i])) { + carpr.carpr_state = i; + break; + } + } + + if (ioctl(s, SIOCSVH, (caddr_t)&ifr) == -1) + err(1, "SIOCSVH"); +} + static struct cmd carp_cmds[] = { DEF_CMD_ARG("advbase", setcarp_advbase), DEF_CMD_ARG("advskew", setcarp_advskew), DEF_CMD_ARG("pass", setcarp_passwd), DEF_CMD_ARG("vhid", setcarp_vhid), + DEF_CMD_ARG("state", setcarp_state), }; static struct afswtch af_carp = { .af_name = "af_carp", Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Fri Nov 23 20:04:39 2012 (r243465) +++ stable/8/sbin/ifconfig/ifconfig.8 Fri Nov 23 21:27:26 2012 (r243466) @@ -2408,6 +2408,13 @@ Set the authentication key to Set the virtual host ID. This is a required setting. Acceptable values are 1 to 255. +.It Cm state Ar state +Force the interface into state +.Ar state . +Valid states are INIT, BACKUP, and MASTER. Note that manually setting the state +to INIT is ignored by +.Xr carp 4 . +This state is set automatically when the underlying interface is down. .El .Pp The From owner-svn-src-all@FreeBSD.ORG Fri Nov 23 21:29:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AB71503; Fri, 23 Nov 2012 21:29:09 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F396F8FC0C; Fri, 23 Nov 2012 21:29:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANLT8Yc098330; Fri, 23 Nov 2012 21:29:08 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANLT8tX098328; Fri, 23 Nov 2012 21:29:08 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201211232129.qANLT8tX098328@svn.freebsd.org> From: Remko Lodder Date: Fri, 23 Nov 2012 21:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243467 - stable/7/sbin/ifconfig X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 23 Nov 2012 21:29:09 -0000 Author: remko Date: Fri Nov 23 21:29:08 2012 New Revision: 243467 URL: http://svnweb.freebsd.org/changeset/base/243467 Log: MFC r232486 Add an ifconfig carp option that enables users to set the state of the carp cluster. This is a direct commit to stable/9 because -HEAD's code is very different. I discussed this with Gleb and the reason for this is that since we do not touch the kernel itself and are not adding very weird or confusing things, we can commit this to the stable branch directly. The options 'master' and 'backup' are now available, which enables the administrator to force a node into the backup or master state on the cluster. Ofcourse preempt has to be disabled otherwise the master node will become master again. One can do that with: sysctl net.inet.carp.preempt=0 After that one can schedule maintenance on the node normally running as the master and such. PR: 100956 Discussed with: glebius Modified: stable/7/sbin/ifconfig/ifcarp.c stable/7/sbin/ifconfig/ifconfig.8 Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifcarp.c ============================================================================== --- stable/7/sbin/ifconfig/ifcarp.c Fri Nov 23 21:27:26 2012 (r243466) +++ stable/7/sbin/ifconfig/ifcarp.c Fri Nov 23 21:29:08 2012 (r243467) @@ -57,6 +57,7 @@ void setcarp_advbase(const char *,int, i void setcarp_advskew(const char *, int, int, const struct afswtch *rafp); void setcarp_passwd(const char *, int, int, const struct afswtch *rafp); void setcarp_vhid(const char *, int, int, const struct afswtch *rafp); +void setcarp_state(const char *, int, int, const struct afswtch *rafp); void carp_status(int s) @@ -175,11 +176,34 @@ setcarp_advbase(const char *val, int d, return; } +void setcarp_state(const char *val, int d, int s, const struct afswtch *afp) +{ + struct carpreq carpr; + int i; + + bzero((char *)&carpr, sizeof(struct carpreq)); + ifr.ifr_data = (caddr_t)&carpr; + + if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1) + err(1, "SIOCGVH"); + + for (i = 0; i <= CARP_MAXSTATE; i++) { + if (!strcasecmp(val, carp_states[i])) { + carpr.carpr_state = i; + break; + } + } + + if (ioctl(s, SIOCSVH, (caddr_t)&ifr) == -1) + err(1, "SIOCSVH"); +} + static struct cmd carp_cmds[] = { DEF_CMD_ARG("advbase", setcarp_advbase), DEF_CMD_ARG("advskew", setcarp_advskew), DEF_CMD_ARG("pass", setcarp_passwd), DEF_CMD_ARG("vhid", setcarp_vhid), + DEF_CMD_ARG("state", setcarp_state), }; static struct afswtch af_carp = { .af_name = "af_carp", Modified: stable/7/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.8 Fri Nov 23 21:27:26 2012 (r243466) +++ stable/7/sbin/ifconfig/ifconfig.8 Fri Nov 23 21:29:08 2012 (r243467) @@ -1825,6 +1825,13 @@ Set the authentication key to Set the virtual host ID. This is a required setting. Acceptable values are 1 to 255. +.It Cm state Ar state +Force the interface into state +.Ar state . +Valid states are INIT, BACKUP, and MASTER. Note that manually setting the state +to INIT is ignored by +.Xr carp 4 . +This state is set automatically when the underlying interface is down. .El .Pp The From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 02:00:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83F54F87; Sat, 24 Nov 2012 02:00:30 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 686A88FC18; Sat, 24 Nov 2012 02:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO20USV041976; Sat, 24 Nov 2012 02:00:30 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO20Ut7041971; Sat, 24 Nov 2012 02:00:30 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211240200.qAO20Ut7041971@svn.freebsd.org> From: Juli Mallett Date: Sat, 24 Nov 2012 02:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243469 - in head/sys: conf contrib/octeon-sdk mips/cavium mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 02:00:30 -0000 Author: jmallett Date: Sat Nov 24 02:00:29 2012 New Revision: 243469 URL: http://svnweb.freebsd.org/changeset/base/243469 Log: o) Add support for specifying a model of Octeon to target at compile-time, reducing the number of runtime checks done by the SDK code. o) Group board/CPU information at early startup by subject matter, so that e.g. CPU information is adjacent to CPU information and board information is adjacent to board information. Modified: head/sys/conf/options.mips head/sys/contrib/octeon-sdk/octeon-model.c head/sys/contrib/octeon-sdk/octeon-model.h head/sys/mips/cavium/octeon_machdep.c head/sys/mips/conf/OCTEON1 Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Fri Nov 23 23:51:06 2012 (r243468) +++ head/sys/conf/options.mips Sat Nov 24 02:00:29 2012 (r243469) @@ -71,6 +71,7 @@ MAXMEM opt_global.h # # Options that control the Cavium Simple Executive. # +OCTEON_MODEL opt_cvmx.h OCTEON_VENDOR_LANNER opt_cvmx.h OCTEON_VENDOR_RADISYS opt_cvmx.h OCTEON_BOARD_CAPK_0100ND opt_cvmx.h Modified: head/sys/contrib/octeon-sdk/octeon-model.c ============================================================================== --- head/sys/contrib/octeon-sdk/octeon-model.c Fri Nov 23 23:51:06 2012 (r243468) +++ head/sys/contrib/octeon-sdk/octeon-model.c Sat Nov 24 02:00:29 2012 (r243469) @@ -60,20 +60,24 @@ #include "cvmx-warn.h" #endif -#if defined(CVMX_BUILD_FOR_LINUX_USER) || defined(CVMX_BUILD_FOR_STANDALONE) +#if defined(CVMX_BUILD_FOR_LINUX_USER) || defined(CVMX_BUILD_FOR_STANDALONE) || defined(CVMX_BUILD_FOR_FREEBSD_KERNEL) +#if !defined(CVMX_BUILD_FOR_FREEBSD_KERNEL) #include +#endif #include "cvmx-sysinfo.h" /** * This function checks to see if the software is compatible with the * chip it is running on. This is called in the application startup code * and does not need to be called directly by the application. - * Does not return if software is incompatible. + * Does not return if software is incompatible, unless compiled for the + * FreeBSD kernel, in which case it returns -1. * * @param chip_id chip id that the software is being run on. * * @return 0: runtime checking or exact version match * 1: chip is newer revision than compiled for, but software will run properly. + * -1: software is incompatible */ int octeon_model_version_check(uint32_t chip_id __attribute__ ((unused))) { @@ -91,7 +95,11 @@ int octeon_model_version_check(uint32_t " Expecting ID=0x%08x, Chip is 0x%08x\n", (OCTEON_MODEL & 0xffffff), (unsigned int)chip_id); if ((OCTEON_MODEL & 0xffffff) > chip_id) printf("Refusing to run on older revision than program was compiled for.\n"); +#if !defined(CVMX_BUILD_FOR_FREEBSD_KERNEL) exit(-1); +#else + return(-1); +#endif } else { Modified: head/sys/contrib/octeon-sdk/octeon-model.h ============================================================================== --- head/sys/contrib/octeon-sdk/octeon-model.h Fri Nov 23 23:51:06 2012 (r243468) +++ head/sys/contrib/octeon-sdk/octeon-model.h Sat Nov 24 02:00:29 2012 (r243469) @@ -317,7 +317,7 @@ extern "C" { ))) #ifndef OCTEON_IS_MODEL -#if defined(USE_RUNTIME_MODEL_CHECKS) || defined(__U_BOOT__) || (defined(__linux__) && defined(__KERNEL__)) || defined(CVMX_BUILD_FOR_TOOLCHAIN) || (defined(__FreeBSD__) && defined(_KERNEL)) +#if defined(USE_RUNTIME_MODEL_CHECKS) || defined(__U_BOOT__) || (defined(__linux__) && defined(__KERNEL__)) || defined(CVMX_BUILD_FOR_TOOLCHAIN) || (defined(__FreeBSD__) && defined(_KERNEL) && !defined(OCTEON_MODEL)) /* NOTE: This for internal use only!!!!! */ static inline int __octeon_is_model_runtime__(uint32_t model) @@ -359,6 +359,7 @@ static inline int __octeon_is_model_runt #endif #endif +int octeon_model_version_check(uint32_t chip_id); const char *octeon_model_get_string(uint32_t chip_id); const char *octeon_model_get_string_buffer(uint32_t chip_id, char * buffer); Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Fri Nov 23 23:51:06 2012 (r243468) +++ head/sys/mips/cavium/octeon_machdep.c Sat Nov 24 02:00:29 2012 (r243469) @@ -276,6 +276,7 @@ platform_start(__register_t a0, __regist { const struct octeon_feature_description *ofd; uint64_t platform_counter_freq; + int rv; mips_postboot_fixup(); @@ -293,19 +294,25 @@ platform_start(__register_t a0, __regist cninit(); /* - * Display information about the board/CPU. + * Display information about the CPU. */ +#if !defined(OCTEON_MODEL) + printf("Using runtime CPU model checks.\n"); +#else + printf("Compiled for CPU model: " __XSTRING(OCTEON_MODEL) "\n"); +#endif + strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id())); + printf("CPU Model: %s\n", cpu_model); printf("CPU clock: %uMHz Core Mask: %#x\n", cvmx_sysinfo_get()->cpu_clock_hz / 1000000, cvmx_sysinfo_get()->core_mask); - printf("Board Type: %u Revision: %u/%u\n", - cvmx_sysinfo_get()->board_type, - cvmx_sysinfo_get()->board_rev_major, - cvmx_sysinfo_get()->board_rev_minor); - printf("MAC address base: %6D (%u configured)\n", - cvmx_sysinfo_get()->mac_addr_base, ":", - cvmx_sysinfo_get()->mac_addr_count); + rv = octeon_model_version_check(cvmx_get_proc_id()); + if (rv == -1) + panic("%s: kernel not compatible with this processor.", __func__); + /* + * Display information about the board. + */ #if defined(OCTEON_BOARD_CAPK_0100ND) strcpy(cpu_board, "CAPK-0100ND"); if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CN3010_EVB_HS5) { @@ -317,10 +324,22 @@ platform_start(__register_t a0, __regist cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type)); #endif printf("Board: %s\n", cpu_board); - strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id())); - printf("Model: %s\n", cpu_model); + printf("Board Type: %u Revision: %u/%u\n", + cvmx_sysinfo_get()->board_type, + cvmx_sysinfo_get()->board_rev_major, + cvmx_sysinfo_get()->board_rev_minor); printf("Serial number: %s\n", cvmx_sysinfo_get()->board_serial_number); + /* + * Additional on-chip hardware/settings. + * + * XXX Display PCI host/target? What else? + */ + printf("MAC address base: %6D (%u configured)\n", + cvmx_sysinfo_get()->mac_addr_base, ":", + cvmx_sysinfo_get()->mac_addr_count); + + octeon_ciu_reset(); /* * XXX Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Fri Nov 23 23:51:06 2012 (r243468) +++ head/sys/mips/conf/OCTEON1 Sat Nov 24 02:00:29 2012 (r243469) @@ -41,6 +41,13 @@ makeoptions DEBUG=-g #Build kernel with #options OCTEON_VENDOR_RADISYS # Support for Radisys boards. #options OCTEON_BOARD_CAPK_0100ND # Support for CAPK-0100nd. +# Compile for a specified Octeon model. If not specified, support for +# detection at runtime will be used instead, which may give inferior +# performance. +# +# See sys/contrib/octeon-sdk/octeon-model.h for possible values. +#options OCTEON_MODEL=OCTEON_CN58XX_PASS1_1 + options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 02:12:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 842BE27D; Sat, 24 Nov 2012 02:12:25 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F0048FC15; Sat, 24 Nov 2012 02:12:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO2CP2r043980; Sat, 24 Nov 2012 02:12:25 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO2CPvH043977; Sat, 24 Nov 2012 02:12:25 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211240212.qAO2CPvH043977@svn.freebsd.org> From: Juli Mallett Date: Sat, 24 Nov 2012 02:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243470 - in head/sys: contrib/octeon-sdk mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 02:12:25 -0000 Author: jmallett Date: Sat Nov 24 02:12:24 2012 New Revision: 243470 URL: http://svnweb.freebsd.org/changeset/base/243470 Log: Use bootverbose to control debug printfs from the Cavium Simple Executive code. Also remove an unnecessary CVMX_ENABLE_DEBUG_PRINTS conditional around what is already a cvmx_dprintf. Modified: head/sys/contrib/octeon-sdk/cvmx-spi.c head/sys/contrib/octeon-sdk/cvmx-utils.h head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/contrib/octeon-sdk/cvmx-spi.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-spi.c Sat Nov 24 02:00:29 2012 (r243469) +++ head/sys/contrib/octeon-sdk/cvmx-spi.c Sat Nov 24 02:12:24 2012 (r243470) @@ -182,9 +182,7 @@ int cvmx_spi_restart_interface(int inter if (!(OCTEON_IS_MODEL(OCTEON_CN38XX) || OCTEON_IS_MODEL(OCTEON_CN58XX))) return res; -#if CVMX_ENABLE_DEBUG_PRINTS cvmx_dprintf ("SPI%d: Restart %s\n", interface, modes[mode]); -#endif // Callback to perform SPI4 reset INVOKE_CB(cvmx_spi_callbacks.reset_cb, interface,mode); Modified: head/sys/contrib/octeon-sdk/cvmx-utils.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-utils.h Sat Nov 24 02:00:29 2012 (r243469) +++ head/sys/contrib/octeon-sdk/cvmx-utils.h Sat Nov 24 02:12:24 2012 (r243470) @@ -76,6 +76,9 @@ extern "C" { #ifdef CVMX_BUILD_FOR_LINUX_KERNEL #define cvmx_dprintf printk #define cvmx_dvprintf vprintk + #elif defined(CVMX_BUILD_FOR_FREEBSD_KERNEL) + void cvmx_dvprintf(const char *, va_list); + void cvmx_dprintf(const char *, ...) __attribute__ ((format(printf, 1, 2))); #else #define cvmx_dprintf printf #define cvmx_dvprintf vprintf Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Sat Nov 24 02:00:29 2012 (r243469) +++ head/sys/mips/cavium/octeon_machdep.c Sat Nov 24 02:12:24 2012 (r243470) @@ -446,6 +446,24 @@ SYSCTL_PROC(_machdep, OID_AUTO, led_disp NULL, 0, sysctl_machdep_led_display, "A", "String to display on LED display"); +void +cvmx_dvprintf(const char *fmt, va_list ap) +{ + if (!bootverbose) + return; + vprintf(fmt, ap); +} + +void +cvmx_dprintf(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + cvmx_dvprintf(fmt, ap); + va_end(ap); +} + /** * version of printf that works better in exception context. * From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 02:41:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF337A74; Sat, 24 Nov 2012 02:41:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BB8C8FC12; Sat, 24 Nov 2012 02:41:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO2fItH047897; Sat, 24 Nov 2012 02:41:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO2fIBn047896; Sat, 24 Nov 2012 02:41:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211240241.qAO2fIBn047896@svn.freebsd.org> From: Adrian Chadd Date: Sat, 24 Nov 2012 02:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243472 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 02:41:18 -0000 Author: adrian Date: Sat Nov 24 02:41:18 2012 New Revision: 243472 URL: http://svnweb.freebsd.org/changeset/base/243472 Log: Add a comment which covers what's going on with the 64 bit TSF write. After chatting with the MAC team, the TSF writes (at least on the 11n MACs, I don't know about pre-11n MACs) are done as 64 bit writes that can take some time. So, doing a 32 bit TSF write is definitely not supported. Leave a comment here which explains that. Whilst here, add a comment which outlines that after a reset or TSF write, the TSF write may take a while (up to 50uS) to update. A write or reset shouldn't be done whilst the previous one is in flight. Also (and this isn't currently done) a read shouldn't occur until the SLEEP32_TSF_WRITE_STAT is clear. Right now we're not doing that, mostly because we haven't been doing lots of TSF resets/writes until recently. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Nov 24 02:13:18 2012 (r243471) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Nov 24 02:41:18 2012 (r243472) @@ -128,6 +128,18 @@ ar5416GetTsf64(struct ath_hal *ah) return (((uint64_t) u32) << 32) | ((uint64_t) low2); } +/* + * Update the TSF. + * + * The full TSF is only updated once the upper 32 bits have + * been written. Writing only the lower 32 bits of the TSF + * will not actually correctly update the TSF. + * + * The #if 0'ed code is to check whether the previous TSF + * reset or write has completed before writing to the + * TSF. Strictly speaking, it should be also checked before + * reading the TSF as the write/reset may not have completed. + */ void ar5416SetTsf64(struct ath_hal *ah, uint64_t tsf64) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 02:55:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 033ECD54; Sat, 24 Nov 2012 02:55:06 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DC0298FC08; Sat, 24 Nov 2012 02:55:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO2t5AU049716; Sat, 24 Nov 2012 02:55:05 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO2t5pJ049713; Sat, 24 Nov 2012 02:55:05 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211240255.qAO2t5pJ049713@svn.freebsd.org> From: Juli Mallett Date: Sat, 24 Nov 2012 02:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243473 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 02:55:06 -0000 Author: jmallett Date: Sat Nov 24 02:55:05 2012 New Revision: 243473 URL: http://svnweb.freebsd.org/changeset/base/243473 Log: o) Have the FreeBSD kernel option "INVARIANTS" trickle down into the Simple Executive code where similar invariant knobs exist. o) Make the Simple Executive's warning function print "WARNING: " on the same line as the warning it is displaying, rather than on a separate line. Modified: head/sys/contrib/octeon-sdk/cvmx-pow.h head/sys/contrib/octeon-sdk/cvmx-warn.c head/sys/contrib/octeon-sdk/cvmx.h Modified: head/sys/contrib/octeon-sdk/cvmx-pow.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-pow.h Sat Nov 24 02:41:18 2012 (r243472) +++ head/sys/contrib/octeon-sdk/cvmx-pow.h Sat Nov 24 02:55:05 2012 (r243473) @@ -80,9 +80,23 @@ extern "C" { #endif -/* Default to having all POW constancy checks turned on */ -#ifndef CVMX_ENABLE_POW_CHECKS -#define CVMX_ENABLE_POW_CHECKS 1 +#if defined(__FreeBSD__) && defined(_KERNEL) + /* + * For the FreeBSD kernel, have POW consistency checks depend on + * the setting of INVARIANTS. + */ + #ifndef CVMX_ENABLE_POW_CHECKS + #ifdef INVARIANTS + #define CVMX_ENABLE_POW_CHECKS 1 + #else + #define CVMX_ENABLE_POW_CHECKS 0 + #endif + #endif +#else + /* Default to having all POW constancy checks turned on */ + #ifndef CVMX_ENABLE_POW_CHECKS + #define CVMX_ENABLE_POW_CHECKS 1 + #endif #endif /** Modified: head/sys/contrib/octeon-sdk/cvmx-warn.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-warn.c Sat Nov 24 02:41:18 2012 (r243472) +++ head/sys/contrib/octeon-sdk/cvmx-warn.c Sat Nov 24 02:55:05 2012 (r243473) @@ -77,7 +77,11 @@ void cvmx_warn(const char *format, ...) printk("WARNING:"); vprintk(format, args); #else +#ifdef CVMX_BUILD_FOR_FREEBSD_KERNEL + printf("WARNING: "); +#else printf("WARNING:\n"); +#endif vprintf(format, args); #endif va_end(args); Modified: head/sys/contrib/octeon-sdk/cvmx.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx.h Sat Nov 24 02:41:18 2012 (r243472) +++ head/sys/contrib/octeon-sdk/cvmx.h Sat Nov 24 02:55:05 2012 (r243473) @@ -53,13 +53,28 @@ /* Control whether simple executive applications use 1-1 TLB mappings to access physical ** memory addresses. This must be disabled to allow large programs that use more than ** the 0x10000000 - 0x20000000 virtual address range. +** +** The FreeBSD kernel ifdefs elsewhere should mean that this is never even checked, +** and so does not need to be defined. */ +#if !defined(__FreeBSD__) || !defined(_KERNEL) #ifndef CVMX_USE_1_TO_1_TLB_MAPPINGS #define CVMX_USE_1_TO_1_TLB_MAPPINGS 1 #endif +#endif -#ifndef CVMX_ENABLE_PARAMETER_CHECKING -#define CVMX_ENABLE_PARAMETER_CHECKING 1 +#if defined(__FreeBSD__) && defined(_KERNEL) + #ifndef CVMX_ENABLE_PARAMETER_CHECKING + #ifdef INVARIANTS + #define CVMX_ENABLE_PARAMETER_CHECKING 1 + #else + #define CVMX_ENABLE_PARAMETER_CHECKING 0 + #endif + #endif +#else + #ifndef CVMX_ENABLE_PARAMETER_CHECKING + #define CVMX_ENABLE_PARAMETER_CHECKING 1 + #endif #endif #ifndef CVMX_ENABLE_DEBUG_PRINTS From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 04:15:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1E4A663; Sat, 24 Nov 2012 04:15:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D2EBD8FC0C; Sat, 24 Nov 2012 04:15:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO4FPRI062953; Sat, 24 Nov 2012 04:15:25 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO4FPaG062952; Sat, 24 Nov 2012 04:15:25 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201211240415.qAO4FPaG062952@svn.freebsd.org> From: Andrew Turner Date: Sat, 24 Nov 2012 04:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243474 - head/usr.bin/cut X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 04:15:26 -0000 Author: andrew Date: Sat Nov 24 04:15:25 2012 New Revision: 243474 URL: http://svnweb.freebsd.org/changeset/base/243474 Log: The is_delim function works on wchar_t characters not ints, update the function to take a wchar_t as it's argument. This fixes the build when wchar_t is not an int, i.e. ARM EABI. Modified: head/usr.bin/cut/cut.c Modified: head/usr.bin/cut/cut.c ============================================================================== --- head/usr.bin/cut/cut.c Sat Nov 24 02:55:05 2012 (r243473) +++ head/usr.bin/cut/cut.c Sat Nov 24 04:15:25 2012 (r243474) @@ -68,7 +68,7 @@ static int b_n_cut(FILE *, const char *) static int c_cut(FILE *, const char *); static int f_cut(FILE *, const char *); static void get_list(char *); -static int is_delim(int); +static int is_delim(wchar_t); static void needpos(size_t); static void usage(void); @@ -364,7 +364,7 @@ out: } static int -is_delim(int ch) +is_delim(wchar_t ch) { if (wflag) { if (ch == ' ' || ch == '\t') From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 06:27:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D7E46A8; Sat, 24 Nov 2012 06:27:47 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F3ED78FC0C; Sat, 24 Nov 2012 06:27:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO6Rk7f084309; Sat, 24 Nov 2012 06:27:46 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO6Rk5O084307; Sat, 24 Nov 2012 06:27:46 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211240627.qAO6Rk5O084307@svn.freebsd.org> From: Devin Teske Date: Sat, 24 Nov 2012 06:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243475 - in head/usr.sbin/bsdconfig/networking: include share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 06:27:47 -0000 Author: dteske Date: Sat Nov 24 06:27:46 2012 New Revision: 243475 URL: http://svnweb.freebsd.org/changeset/base/243475 Log: Add IPv6 address-validation routine. Approved by: adrian (co-mentor) (implicit) Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/messages.subr Sat Nov 24 04:15:25 2012 (r243474) +++ head/usr.sbin/bsdconfig/networking/include/messages.subr Sat Nov 24 06:27:46 2012 (r243475) @@ -58,7 +58,11 @@ msg_ipaddr4="ipaddr" msg_ipv4_addr_octet_contains_invalid_chars="ERROR! One or more individual octets within the IP address\n(separated by dots) contains one or more invalid characters.\nOctets must contain only the characters 0-9.\n\nInvalid IP Address: %s" msg_ipv4_addr_octet_exceeds_max_value="ERROR! One or more individual octets within the IP address\n(separated by dots) exceeds the maximum of 255.\n\nInvalid IP Address: %s" msg_ipv4_addr_octet_is_null="ERROR! One or more individual octets within the IP address\n(separated by dots) are null and/or missing.\n\nInvalid IP Address: %s" -msg_ipv4_addr_octet_missing_or_extra="ERROR! The IP address entered has either too few or too many\noctets.\n\nInvalid IP Address: %s" +msg_ipv4_addr_octet_missing_or_extra="ERROR! The IP address entered has either too few (less than\nfour) or too many (more than four) octets, separated by dots.\n\nInvalid IP Address: %s" +msg_ipv6_addr_segment_contains_invalid_chars="ERROR! One or more individual segments within the IP address\n(separated by colons) contains one or more invalid characters.\nSegments must contain only combinations of the characters 0-9,\nA-F, or a-f.\n\nInvalid IPv6 Address: %s" +msg_ipv6_addr_segment_contains_too_many_chars="ERROR! One or more individual segments within the IP address\n(separated by colons) exceeds the length of 4 hex-digits.\n\nInvalid IPv6 Address: %s" +msg_ipv6_addr_too_few_or_extra_segments="ERROR! The IP address entered has either too few (less than 3), too\nmany (more than 8), or not enough segments, separated by colons.\n\nInvalid IPv6 Address: %s" +msg_ipv6_addr_too_many_null_segments="ERROR! Too many/incorrect null segments. A single null\nsegment is allowed within the IP address (separated by\ncolons) but not allowed at the beginning or end (unless\na double-null segment; i.e., \"::*\" or \"*::\").\n\nInvalid IPv6 Address: %s" msg_ipv4_mask_field_contains_invalid_chars="ERROR! One or more individual fields within the subnet mask\n(separated by dots) contains one or more invalid characters.\n\nInvalid Subnet Mask: %s" msg_ipv4_mask_field_exceeds_max_value="ERROR! One or more individual fields within the subnet mask\n(separated by dots) exceeds the maximum of 255.\n\nInvalid Subnet Mask: %s" msg_ipv4_mask_field_invalid_value="ERROR! One or more individual fields within the subnet mask\n(separated by dots) contains one or more invalid integers.\nFields must be one of 0/128/192/224/240/248/252/254/255.\n\nInvalid Subnet Mask: %s" Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Sat Nov 24 04:15:25 2012 (r243474) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Sat Nov 24 06:27:46 2012 (r243475) @@ -74,7 +74,7 @@ f_ifconfig_inet() # 4 The IP address has either too few or too many octets. # # If the IP address is determined to be invalid, the appropriate error will be -# displayed using the above dialog_msgbox function. +# displayed using the f_dialog_msgbox function. # f_dialog_validate_ipaddr() { @@ -125,6 +125,157 @@ f_dialog_validate_ipaddr() return $retval } +# f_dialog_validate_ipaddr6 $ipv6_addr +# +# Returns zero if the given argument (an IPv6 address) is of the proper format. +# +# The return status for invalid IP address is one of: +# 1 One or more individual segments within the IP address +# (separated by colons) contains one or more invalid characters. +# 2 More than two segments within the IP address are null or the +# the second null segment is not at the end of the address. +# 3 One or more individual segments within the IP address exceeds +# the word length of 32-bits (segments are always hexadecimal). +# 4 The IP address has either too few or too many segments. +# 5 The IPv4 address at the end of the IPv6 address is invalid. +# +# If the IP address is determined to be invalid, the appropriate error will be +# displayed using the f_dialog_msgbox function. +# +f_dialog_validate_ipaddr6() +{ + local ip="$1" + + ( # Operate within a sub-shell to protect the parent environment + + oldIFS="$IFS" + IFS=":" # Split on `colon' + set -- $ip: + + # Return error if too many or too few segments + # Using 9 as max in case of leading or trailing null spanner + [ $# -gt 9 -o $# -lt 3 ] && exit 4 + + h="[0-9A-Fa-f]" + nulls=0 + nsegments=$# + contains_ipv4_segment= + + while [ $# -gt 0 ]; do + + segment="${1%:}" + shift + + # + # Return error if this segment makes one null too-many. + # A single null segment is allowed anywhere in the + # middle as well as double null segments are allowed at + # the beginning or end (but not both). + # + if [ ! "$segment" ]; then + nulls=$(( $nulls + 1 )) + if [ $nulls -eq 3 ]; then + # Only valid syntax for 3 nulls is `::' + [ "$ip" = "::" ] || exit 2 + elif [ $nulls -eq 2 ]; then + # Only valid if begins/ends with `::' + case "$ip" in + ::*|*::) : fall thru ;; + *) exit 2 + esac + fi + continue + fi + + # + # Return error if not a valid hexadecimal short + # + case "$segment" in + $h|$h$h|$h$h$h|$h$h$h$h) + : valid segment of 1-4 hexadecimal digits + ;; + *[!0-9A-Fa-f]*) + # Segment contains at least one invalid char + + # Return error immediately if not last segment + [ $# -eq 0 ] || exit 1 + + # Otherwise, check for legacy IPv4 notation + case "$segment" in + *[!0-9.]*) + # Segment contains at least one invalid + # character even for an IPv4 address + exit 1 + esac + + # Return error if not enough segments + if [ $nulls -eq 0 ]; then + [ $nsegments -eq 7 ] || exit 4 + fi + + contains_ipv4_segment=1 + + # Validate the IPv4 address + IFS="$oldIFS" + f_dialog_validate_ipaddr "$segment" || exit 5 + IFS=":" + ;; + *) + # Segment characters are all valid but too many + exit 3 + esac + + done + + if [ $nulls -eq 1 ]; then + # Single null segment cannot be at beginning/end + case "$ip" in + :*|*:) exit 2 + esac + fi + + # + # A legacy IPv4 address can span the last two 16-bit segments, + # reducing the amount of maximum allowable segments by-one. + # + maxsegments=8 + if [ "$contains_ipv4_segment" ]; then + maxsegments=7 + fi + + case $nulls in + # Return error if missing segments with no null spanner + 0) [ $nsegments -eq $maxsegments ] || exit 4 ;; + # Return error if null spanner with too many segments + 1) [ $nsegments -le $maxsegments ] || exit 4 ;; + # Return error if leading/trailing `::' with too many segments + 2) [ $nsegments -le $(( $maxsegments + 1 )) ] || exit 4 ;; + esac + + exit $SUCCESS + ) + + # + # Produce an appropriate error message if necessary. + # + local retval=$? + case $retval in + 1) f_dialog_msgbox "$( printf \ + "$msg_ipv6_addr_segment_contains_invalid_chars" "$ip" )";; + 2) f_dialog_msgbox "$( printf \ + "$msg_ipv6_addr_too_many_null_segments" "$ip" )";; + 3) f_dialog_msgbox "$( printf \ + "$msg_ipv6_addr_segment_contains_too_many_chars" "$ip" )";; + 4) f_dialog_msgbox "$( printf \ + "$msg_ipv6_addr_too_few_or_extra_segments" "$ip" )";; + 5) : IPv4 at the end of IPv6 address is invalid ;; + # Don't display an error because f_dialog_validate_ipaddr + # already displayed one for the particular issue encountered. + esac + + return $retval +} + # f_dialog_input_ipaddr $interface $ipaddr # # Allows the user to edit a given IP address. If the user does not cancel or From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 07:02:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD38DBB7; Sat, 24 Nov 2012 07:02:31 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A6BF58FC19; Sat, 24 Nov 2012 07:02:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO72Veg090330; Sat, 24 Nov 2012 07:02:31 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO72Va8090326; Sat, 24 Nov 2012 07:02:31 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211240702.qAO72Va8090326@svn.freebsd.org> From: Devin Teske Date: Sat, 24 Nov 2012 07:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243476 - in head/usr.sbin/bsdconfig: share startup/share timezone/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 07:02:32 -0000 Author: dteske Date: Sat Nov 24 07:02:31 2012 New Revision: 243476 URL: http://svnweb.freebsd.org/changeset/base/243476 Log: Whitespace. Approved by: adrian (co-mentor) (implicit) Modified: head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/startup/share/rcedit.subr head/usr.sbin/bsdconfig/timezone/share/zones.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sat Nov 24 06:27:46 2012 (r243475) +++ head/usr.sbin/bsdconfig/share/dialog.subr Sat Nov 24 07:02:31 2012 (r243476) @@ -283,7 +283,7 @@ f_dialog_infobox_size() n=$( echo "$btitle" | f_number_of_lines ) height=$(( $height + $n + 2 )) fi - + # Make sure height is less than maximum screen size [ $height -le $max_height ] || height=$max_height Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Sat Nov 24 06:27:46 2012 (r243475) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Sat Nov 24 07:02:31 2012 (r243476) @@ -277,7 +277,7 @@ f_authenticate_some_user() # # Secure-mode has been requested. # - + [ "$USE_XDIALOG" ] || f_die 1 "$msg_secure_mode_requires_x11" [ "$(id -u)" = "0" ] || f_die 1 "$msg_secure_mode_requires_root" Modified: head/usr.sbin/bsdconfig/startup/share/rcedit.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcedit.subr Sat Nov 24 06:27:46 2012 (r243475) +++ head/usr.sbin/bsdconfig/startup/share/rcedit.subr Sat Nov 24 07:02:31 2012 (r243476) @@ -99,7 +99,7 @@ f_dialog_rcedit() # Return if the value has not changed from current local cur_val="$( f_sysrc_get "$var" )" [ "$_input" = "$cur_val" ] && return $SUCCESS - + f_dprintf "$var: [$cur_val]->[$_input]" err=$( f_sysrc_set "$var" "$_input" 2>&1 ) || Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/zones.subr Sat Nov 24 06:27:46 2012 (r243475) +++ head/usr.sbin/bsdconfig/timezone/share/zones.subr Sat Nov 24 07:02:31 2012 (r243476) @@ -619,7 +619,7 @@ f_install_zoneinfo() return $rv } - + # f_confirm_zone $filename # # Prompt the user to confirm the new timezone data. The first (and only) From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 08:00:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3F937ED for ; Sat, 24 Nov 2012 08:00:56 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2DFC08FC19 for ; Sat, 24 Nov 2012 08:00:55 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so9259311lah.13 for ; Sat, 24 Nov 2012 00:00:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:disposition-notification-to:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:openpgp :content-type:content-transfer-encoding:x-gm-message-state; bh=fgFcrPBV1fchEttrA5FrSkJXPTwYafPYOyAf79oIa5g=; b=jhYnqDfJMSVV0zxr6OVlrLvnR6kJPSrWwxGY6D28LuUh04vEfvSKz+g7xL+d7Hxp0U NQn5bpcRrQO2MCdq7NFqRZfKkl0Ns1SVYxQezlhUoQ3I4aTiIY0GYpUrMzHIeCccZ3q5 jTL0Ht34Ixtv9H4Gvo2k0INogs/BYsMZKp831HxnKSWdTNj3yktKF2wL0rFt71uthTlG OJshSVQKnYDHk0bHLHyHFdVVFru11biFsE/UVy82nhDY/q8xyJqubJ4iUkD5JMtqFirX I1p7nQbxxzh0qDQ1Vtq9zRVCs7OQhFWigk00W9d5YNdwegZCD35n7z9wD6TFcuv/eRjA TCgQ== Received: by 10.112.49.202 with SMTP id w10mr2482042lbn.2.1353744054500; Sat, 24 Nov 2012 00:00:54 -0800 (PST) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPS id sx3sm3096802lab.9.2012.11.24.00.00.53 (version=SSLv3 cipher=OTHER); Sat, 24 Nov 2012 00:00:53 -0800 (PST) Message-ID: <50B07EB6.3010503@freebsd.org> Date: Sat, 24 Nov 2012 12:00:54 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andrew Turner Subject: Re: svn commit: r243474 - head/usr.bin/cut References: <201211240415.qAO4FPaG062952@svn.freebsd.org> In-Reply-To: <201211240415.qAO4FPaG062952@svn.freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmtcPoWIZB0iQH5KWTsYifYp9CetswBn8ucGxjWddTd0ENKwGu4nLNbGxMfI9xx+DPUiaGt Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 08:00:56 -0000 On 24.11.2012 8:15, Andrew Turner wrote: > The is_delim function works on wchar_t characters not ints, update the > function to take a wchar_t as it's argument. > static int > -is_delim(int ch) > +is_delim(wchar_t ch) > { > if (wflag) { > if (ch == ' ' || ch == '\t') > I can't look at the whole code at this moment, but taking standalone this is incorrect comparison for wchar_t. Should be L' ' and L'\t' instead. From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 08:33:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 726ECCE4; Sat, 24 Nov 2012 08:33:28 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5410A8FC0C; Sat, 24 Nov 2012 08:33:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO8XS3X006123; Sat, 24 Nov 2012 08:33:28 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO8XSem006122; Sat, 24 Nov 2012 08:33:28 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201211240833.qAO8XSem006122@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 24 Nov 2012 08:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243477 - stable/7/lib/libc/rpc X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 08:33:28 -0000 Author: jh Date: Sat Nov 24 08:33:27 2012 New Revision: 243477 URL: http://svnweb.freebsd.org/changeset/base/243477 Log: MFC r235143 by kib: Plug a leak. PR: 167068 Tested by: Oliver Pinter Modified: stable/7/lib/libc/rpc/auth_unix.c Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/rpc/auth_unix.c ============================================================================== --- stable/7/lib/libc/rpc/auth_unix.c Sat Nov 24 07:02:31 2012 (r243476) +++ stable/7/lib/libc/rpc/auth_unix.c Sat Nov 24 08:33:27 2012 (r243477) @@ -185,6 +185,7 @@ authunix_create(machname, uid, gid, len, AUTH * authunix_create_default() { + AUTH *auth; int ngids; long ngids_max; char machname[MAXHOSTNAMELEN + 1]; @@ -207,8 +208,10 @@ authunix_create_default() if (ngids > NGRPS) ngids = NGRPS; /* XXX: interface problem; those should all have been unsigned */ - return (authunix_create(machname, (int)uid, (int)gid, ngids, - (int *)gids)); + auth = authunix_create(machname, (int)uid, (int)gid, ngids, + (int *)gids); + free(gids); + return (auth); } /* From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:34:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 496A7D34; Sat, 24 Nov 2012 12:34:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE688FC0C; Sat, 24 Nov 2012 12:34:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCYiNC050579; Sat, 24 Nov 2012 12:34:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCYimO050578; Sat, 24 Nov 2012 12:34:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241234.qAOCYimO050578@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243478 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:34:46 -0000 Author: avg Date: Sat Nov 24 12:34:44 2012 New Revision: 243478 URL: http://svnweb.freebsd.org/changeset/base/243478 Log: MFC r242862: zfs_ioc_destroy_snaps_nvl: remove disk device entries for zvol snapshots Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 24 08:33:27 2012 (r243477) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 24 12:34:44 2012 (r243478) @@ -3213,6 +3213,7 @@ zfs_ioc_destroy_snaps_nvl(zfs_cmd_t *zc) } (void) zfs_unmount_snap(name, NULL); + (void) zvol_remove_minor(name); } err = dmu_snapshots_destroy_nvl(nvl, zc->zc_defer_destroy, From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:35:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E79CE94; Sat, 24 Nov 2012 12:35:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E6D6E8FC0C; Sat, 24 Nov 2012 12:35:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCZ4vX050730; Sat, 24 Nov 2012 12:35:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCZ4SR050729; Sat, 24 Nov 2012 12:35:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241235.qAOCZ4SR050729@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243479 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:35:05 -0000 Author: avg Date: Sat Nov 24 12:35:04 2012 New Revision: 243479 URL: http://svnweb.freebsd.org/changeset/base/243479 Log: MFC r242862: zfs_ioc_destroy_snaps_nvl: remove disk device entries for zvol snapshots Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 24 12:34:44 2012 (r243478) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 24 12:35:04 2012 (r243479) @@ -3213,6 +3213,7 @@ zfs_ioc_destroy_snaps_nvl(zfs_cmd_t *zc) } (void) zfs_unmount_snap(name, NULL); + (void) zvol_remove_minor(name); } err = dmu_snapshots_destroy_nvl(nvl, zc->zc_defer_destroy, From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:37:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD06317B; Sat, 24 Nov 2012 12:37:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A0B98FC18; Sat, 24 Nov 2012 12:37:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCbbW5051194; Sat, 24 Nov 2012 12:37:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCbbsQ051193; Sat, 24 Nov 2012 12:37:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241237.qAOCbbsQ051193@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243480 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:37:37 -0000 Author: avg Date: Sat Nov 24 12:37:37 2012 New Revision: 243480 URL: http://svnweb.freebsd.org/changeset/base/243480 Log: MFC r243213: spa_import_rootpool: fall back to use configuration from zpool.cache Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 12:35:04 2012 (r243479) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 12:37:37 2012 (r243480) @@ -3380,12 +3380,23 @@ spa_generate_rootconf(const char *name) { nvlist_t *config; nvlist_t *nvtop, *nvroot; + uint64_t nchildren; uint64_t pgid; if (vdev_geom_read_pool_label(name, &config) != 0) return (NULL); /* + * Multi-vdev root pool configuration discovery is not supported yet. + */ + nchildren = 0; + nvlist_lookup_uint64(config, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); + if (nchildren != 1) { + nvlist_free(config); + return (NULL); + } + + /* * Add this top-level vdev to the child array. */ VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, @@ -3427,25 +3438,30 @@ spa_import_rootpool(const char *name) * Read the label from the boot device and generate a configuration. */ config = spa_generate_rootconf(name); - if (config == NULL) { + + mutex_enter(&spa_namespace_lock); + if (config != NULL) { + VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, + &pname) == 0 && strcmp(name, pname) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) + == 0); + + if ((spa = spa_lookup(pname)) != NULL) { + /* + * Remove the existing root pool from the namespace so + * that we can replace it with the correct config + * we just read in. + */ + spa_remove(spa); + } + spa = spa_add(pname, config, NULL); + } else if ((spa = spa_lookup(name)) == NULL) { cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); return (EIO); + } else { + VERIFY(nvlist_dup(spa->spa_config, &config, KM_SLEEP) == 0); } - - VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, - &pname) == 0 && strcmp(name, pname) == 0); - VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) == 0); - - mutex_enter(&spa_namespace_lock); - if ((spa = spa_lookup(pname)) != NULL) { - /* - * Remove the existing root pool from the namespace so that we - * can replace it with the correct config we just read in. - */ - spa_remove(spa); - } - spa = spa_add(pname, config, NULL); spa->spa_is_root = B_TRUE; spa->spa_import_flags = ZFS_IMPORT_VERBATIM; @@ -3466,15 +3482,15 @@ spa_import_rootpool(const char *name) return (error); } - error = 0; spa_history_log_version(spa, LOG_POOL_IMPORT); -out: + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_free(rvd); spa_config_exit(spa, SCL_ALL, FTAG); mutex_exit(&spa_namespace_lock); - return (error); + nvlist_free(config); + return (0); } #endif /* sun */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:37:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D4212AF; Sat, 24 Nov 2012 12:37:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 621588FC0C; Sat, 24 Nov 2012 12:37:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCbnET051265; Sat, 24 Nov 2012 12:37:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCbnlS051264; Sat, 24 Nov 2012 12:37:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241237.qAOCbnlS051264@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243481 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:37:49 -0000 Author: avg Date: Sat Nov 24 12:37:48 2012 New Revision: 243481 URL: http://svnweb.freebsd.org/changeset/base/243481 Log: MFC r243213: spa_import_rootpool: fall back to use configuration from zpool.cache Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 12:37:37 2012 (r243480) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 12:37:48 2012 (r243481) @@ -3380,12 +3380,23 @@ spa_generate_rootconf(const char *name) { nvlist_t *config; nvlist_t *nvtop, *nvroot; + uint64_t nchildren; uint64_t pgid; if (vdev_geom_read_pool_label(name, &config) != 0) return (NULL); /* + * Multi-vdev root pool configuration discovery is not supported yet. + */ + nchildren = 0; + nvlist_lookup_uint64(config, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); + if (nchildren != 1) { + nvlist_free(config); + return (NULL); + } + + /* * Add this top-level vdev to the child array. */ VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, @@ -3427,25 +3438,30 @@ spa_import_rootpool(const char *name) * Read the label from the boot device and generate a configuration. */ config = spa_generate_rootconf(name); - if (config == NULL) { + + mutex_enter(&spa_namespace_lock); + if (config != NULL) { + VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, + &pname) == 0 && strcmp(name, pname) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) + == 0); + + if ((spa = spa_lookup(pname)) != NULL) { + /* + * Remove the existing root pool from the namespace so + * that we can replace it with the correct config + * we just read in. + */ + spa_remove(spa); + } + spa = spa_add(pname, config, NULL); + } else if ((spa = spa_lookup(name)) == NULL) { cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); return (EIO); + } else { + VERIFY(nvlist_dup(spa->spa_config, &config, KM_SLEEP) == 0); } - - VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, - &pname) == 0 && strcmp(name, pname) == 0); - VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) == 0); - - mutex_enter(&spa_namespace_lock); - if ((spa = spa_lookup(pname)) != NULL) { - /* - * Remove the existing root pool from the namespace so that we - * can replace it with the correct config we just read in. - */ - spa_remove(spa); - } - spa = spa_add(pname, config, NULL); spa->spa_is_root = B_TRUE; spa->spa_import_flags = ZFS_IMPORT_VERBATIM; @@ -3466,15 +3482,15 @@ spa_import_rootpool(const char *name) return (error); } - error = 0; spa_history_log_version(spa, LOG_POOL_IMPORT); -out: + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_free(rvd); spa_config_exit(spa, SCL_ALL, FTAG); mutex_exit(&spa_namespace_lock); - return (error); + nvlist_free(config); + return (0); } #endif /* sun */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:40:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05DAE533; Sat, 24 Nov 2012 12:40:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DEB718FC08; Sat, 24 Nov 2012 12:40:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCeNp9051842; Sat, 24 Nov 2012 12:40:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCeNst051841; Sat, 24 Nov 2012 12:40:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241240.qAOCeNst051841@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243482 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:40:24 -0000 Author: avg Date: Sat Nov 24 12:40:23 2012 New Revision: 243482 URL: http://svnweb.freebsd.org/changeset/base/243482 Log: MFC r242568: zfs_vnode_lock: no need to double-guess caller's intentions here Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:37:48 2012 (r243481) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:40:23 2012 (r243482) @@ -1740,15 +1740,7 @@ zfs_vnode_lock(vnode_t *vp, int flags) ASSERT(vp != NULL); - /* - * Check if the file system wasn't forcibly unmounted in the meantime. - */ error = vn_lock(vp, flags); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) { - VOP_UNLOCK(vp, 0); - error = ENOENT; - } - return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:40:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10DE4693; Sat, 24 Nov 2012 12:40:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E96D88FC13; Sat, 24 Nov 2012 12:40:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCehwC051937; Sat, 24 Nov 2012 12:40:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCehHX051936; Sat, 24 Nov 2012 12:40:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241240.qAOCehHX051936@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243483 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:40:44 -0000 Author: avg Date: Sat Nov 24 12:40:43 2012 New Revision: 243483 URL: http://svnweb.freebsd.org/changeset/base/243483 Log: MFC r242568: zfs_vnode_lock: no need to double-guess caller's intentions here Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:40:23 2012 (r243482) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:40:43 2012 (r243483) @@ -1736,15 +1736,7 @@ zfs_vnode_lock(vnode_t *vp, int flags) ASSERT(vp != NULL); - /* - * Check if the file system wasn't forcibly unmounted in the meantime. - */ error = vn_lock(vp, flags); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) { - VOP_UNLOCK(vp, 0); - error = ENOENT; - } - return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:42:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84E9B905; Sat, 24 Nov 2012 12:42:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0858FC14; Sat, 24 Nov 2012 12:42:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCgTWW052325; Sat, 24 Nov 2012 12:42:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCgTps052324; Sat, 24 Nov 2012 12:42:29 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241242.qAOCgTps052324@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243484 - stable/9/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:42:29 -0000 Author: avg Date: Sat Nov 24 12:42:29 2012 New Revision: 243484 URL: http://svnweb.freebsd.org/changeset/base/243484 Log: MFC r242569: opensolaris_lookup: use vfs_busy in traverse before calling VFS_ROOT Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sat Nov 24 12:40:43 2012 (r243483) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sat Nov 24 12:42:29 2012 (r243484) @@ -88,6 +88,7 @@ traverse(vnode_t **cvpp, int lktype) vfsp = vn_mountedvfs(cvp); if (vfsp == NULL) break; + error = vfs_busy(vfsp, 0); /* * tvp is NULL for *cvpp vnode, which we can't unlock. */ @@ -95,12 +96,15 @@ traverse(vnode_t **cvpp, int lktype) vput(cvp); else vrele(cvp); + if (error) + return (error); /* * The read lock must be held across the call to VFS_ROOT() to * prevent a concurrent unmount from destroying the vfs. */ error = VFS_ROOT(vfsp, lktype, &tvp); + vfs_unbusy(vfsp); if (error != 0) return (error); cvp = tvp; From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:42:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A45FEA33; Sat, 24 Nov 2012 12:42:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 899428FC0C; Sat, 24 Nov 2012 12:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCgglV052381; Sat, 24 Nov 2012 12:42:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCgg84052380; Sat, 24 Nov 2012 12:42:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241242.qAOCgg84052380@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243485 - stable/8/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:42:42 -0000 Author: avg Date: Sat Nov 24 12:42:42 2012 New Revision: 243485 URL: http://svnweb.freebsd.org/changeset/base/243485 Log: MFC r242569: opensolaris_lookup: use vfs_busy in traverse before calling VFS_ROOT Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sat Nov 24 12:42:29 2012 (r243484) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sat Nov 24 12:42:42 2012 (r243485) @@ -88,6 +88,7 @@ traverse(vnode_t **cvpp, int lktype) vfsp = vn_mountedvfs(cvp); if (vfsp == NULL) break; + error = vfs_busy(vfsp, 0); /* * tvp is NULL for *cvpp vnode, which we can't unlock. */ @@ -95,12 +96,15 @@ traverse(vnode_t **cvpp, int lktype) vput(cvp); else vrele(cvp); + if (error) + return (error); /* * The read lock must be held across the call to VFS_ROOT() to * prevent a concurrent unmount from destroying the vfs. */ error = VFS_ROOT(vfsp, lktype, &tvp); + vfs_unbusy(vfsp); if (error != 0) return (error); cvp = tvp; From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:44:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E6AA6BED; Sat, 24 Nov 2012 12:44:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C79BC8FC08; Sat, 24 Nov 2012 12:44:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCiDX9052670; Sat, 24 Nov 2012 12:44:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCiD7F052669; Sat, 24 Nov 2012 12:44:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241244.qAOCiD7F052669@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243486 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:44:14 -0000 Author: avg Date: Sat Nov 24 12:44:13 2012 New Revision: 243486 URL: http://svnweb.freebsd.org/changeset/base/243486 Log: MFC r242570: zfs_umount: no need to set MNTK_UNMOUNTF here, dounmount handles that Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:42:42 2012 (r243485) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:44:13 2012 (r243486) @@ -1966,10 +1966,6 @@ zfs_umount(vfs_t *vfsp, int fflag) zfsvfs->z_ctldir->v_count > 1) return (EBUSY); } - } else { - MNT_ILOCK(vfsp); - vfsp->mnt_kern_flag |= MNTK_UNMOUNTF; - MNT_IUNLOCK(vfsp); } VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0); From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:44:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06E26D02; Sat, 24 Nov 2012 12:44:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DFAF98FC14; Sat, 24 Nov 2012 12:44:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCiPgQ052734; Sat, 24 Nov 2012 12:44:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCiPdg052733; Sat, 24 Nov 2012 12:44:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241244.qAOCiPdg052733@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243487 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:44:26 -0000 Author: avg Date: Sat Nov 24 12:44:25 2012 New Revision: 243487 URL: http://svnweb.freebsd.org/changeset/base/243487 Log: MFC r242570: zfs_umount: no need to set MNTK_UNMOUNTF here, dounmount handles that Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:44:13 2012 (r243486) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:44:25 2012 (r243487) @@ -1962,10 +1962,6 @@ zfs_umount(vfs_t *vfsp, int fflag) zfsvfs->z_ctldir->v_count > 1) return (EBUSY); } - } else { - MNT_ILOCK(vfsp); - vfsp->mnt_kern_flag |= MNTK_UNMOUNTF; - MNT_IUNLOCK(vfsp); } VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0); From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:46:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77CEDEB4; Sat, 24 Nov 2012 12:46:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5BCF88FC13; Sat, 24 Nov 2012 12:46:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCk8dN053076; Sat, 24 Nov 2012 12:46:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCk8xE053075; Sat, 24 Nov 2012 12:46:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241246.qAOCk8xE053075@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243488 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:46:08 -0000 Author: avg Date: Sat Nov 24 12:46:07 2012 New Revision: 243488 URL: http://svnweb.freebsd.org/changeset/base/243488 Log: MFC r242571: zfs_vnode_forget: dispose of larvae vnode using public vfs api (mostly) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:44:25 2012 (r243487) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:46:07 2012 (r243488) @@ -632,12 +632,11 @@ static void zfs_vnode_forget(vnode_t *vp) { - VOP_UNLOCK(vp, 0); - VI_LOCK(vp); - vp->v_usecount--; - vp->v_iflag |= VI_DOOMED; + /* copied from insmntque_stddtr */ vp->v_data = NULL; - vdropl(vp); + vp->v_op = &dead_vnodeops; + vgone(vp); + vput(vp); } /* From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:51:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 071291C1; Sat, 24 Nov 2012 12:51:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF9EC8FC13; Sat, 24 Nov 2012 12:51:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCpvEo053761; Sat, 24 Nov 2012 12:51:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCpv2i053760; Sat, 24 Nov 2012 12:51:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241251.qAOCpv2i053760@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243489 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:51:58 -0000 Author: avg Date: Sat Nov 24 12:51:57 2012 New Revision: 243489 URL: http://svnweb.freebsd.org/changeset/base/243489 Log: MFC r225153: We need to unlock and destroy vnode attached to znode which we are freeing. MFC slacker: pjd Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:46:07 2012 (r243488) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:51:57 2012 (r243489) @@ -628,6 +628,18 @@ zfs_znode_dmu_fini(znode_t *zp) zp->z_sa_hdl = NULL; } +static void +zfs_vnode_forget(vnode_t *vp) +{ + + VOP_UNLOCK(vp, 0); + VI_LOCK(vp); + vp->v_usecount--; + vp->v_iflag |= VI_DOOMED; + vp->v_data = NULL; + vdropl(vp); +} + /* * Construct a new znode/vnode and intialize. * @@ -689,6 +701,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu if (sa_bulk_lookup(zp->z_sa_hdl, bulk, count) != 0 || zp->z_gen == 0) { if (hdl == NULL) sa_handle_destroy(zp->z_sa_hdl); + zfs_vnode_forget(vp); + zp->z_vnode = NULL; kmem_cache_free(znode_cache, zp); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:53:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7BCFF523; Sat, 24 Nov 2012 12:53:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 609508FC08; Sat, 24 Nov 2012 12:53:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCrdDG054097; Sat, 24 Nov 2012 12:53:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCrdec054096; Sat, 24 Nov 2012 12:53:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241253.qAOCrdec054096@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243490 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:53:39 -0000 Author: avg Date: Sat Nov 24 12:53:38 2012 New Revision: 243490 URL: http://svnweb.freebsd.org/changeset/base/243490 Log: MFC r242571: zfs_vnode_forget: dispose of larvae vnode using public vfs api (mostly) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:51:57 2012 (r243489) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:53:38 2012 (r243490) @@ -632,12 +632,11 @@ static void zfs_vnode_forget(vnode_t *vp) { - VOP_UNLOCK(vp, 0); - VI_LOCK(vp); - vp->v_usecount--; - vp->v_iflag |= VI_DOOMED; + /* copied from insmntque_stddtr */ vp->v_data = NULL; - vdropl(vp); + vp->v_op = &dead_vnodeops; + vgone(vp); + vput(vp); } /* From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:56:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F1E786E; Sat, 24 Nov 2012 12:56:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33C808FC12; Sat, 24 Nov 2012 12:56:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCu85r054593; Sat, 24 Nov 2012 12:56:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCu8lN054592; Sat, 24 Nov 2012 12:56:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241256.qAOCu8lN054592@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243491 - stable/9/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:56:08 -0000 Author: avg Date: Sat Nov 24 12:56:07 2012 New Revision: 243491 URL: http://svnweb.freebsd.org/changeset/base/243491 Log: MFC r242572: opensolaris compat: clear VI_MOUNT before returning if mount_snapshot fails Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sat Nov 24 12:53:38 2012 (r243490) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sat Nov 24 12:56:07 2012 (r243491) @@ -191,6 +191,9 @@ mount_snapshot(kthread_t *td, vnode_t ** td->td_ucred = cr; if (error != 0) { + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); vfs_mount_destroy(mp); From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:56:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A0119DC; Sat, 24 Nov 2012 12:56:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7F94E8FC15; Sat, 24 Nov 2012 12:56:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCuLS0054673; Sat, 24 Nov 2012 12:56:21 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCuLt9054672; Sat, 24 Nov 2012 12:56:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241256.qAOCuLt9054672@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243492 - stable/8/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:56:21 -0000 Author: avg Date: Sat Nov 24 12:56:21 2012 New Revision: 243492 URL: http://svnweb.freebsd.org/changeset/base/243492 Log: MFC r242572: opensolaris compat: clear VI_MOUNT before returning if mount_snapshot fails Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sat Nov 24 12:56:07 2012 (r243491) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sat Nov 24 12:56:21 2012 (r243492) @@ -191,6 +191,9 @@ mount_snapshot(kthread_t *td, vnode_t ** td->td_ucred = cr; if (error != 0) { + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); vfs_mount_destroy(mp); From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:58:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8701AC50; Sat, 24 Nov 2012 12:58:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6ACC18FC12; Sat, 24 Nov 2012 12:58:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCwpPJ055161; Sat, 24 Nov 2012 12:58:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCwpES055160; Sat, 24 Nov 2012 12:58:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241258.qAOCwpES055160@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243493 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:58:51 -0000 Author: avg Date: Sat Nov 24 12:58:51 2012 New Revision: 243493 URL: http://svnweb.freebsd.org/changeset/base/243493 Log: MFC r242573: zfs: set MNTK_EXTENDED_SHARED flag Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:56:21 2012 (r243492) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:58:51 2012 (r243493) @@ -1119,6 +1119,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->mnt_kern_flag |= MNTK_MPSAFE; vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; + vfsp->mnt_kern_flag |= MNTK_EXTENDED_SHARED; /* * The fsid is 64 bits, composed of an 8-bit fs type, which From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 12:59:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 072FBD5E; Sat, 24 Nov 2012 12:59:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E01498FC13; Sat, 24 Nov 2012 12:59:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCx2Q5055251; Sat, 24 Nov 2012 12:59:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCx2AA055250; Sat, 24 Nov 2012 12:59:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241259.qAOCx2AA055250@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243494 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 12:59:03 -0000 Author: avg Date: Sat Nov 24 12:59:02 2012 New Revision: 243494 URL: http://svnweb.freebsd.org/changeset/base/243494 Log: MFC r242573: zfs: set MNTK_EXTENDED_SHARED flag Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:58:51 2012 (r243493) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:59:02 2012 (r243494) @@ -1118,6 +1118,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->mnt_kern_flag |= MNTK_MPSAFE; vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; + vfsp->mnt_kern_flag |= MNTK_EXTENDED_SHARED; /* * The fsid is 64 bits, composed of an 8-bit fs type, which From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 13:00:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20DFAF2F; Sat, 24 Nov 2012 13:00:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 052058FC13; Sat, 24 Nov 2012 13:00:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOD0fK0055612; Sat, 24 Nov 2012 13:00:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOD0fUf055611; Sat, 24 Nov 2012 13:00:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241300.qAOD0fUf055611@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 13:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243495 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 13:00:42 -0000 Author: avg Date: Sat Nov 24 13:00:41 2012 New Revision: 243495 URL: http://svnweb.freebsd.org/changeset/base/243495 Log: MFC r242574: zfsctl_snapdir_lookup: obtain a snapname in the remount case Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Nov 24 12:59:02 2012 (r243494) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Nov 24 13:00:41 2012 (r243495) @@ -1002,6 +1002,7 @@ zfsctl_snapdir_lookup(ap) * The snapshot was unmounted behind our backs, * try to remount it. */ + VERIFY(zfsctl_snapshot_zname(dvp, nm, MAXNAMELEN, snapname) == 0); goto domount; } else { /* From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 13:00:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2045DC4; Sat, 24 Nov 2012 13:00:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03F4E8FC13; Sat, 24 Nov 2012 13:00:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOD0vrx055709; Sat, 24 Nov 2012 13:00:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOD0vCT055708; Sat, 24 Nov 2012 13:00:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241300.qAOD0vCT055708@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 13:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243496 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 13:00:58 -0000 Author: avg Date: Sat Nov 24 13:00:57 2012 New Revision: 243496 URL: http://svnweb.freebsd.org/changeset/base/243496 Log: MFC r242574: zfsctl_snapdir_lookup: obtain a snapname in the remount case Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Nov 24 13:00:41 2012 (r243495) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Nov 24 13:00:57 2012 (r243496) @@ -1002,6 +1002,7 @@ zfsctl_snapdir_lookup(ap) * The snapshot was unmounted behind our backs, * try to remount it. */ + VERIFY(zfsctl_snapshot_zname(dvp, nm, MAXNAMELEN, snapname) == 0); goto domount; } else { /* From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 13:07:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 759B72BB; Sat, 24 Nov 2012 13:07:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7198FC08; Sat, 24 Nov 2012 13:07:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOD7Wan056906; Sat, 24 Nov 2012 13:07:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOD7WFb056905; Sat, 24 Nov 2012 13:07:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241307.qAOD7WFb056905@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 13:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243497 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 13:07:32 -0000 Author: avg Date: Sat Nov 24 13:07:31 2012 New Revision: 243497 URL: http://svnweb.freebsd.org/changeset/base/243497 Log: zfs: create devices/geoms from zvols after receiveing them PR: kern/167066 Tested by: Andreas Nilsson MFC after: 13 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 24 13:00:57 2012 (r243496) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 24 13:07:31 2012 (r243497) @@ -3836,6 +3836,12 @@ zfs_ioc_recv(zfs_cmd_t *zc) error = 1; } #endif + +#ifdef __FreeBSD__ + if (error == 0) + zvol_create_minors(tofs); +#endif + /* * On error, restore the original props. */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 13:10:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1BD7743F; Sat, 24 Nov 2012 13:10:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F33F28FC18; Sat, 24 Nov 2012 13:10:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAODAa17057454; Sat, 24 Nov 2012 13:10:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAODAaje057453; Sat, 24 Nov 2012 13:10:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241310.qAODAaje057453@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 13:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243498 - head/sys/cddl/compat/opensolaris/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 13:10:37 -0000 Author: avg Date: Sat Nov 24 13:10:36 2012 New Revision: 243498 URL: http://svnweb.freebsd.org/changeset/base/243498 Log: opensolaris compat: terminate cmn_err mesages with a new line MFC after: 6 days Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sat Nov 24 13:07:31 2012 (r243497) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sat Nov 24 13:10:36 2012 (r243498) @@ -60,6 +60,7 @@ vcmn_err(int ce, const char *fmt, va_lis if (ce != CE_IGNORE) { printf("%s", prefix); vprintf(fmt, adx); + printf("\n"); } } From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 13:11:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A4AB5C8; Sat, 24 Nov 2012 13:11:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F43C8FC0C; Sat, 24 Nov 2012 13:11:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAODBmlW057705; Sat, 24 Nov 2012 13:11:48 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAODBmNI057704; Sat, 24 Nov 2012 13:11:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241311.qAODBmNI057704@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 13:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243499 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 13:11:48 -0000 Author: avg Date: Sat Nov 24 13:11:47 2012 New Revision: 243499 URL: http://svnweb.freebsd.org/changeset/base/243499 Log: assert_vop_locked: make the assertion race-free and more efficient this is really a minor improvement for the sake of correctness MFC after: 6 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Nov 24 13:10:36 2012 (r243498) +++ head/sys/kern/vfs_subr.c Sat Nov 24 13:11:47 2012 (r243499) @@ -3979,10 +3979,13 @@ assert_vi_unlocked(struct vnode *vp, con void assert_vop_locked(struct vnode *vp, const char *str) { + int locked; - if (!IGNORE_LOCK(vp) && - (VOP_ISLOCKED(vp) == 0 || VOP_ISLOCKED(vp) == LK_EXCLOTHER)) - vfs_badlock("is not locked but should be", str, vp); + if (!IGNORE_LOCK(vp)) { + locked = VOP_ISLOCKED(vp); + if (locked == 0 || locked == LK_EXCLOTHER) + vfs_badlock("is not locked but should be", str, vp); + } } void From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 13:14:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DCA4C7E5; Sat, 24 Nov 2012 13:14:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C1B058FC08; Sat, 24 Nov 2012 13:14:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAODErt2058195; Sat, 24 Nov 2012 13:14:53 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAODErMB058194; Sat, 24 Nov 2012 13:14:53 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241314.qAODErMB058194@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 13:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243500 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 13:14:53 -0000 Author: avg Date: Sat Nov 24 13:14:53 2012 New Revision: 243500 URL: http://svnweb.freebsd.org/changeset/base/243500 Log: spa_import_rootpool: do not call spa_history_log_version The call is a NOP, because pool version in spa_ubsync.ub_version is not initialized and thus appears to be zero. If the version is properly set then the call leads to a NULL pointer dereference because the spa object is still under-constructed. The same change was independently made in the upstream as a part of a larger change (4445fffbbb1ea25fd0e9ea68b9380dd7a6709025). MFC after: 6 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 13:11:47 2012 (r243499) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 13:14:53 2012 (r243500) @@ -3865,8 +3865,6 @@ spa_import_rootpool(const char *name) return (error); } - spa_history_log_version(spa, LOG_POOL_IMPORT); - spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_free(rvd); spa_config_exit(spa, SCL_ALL, FTAG); From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 13:16:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC73A978; Sat, 24 Nov 2012 13:16:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 916658FC13; Sat, 24 Nov 2012 13:16:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAODGnRg058486; Sat, 24 Nov 2012 13:16:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAODGnHb058485; Sat, 24 Nov 2012 13:16:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241316.qAODGnHb058485@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 13:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243501 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 13:16:49 -0000 Author: avg Date: Sat Nov 24 13:16:49 2012 New Revision: 243501 URL: http://svnweb.freebsd.org/changeset/base/243501 Log: spa_import_rootpool: initialize ub_version before calling spa_config_parse ... because the latter makes some decision based on the version. This is especially important for raidz vdevs. This is similar to what spa_load does. This is not an issue for upstream because they do not seem to support using raidz as a root pool. Reported by: Andrei Lavreniyuk Tested by: Andrei Lavreniyuk MFC after: 6 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 13:14:53 2012 (r243500) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 13:16:49 2012 (r243501) @@ -3838,6 +3838,14 @@ spa_import_rootpool(const char *name) spa_remove(spa); } spa = spa_add(pname, config, NULL); + + /* + * Set spa_ubsync.ub_version as it can be used in vdev_alloc() + * via spa_version(). + */ + if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, + &spa->spa_ubsync.ub_version) != 0) + spa->spa_ubsync.ub_version = SPA_VERSION_INITIAL; } else if ((spa = spa_lookup(name)) == NULL) { cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 13:23:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63CCFE19; Sat, 24 Nov 2012 13:23:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 46EFC8FC0C; Sat, 24 Nov 2012 13:23:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAODNGaY059314; Sat, 24 Nov 2012 13:23:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAODNGBA059312; Sat, 24 Nov 2012 13:23:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241323.qAODNGBA059312@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 13:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243502 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 13:23:16 -0000 Author: avg Date: Sat Nov 24 13:23:15 2012 New Revision: 243502 URL: http://svnweb.freebsd.org/changeset/base/243502 Log: zfs roopool: add support for multi-vdev configurations Tested by: madpilot MFC after: 10 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 13:16:49 2012 (r243501) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 13:23:15 2012 (r243502) @@ -3755,54 +3755,120 @@ out: #else -extern int -vdev_geom_read_pool_label(const char *name, nvlist_t **config); +extern int vdev_geom_read_pool_label(const char *name, nvlist_t ***configs, + uint64_t *count); static nvlist_t * spa_generate_rootconf(const char *name) { + nvlist_t **configs, **tops; nvlist_t *config; - nvlist_t *nvtop, *nvroot; + nvlist_t *best_cfg, *nvtop, *nvroot; + uint64_t *holes; + uint64_t best_txg; uint64_t nchildren; uint64_t pgid; + uint64_t count; + uint64_t i; + uint_t nholes; - if (vdev_geom_read_pool_label(name, &config) != 0) + if (vdev_geom_read_pool_label(name, &configs, &count) != 0) return (NULL); + ASSERT3U(count, !=, 0); + best_txg = 0; + for (i = 0; i < count; i++) { + uint64_t txg; + + VERIFY(nvlist_lookup_uint64(configs[i], ZPOOL_CONFIG_POOL_TXG, + &txg) == 0); + if (txg > best_txg) { + best_txg = txg; + best_cfg = configs[i]; + } + } + /* * Multi-vdev root pool configuration discovery is not supported yet. */ nchildren = 0; - nvlist_lookup_uint64(config, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); - if (nchildren != 1) { - nvlist_free(config); - return (NULL); + VERIFY(nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, + &nchildren) == 0); + holes = NULL; + nvlist_lookup_uint64_array(best_cfg, ZPOOL_CONFIG_HOLE_ARRAY, + &holes, &nholes); + + tops = kmem_alloc(nchildren * sizeof(void *), KM_SLEEP | KM_ZERO); + for (i = 0; i < nchildren; i++) { + if (i >= count) + break; + if (configs[i] == NULL) + continue; + VERIFY(nvlist_lookup_nvlist(configs[i], ZPOOL_CONFIG_VDEV_TREE, + &nvtop) == 0); + nvlist_dup(nvtop, &tops[i], KM_SLEEP); + } + for (i = 0; holes != NULL && i < nholes; i++) { + if (i >= nchildren) + continue; + if (tops[holes[i]] != NULL) + continue; + nvlist_alloc(&tops[holes[i]], NV_UNIQUE_NAME, KM_SLEEP); + VERIFY(nvlist_add_string(tops[holes[i]], ZPOOL_CONFIG_TYPE, + VDEV_TYPE_HOLE) == 0); + VERIFY(nvlist_add_uint64(tops[holes[i]], ZPOOL_CONFIG_ID, + holes[i]) == 0); + VERIFY(nvlist_add_uint64(tops[holes[i]], ZPOOL_CONFIG_GUID, + 0) == 0); + } + for (i = 0; i < nchildren; i++) { + if (tops[i] != NULL) + continue; + nvlist_alloc(&tops[i], NV_UNIQUE_NAME, KM_SLEEP); + VERIFY(nvlist_add_string(tops[i], ZPOOL_CONFIG_TYPE, + VDEV_TYPE_MISSING) == 0); + VERIFY(nvlist_add_uint64(tops[i], ZPOOL_CONFIG_ID, + i) == 0); + VERIFY(nvlist_add_uint64(tops[i], ZPOOL_CONFIG_GUID, + 0) == 0); } /* - * Add this top-level vdev to the child array. + * Create pool config based on the best vdev config. */ - VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, - &nvtop) == 0); - VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID, - &pgid) == 0); + nvlist_dup(best_cfg, &config, KM_SLEEP); /* * Put this pool's top-level vdevs into a root vdev. */ + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID, + &pgid) == 0); VERIFY(nvlist_alloc(&nvroot, NV_UNIQUE_NAME, KM_SLEEP) == 0); VERIFY(nvlist_add_string(nvroot, ZPOOL_CONFIG_TYPE, VDEV_TYPE_ROOT) == 0); VERIFY(nvlist_add_uint64(nvroot, ZPOOL_CONFIG_ID, 0ULL) == 0); VERIFY(nvlist_add_uint64(nvroot, ZPOOL_CONFIG_GUID, pgid) == 0); VERIFY(nvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, - &nvtop, 1) == 0); + tops, nchildren) == 0); /* * Replace the existing vdev_tree with the new root vdev in * this pool's configuration (remove the old, add the new). */ VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, nvroot) == 0); + + /* + * Drop vdev config elements that should not be present at pool level. + */ + nvlist_remove(config, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64); + nvlist_remove(config, ZPOOL_CONFIG_TOP_GUID, DATA_TYPE_UINT64); + + for (i = 0; i < count; i++) + nvlist_free(configs[i]); + kmem_free(configs, count * sizeof(void *)); + for (i = 0; i < nchildren; i++) + nvlist_free(tops[i]); + kmem_free(tops, nchildren * sizeof(void *)); nvlist_free(nvroot); return (config); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Nov 24 13:16:49 2012 (r243501) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Nov 24 13:23:15 2012 (r243502) @@ -292,27 +292,74 @@ vdev_geom_read_config(struct g_consumer return (*config == NULL ? ENOENT : 0); } -static int -vdev_geom_check_config(nvlist_t *config, const char *name, uint64_t *best_txg) +static void +resize_configs(nvlist_t ***configs, uint64_t *count, uint64_t id) { - uint64_t vdev_guid; - uint64_t txg; + nvlist_t **new_configs; + uint64_t i; + + if (id < *count) + return; + new_configs = kmem_alloc((id + 1) * sizeof(nvlist_t *), + KM_SLEEP | KM_ZERO); + for (i = 0; i < *count; i++) + new_configs[i] = (*configs)[i]; + if (*configs != NULL) + kmem_free(*configs, *count * sizeof(void *)); + *configs = new_configs; + *count = id + 1; +} + +static void +process_vdev_config(nvlist_t ***configs, uint64_t *count, nvlist_t *cfg, + const char *name, uint64_t* known_pool_guid) +{ + nvlist_t *vdev_tree; + uint64_t pool_guid; + uint64_t vdev_guid, known_guid; + uint64_t id, txg, known_txg; char *pname; + int i; - if (nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, &pname) != 0 || + if (nvlist_lookup_string(cfg, ZPOOL_CONFIG_POOL_NAME, &pname) != 0 || strcmp(pname, name) != 0) - return (ENOENT); + goto ignore; - ZFS_LOG(1, "found pool: %s", pname); + if (nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_POOL_GUID, &pool_guid) != 0) + goto ignore; - txg = 0; - nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg); - if (txg <= *best_txg) - return (ENOENT); - *best_txg = txg; - ZFS_LOG(1, "txg: %ju", (uintmax_t)*best_txg); + if (nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_TOP_GUID, &vdev_guid) != 0) + goto ignore; - return (0); + if (nvlist_lookup_nvlist(cfg, ZPOOL_CONFIG_VDEV_TREE, &vdev_tree) != 0) + goto ignore; + + if (nvlist_lookup_uint64(vdev_tree, ZPOOL_CONFIG_ID, &id) != 0) + goto ignore; + + VERIFY(nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_POOL_TXG, &txg) == 0); + + if (*known_pool_guid != 0) { + if (pool_guid != *known_pool_guid) + goto ignore; + } else + *known_pool_guid = pool_guid; + + resize_configs(configs, count, id); + + if ((*configs)[id] != NULL) { + VERIFY(nvlist_lookup_uint64((*configs)[id], + ZPOOL_CONFIG_POOL_TXG, &known_txg) == 0); + if (txg <= known_txg) + goto ignore; + nvlist_free((*configs)[id]); + } + + (*configs)[id] = cfg; + return; + +ignore: + nvlist_free(cfg); } static int @@ -339,14 +386,15 @@ vdev_geom_detach_taster(struct g_consume } int -vdev_geom_read_pool_label(const char *name, nvlist_t **config) +vdev_geom_read_pool_label(const char *name, + nvlist_t ***configs, uint64_t *count) { struct g_class *mp; struct g_geom *gp, *zgp; struct g_provider *pp; struct g_consumer *zcp; nvlist_t *vdev_cfg; - uint64_t best_txg; + uint64_t pool_guid; int error; DROP_GIANT(); @@ -357,8 +405,9 @@ vdev_geom_read_pool_label(const char *na zgp->orphan = vdev_geom_taste_orphan; zcp = g_new_consumer(zgp); - best_txg = 0; - *config = NULL; + *configs = NULL; + *count = 0; + pool_guid = 0; LIST_FOREACH(mp, &g_classes, class) { if (mp == &zfs_vdev_class) continue; @@ -378,14 +427,8 @@ vdev_geom_read_pool_label(const char *na continue; ZFS_LOG(1, "successfully read vdev config"); - error = vdev_geom_check_config(vdev_cfg, name, - &best_txg); - if (error != 0) { - nvlist_free(vdev_cfg); - continue; - } - nvlist_free(*config); - *config = vdev_cfg; + process_vdev_config(configs, count, + vdev_cfg, name, &pool_guid); } } } @@ -394,7 +437,8 @@ vdev_geom_read_pool_label(const char *na g_destroy_geom(zgp); g_topology_unlock(); PICKUP_GIANT(); - return (*config == NULL ? ENOENT : 0); + + return (*count > 0 ? 0 : ENOENT); } static uint64_t From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 14:02:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78395983; Sat, 24 Nov 2012 14:02:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2832D8FC14; Sat, 24 Nov 2012 14:02:45 +0000 (UTC) Received: from [192.168.0.6] (spaceball.home.andric.com [192.168.0.6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E96415C37; Sat, 24 Nov 2012 15:02:43 +0100 (CET) Message-ID: <50B0D38B.3020605@FreeBSD.org> Date: Sat, 24 Nov 2012 15:02:51 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Ed Schouten Subject: Re: svn commit: r243405 - in stable/9: include lib/libc/stdlib References: <201211221519.qAMFJroe007462@svn.freebsd.org> In-Reply-To: <201211221519.qAMFJroe007462@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 14:02:46 -0000 On 2012-11-22 16:19, Ed Schouten wrote: > Author: ed > Date: Thu Nov 22 15:19:53 2012 > New Revision: 243405 > URL: http://svnweb.freebsd.org/changeset/base/243405 > > Log: > MFC r229848: > > Add aligned_alloc(3). > > The C11 folks reinvented the wheel by introducing an aligned version of > malloc(3) called aligned_alloc(3), instead of posix_memalign(3). Instead > of returning the allocation by reference, it returns the address, just > like malloc(3). > > I'm MFCing this now, as it seems aligned_alloc(3) is needed to make the > new version of libc++ work, which was merged back to FreeBSD 9 in r243376. > > Requested by: dim Thanks! From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 14:11:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16C67C49; Sat, 24 Nov 2012 14:11:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id C5B0D8FC1C; Sat, 24 Nov 2012 14:11:56 +0000 (UTC) Received: from [192.168.0.6] (spaceball.home.andric.com [192.168.0.6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 2866B5C37; Sat, 24 Nov 2012 15:11:56 +0100 (CET) Message-ID: <50B0D5B3.9000802@FreeBSD.org> Date: Sat, 24 Nov 2012 15:12:03 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andrey Chernov Subject: Re: svn commit: r243474 - head/usr.bin/cut References: <201211240415.qAO4FPaG062952@svn.freebsd.org> <50B07EB6.3010503@freebsd.org> In-Reply-To: <50B07EB6.3010503@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 14:11:57 -0000 On 2012-11-24 09:00, Andrey Chernov wrote: > On 24.11.2012 8:15, Andrew Turner wrote: >> The is_delim function works on wchar_t characters not ints, update the >> function to take a wchar_t as it's argument. >> static int >> -is_delim(int ch) >> +is_delim(wchar_t ch) >> { >> if (wflag) { >> if (ch == ' ' || ch == '\t') >> > > I can't look at the whole code at this moment, but taking standalone > this is incorrect comparison for wchar_t. Should be L' ' and L'\t' instead. The compiler just promotes the space and tab to wchar_t, this is only needed for the sake of consistency (and/or style). There is no binary change if you add the L prefixes. :) From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 14:51:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB4AF4C6 for ; Sat, 24 Nov 2012 14:51:50 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2BEE78FC13 for ; Sat, 24 Nov 2012 14:51:49 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so9437437lah.13 for ; Sat, 24 Nov 2012 06:51:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:disposition-notification-to:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:openpgp :content-type:content-transfer-encoding:x-gm-message-state; bh=zYCLWZEuHFgxH1EcxyUBKDEv4KC87eP8otCgxrSebAM=; b=Xb2L7O/iiZf3JQIjpXolyhPSNY0v3DpRgT1BvV9WDgqY92/Y7oduEe9uCLkWlbYqk9 R9JVN9SGah3qPmcUzmMmdeYnea/Fk0845iILfOKHhuNuxtZBC5fRfx5ZRI+asssnMaB5 tIhJ3TJkviCKf8JzhXGAg37DDnJ1L76WTUG5xz47VhGRl6uL3koedolVZTF/vG+zIl35 xP7bKJyyY7e1eQHuvTKWpiNVU6wuLp9742Hq2AL2xSFObJPcL2kn4XCwLAXeVTf/24Sl L3z2VgiW7JxRtnhnWqVd3sQKSl0b9MMVoJEtfl1bn+TwSdQERWGUHEapXRpQEgZAJWNi iTiQ== Received: by 10.112.25.168 with SMTP id d8mr2552300lbg.62.1353768708624; Sat, 24 Nov 2012 06:51:48 -0800 (PST) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPS id p9sm3634207lbc.3.2012.11.24.06.51.47 (version=SSLv3 cipher=OTHER); Sat, 24 Nov 2012 06:51:47 -0800 (PST) Message-ID: <50B0DF04.5060001@freebsd.org> Date: Sat, 24 Nov 2012 18:51:48 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: svn commit: r243474 - head/usr.bin/cut References: <201211240415.qAO4FPaG062952@svn.freebsd.org> <50B07EB6.3010503@freebsd.org> <50B0D5B3.9000802@FreeBSD.org> In-Reply-To: <50B0D5B3.9000802@FreeBSD.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmaEBwaKuBIS2mIIBC5BNJ+/oPfwndWpmwbrW28196VREbs0624vLaFxB9vFUhjFqSmqyS1 Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 14:51:50 -0000 On 24.11.2012 18:12, Dimitry Andric wrote: >>> -is_delim(int ch) >>> +is_delim(wchar_t ch) >>> { >>> if (wflag) { >>> if (ch == ' ' || ch == '\t') >>> >> >> I can't look at the whole code at this moment, but taking standalone >> this is incorrect comparison for wchar_t. Should be L' ' and L'\t' >> instead. > > The compiler just promotes the space and tab to wchar_t, this is only > needed for the sake of consistency (and/or style). There is no binary > change if you add the L prefixes. :) In general case byte order of type promotion is not necessary equal to byte order of L'x' literals. From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 22:23:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F14C742A; Sat, 24 Nov 2012 22:23:02 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id AF4158FC08; Sat, 24 Nov 2012 22:23:01 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id AE275B0D; Sat, 24 Nov 2012 23:21:07 +0100 (CET) Date: Sat, 24 Nov 2012 23:24:08 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r243142 - in head/sys: fs/nfsclient kern sys Message-ID: <20121124222408.GH1460@garage.freebsd.pl> References: <201211160825.qAG8P6v6047507@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6lXr1rPCNTf1w0X8" Content-Disposition: inline In-Reply-To: <201211160825.qAG8P6v6047507@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 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-all@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Nov 2012 22:23:03 -0000 --6lXr1rPCNTf1w0X8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 16, 2012 at 08:25:06AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri Nov 16 08:25:06 2012 > New Revision: 243142 > URL: http://svnweb.freebsd.org/changeset/base/243142 >=20 > Log: > In pget(9), if PGET_NOTWEXIT flag is not specified, also search the > zombie list for the pid. This allows several kern.proc sysctls to > report useful information for zombies. > =20 > Hold the allproc_lock around all searches instead of relocking it. > Remove private pfind_locked() from the new nfs client code. > =20 > Requested and reviewed by: pjd > Tested by: pho > MFC after: 3 weeks [...] > @@ -364,12 +374,16 @@ pget(pid_t pid, int flags, struct proc * > struct proc *p; > int error; > =20 > + sx_slock(&allproc_lock); > if (pid <=3D PID_MAX) > - p =3D pfind(pid); > + p =3D pfind_locked(pid); > else if ((flags & PGET_NOTID) =3D=3D 0) > - p =3D pfind_tid(pid); > + p =3D pfind_tid_locked(pid); > else > p =3D NULL; > + if (p =3D=3D NULL && (flags & PGET_NOTWEXIT) =3D=3D 0) > + p =3D zpfind_locked(pid); > + sx_sunlock(&allproc_lock); > if (p =3D=3D NULL) > return (ESRCH); I think we should move zpfind_locked() under 'pid <=3D PID_MAX': sx_slock(&allproc_lock); if (pid <=3D PID_MAX) { p =3D pfind_locked(pid); if (p =3D=3D NULL && (flags & PGET_NOTWEXIT) =3D=3D 0) p =3D zpfind_locked(pid); } else if ((flags & PGET_NOTID) =3D=3D 0) { p =3D pfind_tid_locked(pid); } else { p =3D NULL; } sx_sunlock(&allproc_lock); if (p =3D=3D NULL) return (ESRCH); --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --6lXr1rPCNTf1w0X8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCxSQgACgkQForvXbEpPzQLJQCg6aP44W5Mwm8LbPnOFsKlBeKE 5vsAn3LchhKKzzO1dPpbv3uydJfVpe6P =pi1E -----END PGP SIGNATURE----- --6lXr1rPCNTf1w0X8--