From owner-svn-src-head@FreeBSD.ORG Sun Nov 18 03:00:08 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 04:51:46 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 11:22:15 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 11:47:26 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 11:54:18 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 14:05:29 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 14:05:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A5D29130 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 037C88FC18 for ; Sun, 18 Nov 2012 14:05:33 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so3871422lah.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=bBOv5WzMdDmYPQ9ForO7+taMxd3GOI4JsL+nzogYF9ypVj2ps7EDuZz1lsTRxDmFVG csB7PZQtKiVERJHBFvxjMORi4lyQj9A7tIIYEB2hz0JC7i+qkfnl2DYZ+HBtEmILI/0P 1GL6wThAQaRIjyEOTMS7nZTKnn5PpmV37abK8UrqzDaS1WyqUVlbgwXbRR0SKnEpvBJB NMZqEznEE9mv8RsEdb33Z8vliyS0Xv1fSIqBXF10JA5DCLgU8UkGY+vXe2tCEGOapQvJ V8QZnF6+hP9Uk3RGdrNR/8Yex6SZryDqRm5JOCAMoOz5pxZgzkluzvFhsMM+iUYEqRsQ 59vA== 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: ALoCoQk+miD2ESXpUqjbJvpiDeP6dlwIs1UWhFQtiT8kvceNVnoD5UTX2xpAZx012hLoQqhbL2RT 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 14:13:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CF5C75F7 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 2F9608FC16 for ; Sun, 18 Nov 2012 14:13:03 +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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 14:21:06 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 15:11:47 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 15:37:27 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 15:46:15 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 15:48:03 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 15:48:34 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 16:06:52 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 16:33:52 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 16:34:04 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 16:34:07 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 16:34:11 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 16:58:08 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 18:57:20 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 19:01:01 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 19:16:11 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 19:26:04 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 19:36:17 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 19:39:43 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 20:39:20 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 20:41:46 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 21:59:23 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 22:03:32 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 22:52:17 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sun Nov 18 23:15:22 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 00:01:57 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 00:19:27 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 01:15:33 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 01:58:21 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 05:24:34 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 05:45:19 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 08:03:33 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 08:03:41 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 08:26:18 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 08:29:54 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 08:30:30 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 08:35:59 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 11:25:21 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 11:30:09 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 11:32:56 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 11:35:56 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 15:12:45 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 16:26:29 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 18:14:03 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 19:19:04 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 19:26:20 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 19:31:54 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 19:36:19 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 20:05:28 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 20:43:19 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 20:53:51 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 20:55:29 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 21:08:54 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 21:11:42 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 21:58:15 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 22:07:53 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 22:43:46 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 22:46:18 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 22:53:58 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 22:56:51 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 23:04:23 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 23:07:38 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 23:42:47 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Mon Nov 19 23:54:05 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 01:42:18 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 01:57:21 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 02:12:02 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 03:21:26 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 04:45:04 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 05:49:18 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 06:20:50 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 07:04:03 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 07:15:45 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 07:22:08 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 07:32:14 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 08:17:36 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 08:43:14 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 09:17:07 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 10:59:03 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 10:59:42 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 12:17:57 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 12:20:59 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 12:21:56 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 12:22:40 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 12:32:19 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 12:43:12 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 13:07:48 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 13:27:10 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 13:38:41 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 13:53:07 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 13:54:39 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 14:03:10 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 14:05:46 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 14:09:38 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 14:11:27 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 14:11:47 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 14:13:59 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 14:56:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A7596C5F for ; Tue, 20 Nov 2012 14:56:46 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 04DC38FC1A for ; Tue, 20 Nov 2012 14:56:45 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so3149614lbb.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=ISmxt5Vu/LPsDxj3ysSfXnx/tIyGnrAnyuEAy/VWMqhrCNySPCzk5cr2Cm3U32CXpr duTDGy+KcyqseIGhqX8P8ZmXp6xz6cZR+KXky4i0xPJPExz2cWcOUg9sl/GyfCmQDOYg DkFkZYKDgdEUQMfQ5Fg5bewRViDkAVT9SATUYXrDp0RabX97HGNMPO2mWziwjFHmkrMv NgLWfLa3/aHGujjw+w+ey0k0uRVcDu+1C7AgM95EIOBD06lFyb8G0pu7ET31G1rHwDmb /T5FcMVA2pO5zitW3D4bzAq9wboWnd3mTMzLwcWZ+XVNVXOFOYdDXTCk3Rz0/tU+M+99 7RAg== 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: ALoCoQkyVvmLnguOsFb78phbjM7EaC6LteLi9XHFw4Gih4rg5faYGvpufLyBfMD6BKP5aQ9oQQp3 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 14:57:50 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 15:23:23 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 15:25:00 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 15:33:48 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 15:45:48 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 15:48:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A52BA483 for ; Tue, 20 Nov 2012 15:48:41 +0000 (UTC) (envelope-from lists@eitanadler.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 1350C8FC08 for ; Tue, 20 Nov 2012 15:48:40 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so3207545lbb.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=pCS6rBcr/1Q0E3+54ikwxdeapjbEA+0AH14fHGGM472X3lDhgShK2n1Nd/0mMzTDcn bn3Ef0xKtjQ8HJmHel/RkWSNt+iUxhj0KUaaD/sgB8eZ6R84IHT0atO5A1ihffeJDPhx JZ4AQIVWK1e081iPgemQZLiEQq2Ap0zl24KGxNThGxGgN7ReCRVYSopJ/kr/ImBKmC2z /gcbwcHO5SLynMhYseREutnrAkza63fqcCtpswljXJUViQLm5T6aQX+Or5kNVnTUDG+D M4pHfbJ91e3A1bLfmRdsmAurhv2th/gow/arTSFMROKKmRR8ZofPpMC/tkZEK6U0Swuu VvEw== 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: ALoCoQnOQm8W/bVM1MWzTXHPWdlOjLWbdsE/JhfFIP5/hnKZn30h5CCq+iO1TFHPVqSJLe31iYPL Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 15:58:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 01DAA718 for ; Tue, 20 Nov 2012 15:58:20 +0000 (UTC) (envelope-from lists@eitanadler.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 6933D8FC18 for ; Tue, 20 Nov 2012 15:58:19 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so3218123lbb.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=PusoNubW5ACaPF5ZK5AZNEp4PDfbG5kyWGn3r3UfpcrU97OrSzDx0nHgJM1HvwFGfs k7KmXob1A2pGzg/Fk2HRZAlEruALPH6BOMJ8KjCpG9WW6p3gBUJCUr+Kn2z4ONfJsNLO vBSfWbdqxKzFo0O9svtMEKpoh963qGl6R5gU28zFHnYehRKQxOZCA9Urxn9fEY7R/+M3 scWXINqqxoxC2gOic8OAThiS3w/+jWPSr3mOdUAf0vItRZy1jqg2bRD3v0hDApYJ6Gz6 wnA/hA9e+JmytXCK6UE7o9hVZkJSWahNYJdHkDoEPJgmlHRiTdlY0Qzq3XXNU+nmLb74 cjEQ== 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: ALoCoQmSkw7Wp8ibXxbQnahXbdAcIbzoPHO0aRNM3k5rYJkankvLBHinht0r7Wm4EEJjPjrLVSJI Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 15:59:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2EEDB8C5 for ; Tue, 20 Nov 2012 15:59:44 +0000 (UTC) (envelope-from lists@eitanadler.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 950AF8FC14 for ; Tue, 20 Nov 2012 15:59:43 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so3219681lbb.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=FKWThJZP/pV9OnYCppqwBiYQFrt65EmA1Jx/kMU59FHLcZ/X3Pn7VLsGpyuGU5supk 9ReBN+QZDoWomAlquu+LMUIzGsCzHJfl+1Ihcz0fVWVGv+HtS3v95bFKzLjSsuxpmDA+ GtAIMJCVDJZNWwPgUfyGLwZsRdCiiZsaFzXRaJCs5/VWbT5b7cEw/k47UuVTUErtooGb cnm4Urdd3GFBVivRrcYr7oBLXu8fR3G5fLOOJ615jpV44p/UMugccW71dNsWgYLFap3o FxrGQVHZJiwpsn+WS1tiaOKgYKcmetxemw2bNIvmsgMsOTFBDaSpM4fUAanh9zkqYoc2 Kx3A== 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: ALoCoQmPRNfF7YNthPZw0z+z6gkelsC++0dtcZqeY4bUCCKIw45xa757lLCbIy10tZP2h9LzN64L Cc: svn-src-head@freebsd.org, Jaakko Heinonen , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 19:23:44 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 21:02:01 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Tue Nov 20 21:26:14 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 01:38:41 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 06:26:18 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 08:04:22 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 10:38:13 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 16:56:48 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 17:05:57 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 18:12:28 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 22:04:40 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 22:26:57 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 22:37:22 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Wed Nov 21 22:40:19 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Thu Nov 22 03:54:52 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 22 04:50:42 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 22 04:53:10 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 22 08:58:31 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 22 09:13:46 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 22 09:56:14 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 22 10:24:30 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 22 10:36:11 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 22 14:40:26 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Fri Nov 23 01:41:30 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 03:24:53 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 03:34:13 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 04:28:14 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 04:30:54 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 05:32:24 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 05:33:01 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 05:38:38 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 05:52:23 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 07:58:12 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 08:22:06 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 08:44:36 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 08:47:58 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 10:14:55 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 11:21:59 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 12:12:07 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 13:43:52 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 15:31:00 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 17:22:39 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 17:27:09 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 19:20:38 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 23 20:04:40 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Sat Nov 24 02:00:30 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 02:12:25 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 02:41:18 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 02:55:06 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 04:15:26 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 06:27:47 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 07:02:31 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 08:00:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B39457EC 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 2A3B78FC15 for ; Sat, 24 Nov 2012 08:00:55 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so9259312lah.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=dBRYLssaPLuzoWdFU0jfp87CMZWGihABZ19iV+kkTEhCinLbYOVviR2xenw59aa86v Qgw56C/XVN4fCZpcWWz3Mdu2U6FqeceBH/HakXKSz5Si9ZnZpAMFP5Rv/7eiWZDPTjPv 7H9SajKAA4SBgAPy7s5fSPKAHodWW/sq78Sy7PuPMui0A9NJ4QkOhA8eWIi9TW3VUPbB YT1EbpSjo4xmkxoFPbaW/UpayUNHOlBftdmFNExn7YfNWhsgW3GsZwtKQc3O37JkTat2 y14/sQqNsFQG6qhKGG0QZp1lc8SOjb5Fm6NcTKN1QzpWigOxVKUw/818y//6hSpiWIaW 67bg== 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: ALoCoQlR57hRZuw54oLEBAYCobeNo1FStSyDYvSGE3kSzF0YoRBOo1Gq88zG44g/b23/Or9Y5tLv Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 13:07:32 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 13:10:37 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 13:11:48 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 13:14:53 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 13:16:49 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 13:23:16 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 14:11:57 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 14:51:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD3E14C7 for ; Sat, 24 Nov 2012 14:51:50 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2BD528FC08 for ; Sat, 24 Nov 2012 14:51:49 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so6843141lbb.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=XeTUvhgah0RzSOsN0He7LEhALBD/XZbPDsbcDeEY87fU0R659Ng+sK7GRYVkowrCkb c0jK2QYbizmrmR3kcdmaQTy2UqzyrTUc40Iw0qaybTKZnW9IZyq2UWxQv2r3RMTmCsCk KyvVbX8Y8ftXPEAk8grms6i9OdusmmCiWq2dzBG1UyzczRv4YuKEQM4+0Px+Z5DpYco0 Ypk4HbGdbqvfgP1AMhVDpuW9QI0iQau6V14QhMGqdh4hrfTMF+HP/XaKtf8vXWznGQC2 g8d1FbLZZROpePMut8aZAxNc1DFdDEcKX8x9LspjXaWk0w2lN4pak62BSMfoOQgk8n6k NRuw== 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: ALoCoQnnAfOvCWAbbwYu0sbO+C2yMGNdGgiF5EDkbogaK1CwnWM9dR8jQ/UOWS/pK3YOaCncELuT Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Sat Nov 24 22:23:03 2012 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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--