From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 06:24:24 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DE5B1065698; Sun, 17 Jan 2010 06:24:24 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC1D8FC13; Sun, 17 Jan 2010 06:24:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0H6OOki033393; Sun, 17 Jan 2010 06:24:24 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0H6OOkj033391; Sun, 17 Jan 2010 06:24:24 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201001170624.o0H6OOkj033391@svn.freebsd.org> From: Mitsuru IWASAKI Date: Sun, 17 Jan 2010 06:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202456 - stable/7/sys/dev/acpi_support X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 06:24:24 -0000 Author: iwasaki Date: Sun Jan 17 06:24:24 2010 New Revision: 202456 URL: http://svn.freebsd.org/changeset/base/202456 Log: MFC r201605: Update acpi_ibm syctl nodes on resume. Modified: stable/7/sys/dev/acpi_support/acpi_ibm.c Modified: stable/7/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- stable/7/sys/dev/acpi_support/acpi_ibm.c Sun Jan 17 06:24:09 2010 (r202455) +++ stable/7/sys/dev/acpi_support/acpi_ibm.c Sun Jan 17 06:24:24 2010 (r202456) @@ -252,6 +252,7 @@ ACPI_SERIAL_DECL(ibm, "ACPI IBM extras") static int acpi_ibm_probe(device_t dev); static int acpi_ibm_attach(device_t dev); static int acpi_ibm_detach(device_t dev); +static int acpi_ibm_resume(device_t dev); static void ibm_led(void *softc, int onoff); static void ibm_led_task(struct acpi_ibm_softc *sc, int pending __unused); @@ -270,6 +271,7 @@ static device_method_t acpi_ibm_methods[ DEVMETHOD(device_probe, acpi_ibm_probe), DEVMETHOD(device_attach, acpi_ibm_attach), DEVMETHOD(device_detach, acpi_ibm_detach), + DEVMETHOD(device_resume, acpi_ibm_resume), {0, 0} }; @@ -435,6 +437,34 @@ acpi_ibm_detach(device_t dev) } static int +acpi_ibm_resume(device_t dev) +{ + struct acpi_ibm_softc *sc = device_get_softc(dev); + + ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); + + ACPI_SERIAL_BEGIN(ibm); + for (int i = 0; acpi_ibm_sysctls[i].name != NULL; i++) { + int val; + + if ((acpi_ibm_sysctls[i].access & CTLFLAG_RD) == 0) { + continue; + } + + val = acpi_ibm_sysctl_get(sc, i); + + if ((acpi_ibm_sysctls[i].access & CTLFLAG_WR) == 0) { + continue; + } + + acpi_ibm_sysctl_set(sc, i, val); + } + ACPI_SERIAL_END(ibm); + + return (0); +} + +static int acpi_ibm_eventmask_set(struct acpi_ibm_softc *sc, int val) { ACPI_OBJECT arg[2]; From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 10:59:07 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFB4D1065670; Sun, 17 Jan 2010 10:59:07 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 440088FC1C; Sun, 17 Jan 2010 10:59:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HAx70s000171; Sun, 17 Jan 2010 10:59:07 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HAx7re000169; Sun, 17 Jan 2010 10:59:07 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001171059.o0HAx7re000169@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 17 Jan 2010 10:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202463 - stable/7/usr.bin/tftp X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 10:59:07 -0000 Author: gavin Date: Sun Jan 17 10:59:07 2010 New Revision: 202463 URL: http://svn.freebsd.org/changeset/base/202463 Log: Merge r201429 from head: Fix return code in the case of successful file transfer, broken in tftp.c 1.13 PR: bin/117452 Submitted by: Spencer Minear minear securecomputing.com Approved by: ed (mentor, implicit) Modified: stable/7/usr.bin/tftp/tftp.c Directory Properties: stable/7/usr.bin/tftp/ (props changed) Modified: stable/7/usr.bin/tftp/tftp.c ============================================================================== --- stable/7/usr.bin/tftp/tftp.c Sun Jan 17 10:58:59 2010 (r202462) +++ stable/7/usr.bin/tftp/tftp.c Sun Jan 17 10:59:07 2010 (r202463) @@ -143,6 +143,7 @@ send_data: (struct sockaddr *)&peer, peer.ss_len); if (n != size + 4) { warn("sendto"); + txrx_error = 1; goto abort; } read_ahead(file, convert); @@ -156,6 +157,7 @@ send_data: alarm(0); if (n < 0) { warn("recvfrom"); + txrx_error = 1; goto abort; } if (!serv.ss_family) @@ -163,6 +165,7 @@ send_data: else if (!cmpport((struct sockaddr *)&serv, (struct sockaddr *)&from)) { warn("server port mismatch"); + txrx_error = 1; goto abort; } peer = from; @@ -205,7 +208,6 @@ abort: stopclock(); if (amount > 0) printstats("Sent", amount); - txrx_error = 1; } /* @@ -261,6 +263,7 @@ send_ack: peer.ss_len) != size) { alarm(0); warn("sendto"); + txrx_error = 1; goto abort; } write_behind(file, convert); @@ -274,6 +277,7 @@ send_ack: alarm(0); if (n < 0) { warn("recvfrom"); + txrx_error = 1; goto abort; } if (!serv.ss_family) @@ -281,6 +285,7 @@ send_ack: else if (!cmpport((struct sockaddr *)&serv, (struct sockaddr *)&from)) { warn("server port mismatch"); + txrx_error = 1; goto abort; } peer = from; @@ -331,7 +336,6 @@ abort: /* ok to ack, since user */ stopclock(); if (amount > 0) printstats("Received", amount); - txrx_error = 1; } static int From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 11:10:33 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4C6B1065758; Sun, 17 Jan 2010 11:10:33 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F36138FC0A; Sun, 17 Jan 2010 11:10:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HBAWhY002945; Sun, 17 Jan 2010 11:10:32 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HBAWuR002943; Sun, 17 Jan 2010 11:10:32 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001171110.o0HBAWuR002943@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 17 Jan 2010 11:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202465 - stable/7/etc/rc.d X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 11:10:34 -0000 Author: gavin Date: Sun Jan 17 11:10:32 2010 New Revision: 202465 URL: http://svn.freebsd.org/changeset/base/202465 Log: Merge r201440, r201445 from head: Don't complain when we encounter the "cache" source, it's valid. Also fix the error message to include a line feed and not include a stray comma. Submitted by: Artis Caune artis.caune gmail.com While here, change "> /dev/stderr" for more usual ">&2" Submitted by: jilles PR: bin/121671 Approved by: ed (mentor, implicit) Modified: stable/7/etc/rc.d/nsswitch Directory Properties: stable/7/etc/rc.d/ (props changed) Modified: stable/7/etc/rc.d/nsswitch ============================================================================== --- stable/7/etc/rc.d/nsswitch Sun Jan 17 11:10:24 2010 (r202464) +++ stable/7/etc/rc.d/nsswitch Sun Jan 17 11:10:32 2010 (r202465) @@ -77,10 +77,10 @@ generate_host_conf() nis) echo "nis" >> $host_conf ;; - *=*) + cache | *=*) ;; *) - printf "Warning: unrecognized source [%s]", $_s > "/dev/stderr" + printf "Warning: unrecognized source [%s]\n" $_s >&2 ;; esac done From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 11:21:18 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8EC4106568D; Sun, 17 Jan 2010 11:21:18 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97C8F8FC1A; Sun, 17 Jan 2010 11:21:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HBLIh9005547; Sun, 17 Jan 2010 11:21:18 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HBLIBe005545; Sun, 17 Jan 2010 11:21:18 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001171121.o0HBLIBe005545@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 17 Jan 2010 11:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202467 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 11:21:18 -0000 Author: gavin Date: Sun Jan 17 11:21:18 2010 New Revision: 202467 URL: http://svn.freebsd.org/changeset/base/202467 Log: Merge r197308 from head (originally by ed): Spell Israel correctly. PR: bin/138580 Submitted by: Alexey Savartsov Approved by: ed (mentor, implicit) Modified: stable/7/usr.sbin/sysinstall/menus.c Directory Properties: stable/7/usr.sbin/sysinstall/ (props changed) Modified: stable/7/usr.sbin/sysinstall/menus.c ============================================================================== --- stable/7/usr.sbin/sysinstall/menus.c Sun Jan 17 11:20:53 2010 (r202466) +++ stable/7/usr.sbin/sysinstall/menus.c Sun Jan 17 11:21:18 2010 (r202467) @@ -638,7 +638,7 @@ DMenu MenuMediaFTP = { { " Ireland #3", "ftp3.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ie.freebsd.org" }, - { "Isreal", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, + { "Israel", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.il.freebsd.org" }, { "Italy", "ftp.it.freebsd.org", NULL, dmenuSetVariable, NULL, From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 13:24:16 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A867106568B; Sun, 17 Jan 2010 13:24:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0902C8FC12; Sun, 17 Jan 2010 13:24:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HDOF4Y034410; Sun, 17 Jan 2010 13:24:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HDOFrD034408; Sun, 17 Jan 2010 13:24:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001171324.o0HDOFrD034408@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 17 Jan 2010 13:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202471 - stable/7/sys/netinet6 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 13:24:16 -0000 Author: bz Date: Sun Jan 17 13:24:15 2010 New Revision: 202471 URL: http://svn.freebsd.org/changeset/base/202471 Log: MFC r201688: Correct a typo. Submitted by: sn_ (sn_ gmx.net) on hackers@ Modified: stable/7/sys/netinet6/icmp6.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet6/icmp6.c ============================================================================== --- stable/7/sys/netinet6/icmp6.c Sun Jan 17 13:23:53 2010 (r202470) +++ stable/7/sys/netinet6/icmp6.c Sun Jan 17 13:24:15 2010 (r202471) @@ -269,7 +269,7 @@ icmp6_error(struct mbuf *m, int type, in * we should basically suppress sending an error (RFC 2463, Section * 2.4). * We have two exceptions (the item e.2 in that section): - * - the Pakcet Too Big message can be sent for path MTU discovery. + * - the Packet Too Big message can be sent for path MTU discovery. * - the Parameter Problem Message that can be allowed an icmp6 error * in the option type field. This check has been done in * ip6_unknown_opt(), so we can just check the type and code. From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 13:28:25 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1D72106566B; Sun, 17 Jan 2010 13:28:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C05D58FC0A; Sun, 17 Jan 2010 13:28:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HDSPE3035548; Sun, 17 Jan 2010 13:28:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HDSP7S035546; Sun, 17 Jan 2010 13:28:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001171328.o0HDSP7S035546@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 17 Jan 2010 13:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202474 - stable/7/sys/modules/crypto X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 13:28:25 -0000 Author: bz Date: Sun Jan 17 13:28:25 2010 New Revision: 202474 URL: http://svn.freebsd.org/changeset/base/202474 Log: MFC r201742: After adding an SDT provider for opencrypto in r199884 we should also depend on opt_kdtrace.h for the module build. Submitted by: (Andre.Albsmeier siemens.com) Modified: stable/7/sys/modules/crypto/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/modules/crypto/Makefile ============================================================================== --- stable/7/sys/modules/crypto/Makefile Sun Jan 17 13:28:06 2010 (r202473) +++ stable/7/sys/modules/crypto/Makefile Sun Jan 17 13:28:25 2010 (r202474) @@ -16,6 +16,6 @@ SRCS += skipjack.c bf_enc.c bf_skey.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha2.c SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h -SRCS += opt_ddb.h +SRCS += opt_ddb.h opt_kdtrace.h SRCS += camellia.c camellia-api.c .include From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 13:31:48 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC006106566B; Sun, 17 Jan 2010 13:31:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99EAB8FC14; Sun, 17 Jan 2010 13:31:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HDVm8p036402; Sun, 17 Jan 2010 13:31:48 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HDVmqp036400; Sun, 17 Jan 2010 13:31:48 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001171331.o0HDVmqp036400@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 17 Jan 2010 13:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202475 - stable/7/sys/opencrypto X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 13:31:48 -0000 Author: bz Date: Sun Jan 17 13:31:48 2010 New Revision: 202475 URL: http://svn.freebsd.org/changeset/base/202475 Log: MFC r187826: While OpenBSD's crypto/ framework has sha1 and md5 implementations that can cope with a result buffer of NULL in the "Final" function, we cannot. Thus pass in a temporary buffer long enough for either md5 or sha1 results so that we do not panic. PR: bin/126468 Reviewed by: cperciva Modified: stable/7/sys/opencrypto/cryptosoft.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/opencrypto/cryptosoft.c ============================================================================== --- stable/7/sys/opencrypto/cryptosoft.c Sun Jan 17 13:28:25 2010 (r202474) +++ stable/7/sys/opencrypto/cryptosoft.c Sun Jan 17 13:31:48 2010 (r202475) @@ -429,12 +429,17 @@ swcr_authprepare(struct auth_hash *axf, break; case CRYPTO_MD5_KPDK: case CRYPTO_SHA1_KPDK: + { + /* We need a buffer that can hold an md5 and a sha1 result. */ + u_char buf[SHA1_RESULTLEN]; + sw->sw_klen = klen; bcopy(key, sw->sw_octx, klen); axf->Init(sw->sw_ictx); axf->Update(sw->sw_ictx, key, klen); - axf->Final(NULL, sw->sw_ictx); + axf->Final(buf, sw->sw_ictx); break; + } default: printf("%s: CRD_F_KEY_EXPLICIT flag given, but algorithm %d " "doesn't use keys.\n", __func__, axf->type); From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 13:36:25 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8232410656AE; Sun, 17 Jan 2010 13:36:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 570F08FC0C; Sun, 17 Jan 2010 13:36:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HDaPbB037659; Sun, 17 Jan 2010 13:36:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HDaPnl037657; Sun, 17 Jan 2010 13:36:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001171336.o0HDaPnl037657@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 17 Jan 2010 13:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202478 - stable/7/sys/opencrypto X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 13:36:25 -0000 Author: bz Date: Sun Jan 17 13:36:25 2010 New Revision: 202478 URL: http://svn.freebsd.org/changeset/base/202478 Log: MFC r201898: Add comments trying to explain what bad things happen here, i.e. how hashed MD5/SHA are implemented, abusing Final() for padding and sw_octx to transport the key from the beginning to the end. Enlightened about what was going on here by: cperciva Reviewed by: cperciva Modified: stable/7/sys/opencrypto/cryptosoft.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/opencrypto/cryptosoft.c ============================================================================== --- stable/7/sys/opencrypto/cryptosoft.c Sun Jan 17 13:36:13 2010 (r202477) +++ stable/7/sys/opencrypto/cryptosoft.c Sun Jan 17 13:36:25 2010 (r202478) @@ -430,7 +430,16 @@ swcr_authprepare(struct auth_hash *axf, case CRYPTO_MD5_KPDK: case CRYPTO_SHA1_KPDK: { - /* We need a buffer that can hold an md5 and a sha1 result. */ + /* + * We need a buffer that can hold an md5 and a sha1 result + * just to throw it away. + * What we do here is the initial part of: + * ALGO( key, keyfill, .. ) + * adding the key to sw_ictx and abusing Final() to get the + * "keyfill" padding. + * In addition we abuse the sw_octx to save the key to have + * it to be able to append it at the end in swcr_authcompute(). + */ u_char buf[SHA1_RESULTLEN]; sw->sw_klen = klen; @@ -491,9 +500,17 @@ swcr_authcompute(struct cryptodesc *crd, case CRYPTO_MD5_KPDK: case CRYPTO_SHA1_KPDK: + /* If we have no key saved, return error. */ if (sw->sw_octx == NULL) return EINVAL; + /* + * Add the trailing copy of the key (see comment in + * swcr_authprepare()) after the data: + * ALGO( .., key, algofill ) + * and let Final() do the proper, natural "algofill" + * padding. + */ axf->Update(&ctx, sw->sw_octx, sw->sw_klen); axf->Final(aalg, &ctx); break; From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 13:45:34 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0111A1065676; Sun, 17 Jan 2010 13:45:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3A458FC0C; Sun, 17 Jan 2010 13:45:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HDjXq1040091; Sun, 17 Jan 2010 13:45:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HDjXQB040088; Sun, 17 Jan 2010 13:45:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001171345.o0HDjXQB040088@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 17 Jan 2010 13:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202482 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 13:45:34 -0000 Author: bz Date: Sun Jan 17 13:45:33 2010 New Revision: 202482 URL: http://svn.freebsd.org/changeset/base/202482 Log: MFC r202116: Adjust a comment to reflect reality, as we have proper source address selection, even for IPv4, since r183571. Pointed out by: Jase Thew (bazerka beardz.net) Modified: stable/7/sys/kern/kern_jail.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_jail.c ============================================================================== --- stable/7/sys/kern/kern_jail.c Sun Jan 17 13:42:07 2010 (r202481) +++ stable/7/sys/kern/kern_jail.c Sun Jan 17 13:45:33 2010 (r202482) @@ -267,7 +267,9 @@ jail_copyin_ips(struct jail *j) * * IP addresses are all sorted but ip[0] to preserve the primary IP * address as given from userland. This special IP is used for - * unbound outgoing connections as well for "loopback" traffic. + * unbound outgoing connections as well for "loopback" traffic in case + * source address selection cannot find any more fitting address to + * connect from. */ #ifdef INET ip4 = NULL; From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 15:21:24 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7460E106566C; Sun, 17 Jan 2010 15:21:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 621918FC16; Sun, 17 Jan 2010 15:21:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HFLORR062623; Sun, 17 Jan 2010 15:21:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HFLOAX062620; Sun, 17 Jan 2010 15:21:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001171521.o0HFLOAX062620@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 17 Jan 2010 15:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202486 - stable/7/usr.sbin/traceroute X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 15:21:24 -0000 Author: bz Date: Sun Jan 17 15:21:24 2010 New Revision: 202486 URL: http://svn.freebsd.org/changeset/base/202486 Log: MFC r201806: Switch traceroute over to make use of proper in-kernel source address selection. Reviewed by: rwatson, fenner PR: kern/139454 Tested by: Frank Steinborn (steinex nognu.de) MFC r201897: Correct spelling. Submitted by: (pluknet gmail.com) Added: stable/7/usr.sbin/traceroute/findsaddr-udp.c - copied, changed from r201806, head/usr.sbin/traceroute/findsaddr-udp.c Modified: stable/7/usr.sbin/traceroute/Makefile Directory Properties: stable/7/usr.sbin/traceroute/ (props changed) Modified: stable/7/usr.sbin/traceroute/Makefile ============================================================================== --- stable/7/usr.sbin/traceroute/Makefile Sun Jan 17 15:20:34 2010 (r202485) +++ stable/7/usr.sbin/traceroute/Makefile Sun Jan 17 15:21:24 2010 (r202486) @@ -5,7 +5,7 @@ TRACEROUTE_DISTDIR?= ${.CURDIR}/../../co PROG= traceroute MAN= traceroute.8 -SRCS= as.c version.c traceroute.c ifaddrlist.c findsaddr-socket.c +SRCS= as.c version.c traceroute.c ifaddrlist.c findsaddr-udp.c BINOWN= root BINMODE=4555 CLEANFILES= version.c @@ -29,7 +29,7 @@ DPADD= ${LIBIPSEC} LDADD= -lipsec .endif -CFLAGS+= -I${TRACEROUTE_DISTDIR}/lbl +CFLAGS+= -I${TRACEROUTE_DISTDIR}/lbl -I${TRACEROUTE_DISTDIR} version.c: ${TRACEROUTE_DISTDIR}/VERSION @rm -f ${.TARGET} Copied and modified: stable/7/usr.sbin/traceroute/findsaddr-udp.c (from r201806, head/usr.sbin/traceroute/findsaddr-udp.c) ============================================================================== --- head/usr.sbin/traceroute/findsaddr-udp.c Fri Jan 8 16:59:28 2010 (r201806, copy source) +++ stable/7/usr.sbin/traceroute/findsaddr-udp.c Sun Jan 17 15:21:24 2010 (r202486) @@ -40,7 +40,7 @@ /* * Return the source address for the given destination address. * - * This makes use of proper source address seclection in the FreeBSD kernel + * This makes use of proper source address selection in the FreeBSD kernel * even taking jails into account (sys/netinet/in_pcb.c:in_pcbladdr()). * We open a UDP socket, and connect to the destination, letting the kernel * do the bind and then read the source IPv4 address using getsockname(2). From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 17 17:36:25 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0A08106566B; Sun, 17 Jan 2010 17:36:25 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD78A8FC14; Sun, 17 Jan 2010 17:36:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HHaPta095583; Sun, 17 Jan 2010 17:36:25 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HHaPoQ095580; Sun, 17 Jan 2010 17:36:25 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001171736.o0HHaPoQ095580@svn.freebsd.org> From: Christian Brueffer Date: Sun, 17 Jan 2010 17:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202494 - in stable/7: share/man/man4 usr.sbin/faithd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 17:36:26 -0000 Author: brueffer Date: Sun Jan 17 17:36:25 2010 New Revision: 202494 URL: http://svn.freebsd.org/changeset/base/202494 Log: MFC: r201870, r201889 Various language fixes. Also fixed the URL to totd, obtained from NetBSD. Modified: stable/7/share/man/man4/faith.4 stable/7/usr.sbin/faithd/faithd.8 Directory Properties: stable/7/share/man/man4/ (props changed) stable/7/usr.sbin/faithd/ (props changed) Modified: stable/7/share/man/man4/faith.4 ============================================================================== --- stable/7/share/man/man4/faith.4 Sun Jan 17 17:31:53 2010 (r202493) +++ stable/7/share/man/man4/faith.4 Sun Jan 17 17:36:25 2010 (r202494) @@ -58,15 +58,15 @@ variable in .Xr rc.conf 5 . .Pp Special action will be taken when IPv6 TCP traffic is seen on a router, -and routing table suggests to route it to +and the routing table suggests to route it to the .Nm interface. In this case, the packet will be accepted by the router, -regardless of list of IPv6 interface addresses assigned to the router. -The packet will be captured by an IPv6 TCP socket, if it has +regardless of the list of IPv6 interface addresses assigned to the router. +The packet will be captured by an IPv6 TCP socket, if it has the .Dv IN6P_FAITH -flag turned on and it has matching address/port pairs. -In result, +flag turned on and matching address/port pairs. +As a result, .Nm will let you capture IPv6 TCP traffic to some specific destination addresses. Userland programs, such as @@ -79,43 +79,42 @@ and perform application-specific address .Pp The .Dv IN6P_FAITH -flag on IPv6 TCP socket can be set by using +flag on a IPv6 TCP socket can be set by using .Xr setsockopt 2 , -with level equals to +with level .Dv IPPROTO_IPV6 -and optname equals to +and optname .Dv IPv6_FAITH . .Pp -To handle error reports by ICMPv6, some of ICMPv6 packets routed to +To handle error reports by ICMPv6, some ICMPv6 packets routed to an .Nm interface will be delivered to IPv6 TCP, as well. .Pp To understand how .Nm -can be used, take a look at source code of +can be used, take a look at the source code of .Xr faithd 8 . .Pp -As +As the .Nm -interface implements potentially dangerous operation, -great care must be taken when configuring -.Nm -interface. -To avoid possible misuse, +interface implements potentially dangerous operations, +great care must be taken when configuring it. +To avoid possible misuse, the .Xr sysctl 8 variable .Li net.inet6.ip6.keepfaith must be set to .Li 1 -prior to the use of the interface. +prior to using the interface. When .Li net.inet6.ip6.keepfaith is .Li 0 , -no packet will be captured by +no packets will be captured by the .Nm interface. .Pp +The .Nm interface is intended to be used on routers, not on hosts. .\" @@ -130,5 +129,5 @@ interface is intended to be used on rout .%O RFC3142 .Re .Sh HISTORY -The FAITH IPv6-to-IPv4 TCP relay translator was first appeared in +The FAITH IPv6-to-IPv4 TCP relay translator first appeared in the WIDE hydrangea IPv6 stack. Modified: stable/7/usr.sbin/faithd/faithd.8 ============================================================================== --- stable/7/usr.sbin/faithd/faithd.8 Sun Jan 17 17:31:53 2010 (r202493) +++ stable/7/usr.sbin/faithd/faithd.8 Sun Jan 17 17:36:25 2010 (r202494) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 1998 +.Dd January 9, 2010 .Dt FAITHD 8 .Os .Sh NAME @@ -44,20 +44,18 @@ .Sh DESCRIPTION The .Nm -utility provides IPv6-to-IPv4 TCP relay. -It must be used on an IPv4/v6 dual stack router. +utility provides IPv6-to-IPv4 TCP relaying. +It can only be used on an IPv4/v6 dual stack router. .Pp When .Nm receives .Tn TCPv6 -traffic, -.Nm -will relay the +traffic, it will relay the .Tn TCPv6 traffic to .Tn TCPv4 . -Destination for relayed +The destination for the relayed .Tn TCPv4 connection will be determined by the last 4 octets of the original .Tn IPv6 @@ -73,14 +71,14 @@ destination address is the traffic will be relayed to IPv4 destination .Li 10.1.1.1 . .Pp -To use +To use the .Nm translation service, an IPv6 address prefix must be reserved for mapping IPv4 addresses into. -Kernel must be properly configured to route all the TCP connection +The kernel must be properly configured to route all the TCP connections toward the reserved IPv6 address prefix into the .Xr faith 4 -pseudo interface, by using +pseudo interface, using the .Xr route 8 command. Also, @@ -91,7 +89,7 @@ to .Dv 1 . .Pp The router must be configured to capture all the TCP traffic -toward reserved +for the reserved .Tn IPv6 address prefix, by using .Xr route 8 @@ -101,21 +99,20 @@ commands. .Pp The .Nm -utility needs a special name-to-address translation logic, so that -hostnames gets resolved into special +utility needs special name-to-address translation logic, so that +hostnames get resolved into the special .Tn IPv6 address prefix. -For small-scale installation, use -.Xr hosts 5 . -For large-scale installation, it is useful to have +For small-scale installations, use +.Xr hosts 5 ; +For large-scale installations, it is useful to have a DNS server with special address translation support. An implementation called .Nm totd -is available -at -.Pa http://www.vermicelli.pasta.cs.uit.no/ipv6/software.html . -Make sure you do not propagate translated DNS records to normal DNS cloud, -it is highly harmful. +is available at +.Pa http://www.vermicelli.pasta.cs.uit.no/software/totd.html . +Make sure you do not propagate translated DNS records over to normal +DNS, as it can cause severe problems. .Ss Daemon mode When .Nm @@ -150,9 +147,9 @@ to you can run local daemons on the router. The .Nm -utility will invoke local daemon at +utility will invoke a local daemon at .Ar serverpath -if the destination address is local interface address, +if the destination address is a local interface address, and will perform translation to IPv4 TCP in other cases. You can also specify .Ar serverargs @@ -182,7 +179,7 @@ The .Nm utility includes special support for protocols used by .Xr ftp 1 . -When translating FTP protocol, +When translating the FTP protocol, .Nm translates network level addresses in .Li PORT/LPRT/EPRT @@ -191,8 +188,8 @@ and commands. .Pp Inactive sessions will be disconnected in 30 minutes, -to avoid stale sessions from chewing up resources. -This may be inappropriate for some of the services +to prevent stale sessions from chewing up resources. +This may be inappropriate for some services (should this be configurable?). .Ss inetd mode When @@ -200,13 +197,13 @@ When is invoked via .Xr inetd 8 , .Nm -will handle connection passed from standard input. +will handle connections passed from standard input. If the connection endpoint is in the reserved IPv6 address prefix, .Nm will relay the connection. Otherwise, .Nm -will invoke service-specific daemon like +will invoke a service-specific daemon like .Xr telnetd 8 , by using the command argument passed from .Xr inetd 8 . @@ -219,16 +216,16 @@ For example, if .Nm is invoked via .Xr inetd 8 -on FTP port, it will operate as a FTP relay. +on the FTP port, it will operate as an FTP relay. .Pp The operation mode requires special support for .Nm in .Xr inetd 8 . .Ss Access control -To prevent malicious accesses, +To prevent malicious access, .Nm -implements a simple address-based access control. +implements simple address-based access control. With .Pa /etc/faithd.conf (or @@ -239,7 +236,7 @@ specified by will avoid relaying unwanted traffic. The .Pa faithd.conf -contains directives with the following format: +configuration file contains directives of the following format: .Bl -bullet .It .Ar src Ns / Ns Ar slen Cm deny Ar dst Ns / Ns Ar dlen @@ -281,6 +278,7 @@ on error. .Sh EXAMPLES Before invoking .Nm , +the .Xr faith 4 interface has to be configured properly. .Bd -literal -offset @@ -334,12 +332,12 @@ ssh stream tcp6/faith nowait root .Ed .Pp .Xr inetd 8 -will open listening sockets with enabling kernel TCP relay support. -Whenever connection comes in, +will open listening sockets with kernel TCP relay support enabled. +Whenever a connection comes in, .Nm will be invoked by .Xr inetd 8 . -If it the connection endpoint is in the reserved IPv6 address prefix. +If the connection endpoint is in the reserved IPv6 address prefix. The .Nm utility will relay the connection. @@ -377,12 +375,12 @@ setting. .Sh HISTORY The .Nm -utility first appeared in WIDE Hydrangea IPv6 protocol stack kit. +utility first appeared in the WIDE Hydrangea IPv6 protocol stack kit. .\" .Pp IPv6 and IPsec support based on the KAME Project (http://www.kame.net/) stack was initially integrated into -.Fx 4.0 +.Fx 4.0 . .Sh SECURITY CONSIDERATIONS It is very insecure to use IP-address based authentication, for connections relayed by .Nm , @@ -392,16 +390,15 @@ Administrators are advised to limit acce .Nm using .Pa faithd.conf , -or by using IPv6 packet filters. -It is to protect +or by using IPv6 packet filters, to protect the .Nm -service from malicious parties and avoid theft of service/bandwidth. -IPv6 destination address can be limited by -carefully configuring routing entries that points to +service from malicious parties, and to avoid theft of service/bandwidth. +IPv6 destination addresses can be limited by +carefully configuring routing entries that point to .Xr faith 4 , using .Xr route 8 . -IPv6 source address needs to be filtered by using packet filters. -Documents listed in +The IPv6 source address needs to be filtered using packet filters. +The documents listed in .Sx SEE ALSO -have more discussions on this topic. +have more information on this topic. From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 18 04:08:43 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F229106566C; Mon, 18 Jan 2010 04:08:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BD2D8FC12; Mon, 18 Jan 2010 04:08:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0I48h6i043324; Mon, 18 Jan 2010 04:08:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0I48hID043316; Mon, 18 Jan 2010 04:08:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001180408.o0I48hID043316@svn.freebsd.org> From: Warner Losh Date: Mon, 18 Jan 2010 04:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202547 - in stable/7/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 04:08:43 -0000 Author: imp Date: Mon Jan 18 04:08:43 2010 New Revision: 202547 URL: http://svn.freebsd.org/changeset/base/202547 Log: MFC 202019: Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. # This is the resolution of removing it from DEFAULTS... Modified: stable/7/sys/amd64/conf/GENERIC stable/7/sys/i386/conf/GENERIC stable/7/sys/ia64/conf/GENERIC stable/7/sys/pc98/conf/GENERIC stable/7/sys/powerpc/conf/GENERIC stable/7/sys/sparc64/conf/GENERIC stable/7/sys/sun4v/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/conf/GENERIC ============================================================================== --- stable/7/sys/amd64/conf/GENERIC Mon Jan 18 03:58:23 2010 (r202546) +++ stable/7/sys/amd64/conf/GENERIC Mon Jan 18 04:08:43 2010 (r202547) @@ -66,6 +66,7 @@ options STOP_NMI # Stop CPUS using NMI options AUDIT # Security event auditing #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks +options INCLUDE_CONFIG_FILE # Include this file in kernel # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: stable/7/sys/i386/conf/GENERIC ============================================================================== --- stable/7/sys/i386/conf/GENERIC Mon Jan 18 03:58:23 2010 (r202546) +++ stable/7/sys/i386/conf/GENERIC Mon Jan 18 04:08:43 2010 (r202547) @@ -66,6 +66,7 @@ options ADAPTIVE_GIANT # Giant mutex i options STOP_NMI # Stop CPUS using NMI instead of IPI options AUDIT # Security event auditing #options KDTRACE_HOOKS # Kernel DTrace hooks +options INCLUDE_CONFIG_FILE # Include this file in kernel # To make an SMP kernel, the next two lines are needed options SMP # Symmetric MultiProcessor Kernel Modified: stable/7/sys/ia64/conf/GENERIC ============================================================================== --- stable/7/sys/ia64/conf/GENERIC Mon Jan 18 03:58:23 2010 (r202546) +++ stable/7/sys/ia64/conf/GENERIC Mon Jan 18 04:08:43 2010 (r202547) @@ -60,6 +60,7 @@ options UFS_ACL # Support for access c options UFS_DIRHASH # Hash-based directory lookup scheme options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B RT extensions options AUDIT # Security event auditing +options INCLUDE_CONFIG_FILE # Include this file in kernel # Various "busses" device firewire # FireWire bus code Modified: stable/7/sys/pc98/conf/GENERIC ============================================================================== --- stable/7/sys/pc98/conf/GENERIC Mon Jan 18 03:58:23 2010 (r202546) +++ stable/7/sys/pc98/conf/GENERIC Mon Jan 18 04:08:43 2010 (r202547) @@ -66,6 +66,7 @@ options P1003_1B_SEMAPHORES # POSIX-sty options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options AUDIT # Security event auditing +options INCLUDE_CONFIG_FILE # Include this file in kernel # To make an SMP kernel, the next two lines are needed #options SMP # Symmetric MultiProcessor Kernel Modified: stable/7/sys/powerpc/conf/GENERIC ============================================================================== --- stable/7/sys/powerpc/conf/GENERIC Mon Jan 18 03:58:23 2010 (r202546) +++ stable/7/sys/powerpc/conf/GENERIC Mon Jan 18 04:08:43 2010 (r202547) @@ -63,6 +63,7 @@ options SYSVSEM #SYSV-style semaphore options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options AUDIT # Security event auditing +options INCLUDE_CONFIG_FILE # Include this file in kernel # To make an SMP kernel, the next line is needed #options SMP # Symmetric MultiProcessor Kernel Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Mon Jan 18 03:58:23 2010 (r202546) +++ stable/7/sys/sparc64/conf/GENERIC Mon Jan 18 04:08:43 2010 (r202547) @@ -65,6 +65,7 @@ options P1003_1B_SEMAPHORES # POSIX-sty options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options ADAPTIVE_GIANT # Giant mutex is adaptive. options AUDIT # Security event auditing +options INCLUDE_CONFIG_FILE # Include this file in kernel # To make an SMP kernel, the next line is needed options SMP # Symmetric MultiProcessor Kernel Modified: stable/7/sys/sun4v/conf/GENERIC ============================================================================== --- stable/7/sys/sun4v/conf/GENERIC Mon Jan 18 03:58:23 2010 (r202546) +++ stable/7/sys/sun4v/conf/GENERIC Mon Jan 18 04:08:43 2010 (r202547) @@ -67,6 +67,7 @@ options AHC_REG_PRETTY_PRINT # Print re options ADAPTIVE_GIANT # Giant mutex is adaptive. options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options AUDIT # Security event auditing +options INCLUDE_CONFIG_FILE # Include this file in kernel # To make an SMP kernel, the next line is needed options SMP # Symmetric MultiProcessor Kernel @@ -210,4 +211,3 @@ device ccd # on most arches and in most cases 1000Hz pessimizes performance # its choice was not adequately researched options HZ=100 - From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 18 05:22:28 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E7971065670; Mon, 18 Jan 2010 05:22:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C69B8FC1A; Mon, 18 Jan 2010 05:22:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0I5MSQE060496; Mon, 18 Jan 2010 05:22:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0I5MS2O060494; Mon, 18 Jan 2010 05:22:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001180522.o0I5MS2O060494@svn.freebsd.org> From: Xin LI Date: Mon, 18 Jan 2010 05:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202550 - stable/7/usr.sbin/rtsold X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 05:22:28 -0000 Author: delphij Date: Mon Jan 18 05:22:27 2010 New Revision: 202550 URL: http://svn.freebsd.org/changeset/base/202550 Log: MFC r201520: Test index value is within the range before using it to reference array member. PR: bin/141838 Submitted by: Henning Petersen Modified: stable/7/usr.sbin/rtsold/probe.c Directory Properties: stable/7/usr.sbin/rtsold/ (props changed) Modified: stable/7/usr.sbin/rtsold/probe.c ============================================================================== --- stable/7/usr.sbin/rtsold/probe.c Mon Jan 18 05:03:40 2010 (r202549) +++ stable/7/usr.sbin/rtsold/probe.c Mon Jan 18 05:22:27 2010 (r202550) @@ -118,7 +118,7 @@ defrouter_probe(struct ifinfo *ifinfo) goto closeandend; } - for (i = 0; dr.defrouter[i].if_index && i < PRLSTSIZ; i++) { + for (i = 0; i < DRLSTSIZ && dr.defrouter[i].if_index; i++) { if (ifindex && dr.defrouter[i].if_index == ifindex) { /* sanity check */ if (!IN6_IS_ADDR_LINKLOCAL(&dr.defrouter[i].rtaddr)) { From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 18 05:24:52 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FBEC106566C; Mon, 18 Jan 2010 05:24:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5398FC1B; Mon, 18 Jan 2010 05:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0I5Oq3L061089; Mon, 18 Jan 2010 05:24:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0I5Oqd6061087; Mon, 18 Jan 2010 05:24:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001180524.o0I5Oqd6061087@svn.freebsd.org> From: Xin LI Date: Mon, 18 Jan 2010 05:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202551 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 05:24:52 -0000 Author: delphij Date: Mon Jan 18 05:24:51 2010 New Revision: 202551 URL: http://svn.freebsd.org/changeset/base/202551 Log: MFC r202129: Report ZFS filesystem version instead of the zpool version when we say it. Reported by: Yuri Pankov (on -fs@) Submitted by: delphij Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Jan 18 05:22:27 2010 (r202550) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Jan 18 05:24:51 2010 (r202551) @@ -1398,7 +1398,7 @@ void zfs_init(void) { - printf("ZFS filesystem version " SPA_VERSION_STRING "\n"); + printf("ZFS filesystem version " ZPL_VERSION_STRING "\n"); /* * Initialize znode cache, vnode ops, etc... From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 18 10:54:00 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B59C106566C; Mon, 18 Jan 2010 10:54:00 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AB2E8FC16; Mon, 18 Jan 2010 10:54:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0IAs03E037039; Mon, 18 Jan 2010 10:54:00 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0IAs0MH037037; Mon, 18 Jan 2010 10:54:00 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001181054.o0IAs0MH037037@svn.freebsd.org> From: Takahashi Yoshihiro Date: Mon, 18 Jan 2010 10:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202561 - stable/7/release X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 10:54:00 -0000 Author: nyan Date: Mon Jan 18 10:53:59 2010 New Revision: 202561 URL: http://svn.freebsd.org/changeset/base/202561 Log: MFC: revision 201391 Do kgzip to the loader on pc98, too. Now pc98's boot2 works for ELF. Modified: stable/7/release/Makefile Directory Properties: stable/7/release/ (props changed) stable/7/release/doc/ (props changed) stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/7/release/Makefile ============================================================================== --- stable/7/release/Makefile Mon Jan 18 10:53:03 2010 (r202560) +++ stable/7/release/Makefile Mon Jan 18 10:53:59 2010 (r202561) @@ -1374,7 +1374,7 @@ buildBootFloppy: @mkdir ${IMAGEDIR} @echo "Setting up /boot directory for ${FSIMAGE} floppy" @mkdir -p ${IMAGEDIR}/boot -.if ${TARGET} == "i386" +.if ${TARGET_ARCH} == "i386" @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \ ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader .else From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 18 10:56:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32987106568D; Mon, 18 Jan 2010 10:56:32 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21B8E8FC14; Mon, 18 Jan 2010 10:56:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0IAuWZ8037740; Mon, 18 Jan 2010 10:56:32 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0IAuWnU037738; Mon, 18 Jan 2010 10:56:32 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001181056.o0IAuWnU037738@svn.freebsd.org> From: Takahashi Yoshihiro Date: Mon, 18 Jan 2010 10:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202563 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 10:56:32 -0000 Author: nyan Date: Mon Jan 18 10:56:31 2010 New Revision: 202563 URL: http://svn.freebsd.org/changeset/base/202563 Log: MFC: revision 201392 Use UFS2 as default filesystem on pc98. Now pc98's boot2 works for UFS2. Modified: stable/7/usr.sbin/sysinstall/label.c Directory Properties: stable/7/usr.sbin/sysinstall/ (props changed) Modified: stable/7/usr.sbin/sysinstall/label.c ============================================================================== --- stable/7/usr.sbin/sysinstall/label.c Mon Jan 18 10:55:29 2010 (r202562) +++ stable/7/usr.sbin/sysinstall/label.c Mon Jan 18 10:56:31 2010 (r202563) @@ -384,11 +384,7 @@ new_part(PartType type, char *mpoint, Bo pi->newfs_data.newfs_ufs.acls = FALSE; pi->newfs_data.newfs_ufs.multilabel = FALSE; pi->newfs_data.newfs_ufs.softupdates = strcmp(mpoint, "/"); -#ifdef PC98 - pi->newfs_data.newfs_ufs.ufs1 = TRUE; -#else pi->newfs_data.newfs_ufs.ufs1 = FALSE; -#endif } return pi; From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 18 11:08:48 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 073EE10656B9; Mon, 18 Jan 2010 11:08:48 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D13B28FC18; Mon, 18 Jan 2010 11:08:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0IB8lYB043269; Mon, 18 Jan 2010 11:08:47 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0IB8lcP043267; Mon, 18 Jan 2010 11:08:47 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001181108.o0IB8lcP043267@svn.freebsd.org> From: Takahashi Yoshihiro Date: Mon, 18 Jan 2010 11:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202565 - stable/7/sys/pc98/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 11:08:48 -0000 Author: nyan Date: Mon Jan 18 11:08:47 2010 New Revision: 202565 URL: http://svn.freebsd.org/changeset/base/202565 Log: MFC: part of revision 201415 Re-enable more options and devices. Now kernel size problem is gone. Modified: stable/7/sys/pc98/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/pc98/conf/GENERIC ============================================================================== --- stable/7/sys/pc98/conf/GENERIC Mon Jan 18 11:03:39 2010 (r202564) +++ stable/7/sys/pc98/conf/GENERIC Mon Jan 18 11:08:47 2010 (r202565) @@ -97,9 +97,9 @@ device sym # NCR/Symbios Logic (newer device aic # PC-9801-100 device ct # host adapter using WD33C93[ABC] chip (C bus) -#device ncv # NCR 53C500 -#device nsp # Workbit Ninja SCSI-3 -#device stg # TMC 18C30/18C50 +device ncv # NCR 53C500 +device nsp # Workbit Ninja SCSI-3 +device stg # TMC 18C30/18C50 # SCSI peripherals device scbus # SCSI bus (required for SCSI) @@ -138,9 +138,9 @@ device sc # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support -#device cbb # cardbus (yenta) bridge -#device pccard # PC Card (16-bit) bus -#device cardbus # CardBus (32-bit) bus +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus # Serial (COM) ports options COM_MULTIPORT @@ -151,15 +151,15 @@ device mse #device joy # NEW Parallel port -#device ppc -#device ppbus # Parallel port bus (required) -#device lpt # Printer -#device plip # TCP/IP over parallel -#device ppi # Parallel port interface device +device ppc +device ppbus # Parallel port bus (required) +device lpt # Printer +device plip # TCP/IP over parallel +device ppi # Parallel port interface device #device vpo # Requires scbus and da # OLD Parallel port # Please stay olpt driver after ppc driver -#device olpt +device olpt # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 18 20:57:50 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA53D106566C; Mon, 18 Jan 2010 20:57:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9DB68FC1F; Mon, 18 Jan 2010 20:57:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0IKvodZ075873; Mon, 18 Jan 2010 20:57:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0IKvohY075871; Mon, 18 Jan 2010 20:57:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001182057.o0IKvohY075871@svn.freebsd.org> From: Michael Tuexen Date: Mon, 18 Jan 2010 20:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202589 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 20:57:51 -0000 Author: tuexen Date: Mon Jan 18 20:57:50 2010 New Revision: 202589 URL: http://svn.freebsd.org/changeset/base/202589 Log: MFC 198522: Bugfix: Use formula from section 7.2.3 of RFC 4960. Reported by Martin Becke. Modified: stable/7/sys/netinet/sctp_cc_functions.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/7/sys/netinet/sctp_cc_functions.c Mon Jan 18 20:34:00 2010 (r202588) +++ stable/7/sys/netinet/sctp_cc_functions.c Mon Jan 18 20:57:50 2010 (r202589) @@ -348,7 +348,7 @@ sctp_cwnd_update_after_timeout(struct sc { int old_cwnd = net->cwnd; - net->ssthresh = max(net->cwnd / 2, 2 * net->mtu); + net->ssthresh = max(net->cwnd / 2, 4 * net->mtu); net->cwnd = net->mtu; net->partial_bytes_acked = 0; From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 18 21:25:12 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B22010656A5; Mon, 18 Jan 2010 21:25:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A17E8FC15; Mon, 18 Jan 2010 21:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0ILPCeD082283; Mon, 18 Jan 2010 21:25:12 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ILPC3o082280; Mon, 18 Jan 2010 21:25:12 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001182125.o0ILPC3o082280@svn.freebsd.org> From: Michael Tuexen Date: Mon, 18 Jan 2010 21:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202592 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 21:25:12 -0000 Author: tuexen Date: Mon Jan 18 21:25:12 2010 New Revision: 202592 URL: http://svn.freebsd.org/changeset/base/202592 Log: MFC 193089: Fix a small memory leak from the nr-sack code - the mapping array was not being freed at term of association. Also get rid of the MICHAELS_EXP code. Modified: stable/7/sys/netinet/sctp_pcb.c stable/7/sys/netinet/sctputil.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/sctp_pcb.c ============================================================================== --- stable/7/sys/netinet/sctp_pcb.c Mon Jan 18 21:17:03 2010 (r202591) +++ stable/7/sys/netinet/sctp_pcb.c Mon Jan 18 21:25:12 2010 (r202592) @@ -4102,9 +4102,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; /* put it in the bucket in the vtag hash of assoc's for the system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); -#ifdef MICHAELS_EXPERIMENT - sctp_delete_from_timewait(stcb->asoc.my_vtag, inp->sctp_lport, stcb->rport); -#endif SCTP_INP_INFO_WUNLOCK(); if ((err = sctp_add_remote_addr(stcb, firstaddr, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC))) { @@ -4117,6 +4114,10 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, SCTP_FREE(asoc->mapping_array, SCTP_M_MAP); asoc->mapping_array = NULL; } + if (asoc->nr_mapping_array) { + SCTP_FREE(asoc->nr_mapping_array, SCTP_M_MAP); + asoc->nr_mapping_array = NULL; + } SCTP_DECR_ASOC_COUNT(); SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); @@ -4879,6 +4880,10 @@ sctp_free_assoc(struct sctp_inpcb *inp, SCTP_FREE(asoc->mapping_array, SCTP_M_MAP); asoc->mapping_array = NULL; } + if (asoc->nr_mapping_array) { + SCTP_FREE(asoc->nr_mapping_array, SCTP_M_MAP); + asoc->nr_mapping_array = NULL; + } /* the stream outs */ if (asoc->strmout) { SCTP_FREE(asoc->strmout, SCTP_M_STRMO); @@ -6361,21 +6366,6 @@ skip_vtag_check: } } SCTP_INP_INFO_RUNLOCK(); -#ifdef MICHAELS_EXPERIMENT - /*- - * Not found, ok to use the tag, add it to the time wait hash - * as well this will prevent two sucessive cookies from getting - * the same tag or two inits sent quickly on multi-processors. - * We only keep the tag for the life of a cookie and when we - * add this tag to the assoc hash we need to purge it from - * the t-wait hash. - */ - SCTP_INP_INFO_WLOCK(); - if (save_in_twait) - sctp_add_vtag_to_timewait(tag, TICKS_TO_SEC(inp->sctp_ep.def_cookie_life, lport, rport)); - SCTP_INP_INFO_WUNLOCK(); -#endif - return (1); } Modified: stable/7/sys/netinet/sctputil.c ============================================================================== --- stable/7/sys/netinet/sctputil.c Mon Jan 18 21:17:03 2010 (r202591) +++ stable/7/sys/netinet/sctputil.c Mon Jan 18 21:25:12 2010 (r202592) @@ -912,24 +912,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str #endif asoc->sb_send_resv = 0; if (override_tag) { -#ifdef MICHAELS_EXPERIMENT - if (sctp_is_in_timewait(override_tag, stcb->sctp_ep->sctp_lport, stcb->rport)) { - /* - * It must be in the time-wait hash, we put it there - * when we aloc one. If not the peer is playing - * games. - */ - asoc->my_vtag = override_tag; - } else { - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOMEM); -#ifdef INVARIANTS - panic("Huh is_in_timewait fails"); -#endif - return (ENOMEM); - } -#else asoc->my_vtag = override_tag; -#endif } else { asoc->my_vtag = sctp_select_a_tag(m, stcb->sctp_ep->sctp_lport, stcb->rport, 1); } @@ -1154,11 +1137,12 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->nr_mapping_array_size = SCTP_INITIAL_NR_MAPPING_ARRAY; SCTP_MALLOC(asoc->nr_mapping_array, uint8_t *, asoc->nr_mapping_array_size, SCTP_M_MAP); - /* - * if (asoc->nr_mapping_array == NULL) { SCTP_FREE(asoc->strmout, - * SCTP_M_STRMO); SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, - * SCTP_FROM_SCTPUTIL, ENOMEM); return (ENOMEM); } - */ + if (asoc->nr_mapping_array == NULL) { + SCTP_FREE(asoc->strmout, SCTP_M_STRMO); + SCTP_FREE(asoc->mapping_array, SCTP_M_MAP); + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOMEM); + return (ENOMEM); + } memset(asoc->nr_mapping_array, 0, asoc->nr_mapping_array_size); /* Now the init of the other outqueues */ From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 18 21:28:11 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAB76106568D; Mon, 18 Jan 2010 21:28:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A46B8FC0A; Mon, 18 Jan 2010 21:28:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0ILSB9R082957; Mon, 18 Jan 2010 21:28:11 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ILSB14082955; Mon, 18 Jan 2010 21:28:11 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001182128.o0ILSB14082955@svn.freebsd.org> From: Michael Tuexen Date: Mon, 18 Jan 2010 21:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202593 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 21:28:11 -0000 Author: tuexen Date: Mon Jan 18 21:28:11 2010 New Revision: 202593 URL: http://svn.freebsd.org/changeset/base/202593 Log: MFC 195894: Add a missing unlock for the inp lock when returning early from sctp_add_to_readq(). Modified: stable/7/sys/netinet/sctputil.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/sctputil.c ============================================================================== --- stable/7/sys/netinet/sctputil.c Mon Jan 18 21:25:12 2010 (r202592) +++ stable/7/sys/netinet/sctputil.c Mon Jan 18 21:28:11 2010 (r202593) @@ -4463,6 +4463,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp control->tail_mbuf = prev; } else { /* Everything got collapsed out?? */ + SCTP_INP_READ_UNLOCK(inp); return; } if (end) { From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 18 22:48:42 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1377F1065670; Mon, 18 Jan 2010 22:48:42 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED0878FC13; Mon, 18 Jan 2010 22:48:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0IMmfDE000958; Mon, 18 Jan 2010 22:48:41 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0IMmfe9000954; Mon, 18 Jan 2010 22:48:41 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201001182248.o0IMmfe9000954@svn.freebsd.org> From: Alan Cox Date: Mon, 18 Jan 2010 22:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202599 - in stable/7/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 22:48:42 -0000 Author: alc Date: Mon Jan 18 22:48:41 2010 New Revision: 202599 URL: http://svn.freebsd.org/changeset/base/202599 Log: MFC r202085 Simplify pmap_init(). Additionally, correct a harmless misbehavior on i386. Modified: stable/7/sys/amd64/amd64/pmap.c stable/7/sys/i386/i386/locore.s stable/7/sys/i386/i386/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Mon Jan 18 22:46:06 2010 (r202598) +++ stable/7/sys/amd64/amd64/pmap.c Mon Jan 18 22:48:41 2010 (r202599) @@ -629,7 +629,6 @@ pmap_page_init(vm_page_t m) void pmap_init(void) { - pd_entry_t *pd; vm_page_t mpte; vm_size_t s; int i, pv_npg; @@ -638,18 +637,13 @@ pmap_init(void) * Initialize the vm page array entries for the kernel pmap's * page table pages. */ - pd = pmap_pde(kernel_pmap, KERNBASE); for (i = 0; i < NKPT; i++) { - if ((pd[i] & (PG_PS | PG_V)) == (PG_PS | PG_V)) - continue; - KASSERT((pd[i] & PG_V) != 0, - ("pmap_init: page table page is missing")); - mpte = PHYS_TO_VM_PAGE(pd[i] & PG_FRAME); + mpte = PHYS_TO_VM_PAGE(KPTphys + (i << PAGE_SHIFT)); KASSERT(mpte >= vm_page_array && mpte < &vm_page_array[vm_page_array_size], ("pmap_init: page table page is out of range")); mpte->pindex = pmap_pde_pindex(KERNBASE) + i; - mpte->phys_addr = pd[i] & PG_FRAME; + mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); } /* Modified: stable/7/sys/i386/i386/locore.s ============================================================================== --- stable/7/sys/i386/i386/locore.s Mon Jan 18 22:46:06 2010 (r202598) +++ stable/7/sys/i386/i386/locore.s Mon Jan 18 22:48:41 2010 (r202599) @@ -104,9 +104,7 @@ IdlePTD: .long 0 /* phys addr of kernel IdlePDPT: .long 0 /* phys addr of kernel PDPT */ #endif -#ifdef SMP .globl KPTphys -#endif KPTphys: .long 0 /* phys addr of kernel page tables */ .globl proc0kstack Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Mon Jan 18 22:46:06 2010 (r202598) +++ stable/7/sys/i386/i386/pmap.c Mon Jan 18 22:48:41 2010 (r202599) @@ -205,6 +205,7 @@ int pseflag = 0; /* PG_PS or-in */ static int nkpt; vm_offset_t kernel_vm_end; extern u_int32_t KERNend; +extern u_int32_t KPTphys; #ifdef PAE pt_entry_t pg_nx; @@ -642,13 +643,13 @@ pmap_init(void) * Initialize the vm page array entries for the kernel pmap's * page table pages. */ - for (i = 0; i < nkpt; i++) { - mpte = PHYS_TO_VM_PAGE(PTD[i + KPTDI] & PG_FRAME); + for (i = 0; i < NKPT; i++) { + mpte = PHYS_TO_VM_PAGE(KPTphys + (i << PAGE_SHIFT)); KASSERT(mpte >= vm_page_array && mpte < &vm_page_array[vm_page_array_size], ("pmap_init: page table page is out of range")); mpte->pindex = i + KPTDI; - mpte->phys_addr = PTD[i + KPTDI] & PG_FRAME; + mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); } /* From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 16:58:51 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35E341065676; Tue, 19 Jan 2010 16:58:51 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24F728FC1A; Tue, 19 Jan 2010 16:58:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JGwpFo051608; Tue, 19 Jan 2010 16:58:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JGwppk051606; Tue, 19 Jan 2010 16:58:51 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001191658.o0JGwppk051606@svn.freebsd.org> From: Christian Brueffer Date: Tue, 19 Jan 2010 16:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202631 - stable/7/lib/libc/rpc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 16:58:51 -0000 Author: brueffer Date: Tue Jan 19 16:58:50 2010 New Revision: 202631 URL: http://svn.freebsd.org/changeset/base/202631 Log: MFC: r201603 Fix a double free(). Modified: stable/7/lib/libc/rpc/getnetpath.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/rpc/getnetpath.c ============================================================================== --- stable/7/lib/libc/rpc/getnetpath.c Tue Jan 19 16:51:51 2010 (r202630) +++ stable/7/lib/libc/rpc/getnetpath.c Tue Jan 19 16:58:50 2010 (r202631) @@ -101,7 +101,7 @@ setnetpath() if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) { free(np_sessionp); syslog (LOG_ERR, "rpc: failed to open " NETCONFIG); - goto failed; + return (NULL); } np_sessionp->valid = NP_VALID; np_sessionp->ncp_list = NULL; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 17:10:35 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2659E1065670; Tue, 19 Jan 2010 17:10:35 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13FC98FC1D; Tue, 19 Jan 2010 17:10:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JHAYMI054342; Tue, 19 Jan 2010 17:10:34 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JHAYdp054328; Tue, 19 Jan 2010 17:10:34 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001191710.o0JHAYdp054328@svn.freebsd.org> From: Christian Brueffer Date: Tue, 19 Jan 2010 17:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202633 - in stable/7/lib/libc: net sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 17:10:35 -0000 Author: brueffer Date: Tue Jan 19 17:10:34 2010 New Revision: 202633 URL: http://svn.freebsd.org/changeset/base/202633 Log: MFC: r202176 Miscellaneous mdoc, spelling and inconsistency fixes. Modified: stable/7/lib/libc/net/sctp_bindx.3 stable/7/lib/libc/net/sctp_connectx.3 stable/7/lib/libc/net/sctp_getaddrlen.3 stable/7/lib/libc/net/sctp_getassocid.3 stable/7/lib/libc/net/sctp_getpaddrs.3 stable/7/lib/libc/net/sctp_opt_info.3 stable/7/lib/libc/net/sctp_recvmsg.3 stable/7/lib/libc/net/sctp_send.3 stable/7/lib/libc/net/sctp_sendmsg.3 stable/7/lib/libc/sys/sctp_generic_recvmsg.2 stable/7/lib/libc/sys/sctp_generic_sendmsg.2 stable/7/lib/libc/sys/sctp_peeloff.2 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/net/sctp_bindx.3 ============================================================================== --- stable/7/lib/libc/net/sctp_bindx.3 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/net/sctp_bindx.3 Tue Jan 19 17:10:34 2010 (r202633) @@ -90,7 +90,7 @@ The call returns 0 on success and -1 upo .Sh ERRORS The .Fn sctp_bindx -can return the following errors. +function can return the following errors: .Bl -tag -width Er .It Bq Er EINVAL This value is returned if the Modified: stable/7/lib/libc/net/sctp_connectx.3 ============================================================================== --- stable/7/lib/libc/net/sctp_connectx.3 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/net/sctp_connectx.3 Tue Jan 19 17:10:34 2010 (r202633) @@ -44,7 +44,7 @@ .In sys/socket.h .In netinet/sctp.h .Ft int -.Fn sctp_connectx "int s" "struct sockaddr *" "int addrcnt" "sctp_assoc_t *" +.Fn sctp_connectx "int sd" "struct sockaddr *addrs" "int addrcnt" "sctp_assoc_t *id" .Sh DESCRIPTION The .Fn sctp_connectx @@ -75,7 +75,7 @@ the extra addresses sent in the call will be silently discarded from the association. On successful completion the provided -.Fa "sctp_assoc_t *" +.Fa id will be filled in with the association identification of the newly forming association. @@ -84,7 +84,7 @@ The call returns 0 on success and -1 upo .Sh ERRORS The .Fn sctp_connectx -can return the following errors. +function can return the following errors: .Bl -tag -width Er .It Bq Er EINVAL An address listed has an invalid family or no Modified: stable/7/lib/libc/net/sctp_getaddrlen.3 ============================================================================== --- stable/7/lib/libc/net/sctp_getaddrlen.3 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/net/sctp_getaddrlen.3 Tue Jan 19 17:10:34 2010 (r202633) @@ -76,7 +76,7 @@ system expects for the specific address .Sh ERRORS The .Fn sctp_getaddrlen -function can return the following errors. +function can return the following errors: .Bl -tag -width Er .It Bq Er EINVAL The address family specified does NOT exist. Modified: stable/7/lib/libc/net/sctp_getassocid.3 ============================================================================== --- stable/7/lib/libc/net/sctp_getassocid.3 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/net/sctp_getassocid.3 Tue Jan 19 17:10:34 2010 (r202633) @@ -58,7 +58,7 @@ The call returns the association id upon .Sh ERRORS The .Fn sctp_getassocid -function can return the following errors. +function can return the following errors: .Bl -tag -width Er .It Bq Er ENOENT The address does not have an association setup to it. Modified: stable/7/lib/libc/net/sctp_getpaddrs.3 ============================================================================== --- stable/7/lib/libc/net/sctp_getpaddrs.3 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/net/sctp_getpaddrs.3 Tue Jan 19 17:10:34 2010 (r202633) @@ -33,7 +33,7 @@ .\" $FreeBSD$ .\" .Dd December 15, 2006 -.Dt SCTP_GETPADDR 3 +.Dt SCTP_GETPADDRS 3 .Os .Sh NAME .Nm sctp_getpaddrs , @@ -64,7 +64,7 @@ array of socket addresses returned in th .Fa addrs upon success. .Pp -After the caller is through the function +After the caller is finished, the function .Fn sctp_freepaddrs or .Fn sctp_freeladdrs @@ -76,7 +76,7 @@ the number of addresses returned in .Fa addrs upon success. .Sh ERRORS -The functions can return the following errors. +The functions can return the following errors: .Bl -tag -width Er .It Bq Er EINVAL An address listed has an invalid family or no Modified: stable/7/lib/libc/net/sctp_opt_info.3 ============================================================================== --- stable/7/lib/libc/net/sctp_opt_info.3 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/net/sctp_opt_info.3 Tue Jan 19 17:10:34 2010 (r202633) @@ -45,7 +45,7 @@ .In sys/socket.h .In netinet/sctp.h .Ft int -.Fn sctp_opt_info "int s" "sctp_assoc_t" "int opt" "void *arg" "socklen_t *size" +.Fn sctp_opt_info "int sd" "sctp_assoc_t id" "int opt" "void *arg" "socklen_t *size" .Sh DESCRIPTION The .Fn sctp_opt_info @@ -90,7 +90,7 @@ socket options. .Sh ERRORS The .Fn sctp_opt_info -function can return the following errors. +function can return the following errors: .Bl -tag -width Er .It Bq Er EINVAL The argument Modified: stable/7/lib/libc/net/sctp_recvmsg.3 ============================================================================== --- stable/7/lib/libc/net/sctp_recvmsg.3 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/net/sctp_recvmsg.3 Tue Jan 19 17:10:34 2010 (r202633) @@ -160,7 +160,7 @@ struct sctp_sndrcvinfo { .Pp The .Fa sinfo->sinfo_ppid -is an opaque 32 bit value that is passed transparently +field is an opaque 32 bit value that is passed transparently through the stack from the peer endpoint. Note that the stack passes this value without regard to byte order. @@ -180,12 +180,13 @@ as soon as possible. When this flag is absent the message was delivered in order within the stream it was received. .Pp +The .Fa sinfo->sinfo_stream -is the SCTP stream that the message was received on. +field is the SCTP stream that the message was received on. Streams in SCTP are reliable (or partially reliable) flows of ordered messages. .Pp -The +The .Fa sinfo->sinfo_context field is used only if the local application set an association level context with the @@ -197,7 +198,7 @@ association. .Pp The .Fa sinfo->sinfo_ssn -will hold the stream sequence number assigned +field will hold the stream sequence number assigned by the peer endpoint if the message is .Em not unordered. @@ -205,7 +206,7 @@ For unordered messages this field holds .Pp The .Fa sinfo->sinfo_tsn -holds a transport sequence number (TSN) that was assigned +field holds a transport sequence number (TSN) that was assigned to this message by the peer endpoint. For messages that fit in or less than the path MTU this will be the only TSN assigned. @@ -215,12 +216,12 @@ message. .Pp The .Fa sinfo->sinfo_cumtsn -holds the current cumulative acknowledgment point of +field holds the current cumulative acknowledgment point of the transport association. Note that this may be larger or smaller than the TSN assigned to the message itself. .Pp -The +The .Fa sinfo->sinfo_assoc_id is the unique association identification that was assigned to the association. @@ -232,10 +233,10 @@ setting various socket options on the sp (see .Xr sctp 4 ) . .Pp -The +The .Fa sinfo->info_timetolive field is not used by -.Fa sctp_recvmsg . +.Fn sctp_recvmsg . .Sh RETURN VALUES The call returns the number of characters sent, or -1 if an error occurred. Modified: stable/7/lib/libc/net/sctp_send.3 ============================================================================== --- stable/7/lib/libc/net/sctp_send.3 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/net/sctp_send.3 Tue Jan 19 17:10:34 2010 (r202633) @@ -294,7 +294,7 @@ if an error occurred. The .Fn sctp_send system call -fail if: +fails if: .Bl -tag -width Er .It Bq Er EBADF An invalid descriptor was specified. Modified: stable/7/lib/libc/net/sctp_sendmsg.3 ============================================================================== --- stable/7/lib/libc/net/sctp_sendmsg.3 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/net/sctp_sendmsg.3 Tue Jan 19 17:10:34 2010 (r202633) @@ -271,7 +271,7 @@ if an error occurred. The .Fn sctp_sendmsg system call -fail if: +fails if: .Bl -tag -width Er .It Bq Er EBADF An invalid descriptor was specified. @@ -324,7 +324,7 @@ is not connected and is a one-to-one sty .Xr sendmsg 3 , .Xr sctp 4 .Sh BUGS -Because in the one-to-many style socket the +Because in the one-to-many style socket .Fn sctp_sendmsg or .Fn sctp_sendmsgx Modified: stable/7/lib/libc/sys/sctp_generic_recvmsg.2 ============================================================================== --- stable/7/lib/libc/sys/sctp_generic_recvmsg.2 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/sys/sctp_generic_recvmsg.2 Tue Jan 19 17:10:34 2010 (r202633) @@ -36,7 +36,7 @@ .Os .Sh NAME .Nm sctp_generic_recvmsg -.Nd receive data from a peer. +.Nd receive data from a peer .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -46,16 +46,20 @@ .Ft int .Fn sctp_generic_recvmsg "int s" "struct iovec *iov" "int iovlen" "struct sockaddr *from" "socklen_t *fromlen" "struct sctp_sndrcvinfo *sinfo" "int *msgflags" .Sh DESCRIPTION -The .Fn sctp_generic_recvmsg -is the true system calls used by the -.Fn sctp_recvmsg -function call. This call is more efficient since it is a -true system calls but it is specific to FreeBSD and -can be expected NOT to be present on any other Operating -System. For detailed useage please see either the -.Fn sctp_recvmsg -function call. +is the true system call used by the +.Xr sctp_recvmsg 3 +function call. +This call is more efficient since it is a +true system call but it is specific to +.Fx +and can be expected +.Em not +to be present on any other operating +system. +For detailed usage please see the +.Xr sctp_recvmsg 3 +function call. .Sh RETURN VALUES The call returns the number of bytes read on success and -1 upon failure. .Sh ERRORS Modified: stable/7/lib/libc/sys/sctp_generic_sendmsg.2 ============================================================================== --- stable/7/lib/libc/sys/sctp_generic_sendmsg.2 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/sys/sctp_generic_sendmsg.2 Tue Jan 19 17:10:34 2010 (r202633) @@ -37,7 +37,7 @@ .Sh NAME .Nm sctp_generic_sendmsg .Nm sctp_generic_sendmsg_iov -.Nd send data to a peer. +.Nd send data to a peer .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -50,21 +50,25 @@ .Fn sctp_generic_sendmsg_iov "int s" "struct iovec *iov" "int iovlen" "struct sockaddr *to" "struct sctp_sndrcvinfo *sinfo" "int flags" .Sh DESCRIPTION -The .Fn sctp_generic_sendmsg and .Fn sctp_generic_sendmsg_iov are the true system calls used by the -.Fn sctp_sendmsg +.Xr sctp_sendmsg 3 and -.Fn sctp_send -function calls. These are more efficient since they are -true system calls but they are specific to FreeBSD and -can be expected NOT to be present on any other Operating -System. For detailed useage please see either the -.Fn sctp_send +.Xr sctp_send 3 +function calls. +These are more efficient since they are +true system calls but they are specific to +.Fx +and can be expected +.Em not +to be present on any other operating +system. +For detailed usage please see either the +.Xr sctp_send 3 or -.Fn sctp_sendmsg +.Xr sctp_sendmsg 3 function calls. .Sh RETURN VALUES The call returns the number of bytes written on success and -1 upon failure. Modified: stable/7/lib/libc/sys/sctp_peeloff.2 ============================================================================== --- stable/7/lib/libc/sys/sctp_peeloff.2 Tue Jan 19 17:09:18 2010 (r202632) +++ stable/7/lib/libc/sys/sctp_peeloff.2 Tue Jan 19 17:10:34 2010 (r202633) @@ -36,7 +36,7 @@ .Os .Sh NAME .Nm sctp_peeloff -.Nd detach an association from a one-to-many socket to its on fd +.Nd detach an association from a one-to-many socket to its own fd .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -58,7 +58,7 @@ upon success. .Sh ERRORS The .Fn sctp_peeloff -can return the following errors. +system call can return the following errors: .Bl -tag -width Er .It Bq Er ENOTCONN The From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 19:51:54 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75923106566B; Tue, 19 Jan 2010 19:51:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 625138FC12; Tue, 19 Jan 2010 19:51:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JJpsPu090307; Tue, 19 Jan 2010 19:51:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JJpsse090299; Tue, 19 Jan 2010 19:51:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001191951.o0JJpsse090299@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 19 Jan 2010 19:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202642 - in stable/7/sys: amd64/include arm/include i386/include ia64/include powerpc/include sparc64/include sun4v/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 19:51:54 -0000 Author: kib Date: Tue Jan 19 19:51:54 2010 New Revision: 202642 URL: http://svn.freebsd.org/changeset/base/202642 Log: MFC r197933: Define architectural load bases for PIE binaries. MFC r198203: Change the load base to below 2GB for sparc64/sun4v. Modified: stable/7/sys/amd64/include/elf.h stable/7/sys/arm/include/elf.h stable/7/sys/i386/include/elf.h stable/7/sys/ia64/include/elf.h stable/7/sys/powerpc/include/elf.h stable/7/sys/sparc64/include/elf.h stable/7/sys/sun4v/include/elf.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/include/elf.h ============================================================================== --- stable/7/sys/amd64/include/elf.h Tue Jan 19 19:38:03 2010 (r202641) +++ stable/7/sys/amd64/include/elf.h Tue Jan 19 19:51:54 2010 (r202642) @@ -106,4 +106,10 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH EM_X86_64 #define ELF_TARG_VER 1 +#if __ELF_WORD_SIZE == 32 +#define ET_DYN_LOAD_ADDR 0x01001000 +#else +#define ET_DYN_LOAD_ADDR 0x01021000 +#endif + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/7/sys/arm/include/elf.h ============================================================================== --- stable/7/sys/arm/include/elf.h Tue Jan 19 19:38:03 2010 (r202641) +++ stable/7/sys/arm/include/elf.h Tue Jan 19 19:51:54 2010 (r202642) @@ -97,4 +97,7 @@ __ElfType(Auxinfo); * value. */ #define MAGIC_TRAMP_NUMBER 0x5c000003 + +#define ET_DYN_LOAD_ADDR 0x12000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/7/sys/i386/include/elf.h ============================================================================== --- stable/7/sys/i386/include/elf.h Tue Jan 19 19:38:03 2010 (r202641) +++ stable/7/sys/i386/include/elf.h Tue Jan 19 19:51:54 2010 (r202642) @@ -105,4 +105,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH EM_386 #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x01001000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/7/sys/ia64/include/elf.h ============================================================================== --- stable/7/sys/ia64/include/elf.h Tue Jan 19 19:38:03 2010 (r202641) +++ stable/7/sys/ia64/include/elf.h Tue Jan 19 19:51:54 2010 (r202642) @@ -141,4 +141,6 @@ __ElfType(Auxinfo); #define DT_IA_64_PLT_RESERVE 0x70000000 +#define ET_DYN_LOAD_ADDR 0x2500000000000000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/7/sys/powerpc/include/elf.h ============================================================================== --- stable/7/sys/powerpc/include/elf.h Tue Jan 19 19:38:03 2010 (r202641) +++ stable/7/sys/powerpc/include/elf.h Tue Jan 19 19:51:54 2010 (r202642) @@ -96,4 +96,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH EM_PPC #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x01010000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/7/sys/sparc64/include/elf.h ============================================================================== --- stable/7/sys/sparc64/include/elf.h Tue Jan 19 19:38:03 2010 (r202641) +++ stable/7/sys/sparc64/include/elf.h Tue Jan 19 19:51:54 2010 (r202642) @@ -97,4 +97,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH ELF_ARCH #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x100000 + #endif /* !_MACHINE_ELF_H_ */ Modified: stable/7/sys/sun4v/include/elf.h ============================================================================== --- stable/7/sys/sun4v/include/elf.h Tue Jan 19 19:38:03 2010 (r202641) +++ stable/7/sys/sun4v/include/elf.h Tue Jan 19 19:51:54 2010 (r202642) @@ -97,4 +97,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH ELF_ARCH #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x100000 + #endif /* !_MACHINE_ELF_H_ */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 19:54:19 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50FA41065670; Tue, 19 Jan 2010 19:54:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F5268FC19; Tue, 19 Jan 2010 19:54:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JJsJkZ090917; Tue, 19 Jan 2010 19:54:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JJsJQA090915; Tue, 19 Jan 2010 19:54:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001191954.o0JJsJQA090915@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 19 Jan 2010 19:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202644 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 19:54:19 -0000 Author: kib Date: Tue Jan 19 19:54:18 2010 New Revision: 202644 URL: http://svn.freebsd.org/changeset/base/202644 Log: MFC r197932: Do not map segments of zero length. Tested by: Mykola Dzham Modified: stable/7/sys/kern/imgact_elf.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/imgact_elf.c ============================================================================== --- stable/7/sys/kern/imgact_elf.c Tue Jan 19 19:53:05 2010 (r202643) +++ stable/7/sys/kern/imgact_elf.c Tue Jan 19 19:54:18 2010 (r202644) @@ -639,7 +639,8 @@ __elfN(load_file)(struct proc *p, const } for (i = 0, numsegs = 0; i < hdr->e_phnum; i++) { - if (phdr[i].p_type == PT_LOAD) { /* Loadable segment */ + if (phdr[i].p_type == PT_LOAD && phdr[i].p_memsz != 0) { + /* Loadable segment */ prot = 0; if (phdr[i].p_flags & PF_X) prot |= VM_PROT_EXECUTE; @@ -769,6 +770,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i for (i = 0; i < hdr->e_phnum; i++) { switch (phdr[i].p_type) { case PT_LOAD: /* Loadable segment */ + if (phdr[i].p_memsz == 0) + break; prot = 0; if (phdr[i].p_flags & PF_X) prot |= VM_PROT_EXECUTE; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 19:56:50 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90C00106566C; Tue, 19 Jan 2010 19:56:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75F468FC15; Tue, 19 Jan 2010 19:56:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JJuo7M091502; Tue, 19 Jan 2010 19:56:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JJuoZr091500; Tue, 19 Jan 2010 19:56:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001191956.o0JJuoZr091500@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 19 Jan 2010 19:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202645 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 19:56:50 -0000 Author: kib Date: Tue Jan 19 19:56:50 2010 New Revision: 202645 URL: http://svn.freebsd.org/changeset/base/202645 Log: MFC r197934: Map PIE binaries at non-zero base address. Tested by: Mykola Dzham Modified: stable/7/sys/kern/imgact_elf.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/imgact_elf.c ============================================================================== --- stable/7/sys/kern/imgact_elf.c Tue Jan 19 19:54:18 2010 (r202644) +++ stable/7/sys/kern/imgact_elf.c Tue Jan 19 19:56:50 2010 (r202645) @@ -692,7 +692,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i u_long text_size = 0, data_size = 0, total_size = 0; u_long text_addr = 0, data_addr = 0; u_long seg_size, seg_addr; - u_long addr, entry = 0, proghdr = 0; + u_long addr, et_dyn_addr, entry = 0, proghdr = 0; int32_t osrel = 0; int error = 0, i; const char *interp = NULL, *newinterp = NULL; @@ -741,9 +741,12 @@ __CONCAT(exec_, __elfN(imgact))(struct i hdr->e_ident[EI_OSABI]); return (ENOEXEC); } - if (hdr->e_type == ET_DYN && - (brand_info->flags & BI_CAN_EXEC_DYN) == 0) - return (ENOEXEC); + if (hdr->e_type == ET_DYN) { + if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0) + return (ENOEXEC); + et_dyn_addr = ET_DYN_LOAD_ADDR; + } else + et_dyn_addr = 0; sv = brand_info->sysvec; if (interp != NULL && brand_info->interp_newpath != NULL) newinterp = brand_info->interp_newpath; @@ -791,7 +794,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i if ((error = __elfN(load_section)(vmspace, imgp->object, phdr[i].p_offset, - (caddr_t)(uintptr_t)phdr[i].p_vaddr, + (caddr_t)(uintptr_t)phdr[i].p_vaddr + et_dyn_addr, phdr[i].p_memsz, phdr[i].p_filesz, prot, sv->sv_pagesize)) != 0) return (error); @@ -805,11 +808,12 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (phdr[i].p_offset == 0 && hdr->e_phoff + hdr->e_phnum * hdr->e_phentsize <= phdr[i].p_filesz) - proghdr = phdr[i].p_vaddr + hdr->e_phoff; + proghdr = phdr[i].p_vaddr + hdr->e_phoff + + et_dyn_addr; - seg_addr = trunc_page(phdr[i].p_vaddr); + seg_addr = trunc_page(phdr[i].p_vaddr + et_dyn_addr); seg_size = round_page(phdr[i].p_memsz + - phdr[i].p_vaddr - seg_addr); + phdr[i].p_vaddr + et_dyn_addr - seg_addr); /* * Is this .text or .data? We can't use @@ -831,7 +835,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i phdr[i].p_memsz)) { text_size = seg_size; text_addr = seg_addr; - entry = (u_long)hdr->e_entry; + entry = (u_long)hdr->e_entry + et_dyn_addr; } else { data_size = seg_size; data_addr = seg_addr; @@ -839,7 +843,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i total_size += seg_size; break; case PT_PHDR: /* Program header table info */ - proghdr = phdr[i].p_vaddr; + proghdr = phdr[i].p_vaddr + et_dyn_addr; break; default: break; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 19:59:04 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3768E1065670; Tue, 19 Jan 2010 19:59:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C8898FC0C; Tue, 19 Jan 2010 19:59:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JJx3H9092036; Tue, 19 Jan 2010 19:59:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JJx3mw092034; Tue, 19 Jan 2010 19:59:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001191959.o0JJx3mw092034@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 19 Jan 2010 19:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202646 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 19:59:04 -0000 Author: kib Date: Tue Jan 19 19:59:03 2010 New Revision: 202646 URL: http://svn.freebsd.org/changeset/base/202646 Log: MFC r198202: If ET_DYN binary has non-zero base address for some reason, honour it and do not relocate the binary to ET_DYN_LOAD_ADDR. Communicate the relocation bias of the mapping for interpeter-less ET_DYN binary. Tested by: Mykola Dzham Modified: stable/7/sys/kern/imgact_elf.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/imgact_elf.c ============================================================================== --- stable/7/sys/kern/imgact_elf.c Tue Jan 19 19:56:50 2010 (r202645) +++ stable/7/sys/kern/imgact_elf.c Tue Jan 19 19:59:03 2010 (r202646) @@ -692,9 +692,9 @@ __CONCAT(exec_, __elfN(imgact))(struct i u_long text_size = 0, data_size = 0, total_size = 0; u_long text_addr = 0, data_addr = 0; u_long seg_size, seg_addr; - u_long addr, et_dyn_addr, entry = 0, proghdr = 0; + u_long addr, baddr, et_dyn_addr, entry = 0, proghdr = 0; int32_t osrel = 0; - int error = 0, i; + int error = 0, i, n; const char *interp = NULL, *newinterp = NULL; Elf_Brandinfo *brand_info; char *path; @@ -724,14 +724,22 @@ __CONCAT(exec_, __elfN(imgact))(struct i phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); if (!aligned(phdr, Elf_Addr)) return (ENOEXEC); + n = 0; + baddr = 0; for (i = 0; i < hdr->e_phnum; i++) { + if (phdr[i].p_type == PT_LOAD) { + if (n == 0) + baddr = phdr[i].p_vaddr; + n++; + continue; + } if (phdr[i].p_type == PT_INTERP) { /* Path to interpreter */ if (phdr[i].p_filesz > MAXPATHLEN || phdr[i].p_offset + phdr[i].p_filesz > PAGE_SIZE) return (ENOEXEC); interp = imgp->image_header + phdr[i].p_offset; - break; + continue; } } @@ -744,7 +752,14 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (hdr->e_type == ET_DYN) { if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0) return (ENOEXEC); - et_dyn_addr = ET_DYN_LOAD_ADDR; + /* + * Honour the base load address from the dso if it is + * non-zero for some reason. + */ + if (baddr == 0) + et_dyn_addr = ET_DYN_LOAD_ADDR; + else + et_dyn_addr = 0; } else et_dyn_addr = 0; sv = brand_info->sysvec; @@ -915,7 +930,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i return (error); } } else - addr = 0; + addr = et_dyn_addr; /* * Construct auxargs table (used by the fixup routine) From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 20:05:20 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A47106566B; Tue, 19 Jan 2010 20:05:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E9368FC17; Tue, 19 Jan 2010 20:05:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JK5KBT093549; Tue, 19 Jan 2010 20:05:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JK5KUJ093547; Tue, 19 Jan 2010 20:05:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001192005.o0JK5KUJ093547@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 19 Jan 2010 20:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202647 - stable/7/libexec/rtld-elf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 20:05:20 -0000 Author: kib Date: Tue Jan 19 20:05:20 2010 New Revision: 202647 URL: http://svn.freebsd.org/changeset/base/202647 Log: MFC r197931: Calculate relocation base for the main object, and apply the relocation adjustment for all virtual addresses encoded into the ELF structures of it. Tested by: Mykola Dzham Modified: stable/7/libexec/rtld-elf/rtld.c Directory Properties: stable/7/libexec/rtld-elf/ (props changed) Modified: stable/7/libexec/rtld-elf/rtld.c ============================================================================== --- stable/7/libexec/rtld-elf/rtld.c Tue Jan 19 19:59:03 2010 (r202646) +++ stable/7/libexec/rtld-elf/rtld.c Tue Jan 19 20:05:20 2010 (r202647) @@ -474,6 +474,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ /* Initialize a fake symbol for resolving undefined weak references. */ sym_zero.st_info = ELF_ST_INFO(STB_GLOBAL, STT_NOTYPE); sym_zero.st_shndx = SHN_UNDEF; + sym_zero.st_value = -(uintptr_t)obj_main->relocbase; if (!libmap_disable) libmap_disable = (bool)lm_init(libmap_override); @@ -961,26 +962,26 @@ digest_phdr(const Elf_Phdr *phdr, int ph obj = obj_new(); for (ph = phdr; ph < phlimit; ph++) { - switch (ph->p_type) { + if (ph->p_type != PT_PHDR) + continue; - case PT_PHDR: - if ((const Elf_Phdr *)ph->p_vaddr != phdr) { - _rtld_error("%s: invalid PT_PHDR", path); - return NULL; - } - obj->phdr = (const Elf_Phdr *) ph->p_vaddr; - obj->phsize = ph->p_memsz; - break; + obj->phdr = phdr; + obj->phsize = ph->p_memsz; + obj->relocbase = (caddr_t)phdr - ph->p_vaddr; + break; + } + + for (ph = phdr; ph < phlimit; ph++) { + switch (ph->p_type) { case PT_INTERP: - obj->interp = (const char *) ph->p_vaddr; + obj->interp = (const char *)(ph->p_vaddr + obj->relocbase); break; case PT_LOAD: if (nsegs == 0) { /* First load segment */ obj->vaddrbase = trunc_page(ph->p_vaddr); - obj->mapbase = (caddr_t) obj->vaddrbase; - obj->relocbase = obj->mapbase - obj->vaddrbase; + obj->mapbase = obj->vaddrbase + obj->relocbase; obj->textsize = round_page(ph->p_vaddr + ph->p_memsz) - obj->vaddrbase; } else { /* Last load segment */ @@ -991,7 +992,7 @@ digest_phdr(const Elf_Phdr *phdr, int ph break; case PT_DYNAMIC: - obj->dynamic = (const Elf_Dyn *) ph->p_vaddr; + obj->dynamic = (const Elf_Dyn *)(ph->p_vaddr + obj->relocbase); break; case PT_TLS: @@ -999,7 +1000,7 @@ digest_phdr(const Elf_Phdr *phdr, int ph obj->tlssize = ph->p_memsz; obj->tlsalign = ph->p_align; obj->tlsinitsize = ph->p_filesz; - obj->tlsinit = (void*) ph->p_vaddr; + obj->tlsinit = (void*)(ph->p_vaddr + obj->relocbase); break; } } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 20:19:52 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 792CD106566C; Tue, 19 Jan 2010 20:19:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 642E38FC15; Tue, 19 Jan 2010 20:19:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JKJqEF096803; Tue, 19 Jan 2010 20:19:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JKJq2Y096793; Tue, 19 Jan 2010 20:19:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001192019.o0JKJq2Y096793@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 19 Jan 2010 20:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202648 - in stable/7: contrib/gcc/config lib/csu/amd64 lib/csu/arm lib/csu/i386-elf lib/csu/ia64 lib/csu/powerpc lib/csu/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 20:19:52 -0000 Author: kib Date: Tue Jan 19 20:19:52 2010 New Revision: 202648 URL: http://svn.freebsd.org/changeset/base/202648 Log: MFC r200038: Properly support -fPIE by linking PIE binaries with specially-built Scrt1.o instead of crt1.o. Separate i386-elf crt1.c into the pure assembler part and C code. Tested by: Mykola Dzham Added: stable/7/lib/csu/i386-elf/crt1_c.c - copied unchanged from r200038, head/lib/csu/i386-elf/crt1_c.c stable/7/lib/csu/i386-elf/crt1_s.S - copied unchanged from r200038, head/lib/csu/i386-elf/crt1_s.S Deleted: stable/7/lib/csu/i386-elf/crt1.c Modified: stable/7/contrib/gcc/config/freebsd-spec.h stable/7/lib/csu/amd64/Makefile stable/7/lib/csu/arm/Makefile stable/7/lib/csu/i386-elf/Makefile stable/7/lib/csu/ia64/Makefile stable/7/lib/csu/powerpc/Makefile stable/7/lib/csu/sparc64/Makefile Directory Properties: stable/7/contrib/gcc/ (props changed) stable/7/lib/csu/ (props changed) Modified: stable/7/contrib/gcc/config/freebsd-spec.h ============================================================================== --- stable/7/contrib/gcc/config/freebsd-spec.h Tue Jan 19 20:05:20 2010 (r202647) +++ stable/7/contrib/gcc/config/freebsd-spec.h Tue Jan 19 20:19:52 2010 (r202648) @@ -102,9 +102,10 @@ Boston, MA 02110-1301, USA. */ %{p:gcrt1.o%s} \ %{!p: \ %{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ + %{!profile: \ + %{pie: Scrt1.o%s;:crt1.o%s}}}}} \ crti.o%s \ - %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}" + %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" /* Provide an ENDFILE_SPEC appropriate for FreeBSD/i386. Here we tack on our own magical crtend.o file (see crtstuff.c) which provides part of @@ -112,8 +113,7 @@ Boston, MA 02110-1301, USA. */ entering `main', followed by the normal "finalizer" file, `crtn.o'. */ #define FBSD_ENDFILE_SPEC "\ - %{!shared:crtend.o%s} \ - %{shared:crtendS.o%s} \ + %{shared|pie:crtendS.o%s;:crtend.o%s} \ crtn.o%s " /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as Modified: stable/7/lib/csu/amd64/Makefile ============================================================================== --- stable/7/lib/csu/amd64/Makefile Tue Jan 19 20:05:20 2010 (r202647) +++ stable/7/lib/csu/amd64/Makefile Tue Jan 19 20:19:52 2010 (r202648) @@ -4,7 +4,7 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include CFLAGS+= -fno-omit-frame-pointer @@ -16,6 +16,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.c ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.CURDIR}/crt1.c +Scrt1.o: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.CURDIR}/crt1.c + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} Modified: stable/7/lib/csu/arm/Makefile ============================================================================== --- stable/7/lib/csu/arm/Makefile Tue Jan 19 20:05:20 2010 (r202647) +++ stable/7/lib/csu/arm/Makefile Tue Jan 19 20:19:52 2010 (r202648) @@ -4,7 +4,7 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -Wall -Wno-unused \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include @@ -16,6 +16,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.c ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +Scrt1.o: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} Modified: stable/7/lib/csu/i386-elf/Makefile ============================================================================== --- stable/7/lib/csu/i386-elf/Makefile Tue Jan 19 20:05:20 2010 (r202647) +++ stable/7/lib/csu/i386-elf/Makefile Tue Jan 19 20:19:52 2010 (r202648) @@ -2,8 +2,8 @@ .PATH: ${.CURDIR}/../common -SRCS= crt1.c crti.S crtn.S -FILES= ${SRCS:N*.h:R:S/$/.o/g} gcrt1.o +SRCS= crti.S crtn.S +FILES= ${SRCS:N*.h:R:S/$/.o/g} gcrt1.o crt1.o Scrt1.o FILESOWN= ${LIBOWN} FILESGRP= ${LIBGRP} FILESMODE= ${LIBMODE} @@ -11,9 +11,23 @@ FILESDIR= ${LIBDIR} WARNS?= 6 CFLAGS+= -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include -CLEANFILES= ${FILES} +CLEANFILES= ${FILES} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o -gcrt1.o: crt1.c - ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.CURDIR}/crt1.c +gcrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -DGCRT -c -o gcrt1_c.o ${.CURDIR}/crt1_c.c + +gcrt1.o: gcrt1_c.o crt1_s.o + ${LD} ${LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o + +crt1.o: crt1_c.o crt1_s.o + ${LD} ${LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o + objcopy --localize-symbol _start1 crt1.o + +Scrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -DGCRT -fPIC -DPIC -c -o Scrt1_c.o ${.CURDIR}/crt1_c.c + +Scrt1.o: Scrt1_c.o crt1_s.o + ${LD} ${LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o + objcopy --localize-symbol _start1 Scrt1.o .include Copied: stable/7/lib/csu/i386-elf/crt1_c.c (from r200038, head/lib/csu/i386-elf/crt1_c.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/csu/i386-elf/crt1_c.c Tue Jan 19 20:19:52 2010 (r202648, copy of r200038, head/lib/csu/i386-elf/crt1_c.c) @@ -0,0 +1,95 @@ +/* LINTLIBRARY */ +/*- + * Copyright 1996-1998 John D. Polstra. + * 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 THE AUTHOR 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$ + */ + +#ifndef lint +#ifndef __GNUC__ +#error "GCC is needed to compile this file" +#endif +#endif /* lint */ + +#include + +#include "libc_private.h" +#include "crtbrand.c" + +extern int _DYNAMIC; +#pragma weak _DYNAMIC + +typedef void (*fptr)(void); + +extern void _fini(void); +extern void _init(void); +extern int main(int, char **, char **); +extern void _start(char *, ...); + +#ifdef GCRT +extern void _mcleanup(void); +extern void monstartup(void *, void *); +extern int eprol; +extern int etext; +#endif + +char **environ; +const char *__progname = ""; + +void _start1(fptr, int, char *[]) __dead2; + +/* The entry function, C part. */ +void +_start1(fptr cleanup, int argc, char *argv[]) +{ + char **env; + const char *s; + + env = argv + argc + 1; + environ = env; + if (argc > 0 && argv[0] != NULL) { + __progname = argv[0]; + for (s = __progname; *s != '\0'; s++) + if (*s == '/') + __progname = s + 1; + } + + if (&_DYNAMIC != NULL) + atexit(cleanup); + else + _init_tls(); + +#ifdef GCRT + atexit(_mcleanup); +#endif + atexit(_fini); +#ifdef GCRT + monstartup(&eprol, &etext); +__asm__("eprol:"); +#endif + _init(); + exit( main(argc, argv, env) ); +} + +__asm(".hidden _start1"); Copied: stable/7/lib/csu/i386-elf/crt1_s.S (from r200038, head/lib/csu/i386-elf/crt1_s.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/csu/i386-elf/crt1_s.S Tue Jan 19 20:19:52 2010 (r202648, copy of r200038, head/lib/csu/i386-elf/crt1_s.S) @@ -0,0 +1,44 @@ +/*- + * Copyright 2009 Konstantin Belousov. + * 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 THE AUTHOR 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$ + */ + + + .text + .align 4 + .globl _start + .type _start, @function +_start: xorl %ebp,%ebp + pushl %ebp + movl %esp,%ebp + andl $0xfffffff0,%esp # align stack + leal 8(%ebp),%eax + pushl %eax # argv + pushl 4(%ebp) # argc + pushl %edx # rtld cleanup + call _start1 + .size _start, . - _start + + .ident "$FreeBSD$" Modified: stable/7/lib/csu/ia64/Makefile ============================================================================== --- stable/7/lib/csu/ia64/Makefile Tue Jan 19 20:05:20 2010 (r202647) +++ stable/7/lib/csu/ia64/Makefile Tue Jan 19 20:19:52 2010 (r202648) @@ -4,7 +4,7 @@ SRCS= crt1.S crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -Wall -Wno-unused \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include @@ -16,6 +16,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.S ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +Scrt1.o: crt1.S + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} Modified: stable/7/lib/csu/powerpc/Makefile ============================================================================== --- stable/7/lib/csu/powerpc/Makefile Tue Jan 19 20:05:20 2010 (r202647) +++ stable/7/lib/csu/powerpc/Makefile Tue Jan 19 20:19:52 2010 (r202648) @@ -4,7 +4,7 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -Wall -Wno-unused \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include @@ -16,6 +16,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.c ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +Scrt1.o: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} Modified: stable/7/lib/csu/sparc64/Makefile ============================================================================== --- stable/7/lib/csu/sparc64/Makefile Tue Jan 19 20:05:20 2010 (r202647) +++ stable/7/lib/csu/sparc64/Makefile Tue Jan 19 20:19:52 2010 (r202648) @@ -4,7 +4,7 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../../libc/include all: ${OBJS} @@ -14,6 +14,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.c ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +Scrt1.o: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 20:48:57 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B48AC1065692; Tue, 19 Jan 2010 20:48:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8979D8FC29; Tue, 19 Jan 2010 20:48:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JKmvHZ003618; Tue, 19 Jan 2010 20:48:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JKmvmK003615; Tue, 19 Jan 2010 20:48:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001192048.o0JKmvmK003615@svn.freebsd.org> From: John Baldwin Date: Tue, 19 Jan 2010 20:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202653 - stable/7/share/man/man9 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 20:48:57 -0000 Author: jhb Date: Tue Jan 19 20:48:57 2010 New Revision: 202653 URL: http://svn.freebsd.org/changeset/base/202653 Log: MFC 202284,202650: - Update required headers for namei() to remove . - Add RETURN VALUES and ERROR sections for namei()'s error return values. - Add a missing link to NDHASGIANT.9. Modified: stable/7/share/man/man9/Makefile stable/7/share/man/man9/namei.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/Makefile ============================================================================== --- stable/7/share/man/man9/Makefile Tue Jan 19 20:48:23 2010 (r202652) +++ stable/7/share/man/man9/Makefile Tue Jan 19 20:48:57 2010 (r202653) @@ -852,6 +852,7 @@ MLINKS+=mutex.9 mtx_assert.9 \ mutex.9 mtx_unlock_spin.9 \ mutex.9 mtx_unlock_spin_flags.9 MLINKS+=namei.9 NDFREE.9 \ + namei.9 NDHASGIANT.9 \ namei.9 NDINIT.9 MLINKS+=pbuf.9 getpbuf.9 \ pbuf.9 relpbuf.9 \ Modified: stable/7/share/man/man9/namei.9 ============================================================================== --- stable/7/share/man/man9/namei.9 Tue Jan 19 20:48:23 2010 (r202652) +++ stable/7/share/man/man9/namei.9 Tue Jan 19 20:48:57 2010 (r202653) @@ -44,7 +44,7 @@ .Nd pathname translation and lookup operations .Sh SYNOPSIS .In sys/param.h -.In sys/proc.h +.\".In sys/fcntl.h .In sys/namei.h .Ft int .Fn namei "struct nameidata *ndp" @@ -315,6 +315,34 @@ flag can be passed to the .Fn NDFREE function. .El +.Sh RETURN VALUES +If successful, +.Fn namei +will return 0, otherwise it will return an error. +.Sh ERRORS +Errors which +.Fn namei +may return: +.Bl -tag -width Er +.It Bq Er ENOTDIR +A component of the specified pathname is not a directory when a directory is +expected. +.It Bq Er ENAMETOOLONG +A component of a pathname exceeded 255 characters, +or an entire pathname exceeded 1023 characters. +.It Bq Er ENOENT +A component of the specified pathname does not exist, +or the pathname is an empty string. +.It Bq Er ACCES +An attempt is made to access a file in a way forbidden by its file access +permissions. +.It Bq Er ELOOP +Too many symbolic links were encountered in translating the pathname. +.It Bq Er EISDIR +An attempt is made to open a directory with write mode specified. +.It Bq Er EROFS +An attempt is made to modify a file or directory on a read-only file system. +.El .Sh FILES .Bl -tag .It Pa src/sys/kern/vfs_lookup.c From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 20:56:57 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91AF310656A5; Tue, 19 Jan 2010 20:56:57 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 802298FC22; Tue, 19 Jan 2010 20:56:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JKuvgx005475; Tue, 19 Jan 2010 20:56:57 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JKuvG2005473; Tue, 19 Jan 2010 20:56:57 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201001192056.o0JKuvG2005473@svn.freebsd.org> From: Fabien Thomas Date: Tue, 19 Jan 2010 20:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202655 - stable/7/lib/libpmc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 20:56:57 -0000 Author: fabient Date: Tue Jan 19 20:56:57 2010 New Revision: 202655 URL: http://svn.freebsd.org/changeset/base/202655 Log: MFC 202157: Bug fix: add a missing initializer. Modified: stable/7/lib/libpmc/libpmc.c Directory Properties: stable/7/lib/libpmc/ (props changed) Modified: stable/7/lib/libpmc/libpmc.c ============================================================================== --- stable/7/lib/libpmc/libpmc.c Tue Jan 19 20:55:57 2010 (r202654) +++ stable/7/lib/libpmc/libpmc.c Tue Jan 19 20:56:57 2010 (r202655) @@ -2507,6 +2507,7 @@ pmc_init(void) break; case PMC_CPU_INTEL_CORE: PMC_MDEP_INIT(core); + pmc_class_table[n] = &core_class_table_descr; break; case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 22:03:45 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4E6C106570A; Tue, 19 Jan 2010 22:03:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2EF18FC28; Tue, 19 Jan 2010 22:03:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JM3jJt020254; Tue, 19 Jan 2010 22:03:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JM3jQo020252; Tue, 19 Jan 2010 22:03:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001192203.o0JM3jQo020252@svn.freebsd.org> From: Marius Strobl Date: Tue, 19 Jan 2010 22:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202656 - stable/7/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 22:03:45 -0000 Author: marius Date: Tue Jan 19 22:03:45 2010 New Revision: 202656 URL: http://svn.freebsd.org/changeset/base/202656 Log: MFC: r197368 - Update the list of known-working machines based on feedback for 7.2. - Update the V440 entry regarding added support for the on-board NICs in 7.3 and 8.0. Modified: stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Jan 19 20:56:57 2010 (r202655) +++ stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Jan 19 22:03:45 2010 (r202656) @@ -464,15 +464,24 @@ &sun.blade; 2000 + &sun.blade; 2500 + + + &sun.fire; 280R &sun.fire; V210 - &sun.fire; V440 (except for the on-board NICs) + &sun.fire; V250 + &sun.fire; V440 (support for the on-board NICs first + appeared in 7.3-RELEASE and 8.0-RELEASE) + + + &sun.fire; V880 From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 19 22:09:45 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E4A21065692; Tue, 19 Jan 2010 22:09:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C3798FC0C; Tue, 19 Jan 2010 22:09:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JM9jcE021655; Tue, 19 Jan 2010 22:09:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JM9jOE021653; Tue, 19 Jan 2010 22:09:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001192209.o0JM9jOE021653@svn.freebsd.org> From: Marius Strobl Date: Tue, 19 Jan 2010 22:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202658 - stable/7/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 22:09:45 -0000 Author: marius Date: Tue Jan 19 22:09:45 2010 New Revision: 202658 URL: http://svn.freebsd.org/changeset/base/202658 Log: MFC: r202453 Update the sparc64 hardware list regarding machines that will be supported by 7.3-RELEASE. Modified: stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Jan 19 22:09:41 2010 (r202657) +++ stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Jan 19 22:09:45 2010 (r202658) @@ -466,7 +466,6 @@ &sun.blade; 2500 - &sun.fire; 280R @@ -474,13 +473,19 @@ &sun.fire; V210 + &sun.fire; V215 (support first appeared in 7.3-RELEASE) + + &sun.fire; V250 &sun.fire; V440 (support for the on-board NICs first appeared in 7.3-RELEASE and 8.0-RELEASE) - + + &sun.fire; V480 (501-6780 and 501-6790 centerplanes only, for + which support first appeared in 7.3-RELEASE) + &sun.fire; V880 @@ -499,6 +504,9 @@ &sun.fire; V240 + + &sun.fire; V245 (support first appeared in 7.3-RELEASE) + From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 20 00:46:56 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05F7C1065676; Wed, 20 Jan 2010 00:46:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF11E8FC15; Wed, 20 Jan 2010 00:46:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0K0ktVl056203; Wed, 20 Jan 2010 00:46:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0K0ktng056200; Wed, 20 Jan 2010 00:46:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001200046.o0K0ktng056200@svn.freebsd.org> From: Xin LI Date: Wed, 20 Jan 2010 00:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202663 - stable/7/usr.sbin/burncd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 00:46:56 -0000 Author: delphij Date: Wed Jan 20 00:46:55 2010 New Revision: 202663 URL: http://svn.freebsd.org/changeset/base/202663 Log: MFC r200795: Add support of using environment variable BURNCD_SPEED to specify recodring speed. PR: bin/140530 Submitted by: Alexander Best Modified: stable/7/usr.sbin/burncd/burncd.8 stable/7/usr.sbin/burncd/burncd.c Directory Properties: stable/7/usr.sbin/burncd/ (props changed) Modified: stable/7/usr.sbin/burncd/burncd.8 ============================================================================== --- stable/7/usr.sbin/burncd/burncd.8 Wed Jan 20 00:43:15 2010 (r202662) +++ stable/7/usr.sbin/burncd/burncd.8 Wed Jan 20 00:46:55 2010 (r202663) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 2005 +.Dd December 21, 2009 .Os .Dt BURNCD 8 .Sh NAME @@ -158,7 +158,11 @@ refers to stdin, and can only be used on .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : -.Bl -tag -width ".Ev CDROM" +.Bl -tag -width ".Ev BURNCD_SPEED" +.It Ev BURNCD_SPEED +The write speed to use if one is not specified with the +.Fl s +flag. .It Ev CDROM The CD device to use if one is not specified with the .Fl f Modified: stable/7/usr.sbin/burncd/burncd.c ============================================================================== --- stable/7/usr.sbin/burncd/burncd.c Wed Jan 20 00:43:15 2010 (r202662) +++ stable/7/usr.sbin/burncd/burncd.c Wed Jan 20 00:46:55 2010 (r202663) @@ -80,11 +80,13 @@ main(int argc, char **argv) int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0, preemp = 0; int nogap = 0, speed = 4 * 177, test_write = 0, force = 0; int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0; - const char *dev; + const char *dev, *env_speed; if ((dev = getenv("CDROM")) == NULL) dev = "/dev/acd0"; + env_speed = getenv("BURNCD_SPEED"); + while ((ch = getopt(argc, argv, "def:Flmnpqs:tv")) != -1) { switch (ch) { case 'd': @@ -124,12 +126,7 @@ main(int argc, char **argv) break; case 's': - if (strcasecmp("max", optarg) == 0) - speed = CDR_MAX_SPEED; - else - speed = atoi(optarg) * 177; - if (speed <= 0) - errx(EX_USAGE, "Invalid speed: %s", optarg); + env_speed = optarg; break; case 't': @@ -147,6 +144,15 @@ main(int argc, char **argv) argc -= optind; argv += optind; + if (env_speed == NULL) + ; + else if (strcasecmp("max", env_speed) == 0) + speed = CDR_MAX_SPEED; + else + speed = atoi(env_speed) * 177; + if (speed <= 0) + errx(EX_USAGE, "Invalid speed: %s", optarg); + if (argc == 0) usage(); From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 20 00:54:51 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A88F81065679; Wed, 20 Jan 2010 00:54:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97B7C8FC19; Wed, 20 Jan 2010 00:54:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0K0sppc058139; Wed, 20 Jan 2010 00:54:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0K0sp4L058137; Wed, 20 Jan 2010 00:54:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001200054.o0K0sp4L058137@svn.freebsd.org> From: Xin LI Date: Wed, 20 Jan 2010 00:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202667 - stable/7/lib/libc/stdio X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 00:54:51 -0000 Author: delphij Date: Wed Jan 20 00:54:51 2010 New Revision: 202667 URL: http://svn.freebsd.org/changeset/base/202667 Log: MFC r200799: K&R -> ANSI prototype. Modified: stable/7/lib/libc/stdio/vsscanf.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/stdio/vsscanf.c ============================================================================== --- stable/7/lib/libc/stdio/vsscanf.c Wed Jan 20 00:53:44 2010 (r202666) +++ stable/7/lib/libc/stdio/vsscanf.c Wed Jan 20 00:54:51 2010 (r202667) @@ -45,20 +45,15 @@ eofread(void *, char *, int); /* ARGSUSED */ static int -eofread(cookie, buf, len) - void *cookie; - char *buf; - int len; +eofread(void *cookie, char *buf, int len) { return (0); } int -vsscanf(str, fmt, ap) - const char * __restrict str; - const char * __restrict fmt; - __va_list ap; +vsscanf(const char * __restrict str, const char * __restrict fmt, + __va_list ap) { FILE f; struct __sFILEX ext; From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 20 14:48:58 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 751631065782; Wed, 20 Jan 2010 14:48:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63DBE8FC16; Wed, 20 Jan 2010 14:48:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0KEmw6L033229; Wed, 20 Jan 2010 14:48:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0KEmwGI033227; Wed, 20 Jan 2010 14:48:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001201448.o0KEmwGI033227@svn.freebsd.org> From: John Baldwin Date: Wed, 20 Jan 2010 14:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202701 - stable/7/share/man/man9 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 14:48:58 -0000 Author: jhb Date: Wed Jan 20 14:48:58 2010 New Revision: 202701 URL: http://svn.freebsd.org/changeset/base/202701 Log: MFC 202285: - Note that if_xname, if_dname, and if_dunit are usually initialized via if_initname(). - Document if_drv_flags and replace references to IFF_(RUNNING|OACTIVE) with references to IFF_DRV_(RUNNING|OACTIVE). Modified: stable/7/share/man/man9/ifnet.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/ifnet.9 ============================================================================== --- stable/7/share/man/man9/ifnet.9 Wed Jan 20 14:48:42 2010 (r202700) +++ stable/7/share/man/man9/ifnet.9 Wed Jan 20 14:48:58 2010 (r202701) @@ -233,11 +233,15 @@ The name of the interface, .Dq Li fxp0 or .Dq Li lo0 ) . -(Initialized by driver.) +(Initialized by driver +(usually via +.Fn if_initname ) . ) .It Va if_dname .Pq Vt "const char *" The name of the driver. -(Initialized by driver.) +(Initialized by driver +(usually via +.Fn if_initname ) . ) .It Va if_dunit .Pq Vt int A unique number assigned to each interface managed by a particular @@ -245,7 +249,9 @@ driver. Drivers may choose to set this to .Dv IF_DUNIT_NONE if a unit number is not associated with the device. -(Initialized by driver.) +(Initialized by driver +(usually via +.Fn if_initname ) . ) .It Va if_addrhead .Pq Vt "struct ifaddrhead" The head of the @@ -285,7 +291,11 @@ decremented by generic watchdog code.) .It Va if_flags .Pq Vt int Flags describing operational parameters of this interface (see below). -(Manipulated by both driver and generic code.) +(Manipulated by generic code.) +.It Va if_drv_flags +.Pq Vt int +Flags describing operational status of this interface (see below). +(Manipulated by driver.) .It Va if_capabilities .Pq Vt int Flags describing the capabilities the interface supports (see below). @@ -358,10 +368,10 @@ order to provide for some interface clas among all drivers. .Fn if_start may only be called when the -.Dv IFF_OACTIVE +.Dv IFF_DRV_OACTIVE flag is not set. (Thus, -.Dv IFF_OACTIVE +.Dv IFF_DRV_OACTIVE does not literally mean that output is active, but rather that the device's internal output queue is full.) .It Fn if_done @@ -399,7 +409,7 @@ Initialize and bring up the hardware, e.g., reset the chip and the watchdog timer and enable the receiver unit. Should mark the interface running, but not active -.Dv ( IFF_RUNNING , ~IIF_OACTIVE ) . +.Dv ( IFF_DRV_RUNNING , ~IIF_DRV_OACTIVE ) . .It Fn if_resolvemulti Check the requested multicast group membership, .Fa addr , @@ -418,6 +428,12 @@ Flags of the former kind are marked .Aq S in this table; the latter are marked .Aq D . +Flags which begin with +.Dq IFF_DRV_ +are stored in +.Va if_drv_flags ; +all other flags are stored in +.Va if_flags . .Pp The macro .Dv IFF_CANTCHANGE @@ -447,7 +463,7 @@ The interface is a loopback device. The interface is point-to-point; .Dq broadcast address is actually the address of the other end. -.It Dv IFF_RUNNING +.It Dv IFF_DRV_RUNNING .Aq D* The interface has been configured and dynamic resources were successfully allocated. @@ -466,7 +482,7 @@ This interface is in the permanently pro .It Dv IFF_ALLMULTI .Aq D* This interface is in all-multicasts mode (used by multicast routers). -.It Dv IFF_OACTIVE +.It Dv IFF_DRV_OACTIVE .Aq D* The interface's hardware output queue (if any) is full; output packets are to be queued. From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 20 15:14:20 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2188106568B; Wed, 20 Jan 2010 15:14:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0F688FC15; Wed, 20 Jan 2010 15:14:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0KFEKso038902; Wed, 20 Jan 2010 15:14:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0KFEKWP038900; Wed, 20 Jan 2010 15:14:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001201514.o0KFEKWP038900@svn.freebsd.org> From: John Baldwin Date: Wed, 20 Jan 2010 15:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202703 - stable/7/contrib/gcc/config/i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 15:14:20 -0000 Author: jhb Date: Wed Jan 20 15:14:20 2010 New Revision: 202703 URL: http://svn.freebsd.org/changeset/base/202703 Log: MFC 198344: Change gcc to assume a default machine architecture of 486 instead of 386 on "i386". Doing it in the compiler is deemed to be less fragile then attempting to provide a default -march setting via bsd.cpu.mk. FreeBSD itself has not supported plain 386 CPUs since 5.x. Modified: stable/7/contrib/gcc/config/i386/i386.c Directory Properties: stable/7/contrib/gcc/ (props changed) Modified: stable/7/contrib/gcc/config/i386/i386.c ============================================================================== --- stable/7/contrib/gcc/config/i386/i386.c Wed Jan 20 15:13:38 2010 (r202702) +++ stable/7/contrib/gcc/config/i386/i386.c Wed Jan 20 15:14:20 2010 (r202703) @@ -1614,7 +1614,7 @@ override_options (void) "-mtune=generic instead as appropriate."); if (!ix86_arch_string) - ix86_arch_string = TARGET_64BIT ? "x86-64" : "i386"; + ix86_arch_string = TARGET_64BIT ? "x86-64" : "i486"; if (!strcmp (ix86_arch_string, "generic")) error ("generic CPU can be used only for -mtune= switch"); if (!strncmp (ix86_arch_string, "generic", 7)) From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 20 18:50:50 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F4C6106566C; Wed, 20 Jan 2010 18:50:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8918FC0C; Wed, 20 Jan 2010 18:50:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0KIoo2L087026; Wed, 20 Jan 2010 18:50:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0KIood2087024; Wed, 20 Jan 2010 18:50:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001201850.o0KIood2087024@svn.freebsd.org> From: Michael Tuexen Date: Wed, 20 Jan 2010 18:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202711 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 18:50:50 -0000 Author: tuexen Date: Wed Jan 20 18:50:49 2010 New Revision: 202711 URL: http://svn.freebsd.org/changeset/base/202711 Log: MFC 199372 Do not start the iterator when there are no associations. This fixes a bug found by Irene Ruengeler. Modified: stable/7/sys/netinet/sctp_asconf.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/sctp_asconf.c ============================================================================== --- stable/7/sys/netinet/sctp_asconf.c Wed Jan 20 18:28:24 2010 (r202710) +++ stable/7/sys/netinet/sctp_asconf.c Wed Jan 20 18:50:49 2010 (r202711) @@ -3180,24 +3180,6 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * ifa = NULL; } if (ifa != NULL) { - /* add this address */ - struct sctp_asconf_iterator *asc; - struct sctp_laddr *wi; - - SCTP_MALLOC(asc, struct sctp_asconf_iterator *, - sizeof(struct sctp_asconf_iterator), - SCTP_M_ASC_IT); - if (asc == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, ENOMEM); - return (ENOMEM); - } - wi = SCTP_ZONE_GET(SCTP_BASE_INFO(ipi_zone_laddr), - struct sctp_laddr); - if (wi == NULL) { - SCTP_FREE(asc, SCTP_M_ASC_IT); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, ENOMEM); - return (ENOMEM); - } if (type == SCTP_ADD_IP_ADDRESS) { sctp_add_local_addr_ep(inp, ifa, type); } else if (type == SCTP_DEL_IP_ADDRESS) { @@ -3205,8 +3187,6 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * if (inp->laddr_count < 2) { /* can't delete the last local address */ - SCTP_FREE(asc, SCTP_M_ASC_IT); - SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), wi); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, EINVAL); return (EINVAL); } @@ -3218,27 +3198,49 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * } } } - LIST_INIT(&asc->list_of_work); - asc->cnt = 1; - SCTP_INCR_LADDR_COUNT(); - wi->ifa = ifa; - wi->action = type; - atomic_add_int(&ifa->refcount, 1); - LIST_INSERT_HEAD(&asc->list_of_work, wi, sctp_nxt_addr); - (void)sctp_initiate_iterator(sctp_asconf_iterator_ep, - sctp_asconf_iterator_stcb, - sctp_asconf_iterator_ep_end, - SCTP_PCB_ANY_FLAGS, - SCTP_PCB_ANY_FEATURES, - SCTP_ASOC_ANY_STATE, - (void *)asc, 0, - sctp_asconf_iterator_end, inp, 0); + if (!LIST_EMPTY(&inp->sctp_asoc_list)) { + /* + * There is no need to start the iterator if the inp + * has no associations. + */ + struct sctp_asconf_iterator *asc; + struct sctp_laddr *wi; + + SCTP_MALLOC(asc, struct sctp_asconf_iterator *, + sizeof(struct sctp_asconf_iterator), + SCTP_M_ASC_IT); + if (asc == NULL) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, ENOMEM); + return (ENOMEM); + } + wi = SCTP_ZONE_GET(SCTP_BASE_INFO(ipi_zone_laddr), struct sctp_laddr); + if (wi == NULL) { + SCTP_FREE(asc, SCTP_M_ASC_IT); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, ENOMEM); + return (ENOMEM); + } + LIST_INIT(&asc->list_of_work); + asc->cnt = 1; + SCTP_INCR_LADDR_COUNT(); + wi->ifa = ifa; + wi->action = type; + atomic_add_int(&ifa->refcount, 1); + LIST_INSERT_HEAD(&asc->list_of_work, wi, sctp_nxt_addr); + (void)sctp_initiate_iterator(sctp_asconf_iterator_ep, + sctp_asconf_iterator_stcb, + sctp_asconf_iterator_ep_end, + SCTP_PCB_ANY_FLAGS, + SCTP_PCB_ANY_FEATURES, + SCTP_ASOC_ANY_STATE, + (void *)asc, 0, + sctp_asconf_iterator_end, inp, 0); + } + return (0); } else { /* invalid address! */ SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_ASCONF, EADDRNOTAVAIL); return (EADDRNOTAVAIL); } - return (0); } void From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 20 18:55:41 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C007106566C; Wed, 20 Jan 2010 18:55:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19D998FC14; Wed, 20 Jan 2010 18:55:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0KIteZx088123; Wed, 20 Jan 2010 18:55:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0KIteSZ088118; Wed, 20 Jan 2010 18:55:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001201855.o0KIteSZ088118@svn.freebsd.org> From: Michael Tuexen Date: Wed, 20 Jan 2010 18:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202712 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 18:55:41 -0000 Author: tuexen Date: Wed Jan 20 18:55:40 2010 New Revision: 202712 URL: http://svn.freebsd.org/changeset/base/202712 Log: MFC 199437 Use always LIST_EMPTY instead of sometime SCTP_LIST_EMPTY, which is defined as LIST_EMPTY. Modified: stable/7/sys/netinet/sctp_auth.c stable/7/sys/netinet/sctp_os_bsd.h stable/7/sys/netinet/sctp_pcb.c stable/7/sys/netinet/sctp_usrreq.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/sctp_auth.c ============================================================================== --- stable/7/sys/netinet/sctp_auth.c Wed Jan 20 18:50:49 2010 (r202711) +++ stable/7/sys/netinet/sctp_auth.c Wed Jan 20 18:55:40 2010 (r202712) @@ -573,7 +573,7 @@ sctp_insert_sharedkey(struct sctp_keyhea return (EINVAL); /* insert into an empty list? */ - if (SCTP_LIST_EMPTY(shared_keys)) { + if (LIST_EMPTY(shared_keys)) { LIST_INSERT_HEAD(shared_keys, new_skey, next); return (0); } Modified: stable/7/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/7/sys/netinet/sctp_os_bsd.h Wed Jan 20 18:50:49 2010 (r202711) +++ stable/7/sys/netinet/sctp_os_bsd.h Wed Jan 20 18:55:40 2010 (r202712) @@ -168,7 +168,6 @@ MALLOC_DECLARE(SCTP_M_SOCKOPT); * */ #define USER_ADDR_NULL (NULL) /* FIX ME: temp */ -#define SCTP_LIST_EMPTY(list) LIST_EMPTY(list) #if defined(SCTP_DEBUG) #define SCTPDBG(level, params...) \ Modified: stable/7/sys/netinet/sctp_pcb.c ============================================================================== --- stable/7/sys/netinet/sctp_pcb.c Wed Jan 20 18:50:49 2010 (r202711) +++ stable/7/sys/netinet/sctp_pcb.c Wed Jan 20 18:55:40 2010 (r202712) @@ -452,7 +452,7 @@ sctp_remove_ifa_from_ifn(struct sctp_ifa sctp_ifap->ifn_p->num_v4--; ifn_index = sctp_ifap->ifn_p->ifn_index; - if (SCTP_LIST_EMPTY(&sctp_ifap->ifn_p->ifalist)) { + if (LIST_EMPTY(&sctp_ifap->ifn_p->ifalist)) { /* remove the ifn, possibly freeing it */ sctp_delete_ifn(sctp_ifap->ifn_p, SCTP_ADDR_LOCKED); } else { @@ -4252,7 +4252,7 @@ sctp_delete_from_timewait(uint32_t tag, int i; chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - if (!SCTP_LIST_EMPTY(chain)) { + if (!LIST_EMPTY(chain)) { LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { if ((twait_block->vtag_block[i].v_tag == tag) && @@ -4282,7 +4282,7 @@ sctp_is_in_timewait(uint32_t tag, uint16 SCTP_INP_INFO_WLOCK(); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - if (!SCTP_LIST_EMPTY(chain)) { + if (!LIST_EMPTY(chain)) { LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { if ((twait_block->vtag_block[i].v_tag == tag) && @@ -4312,7 +4312,7 @@ sctp_add_vtag_to_timewait(uint32_t tag, (void)SCTP_GETTIME_TIMEVAL(&now); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = 0; - if (!SCTP_LIST_EMPTY(chain)) { + if (!LIST_EMPTY(chain)) { /* Block(s) present, lets find space, and expire on the fly */ LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { @@ -4935,7 +4935,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, sctp_free_remote_addr(net); } - while (!SCTP_LIST_EMPTY(&asoc->sctp_restricted_addrs)) { + while (!LIST_EMPTY(&asoc->sctp_restricted_addrs)) { /* sa_ignore FREED_MEMORY */ laddr = LIST_FIRST(&asoc->sctp_restricted_addrs); sctp_remove_laddr(laddr); @@ -5581,7 +5581,7 @@ sctp_pcb_finish(void) */ for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) { chain = &SCTP_BASE_INFO(vtag_timewait)[i]; - if (!SCTP_LIST_EMPTY(chain)) { + if (!LIST_EMPTY(chain)) { prev_twait_block = NULL; LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { if (prev_twait_block) { @@ -6340,7 +6340,7 @@ skip_vtag_check: chain = &SCTP_BASE_INFO(vtag_timewait[(tag % SCTP_STACK_VTAG_HASH_SIZE))]; /* Now what about timed wait ? */ - if (!SCTP_LIST_EMPTY(chain)) { + if (!LIST_EMPTY(chain)) { /* * Block(s) are present, lets see if we have this tag in the * list Modified: stable/7/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/7/sys/netinet/sctp_usrreq.c Wed Jan 20 18:50:49 2010 (r202711) +++ stable/7/sys/netinet/sctp_usrreq.c Wed Jan 20 18:55:40 2010 (r202712) @@ -752,7 +752,7 @@ sctp_disconnect(struct socket *so) SCTP_INP_RLOCK(inp); if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - if (SCTP_LIST_EMPTY(&inp->sctp_asoc_list)) { + if (LIST_EMPTY(&inp->sctp_asoc_list)) { /* No connection */ SCTP_INP_RUNLOCK(inp); return (0); From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 20 18:58:23 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACF9C106566C; Wed, 20 Jan 2010 18:58:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B5678FC12; Wed, 20 Jan 2010 18:58:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0KIwNjo088754; Wed, 20 Jan 2010 18:58:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0KIwNKu088752; Wed, 20 Jan 2010 18:58:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001201858.o0KIwNKu088752@svn.freebsd.org> From: Michael Tuexen Date: Wed, 20 Jan 2010 18:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202713 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 18:58:23 -0000 Author: tuexen Date: Wed Jan 20 18:58:23 2010 New Revision: 202713 URL: http://svn.freebsd.org/changeset/base/202713 Log: MFC 201523 Correct usage of parenthesis. Modified: stable/7/sys/netinet/sctp_pcb.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/sctp_pcb.c ============================================================================== --- stable/7/sys/netinet/sctp_pcb.c Wed Jan 20 18:55:40 2010 (r202712) +++ stable/7/sys/netinet/sctp_pcb.c Wed Jan 20 18:58:23 2010 (r202713) @@ -5510,7 +5510,7 @@ sctp_pcb_init() /* Init the TIMEWAIT list */ for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) { - LIST_INIT(&SCTP_BASE_INFO(vtag_timewait[i])); + LIST_INIT(&SCTP_BASE_INFO(vtag_timewait)[i]); } #if defined(SCTP_USE_THREAD_BASED_ITERATOR) @@ -6338,7 +6338,7 @@ sctp_is_vtag_good(struct sctp_inpcb *inp } skip_vtag_check: - chain = &SCTP_BASE_INFO(vtag_timewait[(tag % SCTP_STACK_VTAG_HASH_SIZE))]; + chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; /* Now what about timed wait ? */ if (!LIST_EMPTY(chain)) { /* From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 20 19:11:31 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EC57106566C; Wed, 20 Jan 2010 19:11:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D12F8FC19; Wed, 20 Jan 2010 19:11:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0KJBVXv091789; Wed, 20 Jan 2010 19:11:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0KJBVPX091787; Wed, 20 Jan 2010 19:11:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001201911.o0KJBVPX091787@svn.freebsd.org> From: Michael Tuexen Date: Wed, 20 Jan 2010 19:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202714 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 19:11:31 -0000 Author: tuexen Date: Wed Jan 20 19:11:31 2010 New Revision: 202714 URL: http://svn.freebsd.org/changeset/base/202714 Log: MFC 199369 Do not hold the lock longer than necessary. Modified: stable/7/sys/netinet/sctputil.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/sctputil.c ============================================================================== --- stable/7/sys/netinet/sctputil.c Wed Jan 20 18:58:23 2010 (r202713) +++ stable/7/sys/netinet/sctputil.c Wed Jan 20 19:11:31 2010 (r202714) @@ -6074,11 +6074,11 @@ sctp_dynamic_set_primary(struct sockaddr * newest first :-0 */ LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); + SCTP_IPI_ITERATOR_WQ_UNLOCK(); sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, (struct sctp_tcb *)NULL, (struct sctp_nets *)NULL); - SCTP_IPI_ITERATOR_WQ_UNLOCK(); return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 20 19:14:34 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD9771065670; Wed, 20 Jan 2010 19:14:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABF5F8FC18; Wed, 20 Jan 2010 19:14:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0KJEYdl092500; Wed, 20 Jan 2010 19:14:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0KJEYYM092498; Wed, 20 Jan 2010 19:14:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001201914.o0KJEYYM092498@svn.freebsd.org> From: Michael Tuexen Date: Wed, 20 Jan 2010 19:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202715 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 19:14:34 -0000 Author: tuexen Date: Wed Jan 20 19:14:34 2010 New Revision: 202715 URL: http://svn.freebsd.org/changeset/base/202715 Log: MFC 199866 Use the default stack size for the iterator thread. This fixes a crash reported by Irene Ruengeler. Modified: stable/7/sys/netinet/sctp_constants.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/sctp_constants.h ============================================================================== --- stable/7/sys/netinet/sctp_constants.h Wed Jan 20 19:11:31 2010 (r202714) +++ stable/7/sys/netinet/sctp_constants.h Wed Jan 20 19:14:34 2010 (r202715) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_USE_THREAD_BASED_ITERATOR 1 #define SCTP_KTRHEAD_NAME "sctp_iterator" -#define SCTP_KTHREAD_PAGES 2 +#define SCTP_KTHREAD_PAGES 0 /* If you support Multi-VRF how big to From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 20 19:20:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A5A3106568D; Wed, 20 Jan 2010 19:20:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 191EC8FC1E; Wed, 20 Jan 2010 19:20:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0KJKVI9093888; Wed, 20 Jan 2010 19:20:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0KJKVno093886; Wed, 20 Jan 2010 19:20:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001201920.o0KJKVno093886@svn.freebsd.org> From: Michael Tuexen Date: Wed, 20 Jan 2010 19:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202716 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 19:20:32 -0000 Author: tuexen Date: Wed Jan 20 19:20:31 2010 New Revision: 202716 URL: http://svn.freebsd.org/changeset/base/202716 Log: MFC 197868 Use correct arguments when calling SCTP_RTALLOC(). Modified: stable/7/sys/netinet/sctp_output.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/sctp_output.c ============================================================================== --- stable/7/sys/netinet/sctp_output.c Wed Jan 20 19:14:34 2010 (r202715) +++ stable/7/sys/netinet/sctp_output.c Wed Jan 20 19:20:31 2010 (r202716) @@ -5397,7 +5397,7 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_free_ifa(_lsrc); } else { ip->ip_src = over_addr->sin.sin_addr; - SCTP_RTALLOC((&ro->ro_rt), vrf_id); + SCTP_RTALLOC(ro, vrf_id); } } if (port) { @@ -5729,7 +5729,7 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_free_ifa(_lsrc); } else { lsa6->sin6_addr = over_addr->sin6.sin6_addr; - SCTP_RTALLOC((&ro->ro_rt), vrf_id); + SCTP_RTALLOC(ro, vrf_id); } (void)sa6_recoverscope(sin6); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 00:39:46 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5657D1065672; Thu, 21 Jan 2010 00:39:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 461948FC18; Thu, 21 Jan 2010 00:39:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0L0dkM2065603; Thu, 21 Jan 2010 00:39:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0L0dkl3065600; Thu, 21 Jan 2010 00:39:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001210039.o0L0dkl3065600@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 21 Jan 2010 00:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202725 - stable/7/sys/dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 00:39:46 -0000 Author: yongari Date: Thu Jan 21 00:39:45 2010 New Revision: 202725 URL: http://svn.freebsd.org/changeset/base/202725 Log: MFC r202269: Add BCM5754 PHY id that is found on Dell Studio XPS 16. Modified: stable/7/sys/dev/mii/brgphy.c stable/7/sys/dev/mii/miidevs Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Thu Jan 21 00:37:14 2010 (r202724) +++ stable/7/sys/dev/mii/brgphy.c Thu Jan 21 00:39:45 2010 (r202725) @@ -133,6 +133,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5708S), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709CAX), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5722), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5784), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761), MII_PHY_DESC(BROADCOM2, BCM5906), Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Thu Jan 21 00:37:14 2010 (r202724) +++ stable/7/sys/dev/mii/miidevs Thu Jan 21 00:39:45 2010 (r202725) @@ -148,6 +148,7 @@ model xxBROADCOM_ALT1 BCM5787 0x000e BCM model xxBROADCOM_ALT1 BCM5708S 0x0015 BCM5708S 1000/2500BaseSX PHY model xxBROADCOM_ALT1 BCM5709CAX 0x002c BCM5709C(AX) 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5722 0x002d BCM5722 10/100/1000baseTX PHY +model xxBROADCOM_ALT1 BCM5784 0x003a BCM5784 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5709C 0x003c BCM5709C 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5761 0x003d BCM5761 10/100/1000baseTX PHY model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX PHY From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 00:46:55 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 118C2106566B; Thu, 21 Jan 2010 00:46:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 012618FC0C; Thu, 21 Jan 2010 00:46:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0L0ksqR067287; Thu, 21 Jan 2010 00:46:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0L0ksJp067284; Thu, 21 Jan 2010 00:46:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001210046.o0L0ksJp067284@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 21 Jan 2010 00:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202727 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 00:46:55 -0000 Author: yongari Date: Thu Jan 21 00:46:54 2010 New Revision: 202727 URL: http://svn.freebsd.org/changeset/base/202727 Log: MFC r202293: For controllers that has dual mode PHY(copper or fiber) interfaces over GMII, make sure to enable GMII. With this change brgphy(4) is used to handle the dual mode PHY. Since we still don't have a sane way to pass PHY specific information to mii(4) layer special handling is needed in brgphy(4) to determine which mode of PHY was configured in parent interface. This change make BCM5715S work. Tested by: olli Obtained from: OpenBSD PR: kern/122551 Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jan 21 00:45:12 2010 (r202726) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 21 00:46:54 2010 (r202727) @@ -901,7 +901,8 @@ bge_miibus_statchg(device_t dev) mii = device_get_softc(sc->bge_miibus); BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE); - if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || + IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII); else BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII); @@ -1782,13 +1783,20 @@ bge_blockinit(struct bge_softc *sc) if (!(BGE_IS_5705_PLUS(sc))) CSR_WRITE_4(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE); + val = BGE_MACMODE_TXDMA_ENB | BGE_MACMODE_RXDMA_ENB | + BGE_MACMODE_RX_STATS_CLEAR | BGE_MACMODE_TX_STATS_CLEAR | + BGE_MACMODE_RX_STATS_ENB | BGE_MACMODE_TX_STATS_ENB | + BGE_MACMODE_FRMHDR_DMA_ENB; + + if (sc->bge_flags & BGE_FLAG_TBI) + val |= BGE_PORTMODE_TBI; + else if (sc->bge_flags & BGE_FLAG_MII_SERDES) + val |= BGE_PORTMODE_GMII; + else + val |= BGE_PORTMODE_MII; + /* Turn on DMA, clear stats */ - CSR_WRITE_4(sc, BGE_MAC_MODE, BGE_MACMODE_TXDMA_ENB | - BGE_MACMODE_RXDMA_ENB | BGE_MACMODE_RX_STATS_CLEAR | - BGE_MACMODE_TX_STATS_CLEAR | BGE_MACMODE_RX_STATS_ENB | - BGE_MACMODE_TX_STATS_ENB | BGE_MACMODE_FRMHDR_DMA_ENB | - ((sc->bge_flags & BGE_FLAG_TBI) ? - BGE_PORTMODE_TBI : BGE_PORTMODE_MII)); + CSR_WRITE_4(sc, BGE_MAC_MODE, val); /* Set misc. local control, enable interrupts on attentions */ CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN); @@ -2849,12 +2857,14 @@ bge_attach(device_t dev) hwcfg = ntohl(hwcfg); } - if ((hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) - sc->bge_flags |= BGE_FLAG_TBI; - /* The SysKonnect SK-9D41 is a 1000baseSX card. */ - if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41) - sc->bge_flags |= BGE_FLAG_TBI; + if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == + SK_SUBSYSID_9D41 || (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) { + if (BGE_IS_5714_FAMILY(sc)) + sc->bge_flags |= BGE_FLAG_MII_SERDES; + else + sc->bge_flags |= BGE_FLAG_TBI; + } if (sc->bge_flags & BGE_FLAG_TBI) { ifmedia_init(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd, Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Thu Jan 21 00:45:12 2010 (r202726) +++ stable/7/sys/dev/bge/if_bgereg.h Thu Jan 21 00:46:54 2010 (r202727) @@ -2602,6 +2602,7 @@ struct bge_softc { #define BGE_FLAG_JUMBO 0x00000002 #define BGE_FLAG_WIRESPEED 0x00000004 #define BGE_FLAG_EADDR 0x00000008 +#define BGE_FLAG_MII_SERDES 0x00000010 #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 00:50:46 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFE21106568F; Thu, 21 Jan 2010 00:50:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFCB98FC1D; Thu, 21 Jan 2010 00:50:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0L0oktQ068271; Thu, 21 Jan 2010 00:50:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0L0okHi068269; Thu, 21 Jan 2010 00:50:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001210050.o0L0okHi068269@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 21 Jan 2010 00:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202729 - stable/7/sys/dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 00:50:47 -0000 Author: yongari Date: Thu Jan 21 00:50:46 2010 New Revision: 202729 URL: http://svn.freebsd.org/changeset/base/202729 Log: MFC r202294: Add check for fiber mode for BCM5714 PHY. This PHY supports both copper and fiber interfaces over GMII so an explicit check is necessary to know whether it was configured for fiber interface. This change make BCM5715S work. Tested by: olli PR: kern/122551 Modified: stable/7/sys/dev/mii/brgphy.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Thu Jan 21 00:49:14 2010 (r202728) +++ stable/7/sys/dev/mii/brgphy.c Thu Jan 21 00:50:46 2010 (r202729) @@ -197,6 +197,7 @@ brgphy_attach(device_t dev) case MII_OUI_xxBROADCOM: switch (bsc->mii_model) { case MII_MODEL_xxBROADCOM_BCM5706: + case MII_MODEL_xxBROADCOM_BCM5714: /* * The 5464 PHY used in the 5706 supports both copper * and fiber interfaces over GMII. Need to check the From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 00:54:22 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 634501065696; Thu, 21 Jan 2010 00:54:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 531A58FC0A; Thu, 21 Jan 2010 00:54:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0L0sMAR069147; Thu, 21 Jan 2010 00:54:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0L0sMcM069145; Thu, 21 Jan 2010 00:54:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001210054.o0L0sMcM069145@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 21 Jan 2010 00:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202731 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 00:54:22 -0000 Author: yongari Date: Thu Jan 21 00:54:22 2010 New Revision: 202731 URL: http://svn.freebsd.org/changeset/base/202731 Log: MFC r202406: Don't free mbuf chains when bge(4) fails to collapse the mbuf chains. This part of code is to enhance performance so failing the collapsing should not free TX frames. Otherwise bge(4) will unnecessarily drop frames which in turn can freeze the network connection. Reported by: Igor Sysoev (is <> rambler-co dot ru) Tested by: Igor Sysoev (is <> rambler-co dot ru) Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jan 21 00:53:00 2010 (r202730) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 21 00:54:22 2010 (r202731) @@ -3944,11 +3944,8 @@ bge_encap(struct bge_softc *sc, struct m m = m_defrag(m, M_DONTWAIT); else m = m_collapse(m, M_DONTWAIT, sc->bge_forced_collapse); - if (m == NULL) { - m_freem(*m_head); - *m_head = NULL; - return (ENOBUFS); - } + if (m == NULL) + m = *m_head; *m_head = m; } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 10:16:33 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A2871065672; Thu, 21 Jan 2010 10:16:33 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3883A8FC19; Thu, 21 Jan 2010 10:16:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0LAGXmY093927; Thu, 21 Jan 2010 10:16:33 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0LAGXtZ093924; Thu, 21 Jan 2010 10:16:33 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201001211016.o0LAGXtZ093924@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 21 Jan 2010 10:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202741 - stable/7/usr.bin/whois X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 10:16:33 -0000 Author: edwin Date: Thu Jan 21 10:16:32 2010 New Revision: 202741 URL: http://svn.freebsd.org/changeset/base/202741 Log: MFC of 202280, 202281 - Remove -d option, whois.nic.mil doesn't exist anymore. - Make whois capable of searching for IPv6 addresses just like it can do for IPv4 addresses without having to explicetly specify that the ARIN server should be used to get the initial information. PR: bin/142507, bin/128725 Submitted by: Dan Mahoney , "Matt D. Harris" domain && *--pos == '.';) *pos = '\0'; if (*domain == '\0') @@ -364,7 +364,7 @@ static void usage(void) { fprintf(stderr, - "usage: whois [-aAbdfgiIklmQrR6] [-c country-code | -h hostname] " + "usage: whois [-aAbfgiIklmQrR6] [-c country-code | -h hostname] " "[-p port] name ...\n"); exit(EX_USAGE); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 12:18:29 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 877AF1065676; Thu, 21 Jan 2010 12:18:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7453B8FC1D; Thu, 21 Jan 2010 12:18:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0LCIT7O023774; Thu, 21 Jan 2010 12:18:29 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0LCIT0I023771; Thu, 21 Jan 2010 12:18:29 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201001211218.o0LCIT0I023771@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 21 Jan 2010 12:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202745 - in stable/7/sys: conf dev/cxgb dev/cxgb/common modules/cxgb/cxgb net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 12:18:29 -0000 Author: np Date: Thu Jan 21 12:18:29 2010 New Revision: 202745 URL: http://svn.freebsd.org/changeset/base/202745 Log: MFC r194917,r194918,r197043,r197791,r199239,r199240,r200003,r201907,r202671,r202678: r194917: About to add 10Gbase-T to known media types, this is just a whitespace cleanup before that commit. No functional impact. r194918: Add 10Gbase-T to known ethernet media types Some parts of r194521 (convert the port and adapter locks from sx_locks to regular mutexes). r197043: There is no need to log anything for a ctrlq stall or restart. These are normal events. r197791: cxgb(4) updates, including: - support for the new Gen-2, BT, and LP-CR cards. - T3 firmware 7.7.0 - shared "common code" updates. r199239: The 10GBASE-T card should use an IPG of 1. Also enable the check for low power startup on this card. r199240: Don't disable the XGMAC's tx on ifconfig down. It is unnecessary and can cause false backpressure in the chip. Fix a us/ms mixup while here. r200003: T3 firmware 7.8.0 for cxgb(4) r201907: Extra parantheses to keep certain compilers happy. r202671: Fix for a cxgb(4) panic. cxgb_ioctl can be called by the IP and IPv6 layers with non-sleepable locks held. Don't (potentially) sleep in those situations. r202678: Complain if freelist queue sizes are significantly less than desired. Added: stable/7/sys/dev/cxgb/common/cxgb_aq100x.c - copied, changed from r197791, head/sys/dev/cxgb/common/cxgb_aq100x.c Modified: stable/7/sys/conf/files stable/7/sys/dev/cxgb/common/cxgb_ael1002.c stable/7/sys/dev/cxgb/common/cxgb_common.h stable/7/sys/dev/cxgb/common/cxgb_mv88e1xxx.c stable/7/sys/dev/cxgb/common/cxgb_regs.h stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c stable/7/sys/dev/cxgb/common/cxgb_tn1010.c stable/7/sys/dev/cxgb/common/cxgb_vsc8211.c stable/7/sys/dev/cxgb/common/cxgb_xgmac.c stable/7/sys/dev/cxgb/cxgb_adapter.h stable/7/sys/dev/cxgb/cxgb_main.c stable/7/sys/dev/cxgb/cxgb_osdep.h stable/7/sys/dev/cxgb/cxgb_sge.c stable/7/sys/dev/cxgb/cxgb_t3fw.h stable/7/sys/modules/cxgb/cxgb/Makefile stable/7/sys/net/if_media.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Thu Jan 21 11:41:29 2010 (r202744) +++ stable/7/sys/conf/files Thu Jan 21 12:18:29 2010 (r202745) @@ -689,6 +689,7 @@ dev/cxgb/common/cxgb_mc5.c optional cxgb dev/cxgb/common/cxgb_vsc7323.c optional cxgb pci dev/cxgb/common/cxgb_vsc8211.c optional cxgb pci dev/cxgb/common/cxgb_ael1002.c optional cxgb pci +dev/cxgb/common/cxgb_aq100x.c optional cxgb pci dev/cxgb/common/cxgb_mv88e1xxx.c optional cxgb pci dev/cxgb/common/cxgb_xgmac.c optional cxgb pci dev/cxgb/common/cxgb_t3_hw.c optional cxgb pci Modified: stable/7/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- stable/7/sys/dev/cxgb/common/cxgb_ael1002.c Thu Jan 21 11:41:29 2010 (r202744) +++ stable/7/sys/dev/cxgb/common/cxgb_ael1002.c Thu Jan 21 12:18:29 2010 (r202745) @@ -49,16 +49,30 @@ enum { enum { AEL100X_TX_DISABLE = 9, AEL100X_TX_CONFIG1 = 0xc002, + AEL1002_PWR_DOWN_HI = 0xc011, AEL1002_PWR_DOWN_LO = 0xc012, AEL1002_XFI_EQL = 0xc015, AEL1002_LB_EN = 0xc017, + AEL_OPT_SETTINGS = 0xc017, AEL_I2C_CTRL = 0xc30a, AEL_I2C_DATA = 0xc30b, AEL_I2C_STAT = 0xc30c, + AEL2005_GPIO_CTRL = 0xc214, AEL2005_GPIO_STAT = 0xc215, + + AEL2020_GPIO_INTR = 0xc103, + AEL2020_GPIO_CTRL = 0xc108, + AEL2020_GPIO_STAT = 0xc10c, + AEL2020_GPIO_CFG = 0xc110, + + AEL2020_GPIO_SDA = 0, + AEL2020_GPIO_MODDET = 1, + AEL2020_GPIO_0 = 3, + AEL2020_GPIO_1 = 2, + AEL2020_GPIO_LSTAT = AEL2020_GPIO_1, }; enum { edc_none, edc_sr, edc_twinax }; @@ -85,7 +99,7 @@ struct reg_val { unsigned short set_bits; }; -static int get_module_type(struct cphy *phy); +static int ael2xxx_get_module_type(struct cphy *phy, int delay_ms); static int set_phy_regs(struct cphy *phy, const struct reg_val *rv) { @@ -112,6 +126,9 @@ static void ael100x_txon(struct cphy *ph msleep(30); } +/* + * Read an 8-bit word from a device attached to the PHY's i2c bus. + */ static int ael_i2c_rd(struct cphy *phy, int dev_addr, int word_addr) { int i, err; @@ -135,11 +152,14 @@ static int ael_i2c_rd(struct cphy *phy, return data >> 8; } } - CH_WARN(phy->adapter, "PHY %u I2C read of addr %u timed out\n", - phy->addr, word_addr); + CH_WARN(phy->adapter, "PHY %u i2c read of dev.addr %x.%x timed out\n", + phy->addr, dev_addr, word_addr); return -ETIMEDOUT; } +/* + * Write an 8-bit word to a device attached to the PHY's i2c bus. + */ static int ael_i2c_wr(struct cphy *phy, int dev_addr, int word_addr, int data) { int i, err; @@ -162,8 +182,8 @@ static int ael_i2c_wr(struct cphy *phy, if ((stat & 3) == 1) return 0; } - CH_WARN(phy->adapter, "PHY %u I2C Write of addr %u timed out\n", - phy->addr, word_addr); + CH_WARN(phy->adapter, "PHY %u i2c Write of dev.addr %x.%x = %#x timed out\n", + phy->addr, dev_addr, word_addr, data); return -ETIMEDOUT; } @@ -234,9 +254,9 @@ static int ael1002_get_module_type(struc if (delay_ms) msleep(delay_ms); - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0); + v = ael2xxx_get_module_type(phy, delay_ms); - return v == -ETIMEDOUT ? phy_modtype_none : get_module_type(phy); + return (v == -ETIMEDOUT ? phy_modtype_none : v); } static int ael1002_reset(struct cphy *phy, int wait) @@ -316,12 +336,13 @@ static struct cphy_ops ael1002_ops = { }; #endif -int t3_ael1002_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr, +int t3_ael1002_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops) { int err; + struct cphy *phy = &pinfo->phy; - cphy_init(phy, adapter, phy_addr, &ael1002_ops, mdio_ops, + cphy_init(phy, pinfo->adapter, pinfo, phy_addr, &ael1002_ops, mdio_ops, SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE, "10GBASE-R"); ael100x_txon(phy); @@ -370,12 +391,6 @@ static int ael1006_reset(struct cphy *ph } -static int ael1006_power_down(struct cphy *phy, int enable) -{ - return t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, - BMCR_PDOWN, enable ? BMCR_PDOWN : 0); -} - #ifdef C99_NOT_SUPPORTED static struct cphy_ops ael1006_ops = { ael1006_reset, @@ -389,7 +404,7 @@ static struct cphy_ops ael1006_ops = { NULL, NULL, get_link_status_r, - ael1006_power_down, + ael1002_power_down, }; #else static struct cphy_ops ael1006_ops = { @@ -399,20 +414,97 @@ static struct cphy_ops ael1006_ops = { .intr_clear = t3_phy_lasi_intr_clear, .intr_handler = t3_phy_lasi_intr_handler, .get_link_status = get_link_status_r, - .power_down = ael1006_power_down, + .power_down = ael1002_power_down, }; #endif -int t3_ael1006_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr, +int t3_ael1006_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops) { - cphy_init(phy, adapter, phy_addr, &ael1006_ops, mdio_ops, + struct cphy *phy = &pinfo->phy; + + cphy_init(phy, pinfo->adapter, pinfo, phy_addr, &ael1006_ops, mdio_ops, SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE, "10GBASE-SR"); + phy->modtype = phy_modtype_sr; ael100x_txon(phy); return 0; } +/* + * Decode our module type. + */ +static int ael2xxx_get_module_type(struct cphy *phy, int delay_ms) +{ + int v; + + if (delay_ms) + msleep(delay_ms); + + v = get_phytrans_type(phy); + if (v == phy_transtype_sfp) { + /* SFP: see SFF-8472 for below */ + + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 3); + if (v < 0) + return v; + + if (v == 0x1) + return phy_modtype_twinax; + if (v == 0x10) + return phy_modtype_sr; + if (v == 0x20) + return phy_modtype_lr; + if (v == 0x40) + return phy_modtype_lrm; + + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 6); + if (v < 0) + return v; + if (v != 4) + return phy_modtype_unknown; + + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 10); + if (v < 0) + return v; + + if (v & 0x80) { + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0x12); + if (v < 0) + return v; + return v > 10 ? phy_modtype_twinax_long : + phy_modtype_twinax; + } + } else if (v == phy_transtype_xfp) { + /* XFP: See INF-8077i for details. */ + + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 127); + if (v < 0) + return v; + + if (v != 1) { + /* XXX: set page select to table 1 yourself */ + return phy_modtype_unknown; + } + + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 131); + if (v < 0) + return v; + v &= 0xf0; + if (v == 0x10) + return phy_modtype_lrm; + if (v == 0x40) + return phy_modtype_lr; + if (v == 0x80) + return phy_modtype_sr; + } + + return phy_modtype_unknown; +} + +/* + * Code to support the Aeluros/NetLogic 2005 10Gb PHY. + */ static int ael2005_setup_sr_edc(struct cphy *phy) { static struct reg_val regs[] = { @@ -1107,72 +1199,21 @@ static int ael2005_setup_twinax_edc(stru return err; } -static int get_module_type(struct cphy *phy) +static int ael2005_get_module_type(struct cphy *phy, int delay_ms) { int v; + unsigned int stat; - v = get_phytrans_type(phy); - if (v == phy_transtype_sfp) { - /* SFP: see SFF-8472 for below */ - - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 3); - if (v < 0) - return v; - - if (v == 0x1) - return phy_modtype_twinax; - if (v == 0x10) - return phy_modtype_sr; - if (v == 0x20) - return phy_modtype_lr; - if (v == 0x40) - return phy_modtype_lrm; - - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 6); - if (v < 0) - return v; - if (v != 4) - return phy_modtype_unknown; - - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 10); - if (v < 0) - return v; - - if (v & 0x80) { - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0x12); - if (v < 0) - return v; - return v > 10 ? phy_modtype_twinax_long : - phy_modtype_twinax; - } - } else if (v == phy_transtype_xfp) { - /* XFP: See INF-8077i for details. */ - - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 127); - if (v < 0) - return v; - - if (v != 1) { - /* XXX: set page select to table 1 yourself */ - return phy_modtype_unknown; - } + v = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL2005_GPIO_CTRL, &stat); + if (v) + return v; - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 131); - if (v < 0) - return v; - v &= 0xf0; - if (v == 0x10) - return phy_modtype_lrm; - if (v == 0x40) - return phy_modtype_lr; - if (v == 0x80) - return phy_modtype_sr; - } + if (stat & (1 << 8)) /* module absent */ + return phy_modtype_none; - return phy_modtype_unknown; + return ael2xxx_get_module_type(phy, delay_ms); } - static int ael2005_intr_enable(struct cphy *phy) { int err = mdio_write(phy, MDIO_DEV_PMA_PMD, AEL2005_GPIO_CTRL, 0x200); @@ -1191,24 +1232,6 @@ static int ael2005_intr_clear(struct cph return err ? err : t3_phy_lasi_intr_clear(phy); } -static int ael2005_get_module_type(struct cphy *phy, int delay_ms) -{ - int v; - unsigned int stat; - - v = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL2005_GPIO_CTRL, &stat); - if (v) - return v; - - if (stat & (1 << 8)) /* module absent */ - return phy_modtype_none; - - if (delay_ms) - msleep(delay_ms); - - return get_module_type(phy); -} - static int ael2005_reset(struct cphy *phy, int wait) { static struct reg_val regs0[] = { @@ -1227,7 +1250,8 @@ static int ael2005_reset(struct cphy *ph { 0, 0, 0, 0 } }; - int err, lasi_ctrl; + int err; + unsigned int lasi_ctrl; err = mdio_read(phy, MDIO_DEV_PMA_PMD, LASI_CTRL, &lasi_ctrl); if (err) @@ -1315,8 +1339,8 @@ static int ael2005_intr_handler(struct c return ret; } -#ifdef C99_NOT_SUPPORTED static struct cphy_ops ael2005_ops = { +#ifdef C99_NOT_SUPPORTED ael2005_reset, ael2005_intr_enable, ael2005_intr_disable, @@ -1329,9 +1353,7 @@ static struct cphy_ops ael2005_ops = { NULL, get_link_status_r, ael1002_power_down, -}; #else -static struct cphy_ops ael2005_ops = { .reset = ael2005_reset, .intr_enable = ael2005_intr_enable, .intr_disable = ael2005_intr_disable, @@ -1339,14 +1361,16 @@ static struct cphy_ops ael2005_ops = { .intr_handler = ael2005_intr_handler, .get_link_status = get_link_status_r, .power_down = ael1002_power_down, -}; #endif +}; -int t3_ael2005_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr, +int t3_ael2005_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops) { int err; - cphy_init(phy, adapter, phy_addr, &ael2005_ops, mdio_ops, + struct cphy *phy = &pinfo->phy; + + cphy_init(phy, pinfo->adapter, pinfo, phy_addr, &ael2005_ops, mdio_ops, SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE | SUPPORTED_IRQ, "10GBASE-R"); msleep(125); @@ -1361,6 +1385,713 @@ int t3_ael2005_phy_prep(struct cphy *phy } /* + * Setup EDC and other parameters for operation with an optical module. + */ +static int ael2020_setup_sr_edc(struct cphy *phy) +{ + static struct reg_val regs[] = { + { MDIO_DEV_PMA_PMD, 0xcc01, 0xffff, 0x488a }, + + { MDIO_DEV_PMA_PMD, 0xcb1b, 0xffff, 0x0200 }, + { MDIO_DEV_PMA_PMD, 0xcb1c, 0xffff, 0x00f0 }, + { MDIO_DEV_PMA_PMD, 0xcc06, 0xffff, 0x00e0 }, + + /* end */ + { 0, 0, 0, 0 } + }; + int err; + + err = set_phy_regs(phy, regs); + msleep(50); + if (err) + return err; + + phy->priv = edc_sr; + return 0; +} + +/* + * Setup EDC and other parameters for operation with an TWINAX module. + */ +static int ael2020_setup_twinax_edc(struct cphy *phy, int modtype) +{ + static struct reg_val uCclock40MHz[] = { + { MDIO_DEV_PMA_PMD, 0xff28, 0xffff, 0x4001 }, + { MDIO_DEV_PMA_PMD, 0xff2a, 0xffff, 0x0002 }, + { 0, 0, 0, 0 } + }; + + static struct reg_val uCclockActivate[] = { + { MDIO_DEV_PMA_PMD, 0xd000, 0xffff, 0x5200 }, + { 0, 0, 0, 0 } + }; + + static struct reg_val uCactivate[] = { + { MDIO_DEV_PMA_PMD, 0xd080, 0xffff, 0x0100 }, + { MDIO_DEV_PMA_PMD, 0xd092, 0xffff, 0x0000 }, + { 0, 0, 0, 0 } + }; + + static u16 twinax_edc[] = { + 0xd800, 0x4009, + 0xd801, 0x2fff, + 0xd802, 0x300f, + 0xd803, 0x40aa, + 0xd804, 0x401c, + 0xd805, 0x401e, + 0xd806, 0x2ff4, + 0xd807, 0x3dc4, + 0xd808, 0x2035, + 0xd809, 0x3035, + 0xd80a, 0x6524, + 0xd80b, 0x2cb2, + 0xd80c, 0x3012, + 0xd80d, 0x1002, + 0xd80e, 0x26e2, + 0xd80f, 0x3022, + 0xd810, 0x1002, + 0xd811, 0x27d2, + 0xd812, 0x3022, + 0xd813, 0x1002, + 0xd814, 0x2822, + 0xd815, 0x3012, + 0xd816, 0x1002, + 0xd817, 0x2492, + 0xd818, 0x3022, + 0xd819, 0x1002, + 0xd81a, 0x2772, + 0xd81b, 0x3012, + 0xd81c, 0x1002, + 0xd81d, 0x23d2, + 0xd81e, 0x3022, + 0xd81f, 0x1002, + 0xd820, 0x22cd, + 0xd821, 0x301d, + 0xd822, 0x27f2, + 0xd823, 0x3022, + 0xd824, 0x1002, + 0xd825, 0x5553, + 0xd826, 0x0307, + 0xd827, 0x2522, + 0xd828, 0x3022, + 0xd829, 0x1002, + 0xd82a, 0x2142, + 0xd82b, 0x3012, + 0xd82c, 0x1002, + 0xd82d, 0x4016, + 0xd82e, 0x5e63, + 0xd82f, 0x0344, + 0xd830, 0x2142, + 0xd831, 0x3012, + 0xd832, 0x1002, + 0xd833, 0x400e, + 0xd834, 0x2522, + 0xd835, 0x3022, + 0xd836, 0x1002, + 0xd837, 0x2b52, + 0xd838, 0x3012, + 0xd839, 0x1002, + 0xd83a, 0x2742, + 0xd83b, 0x3022, + 0xd83c, 0x1002, + 0xd83d, 0x25e2, + 0xd83e, 0x3022, + 0xd83f, 0x1002, + 0xd840, 0x2fa4, + 0xd841, 0x3dc4, + 0xd842, 0x6624, + 0xd843, 0x414b, + 0xd844, 0x56b3, + 0xd845, 0x03c6, + 0xd846, 0x866b, + 0xd847, 0x400c, + 0xd848, 0x2712, + 0xd849, 0x3012, + 0xd84a, 0x1002, + 0xd84b, 0x2c4b, + 0xd84c, 0x309b, + 0xd84d, 0x56b3, + 0xd84e, 0x03c3, + 0xd84f, 0x866b, + 0xd850, 0x400c, + 0xd851, 0x2272, + 0xd852, 0x3022, + 0xd853, 0x1002, + 0xd854, 0x2742, + 0xd855, 0x3022, + 0xd856, 0x1002, + 0xd857, 0x25e2, + 0xd858, 0x3022, + 0xd859, 0x1002, + 0xd85a, 0x2fb4, + 0xd85b, 0x3dc4, + 0xd85c, 0x6624, + 0xd85d, 0x56b3, + 0xd85e, 0x03c3, + 0xd85f, 0x866b, + 0xd860, 0x401c, + 0xd861, 0x2c45, + 0xd862, 0x3095, + 0xd863, 0x5b53, + 0xd864, 0x2372, + 0xd865, 0x3012, + 0xd866, 0x13c2, + 0xd867, 0x5cc3, + 0xd868, 0x2712, + 0xd869, 0x3012, + 0xd86a, 0x1312, + 0xd86b, 0x2b52, + 0xd86c, 0x3012, + 0xd86d, 0x1002, + 0xd86e, 0x2742, + 0xd86f, 0x3022, + 0xd870, 0x1002, + 0xd871, 0x2582, + 0xd872, 0x3022, + 0xd873, 0x1002, + 0xd874, 0x2142, + 0xd875, 0x3012, + 0xd876, 0x1002, + 0xd877, 0x628f, + 0xd878, 0x2985, + 0xd879, 0x33a5, + 0xd87a, 0x25e2, + 0xd87b, 0x3022, + 0xd87c, 0x1002, + 0xd87d, 0x5653, + 0xd87e, 0x03d2, + 0xd87f, 0x401e, + 0xd880, 0x6f72, + 0xd881, 0x1002, + 0xd882, 0x628f, + 0xd883, 0x2304, + 0xd884, 0x3c84, + 0xd885, 0x6436, + 0xd886, 0xdff4, + 0xd887, 0x6436, + 0xd888, 0x2ff5, + 0xd889, 0x3005, + 0xd88a, 0x8656, + 0xd88b, 0xdfba, + 0xd88c, 0x56a3, + 0xd88d, 0xd05a, + 0xd88e, 0x2972, + 0xd88f, 0x3012, + 0xd890, 0x1392, + 0xd891, 0xd05a, + 0xd892, 0x56a3, + 0xd893, 0xdfba, + 0xd894, 0x0383, + 0xd895, 0x6f72, + 0xd896, 0x1002, + 0xd897, 0x2b45, + 0xd898, 0x3005, + 0xd899, 0x4178, + 0xd89a, 0x5653, + 0xd89b, 0x0384, + 0xd89c, 0x2a62, + 0xd89d, 0x3012, + 0xd89e, 0x1002, + 0xd89f, 0x2f05, + 0xd8a0, 0x3005, + 0xd8a1, 0x41c8, + 0xd8a2, 0x5653, + 0xd8a3, 0x0382, + 0xd8a4, 0x0002, + 0xd8a5, 0x4218, + 0xd8a6, 0x2474, + 0xd8a7, 0x3c84, + 0xd8a8, 0x6437, + 0xd8a9, 0xdff4, + 0xd8aa, 0x6437, + 0xd8ab, 0x2ff5, + 0xd8ac, 0x3c05, + 0xd8ad, 0x8757, + 0xd8ae, 0xb888, + 0xd8af, 0x9787, + 0xd8b0, 0xdff4, + 0xd8b1, 0x6724, + 0xd8b2, 0x866a, + 0xd8b3, 0x6f72, + 0xd8b4, 0x1002, + 0xd8b5, 0x2641, + 0xd8b6, 0x3021, + 0xd8b7, 0x1001, + 0xd8b8, 0xc620, + 0xd8b9, 0x0000, + 0xd8ba, 0xc621, + 0xd8bb, 0x0000, + 0xd8bc, 0xc622, + 0xd8bd, 0x00ce, + 0xd8be, 0xc623, + 0xd8bf, 0x007f, + 0xd8c0, 0xc624, + 0xd8c1, 0x0032, + 0xd8c2, 0xc625, + 0xd8c3, 0x0000, + 0xd8c4, 0xc627, + 0xd8c5, 0x0000, + 0xd8c6, 0xc628, + 0xd8c7, 0x0000, + 0xd8c8, 0xc62c, + 0xd8c9, 0x0000, + 0xd8ca, 0x0000, + 0xd8cb, 0x2641, + 0xd8cc, 0x3021, + 0xd8cd, 0x1001, + 0xd8ce, 0xc502, + 0xd8cf, 0x53ac, + 0xd8d0, 0xc503, + 0xd8d1, 0x2cd3, + 0xd8d2, 0xc600, + 0xd8d3, 0x2a6e, + 0xd8d4, 0xc601, + 0xd8d5, 0x2a2c, + 0xd8d6, 0xc605, + 0xd8d7, 0x5557, + 0xd8d8, 0xc60c, + 0xd8d9, 0x5400, + 0xd8da, 0xc710, + 0xd8db, 0x0700, + 0xd8dc, 0xc711, + 0xd8dd, 0x0f06, + 0xd8de, 0xc718, + 0xd8df, 0x0700, + 0xd8e0, 0xc719, + 0xd8e1, 0x0f06, + 0xd8e2, 0xc720, + 0xd8e3, 0x4700, + 0xd8e4, 0xc721, + 0xd8e5, 0x0f06, + 0xd8e6, 0xc728, + 0xd8e7, 0x0700, + 0xd8e8, 0xc729, + 0xd8e9, 0x1207, + 0xd8ea, 0xc801, + 0xd8eb, 0x7f50, + 0xd8ec, 0xc802, + 0xd8ed, 0x7760, + 0xd8ee, 0xc803, + 0xd8ef, 0x7fce, + 0xd8f0, 0xc804, + 0xd8f1, 0x520e, + 0xd8f2, 0xc805, + 0xd8f3, 0x5c11, + 0xd8f4, 0xc806, + 0xd8f5, 0x3c51, + 0xd8f6, 0xc807, + 0xd8f7, 0x4061, + 0xd8f8, 0xc808, + 0xd8f9, 0x49c1, + 0xd8fa, 0xc809, + 0xd8fb, 0x3840, + 0xd8fc, 0xc80a, + 0xd8fd, 0x0000, + 0xd8fe, 0xc821, + 0xd8ff, 0x0002, + 0xd900, 0xc822, + 0xd901, 0x0046, + 0xd902, 0xc844, + 0xd903, 0x182f, + 0xd904, 0xc013, + 0xd905, 0xf341, + 0xd906, 0xc084, + 0xd907, 0x0030, + 0xd908, 0xc904, + 0xd909, 0x1401, + 0xd90a, 0xcb0c, + 0xd90b, 0x0004, + 0xd90c, 0xcb0e, + 0xd90d, 0xa00a, + 0xd90e, 0xcb0f, + 0xd90f, 0xc0c0, + 0xd910, 0xcb10, + 0xd911, 0xc0c0, + 0xd912, 0xcb11, + 0xd913, 0x00a0, + 0xd914, 0xcb12, + 0xd915, 0x0007, + 0xd916, 0xc241, + 0xd917, 0xa000, + 0xd918, 0xc243, + 0xd919, 0x7fe0, + 0xd91a, 0xc604, + 0xd91b, 0x000e, + 0xd91c, 0xc609, + 0xd91d, 0x00f5, + 0xd91e, 0xc611, + 0xd91f, 0x000e, + 0xd920, 0xc660, + 0xd921, 0x9600, + 0xd922, 0xc687, + 0xd923, 0x0004, + 0xd924, 0xc60a, + 0xd925, 0x04f5, + 0xd926, 0x0000, + 0xd927, 0x2641, + 0xd928, 0x3021, + 0xd929, 0x1001, + 0xd92a, 0xc620, + 0xd92b, 0x14e5, + 0xd92c, 0xc621, + 0xd92d, 0xc53d, + 0xd92e, 0xc622, + 0xd92f, 0x3cbe, + 0xd930, 0xc623, + 0xd931, 0x4452, + 0xd932, 0xc624, + 0xd933, 0xc5c5, + 0xd934, 0xc625, + 0xd935, 0xe01e, + 0xd936, 0xc627, + 0xd937, 0x0000, + 0xd938, 0xc628, + 0xd939, 0x0000, + 0xd93a, 0xc62c, + 0xd93b, 0x0000, + 0xd93c, 0x0000, + 0xd93d, 0x2b84, + 0xd93e, 0x3c74, + 0xd93f, 0x6435, + 0xd940, 0xdff4, + 0xd941, 0x6435, + 0xd942, 0x2806, + 0xd943, 0x3006, + 0xd944, 0x8565, + 0xd945, 0x2b24, + 0xd946, 0x3c24, + 0xd947, 0x6436, + 0xd948, 0x1002, + 0xd949, 0x2b24, + 0xd94a, 0x3c24, + 0xd94b, 0x6436, + 0xd94c, 0x4045, + 0xd94d, 0x8656, + 0xd94e, 0x5663, + 0xd94f, 0x0302, + 0xd950, 0x401e, + 0xd951, 0x1002, + 0xd952, 0x2807, + 0xd953, 0x31a7, + 0xd954, 0x20c4, + 0xd955, 0x3c24, + 0xd956, 0x6724, + 0xd957, 0x1002, + 0xd958, 0x2807, + 0xd959, 0x3187, + 0xd95a, 0x20c4, + 0xd95b, 0x3c24, + 0xd95c, 0x6724, + 0xd95d, 0x1002, + 0xd95e, 0x24f4, + 0xd95f, 0x3c64, + 0xd960, 0x6436, + 0xd961, 0xdff4, + 0xd962, 0x6436, + 0xd963, 0x1002, + 0xd964, 0x2006, + 0xd965, 0x3d76, + 0xd966, 0xc161, + 0xd967, 0x6134, + 0xd968, 0x6135, + 0xd969, 0x5443, + 0xd96a, 0x0303, + 0xd96b, 0x6524, + 0xd96c, 0x00fb, + 0xd96d, 0x1002, + 0xd96e, 0x20d4, + 0xd96f, 0x3c24, + 0xd970, 0x2025, + 0xd971, 0x3005, + 0xd972, 0x6524, + 0xd973, 0x1002, + 0xd974, 0xd019, + 0xd975, 0x2104, + 0xd976, 0x3c24, + 0xd977, 0x2105, + 0xd978, 0x3805, + 0xd979, 0x6524, + 0xd97a, 0xdff4, + 0xd97b, 0x4005, + 0xd97c, 0x6524, + 0xd97d, 0x2e8d, + 0xd97e, 0x303d, + 0xd97f, 0x2408, + 0xd980, 0x35d8, + 0xd981, 0x5dd3, + 0xd982, 0x0307, + 0xd983, 0x8887, + 0xd984, 0x63a7, + 0xd985, 0x8887, + 0xd986, 0x63a7, + 0xd987, 0xdffd, + 0xd988, 0x00f9, + 0xd989, 0x1002, + 0xd98a, 0x0000, + }; + int i, err; + + /* set uC clock and activate it */ + err = set_phy_regs(phy, uCclock40MHz); + msleep(500); + if (err) + return err; + err = set_phy_regs(phy, uCclockActivate); + msleep(500); + if (err) + return err; + + for (i = 0; i < ARRAY_SIZE(twinax_edc) && !err; i += 2) + err = mdio_write(phy, MDIO_DEV_PMA_PMD, twinax_edc[i], + twinax_edc[i + 1]); + /* activate uC */ + err = set_phy_regs(phy, uCactivate); + if (!err) + phy->priv = edc_twinax; + return err; +} + +/* + * Return Module Type. + */ +static int ael2020_get_module_type(struct cphy *phy, int delay_ms) +{ + int v; + unsigned int stat; + + v = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL2020_GPIO_STAT, &stat); + if (v) + return v; + + if (stat & (0x1 << (AEL2020_GPIO_MODDET*4))) { + /* module absent */ + return phy_modtype_none; + } + + return ael2xxx_get_module_type(phy, delay_ms); +} + +/* + * Enable PHY interrupts. We enable "Module Detection" interrupts (on any + * state transition) and then generic Link Alarm Status Interrupt (LASI). + */ +static int ael2020_intr_enable(struct cphy *phy) +{ + struct reg_val regs[] = { + { MDIO_DEV_PMA_PMD, AEL2020_GPIO_CFG+AEL2020_GPIO_LSTAT, + 0xffff, 0x4 }, + { MDIO_DEV_PMA_PMD, AEL2020_GPIO_CTRL, + 0xffff, 0x8 << (AEL2020_GPIO_LSTAT*4) }, + + { MDIO_DEV_PMA_PMD, AEL2020_GPIO_CTRL, + 0xffff, 0x2 << (AEL2020_GPIO_MODDET*4) }, + + /* end */ + { 0, 0, 0, 0 } + }; + int err; + + err = set_phy_regs(phy, regs); + if (err) + return err; + + phy->caps |= POLL_LINK_1ST_TIME; + + /* enable standard Link Alarm Status Interrupts */ + err = t3_phy_lasi_intr_enable(phy); + if (err) + return err; + + return 0; +} + +/* + * Disable PHY interrupts. The mirror of the above ... + */ +static int ael2020_intr_disable(struct cphy *phy) +{ + struct reg_val regs[] = { + { MDIO_DEV_PMA_PMD, AEL2020_GPIO_CTRL, + 0xffff, 0xb << (AEL2020_GPIO_LSTAT*4) }, + + { MDIO_DEV_PMA_PMD, AEL2020_GPIO_CTRL, + 0xffff, 0x1 << (AEL2020_GPIO_MODDET*4) }, + + /* end */ + { 0, 0, 0, 0 } + }; + int err; + + err = set_phy_regs(phy, regs); + if (err) + return err; + + /* disable standard Link Alarm Status Interrupts */ + return t3_phy_lasi_intr_disable(phy); +} + +/* + * Clear PHY interrupt state. + */ +static int ael2020_intr_clear(struct cphy *phy) +{ + unsigned int stat; + int err = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL2020_GPIO_INTR, &stat); + return err ? err : t3_phy_lasi_intr_clear(phy); +} + +/* + * Common register settings for the AEL2020 when it comes out of reset. + */ +static struct reg_val ael2020_reset_regs[] = { + { MDIO_DEV_PMA_PMD, 0xc003, 0xffff, 0x3101 }, + + { MDIO_DEV_PMA_PMD, 0xcd40, 0xffff, 0x0001 }, + + { MDIO_DEV_PMA_PMD, 0xff02, 0xffff, 0x0023 }, + { MDIO_DEV_PMA_PMD, 0xff03, 0xffff, 0x0000 }, + { MDIO_DEV_PMA_PMD, 0xff04, 0xffff, 0x0000 }, + + /* end */ + { 0, 0, 0, 0 } +}; + +/* + * Reset the PHY and put it into a canonical operating state. + */ +static int ael2020_reset(struct cphy *phy, int wait) +{ + int err; + unsigned int lasi_ctrl; + + /* grab current interrupt state */ + err = mdio_read(phy, MDIO_DEV_PMA_PMD, LASI_CTRL, &lasi_ctrl); + if (err) + return err; + + err = t3_phy_reset(phy, MDIO_DEV_PMA_PMD, 125); + if (err) + return err; + msleep(100); + + /* basic initialization for all module types */ + phy->priv = edc_none; + err = set_phy_regs(phy, ael2020_reset_regs); + if (err) + return err; + + /* determine module type and perform appropriate initialization */ + err = ael2020_get_module_type(phy, 0); + if (err < 0) + return err; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 14:33:18 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEF00106566B; Thu, 21 Jan 2010 14:33:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC5778FC14; Thu, 21 Jan 2010 14:33:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0LEXI3p054469; Thu, 21 Jan 2010 14:33:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0LEXIFC054459; Thu, 21 Jan 2010 14:33:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001211433.o0LEXIFC054459@svn.freebsd.org> From: John Baldwin Date: Thu, 21 Jan 2010 14:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202750 - in stable/7/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/md fs/cd9660 fs/udf kern sys ufs/ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 14:33:18 -0000 Author: jhb Date: Thu Jan 21 14:33:18 2010 New Revision: 202750 URL: http://svn.freebsd.org/changeset/base/202750 Log: MFC 189696,189697: Add a new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that a filesystem supports additional operations using shared vnode locks. Currently this is used to enable shared locks for open() and close() of read-only file descriptors. - When an ISOPEN namei() request is performed with LOCKSHARED, use a shared vnode lock for the leaf vnode only if the mount point has the extended shared flag set. - Set LOCKSHARED in vn_open_cred() for requests that specify O_RDONLY but not O_CREAT. - Use a shared vnode lock around VOP_CLOSE() if the file was opened with O_RDONLY and the mountpoint has the extended shared flag set. - Adjust md(4) to upgrade the vnode lock on the vnode it gets back from vn_open() since it now may only have a shared vnode lock. - Don't enable shared vnode locks on FIFO vnodes in ZFS and UFS since FIFO's require exclusive vnode locks for their open() and close() routines. (My recent MPSAFE patches for UDF and cd9660 already included this change.) - Enable extended shared operations on UFS, cd9660, and UDF. Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/7/sys/dev/md/md.c stable/7/sys/fs/cd9660/cd9660_vfsops.c stable/7/sys/fs/udf/udf_vfsops.c stable/7/sys/kern/vfs_lookup.c stable/7/sys/kern/vfs_vnops.c stable/7/sys/kern/vnode_if.src stable/7/sys/sys/mount.h stable/7/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jan 21 13:31:41 2010 (r202749) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jan 21 14:33:18 2010 (r202750) @@ -1520,6 +1520,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, vnode.v_type = VDIR; vnode.v_data = rootzp; rootzp->z_vnode = &vnode; + VN_LOCK_ASHARE(vp); bzero(&zfsvfs, sizeof (zfsvfs_t)); Modified: stable/7/sys/dev/md/md.c ============================================================================== --- stable/7/sys/dev/md/md.c Thu Jan 21 13:31:41 2010 (r202749) +++ stable/7/sys/dev/md/md.c Thu Jan 21 14:33:18 2010 (r202750) @@ -918,12 +918,20 @@ mdcreate_vnode(struct md_s *sc, struct m return (error); vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); - if (nd.ni_vp->v_type != VREG || - (error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred, td))) { - VOP_UNLOCK(nd.ni_vp, 0, td); - (void)vn_close(nd.ni_vp, flags, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); - return (error ? error : EINVAL); + if (nd.ni_vp->v_type != VREG) { + error = EINVAL; + goto bad; + } + error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred, td); + if (error != 0) + goto bad; + if (VOP_ISLOCKED(nd.ni_vp, td) != LK_EXCLUSIVE) { + vn_lock(nd.ni_vp, LK_UPGRADE | LK_RETRY, td); + if (nd.ni_vp->v_iflag & VI_DOOMED) { + /* Forced unmount. */ + error = EBADF; + goto bad; + } } nd.ni_vp->v_vflag |= VV_MD; VOP_UNLOCK(nd.ni_vp, 0, td); @@ -942,13 +950,15 @@ mdcreate_vnode(struct md_s *sc, struct m sc->vnode = NULL; vn_lock(nd.ni_vp, LK_EXCLUSIVE | LK_RETRY, td); nd.ni_vp->v_vflag &= ~VV_MD; - VOP_UNLOCK(nd.ni_vp, 0, td); - (void)vn_close(nd.ni_vp, flags, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); - return (error); + goto bad; } VFS_UNLOCK_GIANT(vfslocked); return (0); +bad: + VOP_UNLOCK(nd.ni_vp, 0, td); + (void)vn_close(nd.ni_vp, flags, td->td_ucred, td); + VFS_UNLOCK_GIANT(vfslocked); + return (error); } static int Modified: stable/7/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- stable/7/sys/fs/cd9660/cd9660_vfsops.c Thu Jan 21 13:31:41 2010 (r202749) +++ stable/7/sys/fs/cd9660/cd9660_vfsops.c Thu Jan 21 14:33:18 2010 (r202750) @@ -373,7 +373,8 @@ iso_mountfs(devvp, mp, td) mp->mnt_maxsymlinklen = 0; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED; + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | + MNTK_EXTENDED_SHARED; MNT_IUNLOCK(mp); isomp->im_mountp = mp; isomp->im_dev = dev; Modified: stable/7/sys/fs/udf/udf_vfsops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vfsops.c Thu Jan 21 13:31:41 2010 (r202749) +++ stable/7/sys/fs/udf/udf_vfsops.c Thu Jan 21 14:33:18 2010 (r202750) @@ -353,7 +353,8 @@ udf_mountfs(struct vnode *devvp, struct mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED; + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | + MNTK_EXTENDED_SHARED; MNT_IUNLOCK(mp); udfmp->im_mountp = mp; udfmp->im_dev = dev; Modified: stable/7/sys/kern/vfs_lookup.c ============================================================================== --- stable/7/sys/kern/vfs_lookup.c Thu Jan 21 13:31:41 2010 (r202749) +++ stable/7/sys/kern/vfs_lookup.c Thu Jan 21 14:33:18 2010 (r202750) @@ -322,6 +322,41 @@ compute_cn_lkflags(struct mount *mp, int return lkflags; } +static __inline int +needs_exclusive_leaf(struct mount *mp, int flags) +{ + + /* + * Intermediate nodes can use shared locks, we only need to + * force an exclusive lock for leaf nodes. + */ + if ((flags & (ISLASTCN | LOCKLEAF)) != (ISLASTCN | LOCKLEAF)) + return (0); + + /* Always use exclusive locks if LOCKSHARED isn't set. */ + if (!(flags & LOCKSHARED)) + return (1); + + /* + * For lookups during open(), if the mount point supports + * extended shared operations, then use a shared lock for the + * leaf node, otherwise use an exclusive lock. + */ + if (flags & ISOPEN) { + if (mp != NULL && + (mp->mnt_kern_flag & MNTK_EXTENDED_SHARED)) + return (0); + else + return (1); + } + + /* + * Lookup requests outside of open() that specify LOCKSHARED + * only need a shared lock on the leaf vnode. + */ + return (0); +} + /* * Search a pathname. * This is a very central and rather complicated routine. @@ -580,8 +615,7 @@ unionlookup: * If we're looking up the last component and we need an exclusive * lock, adjust our lkflags. */ - if ((cnp->cn_flags & (ISLASTCN|LOCKSHARED|LOCKLEAF)) == - (ISLASTCN|LOCKLEAF)) + if (needs_exclusive_leaf(dp->v_mount, cnp->cn_flags)) cnp->cn_lkflags = LK_EXCLUSIVE; #ifdef NAMEI_DIAGNOSTIC vprint("lookup in", dp); @@ -778,8 +812,8 @@ success: * Because of lookup_shared we may have the vnode shared locked, but * the caller may want it to be exclusively locked. */ - if ((cnp->cn_flags & (ISLASTCN | LOCKSHARED | LOCKLEAF)) == - (ISLASTCN | LOCKLEAF) && VOP_ISLOCKED(dp, td) != LK_EXCLUSIVE) { + if (needs_exclusive_leaf(dp->v_mount, cnp->cn_flags) && + VOP_ISLOCKED(dp, td) != LK_EXCLUSIVE) { vn_lock(dp, LK_UPGRADE | LK_RETRY, td); if (dp->v_iflag & VI_DOOMED) { error = ENOENT; Modified: stable/7/sys/kern/vfs_vnops.c ============================================================================== --- stable/7/sys/kern/vfs_vnops.c Thu Jan 21 13:31:41 2010 (r202749) +++ stable/7/sys/kern/vfs_vnops.c Thu Jan 21 14:33:18 2010 (r202750) @@ -185,6 +185,8 @@ restart: ndp->ni_cnd.cn_flags = ISOPEN | ((fmode & O_NOFOLLOW) ? NOFOLLOW : FOLLOW) | LOCKLEAF | MPSAFE | AUDITVNODE1; + if (!(fmode & FWRITE)) + ndp->ni_cnd.cn_flags |= LOCKSHARED; if ((error = namei(ndp)) != 0) return (error); if (!mpsafe) @@ -235,7 +237,7 @@ restart: if (fmode & FWRITE) vp->v_writecount++; *flagp = fmode; - ASSERT_VOP_ELOCKED(vp, "vn_open_cred"); + ASSERT_VOP_LOCKED(vp, "vn_open_cred"); if (!mpsafe) VFS_UNLOCK_GIANT(vfslocked); return (0); @@ -280,12 +282,18 @@ vn_close(vp, flags, file_cred, td) struct thread *td; { struct mount *mp; - int error; + int error, lock_flags; + + if (!(flags & FWRITE) && vp->v_mount != NULL && + vp->v_mount->mnt_kern_flag & MNTK_EXTENDED_SHARED) + lock_flags = LK_SHARED; + else + lock_flags = LK_EXCLUSIVE; VFS_ASSERT_GIANT(vp->v_mount); vn_start_write(vp, &mp, V_WAIT); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, lock_flags | LK_RETRY, td); if (flags & FWRITE) { VNASSERT(vp->v_writecount > 0, vp, ("vn_close: negative writecount")); Modified: stable/7/sys/kern/vnode_if.src ============================================================================== --- stable/7/sys/kern/vnode_if.src Thu Jan 21 13:31:41 2010 (r202749) +++ stable/7/sys/kern/vnode_if.src Thu Jan 21 14:33:18 2010 (r202750) @@ -134,7 +134,7 @@ vop_open { }; -%% close vp E E E +%% close vp L L L vop_close { IN struct vnode *vp; Modified: stable/7/sys/sys/mount.h ============================================================================== --- stable/7/sys/sys/mount.h Thu Jan 21 13:31:41 2010 (r202749) +++ stable/7/sys/sys/mount.h Thu Jan 21 14:33:18 2010 (r202750) @@ -328,6 +328,7 @@ void __mnt_vnode_markerfree(str #define MNTK_SOFTDEP 0x00000004 /* async disabled by softdep */ #define MNTK_NOINSMNTQ 0x00000008 /* insmntque is not allowed */ #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ +#define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ #define MNTK_SHARED_WRITES 0x00000080 /* Allow shared locking for writes */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ @@ -335,8 +336,8 @@ void __mnt_vnode_markerfree(str #define MNTK_SUSPEND2 0x04000000 /* block secondary writes */ #define MNTK_SUSPENDED 0x10000000 /* write operations are suspended */ #define MNTK_MPSAFE 0x20000000 /* Filesystem is MPSAFE. */ -#define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ +#define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ /* * Sysctl CTL_VFS definitions. Modified: stable/7/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/7/sys/ufs/ffs/ffs_vfsops.c Thu Jan 21 13:31:41 2010 (r202749) +++ stable/7/sys/ufs/ffs/ffs_vfsops.c Thu Jan 21 14:33:18 2010 (r202750) @@ -883,7 +883,8 @@ ffs_mountfs(devvp, mp, td) * Initialize filesystem stat information in mount struct. */ MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED; + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | + MNTK_EXTENDED_SHARED; MNT_IUNLOCK(mp); #ifdef UFS_EXTATTR #ifdef UFS_EXTATTR_AUTOSTART @@ -1440,10 +1441,9 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags return (error); } /* - * FFS supports recursive and shared locking. + * FFS supports recursive locking. */ - vp->v_vnlock->lk_flags |= LK_CANRECURSE; - vp->v_vnlock->lk_flags &= ~LK_NOSHARE; + VN_LOCK_AREC(vp); vp->v_data = ip; vp->v_bufobj.bo_bsize = fs->fs_bsize; ip->i_vnode = vp; @@ -1518,6 +1518,10 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags /* * Finish inode initialization. */ + if (vp->v_type != VFIFO) { + /* FFS supports shared locking for all files except fifos. */ + VN_LOCK_ASHARE(vp); + } /* * Set up a generation number for this inode if it does not From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 16:41:14 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 014321065672; Thu, 21 Jan 2010 16:41:14 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E427B8FC17; Thu, 21 Jan 2010 16:41:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0LGfDq1083708; Thu, 21 Jan 2010 16:41:13 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0LGfDGk083706; Thu, 21 Jan 2010 16:41:13 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001211641.o0LGfDGk083706@svn.freebsd.org> From: Christian Brueffer Date: Thu, 21 Jan 2010 16:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202754 - stable/7/sys/modules X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 16:41:14 -0000 Author: brueffer Date: Thu Jan 21 16:41:13 2010 New Revision: 202754 URL: http://svn.freebsd.org/changeset/base/202754 Log: MFC: r202290 Build iwi(4) and iwifw(4) modules on amd64 as well. Modified: stable/7/sys/modules/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Thu Jan 21 16:31:45 2010 (r202753) +++ stable/7/sys/modules/Makefile Thu Jan 21 16:41:13 2010 (r202754) @@ -553,6 +553,8 @@ _ipmi= ipmi _ips= ips _ipw= ipw _ipwfw= ipwfw +_iwi= iwi +_iwifw= iwifw _ixgb= ixgb _lindev= lindev _linprocfs= linprocfs From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 17:37:26 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3DE7106566B; Thu, 21 Jan 2010 17:37:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C27168FC1E; Thu, 21 Jan 2010 17:37:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0LHbQZ6096801; Thu, 21 Jan 2010 17:37:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0LHbQKv096799; Thu, 21 Jan 2010 17:37:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001211737.o0LHbQKv096799@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jan 2010 17:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202760 - stable/7/sys/sparc64/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 17:37:26 -0000 Author: marius Date: Thu Jan 21 17:37:26 2010 New Revision: 202760 URL: http://svn.freebsd.org/changeset/base/202760 Log: MFC: r202587 Add epic(4) also here. Modified: stable/7/sys/sparc64/conf/NOTES Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/conf/NOTES ============================================================================== --- stable/7/sys/sparc64/conf/NOTES Thu Jan 21 17:37:25 2010 (r202759) +++ stable/7/sys/sparc64/conf/NOTES Thu Jan 21 17:37:26 2010 (r202760) @@ -45,6 +45,7 @@ device mc146818 # Motorola MC146818 and device auxio # auxiliary I/O device device clkbrd # Clock Board (blinkenlight on Sun Exx00) +device epic # Sun Fire V215/V245 LEDs device creator # Creator, Creator3D and Elite3D framebuffers device machfb # ATI Mach64 framebuffers From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 17:55:48 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31AD91065672; Thu, 21 Jan 2010 17:55:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C3E58FC08; Thu, 21 Jan 2010 17:55:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0LHtmWO001236; Thu, 21 Jan 2010 17:55:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0LHtl0m001217; Thu, 21 Jan 2010 17:55:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001211755.o0LHtl0m001217@svn.freebsd.org> From: John Baldwin Date: Thu, 21 Jan 2010 17:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202763 - in stable/7: share/man/man9 sys/amd64/amd64 sys/amd64/include sys/i386/i386 sys/i386/include sys/kern sys/sparc64/include sys/sparc64/pci sys/sparc64/sparc64 sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 17:55:48 -0000 Author: jhb Date: Thu Jan 21 17:55:47 2010 New Revision: 202763 URL: http://svn.freebsd.org/changeset/base/202763 Log: MFC 198134,198149,198170,198171,198391,200948: Add a facility for associating optional descriptions with active interrupt handlers. This is primarily intended as a way to allow devices that use multiple interrupts (e.g. MSI) to meaningfully distinguish the various interrupt handlers. - Add a new BUS_DESCRIBE_INTR() method to the bus interface to associate a description with an active interrupt handler setup by BUS_SETUP_INTR. It has a default method (bus_generic_describe_intr()) which simply passes the request up to the parent device. - Add a bus_describe_intr() wrapper around BUS_DESCRIBE_INTR() that supports printf(9) style formatting using var args. - Reserve MAXCOMLEN bytes in the intr_handler structure to hold the name of an interrupt handler and copy the name passed to intr_event_add_handler() into that buffer instead of just saving the pointer to the name. - Add a new intr_event_describe_handler() which appends a description string to an interrupt handler's name. - Implement support for interrupt descriptions on amd64, i386, and sparc64 by having the nexus(4) driver supply a custom bus_describe_intr method that invokes a new intr_describe() MD routine which in turn looks up the associated interrupt event and invokes intr_event_describe_handler(). Added: stable/7/share/man/man9/BUS_DESCRIBE_INTR.9 - copied, changed from r198134, head/share/man/man9/BUS_DESCRIBE_INTR.9 Modified: stable/7/share/man/man9/Makefile stable/7/sys/amd64/amd64/intr_machdep.c stable/7/sys/amd64/amd64/nexus.c stable/7/sys/amd64/include/intr_machdep.h stable/7/sys/i386/i386/intr_machdep.c stable/7/sys/i386/i386/nexus.c stable/7/sys/i386/include/intr_machdep.h stable/7/sys/kern/bus_if.m stable/7/sys/kern/kern_intr.c stable/7/sys/kern/subr_bus.c stable/7/sys/sparc64/include/intr_machdep.h stable/7/sys/sparc64/pci/psycho.c stable/7/sys/sparc64/pci/schizo.c stable/7/sys/sparc64/sparc64/intr_machdep.c stable/7/sys/sparc64/sparc64/nexus.c stable/7/sys/sys/bus.h stable/7/sys/sys/interrupt.h Directory Properties: stable/7/share/man/man9/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Copied and modified: stable/7/share/man/man9/BUS_DESCRIBE_INTR.9 (from r198134, head/share/man/man9/BUS_DESCRIBE_INTR.9) ============================================================================== --- head/share/man/man9/BUS_DESCRIBE_INTR.9 Thu Oct 15 14:54:35 2009 (r198134, copy source) +++ stable/7/share/man/man9/BUS_DESCRIBE_INTR.9 Thu Jan 21 17:55:47 2010 (r202763) @@ -88,10 +88,10 @@ the interrupt handler name. Zero is returned on success, otherwise an appropriate error is returned. .Sh SEE ALSO .Xr BUS_SETUP_INTR 9 , -.Xr device 9 , -.Xr printf 9 , .Xr systat 1 , -.Xr vmstat 8 +.Xr vmstat 8 , +.Xr device 9 , +.Xr printf 9 .Sh HISTORY The .Fn BUS_DESCRIBE_INTR Modified: stable/7/share/man/man9/Makefile ============================================================================== --- stable/7/share/man/man9/Makefile Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/share/man/man9/Makefile Thu Jan 21 17:55:47 2010 (r202763) @@ -24,6 +24,7 @@ MAN= accept_filter.9 \ BUS_BIND_INTR.9 \ bus_child_present.9 \ BUS_CONFIG_INTR.9 \ + BUS_DESCRIBE_INTR.9 \ bus_dma.9 \ bus_generic_attach.9 \ bus_generic_detach.9 \ @@ -379,6 +380,7 @@ MLINKS+=buf.9 bp.9 MLINKS+=bus_activate_resource.9 bus_deactivate_resource.9 MLINKS+=bus_alloc_resource.9 bus_alloc_resource_any.9 MLINKS+=BUS_BIND_INTR.9 bus_bind_intr.9 +MLINKS+=BUS_DESCRIBE_INTR.9 bus_describe_intr.9 MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dmamap_create.9 \ bus_dma.9 bus_dmamap_destroy.9 \ Modified: stable/7/sys/amd64/amd64/intr_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/intr_machdep.c Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/amd64/amd64/intr_machdep.c Thu Jan 21 17:55:47 2010 (r202763) @@ -405,6 +405,23 @@ atpic_reset(void) } #endif +/* Add a description to an active interrupt handler. */ +int +intr_describe(u_int vector, void *ih, const char *descr) +{ + struct intsrc *isrc; + int error; + + isrc = intr_lookup_source(vector); + if (isrc == NULL) + return (EINVAL); + error = intr_event_describe_handler(isrc->is_event, ih, descr); + if (error) + return (error); + intrcnt_updatename(isrc); + return (0); +} + #ifdef DDB /* * Dump data about interrupt handlers Modified: stable/7/sys/amd64/amd64/nexus.c ============================================================================== --- stable/7/sys/amd64/amd64/nexus.c Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/amd64/amd64/nexus.c Thu Jan 21 17:55:47 2010 (r202763) @@ -94,6 +94,9 @@ static int nexus_bind_intr(device_t, dev #endif static int nexus_config_intr(device_t, int, enum intr_trigger, enum intr_polarity); +static int nexus_describe_intr(device_t dev, device_t child, + struct resource *irq, void *cookie, + const char *descr); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); static int nexus_deactivate_resource(device_t, device_t, int, int, @@ -137,6 +140,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif DEVMETHOD(bus_config_intr, nexus_config_intr), + DEVMETHOD(bus_describe_intr, nexus_describe_intr), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_set_resource, nexus_set_resource), DEVMETHOD(bus_get_resource, nexus_get_resource), @@ -472,6 +476,14 @@ nexus_config_intr(device_t dev, int irq, return (intr_config_intr(irq, trig, pol)); } +static int +nexus_describe_intr(device_t dev, device_t child, struct resource *irq, + void *cookie, const char *descr) +{ + + return (intr_describe(rman_get_start(irq), cookie, descr)); +} + static struct resource_list * nexus_get_reslist(device_t dev, device_t child) { Modified: stable/7/sys/amd64/include/intr_machdep.h ============================================================================== --- stable/7/sys/amd64/include/intr_machdep.h Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/amd64/include/intr_machdep.h Thu Jan 21 17:55:47 2010 (r202763) @@ -151,6 +151,7 @@ int intr_bind(u_int vector, u_char cpu); #endif int intr_config_intr(int vector, enum intr_trigger trig, enum intr_polarity pol); +int intr_describe(u_int vector, void *ih, const char *descr); void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); struct intsrc *intr_lookup_source(int vector); int intr_register_pic(struct pic *pic); Modified: stable/7/sys/i386/i386/intr_machdep.c ============================================================================== --- stable/7/sys/i386/i386/intr_machdep.c Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/i386/i386/intr_machdep.c Thu Jan 21 17:55:47 2010 (r202763) @@ -374,6 +374,23 @@ intr_init(void *dummy __unused) } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); +/* Add a description to an active interrupt handler. */ +int +intr_describe(u_int vector, void *ih, const char *descr) +{ + struct intsrc *isrc; + int error; + + isrc = intr_lookup_source(vector); + if (isrc == NULL) + return (EINVAL); + error = intr_event_describe_handler(isrc->is_event, ih, descr); + if (error) + return (error); + intrcnt_updatename(isrc); + return (0); +} + #ifdef DDB /* * Dump data about interrupt handlers Modified: stable/7/sys/i386/i386/nexus.c ============================================================================== --- stable/7/sys/i386/i386/nexus.c Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/i386/i386/nexus.c Thu Jan 21 17:55:47 2010 (r202763) @@ -98,6 +98,9 @@ static int nexus_bind_intr(device_t, dev #endif static int nexus_config_intr(device_t, int, enum intr_trigger, enum intr_polarity); +static int nexus_describe_intr(device_t dev, device_t child, + struct resource *irq, void *cookie, + const char *descr); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); static int nexus_deactivate_resource(device_t, device_t, int, int, @@ -143,6 +146,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif DEVMETHOD(bus_config_intr, nexus_config_intr), + DEVMETHOD(bus_describe_intr, nexus_describe_intr), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_set_resource, nexus_set_resource), DEVMETHOD(bus_get_resource, nexus_get_resource), @@ -519,6 +523,14 @@ nexus_config_intr(device_t dev, int irq, return (intr_config_intr(irq, trig, pol)); } +static int +nexus_describe_intr(device_t dev, device_t child, struct resource *irq, + void *cookie, const char *descr) +{ + + return (intr_describe(rman_get_start(irq), cookie, descr)); +} + static struct resource_list * nexus_get_reslist(device_t dev, device_t child) { Modified: stable/7/sys/i386/include/intr_machdep.h ============================================================================== --- stable/7/sys/i386/include/intr_machdep.h Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/i386/include/intr_machdep.h Thu Jan 21 17:55:47 2010 (r202763) @@ -138,6 +138,7 @@ int intr_bind(u_int vector, u_char cpu); #endif int intr_config_intr(int vector, enum intr_trigger trig, enum intr_polarity pol); +int intr_describe(u_int vector, void *ih, const char *descr); void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); struct intsrc *intr_lookup_source(int vector); int intr_register_pic(struct pic *pic); Modified: stable/7/sys/kern/bus_if.m ============================================================================== --- stable/7/sys/kern/bus_if.m Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/kern/bus_if.m Thu Jan 21 17:55:47 2010 (r202763) @@ -509,7 +509,6 @@ METHOD int bind_intr { int _cpu; } DEFAULT bus_generic_bind_intr; - /** * @brief Allow (bus) drivers to specify the trigger mode and polarity * of the specified interrupt. @@ -527,6 +526,25 @@ METHOD int config_intr { } DEFAULT bus_generic_config_intr; /** + * @brief Allow drivers to associate a description with an active + * interrupt handler. + * + * @param _dev the parent device of @p _child + * @param _child the device which allocated the resource + * @param _irq the resource representing the interrupt + * @param _cookie the cookie value returned when the interrupt + * was originally registered + * @param _descr the description to associate with the interrupt + */ +METHOD int describe_intr { + device_t _dev; + device_t _child; + struct resource *_irq; + void *_cookie; + const char *_descr; +} DEFAULT bus_generic_describe_intr; + +/** * @brief Notify a (bus) driver about a child that the hints mechanism * believes it has discovered. * Modified: stable/7/sys/kern/kern_intr.c ============================================================================== --- stable/7/sys/kern/kern_intr.c Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/kern/kern_intr.c Thu Jan 21 17:55:47 2010 (r202763) @@ -506,7 +506,7 @@ intr_event_add_handler(struct intr_event ih->ih_filter = filter; ih->ih_handler = handler; ih->ih_argument = arg; - ih->ih_name = name; + strlcpy(ih->ih_name, name, sizeof(ih->ih_name)); ih->ih_event = ie; ih->ih_pri = pri; if (flags & INTR_EXCL) @@ -579,7 +579,7 @@ intr_event_add_handler(struct intr_event ih->ih_filter = filter; ih->ih_handler = handler; ih->ih_argument = arg; - ih->ih_name = name; + strlcpy(ih->ih_name, name, sizeof(ih->ih_name)); ih->ih_event = ie; ih->ih_pri = pri; if (flags & INTR_EXCL) @@ -647,6 +647,61 @@ intr_event_add_handler(struct intr_event #endif /* + * Append a description preceded by a ':' to the name of the specified + * interrupt handler. + */ +int +intr_event_describe_handler(struct intr_event *ie, void *cookie, + const char *descr) +{ + struct intr_handler *ih; + size_t space; + char *start; + + mtx_lock(&ie->ie_lock); +#ifdef INVARIANTS + TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { + if (ih == cookie) + break; + } + if (ih == NULL) { + mtx_unlock(&ie->ie_lock); + panic("handler %p not found in interrupt event %p", cookie, ie); + } +#endif + ih = cookie; + + /* + * Look for an existing description by checking for an + * existing ":". This assumes device names do not include + * colons. If one is found, prepare to insert the new + * description at that point. If one is not found, find the + * end of the name to use as the insertion point. + */ + start = index(ih->ih_name, ':'); + if (start == NULL) + start = index(ih->ih_name, 0); + + /* + * See if there is enough remaining room in the string for the + * description + ":". The "- 1" leaves room for the trailing + * '\0'. The "+ 1" accounts for the colon. + */ + space = sizeof(ih->ih_name) - (start - ih->ih_name) - 1; + if (strlen(descr) + 1 > space) { + mtx_unlock(&ie->ie_lock); + return (ENOSPC); + } + + /* Append a colon followed by the description. */ + *start = ':'; + strcpy(start + 1, descr); + intr_event_update(ie); + mtx_unlock(&ie->ie_lock); + return (0); +} + +/* * Return the ie_source field from the intr_event an intr_handler is * associated with. */ Modified: stable/7/sys/kern/subr_bus.c ============================================================================== --- stable/7/sys/kern/subr_bus.c Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/kern/subr_bus.c Thu Jan 21 17:55:47 2010 (r202763) @@ -3264,6 +3264,24 @@ bus_generic_config_intr(device_t dev, in } /** + * @brief Helper function for implementing BUS_DESCRIBE_INTR(). + * + * This simple implementation of BUS_DESCRIBE_INTR() simply calls the + * BUS_DESCRIBE_INTR() method of the parent of @p dev. + */ +int +bus_generic_describe_intr(device_t dev, device_t child, struct resource *irq, + void *cookie, const char *descr) +{ + + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent) + return (BUS_DESCRIBE_INTR(dev->parent, child, irq, cookie, + descr)); + return (EINVAL); +} + +/** * @brief Helper function for implementing BUS_GET_DMA_TAG(). * * This simple implementation of BUS_GET_DMA_TAG() simply calls the @@ -3569,6 +3587,28 @@ bus_bind_intr(device_t dev, struct resou } /** + * @brief Wrapper function for BUS_DESCRIBE_INTR(). + * + * This function first formats the requested description into a + * temporary buffer and then calls the BUS_DESCRIBE_INTR() method of + * the parent of @p dev. + */ +int +bus_describe_intr(device_t dev, struct resource *irq, void *cookie, + const char *fmt, ...) +{ + char descr[MAXCOMLEN]; + va_list ap; + + if (dev->parent == NULL) + return (EINVAL); + va_start(ap, fmt); + vsnprintf(descr, sizeof(descr), fmt, ap); + va_end(ap); + return (BUS_DESCRIBE_INTR(dev->parent, dev, irq, cookie, descr)); +} + +/** * @brief Wrapper function for BUS_SET_RESOURCE(). * * This function simply calls the BUS_SET_RESOURCE() method of the Modified: stable/7/sys/sparc64/include/intr_machdep.h ============================================================================== --- stable/7/sys/sparc64/include/intr_machdep.h Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/sparc64/include/intr_machdep.h Thu Jan 21 17:55:47 2010 (r202763) @@ -93,6 +93,7 @@ extern struct intr_vector intr_vectors[] void intr_add_cpu(u_int cpu); #endif int intr_bind(int vec, u_char cpu); +int intr_describe(int vec, void *ih, const char *descr); void intr_setup(int level, ih_func_t *ihf, int pri, iv_func_t *ivf, void *iva); void intr_init1(void); Modified: stable/7/sys/sparc64/pci/psycho.c ============================================================================== --- stable/7/sys/sparc64/pci/psycho.c Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/sparc64/pci/psycho.c Thu Jan 21 17:55:47 2010 (r202763) @@ -116,6 +116,7 @@ static bus_alloc_resource_t psycho_alloc static bus_activate_resource_t psycho_activate_resource; static bus_deactivate_resource_t psycho_deactivate_resource; static bus_release_resource_t psycho_release_resource; +static bus_describe_intr_t psycho_describe_intr; static bus_get_dma_tag_t psycho_get_dma_tag; static pcib_maxslots_t psycho_maxslots; static pcib_read_config_t psycho_read_config; @@ -140,6 +141,7 @@ static device_method_t psycho_methods[] DEVMETHOD(bus_activate_resource, psycho_activate_resource), DEVMETHOD(bus_deactivate_resource, psycho_deactivate_resource), DEVMETHOD(bus_release_resource, psycho_release_resource), + DEVMETHOD(bus_describe_intr, psycho_describe_intr), DEVMETHOD(bus_get_dma_tag, psycho_get_dma_tag), /* pcib interface */ @@ -1262,6 +1264,18 @@ psycho_teardown_intr(device_t dev, devic return (bus_generic_teardown_intr(dev, child, vec, cookie)); } +static int +psycho_describe_intr(device_t dev, device_t child, struct resource *vec, + void *cookie, const char *descr) +{ + struct psycho_softc *sc; + + sc = device_get_softc(dev); + if (sc->sc_mode == PSYCHO_MODE_SABRE) + cookie = ((struct psycho_dma_sync *)cookie)->pds_cookie; + return (bus_generic_describe_intr(dev, child, vec, cookie, descr)); +} + static struct resource * psycho_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/sparc64/pci/schizo.c Thu Jan 21 17:55:47 2010 (r202763) @@ -114,6 +114,7 @@ static bus_alloc_resource_t schizo_alloc static bus_activate_resource_t schizo_activate_resource; static bus_deactivate_resource_t schizo_deactivate_resource; static bus_release_resource_t schizo_release_resource; +static bus_describe_intr_t schizo_describe_intr; static bus_get_dma_tag_t schizo_get_dma_tag; static pcib_maxslots_t schizo_maxslots; static pcib_read_config_t schizo_read_config; @@ -138,6 +139,7 @@ static device_method_t schizo_methods[] DEVMETHOD(bus_activate_resource, schizo_activate_resource), DEVMETHOD(bus_deactivate_resource, schizo_deactivate_resource), DEVMETHOD(bus_release_resource, schizo_release_resource), + DEVMETHOD(bus_describe_intr, schizo_describe_intr), DEVMETHOD(bus_get_dma_tag, schizo_get_dma_tag), /* pcib interface */ @@ -1283,6 +1285,18 @@ schizo_teardown_intr(device_t dev, devic return (bus_generic_teardown_intr(dev, child, vec, cookie)); } +static int +schizo_describe_intr(device_t dev, device_t child, struct resource *vec, + void *cookie, const char *descr) +{ + struct schizo_softc *sc; + + sc = device_get_softc(dev); + if ((sc->sc_flags & SCHIZO_FLAGS_CDMA) != 0) + cookie = ((struct schizo_dma_sync *)cookie)->sds_cookie; + return (bus_generic_describe_intr(dev, child, vec, cookie, descr)); +} + static struct resource * schizo_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Thu Jan 21 17:55:47 2010 (r202763) @@ -414,6 +414,31 @@ inthand_remove(int vec, void *cookie) return (error); } +/* Add a description to an active interrupt handler. */ +int +intr_describe(int vec, void *ih, const char *descr) +{ + struct intr_vector *iv; + int error; + + if (vec < 0 || vec >= IV_MAX) + return (EINVAL); + sx_xlock(&intr_table_lock); + iv = &intr_vectors[vec]; + if (iv == NULL) { + sx_xunlock(&intr_table_lock); + return (EINVAL); + } + error = intr_event_describe_handler(iv->iv_event, ih, descr); + if (error) { + sx_xunlock(&intr_table_lock); + return (error); + } + intrcnt_updatename(vec, iv->iv_event->ie_fullname, 0); + sx_xunlock(&intr_table_lock); + return (error); +} + #ifdef SMP /* * Support for balancing interrupt sources across CPUs. For now we just Modified: stable/7/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/nexus.c Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/sparc64/sparc64/nexus.c Thu Jan 21 17:55:47 2010 (r202763) @@ -90,12 +90,13 @@ static bus_activate_resource_t nexus_act static bus_deactivate_resource_t nexus_deactivate_resource; static bus_release_resource_t nexus_release_resource; static bus_get_resource_list_t nexus_get_resource_list; +#ifdef SMP +static bus_bind_intr_t nexus_bind_intr; +#endif +static bus_describe_intr_t nexus_describe_intr; static bus_get_dma_tag_t nexus_get_dma_tag; static ofw_bus_get_devinfo_t nexus_get_devinfo; -#ifdef SMP -static int nexus_bind_intr(device_t, device_t, struct resource *, int); -#endif static int nexus_inlist(const char *, const char *const *); static struct nexus_devinfo * nexus_setup_dinfo(device_t, phandle_t); static void nexus_destroy_dinfo(struct nexus_devinfo *); @@ -128,6 +129,7 @@ static device_method_t nexus_methods[] = #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif + DEVMETHOD(bus_describe_intr, nexus_describe_intr), DEVMETHOD(bus_get_dma_tag, nexus_get_dma_tag), /* ofw_bus interface */ @@ -328,6 +330,14 @@ nexus_bind_intr(device_t dev, device_t c } #endif +static int +nexus_describe_intr(device_t dev, device_t child, struct resource *r, + void *cookie, const char *descr) +{ + + return (intr_describe(rman_get_start(r), cookie, descr)); +} + static struct resource * nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) Modified: stable/7/sys/sys/bus.h ============================================================================== --- stable/7/sys/sys/bus.h Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/sys/bus.h Thu Jan 21 17:55:47 2010 (r202763) @@ -291,6 +291,9 @@ int bus_generic_bind_intr(device_t dev, int bus_generic_child_present(device_t dev, device_t child); int bus_generic_config_intr(device_t, int, enum intr_trigger, enum intr_polarity); +int bus_generic_describe_intr(device_t dev, device_t child, + struct resource *irq, void *cookie, + const char *descr); int bus_generic_deactivate_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int bus_generic_detach(device_t dev); @@ -361,6 +364,8 @@ int bus_setup_intr(device_t dev, struct void *arg, void **cookiep); int bus_teardown_intr(device_t dev, struct resource *r, void *cookie); int bus_bind_intr(device_t dev, struct resource *r, int cpu); +int bus_describe_intr(device_t dev, struct resource *irq, void *cookie, + const char *fmt, ...); int bus_set_resource(device_t dev, int type, int rid, u_long start, u_long count); int bus_get_resource(device_t dev, int type, int rid, Modified: stable/7/sys/sys/interrupt.h ============================================================================== --- stable/7/sys/sys/interrupt.h Thu Jan 21 17:54:29 2010 (r202762) +++ stable/7/sys/sys/interrupt.h Thu Jan 21 17:55:47 2010 (r202763) @@ -47,7 +47,7 @@ struct intr_handler { driver_intr_t *ih_handler; /* Handler function. */ void *ih_argument; /* Argument to pass to handler. */ int ih_flags; - const char *ih_name; /* Name of handler. */ + char ih_name[MAXCOMLEN]; /* Name of handler. */ struct intr_event *ih_event; /* Event we are connected to. */ int ih_need; /* Needs service. */ TAILQ_ENTRY(intr_handler) ih_next; /* Next handler for this event. */ @@ -156,6 +156,8 @@ int intr_event_create(struct intr_event void (*post_ithread)(void *), void (*post_filter)(void *), int (*assign_cpu)(void *, u_char), const char *fmt, ...) __printflike(9, 10); +int intr_event_describe_handler(struct intr_event *ie, void *cookie, + const char *descr); int intr_event_destroy(struct intr_event *ie); int intr_event_handle(struct intr_event *ie, struct trapframe *frame); int intr_event_remove_handler(void *cookie); From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 19:17:43 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5225C106566C; Thu, 21 Jan 2010 19:17:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F0588FC18; Thu, 21 Jan 2010 19:17:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0LJHh8x020314; Thu, 21 Jan 2010 19:17:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0LJHhZH020308; Thu, 21 Jan 2010 19:17:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001211917.o0LJHhZH020308@svn.freebsd.org> From: John Baldwin Date: Thu, 21 Jan 2010 19:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202765 - in stable/7/sys: kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 19:17:43 -0000 Author: jhb Date: Thu Jan 21 19:17:42 2010 New Revision: 202765 URL: http://svn.freebsd.org/changeset/base/202765 Log: MFC 198411: - Fix several off-by-one errors when using MAXCOMLEN. The p_comm[] and td_name[] arrays are actually MAXCOMLEN + 1 in size and a few places that created shadow copies of these arrays were just using MAXCOMLEN. - Prefer using sizeof() of an array type to explicit constants for the array length in a few places. - Ensure that all of p_comm[] is always zero'd during execve() to guard against any possible information leaks. Previously trailing garbage in p_comm[] could be leaked to userland in ktrace record headers. Modified: stable/7/sys/kern/kern_exec.c stable/7/sys/kern/kern_ktrace.c stable/7/sys/kern/subr_bus.c stable/7/sys/kern/subr_taskqueue.c stable/7/sys/sys/interrupt.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_exec.c ============================================================================== --- stable/7/sys/kern/kern_exec.c Thu Jan 21 19:11:18 2010 (r202764) +++ stable/7/sys/kern/kern_exec.c Thu Jan 21 19:17:42 2010 (r202765) @@ -559,9 +559,9 @@ interpret: execsigs(p); /* name this process - nameiexec(p, ndp) */ + bzero(p->p_comm, sizeof(p->p_comm)); len = min(ndp->ni_cnd.cn_namelen,MAXCOMLEN); bcopy(ndp->ni_cnd.cn_nameptr, p->p_comm, len); - p->p_comm[len] = 0; /* * mark as execed, wakeup the process that vforked (if any) and tell Modified: stable/7/sys/kern/kern_ktrace.c ============================================================================== --- stable/7/sys/kern/kern_ktrace.c Thu Jan 21 19:11:18 2010 (r202764) +++ stable/7/sys/kern/kern_ktrace.c Thu Jan 21 19:17:42 2010 (r202765) @@ -257,6 +257,10 @@ ktrace_resize_pool(u_int newsize) return (ktr_requestpool); } +/* ktr_getrequest() assumes that ktr_comm[] is the same size as p_comm[]. */ +CTASSERT(sizeof(((struct ktr_header *)NULL)->ktr_comm) == + (sizeof((struct proc *)NULL)->p_comm)); + static struct ktr_request * ktr_getrequest(int type) { @@ -284,7 +288,8 @@ ktr_getrequest(int type) microtime(&req->ktr_header.ktr_time); req->ktr_header.ktr_pid = p->p_pid; req->ktr_header.ktr_tid = td->td_tid; - bcopy(p->p_comm, req->ktr_header.ktr_comm, MAXCOMLEN + 1); + bcopy(p->p_comm, req->ktr_header.ktr_comm, + sizeof(req->ktr_header.ktr_comm)); req->ktr_buffer = NULL; req->ktr_header.ktr_len = 0; } else { Modified: stable/7/sys/kern/subr_bus.c ============================================================================== --- stable/7/sys/kern/subr_bus.c Thu Jan 21 19:11:18 2010 (r202764) +++ stable/7/sys/kern/subr_bus.c Thu Jan 21 19:17:42 2010 (r202765) @@ -3597,8 +3597,8 @@ int bus_describe_intr(device_t dev, struct resource *irq, void *cookie, const char *fmt, ...) { - char descr[MAXCOMLEN]; va_list ap; + char descr[MAXCOMLEN + 1]; if (dev->parent == NULL) return (EINVAL); Modified: stable/7/sys/kern/subr_taskqueue.c ============================================================================== --- stable/7/sys/kern/subr_taskqueue.c Thu Jan 21 19:11:18 2010 (r202764) +++ stable/7/sys/kern/subr_taskqueue.c Thu Jan 21 19:17:42 2010 (r202765) @@ -343,7 +343,7 @@ taskqueue_start_threads(struct taskqueue va_list ap; struct taskqueue *tq; struct thread *td; - char ktname[MAXCOMLEN]; + char ktname[MAXCOMLEN + 1]; int i, error; if (count <= 0) @@ -351,7 +351,7 @@ taskqueue_start_threads(struct taskqueue tq = *tqp; va_start(ap, name); - vsnprintf(ktname, MAXCOMLEN, name, ap); + vsnprintf(ktname, sizeof(ktname), name, ap); va_end(ap); tq->tq_pproc = malloc(sizeof(struct proc *) * count, M_TASKQUEUE, Modified: stable/7/sys/sys/interrupt.h ============================================================================== --- stable/7/sys/sys/interrupt.h Thu Jan 21 19:11:18 2010 (r202764) +++ stable/7/sys/sys/interrupt.h Thu Jan 21 19:17:42 2010 (r202765) @@ -47,7 +47,7 @@ struct intr_handler { driver_intr_t *ih_handler; /* Handler function. */ void *ih_argument; /* Argument to pass to handler. */ int ih_flags; - char ih_name[MAXCOMLEN]; /* Name of handler. */ + char ih_name[MAXCOMLEN + 1]; /* Name of handler. */ struct intr_event *ih_event; /* Event we are connected to. */ int ih_need; /* Needs service. */ TAILQ_ENTRY(intr_handler) ih_next; /* Next handler for this event. */ @@ -94,8 +94,8 @@ struct intr_handler { struct intr_event { TAILQ_ENTRY(intr_event) ie_list; TAILQ_HEAD(, intr_handler) ie_handlers; /* Interrupt handlers. */ - char ie_name[MAXCOMLEN]; /* Individual event name. */ - char ie_fullname[MAXCOMLEN]; + char ie_name[MAXCOMLEN + 1]; /* Individual event name. */ + char ie_fullname[MAXCOMLEN + 1]; struct mtx ie_lock; void *ie_source; /* Cookie used by MD code. */ struct intr_thread *ie_thread; /* Thread we are connected to. */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 20:17:15 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC400106566C; Thu, 21 Jan 2010 20:17:15 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by mx1.freebsd.org (Postfix) with ESMTP id A729F8FC19; Thu, 21 Jan 2010 20:17:14 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 9so110538eyd.9 for ; Thu, 21 Jan 2010 12:17:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=MUoSX0cFSF3DANhTZ9WMFP/C5L5uVErND0lW39L+4p4=; b=wJbE95fYCzFZR+1HjTRsSMWG7nSMBP3a8BnYk5ArPHh9aYuBQbxfQ8qATIKxVeMeMp wPUc1OxvzTagtkalr2ip2ZsXE9XuHbDYvvpv6FGKIyjUWvDCB+sMz5neJItnfpN+tp9S iZrDaI7JIdlbXPfj8lYeIG13WdrIet6sfsAUc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=FHfdJGBDazUiO6DUgG22pzFt07bODfz9T2qS96ThY6feMJzCxj2YBy8mabyJQkSwvy vk003gJvI/WAbnT5ty1RI20CTT2Cys6vCLvVXht9olQa74eQAJ8VTuX+81/XW2Hrq/gF IkYsY5sFv9J/nEFCyUexVJ/Wxo/bQJ4KvVV+s= Received: by 10.213.109.71 with SMTP id i7mr680938ebp.76.1264105033551; Thu, 21 Jan 2010 12:17:13 -0800 (PST) Received: from centel.dataix.local (ppp-22.1.dialinfree.com [209.172.22.1]) by mx.google.com with ESMTPS id 14sm1154246ewy.3.2010.01.21.12.17.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 21 Jan 2010 12:17:12 -0800 (PST) Sender: "J. Hellenthal" Date: Thu, 21 Jan 2010 15:16:52 -0500 From: jhell To: John Baldwin In-Reply-To: <201001211433.o0LEXIFC054459@svn.freebsd.org> Message-ID: References: <201001211433.o0LEXIFC054459@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r202750 - in stable/7/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/md fs/cd9660 fs/udf kern sys ufs/ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 20:17:15 -0000 Builds for stable/7 are broke by this commit with the folling error. cc -O2 -fno-strict-aliasing -pipe -DFREEBSD_NAMECACHE -DBUILDING_ZFS -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc -I/usr/src/sys/modules/zfs/../../cddl/compat/opensolaris -I/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs -I/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/zmod -I/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common -I/usr/src/sys/modules/zfs/../.. -I/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common/zfs -I/usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/common -I/usr/src/sys/modules/zfs/../../../include -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/sys/SH4500/opt_global.h -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -g -I/usr/obj/usr/src/sys/SH4500 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c: In function 'zfs_create_fs': /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c:1523: error: 'vp' undeclared (first use in this function) /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c:1523: error: (Each undeclared identifier is reported only once /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c:1523: error: for each function it appears in.) *** Error code 1 Stop in /usr/src/sys/modules/zfs. *** Error code 1 Stop in /usr/src/sys/modules. *** Error code 1 On Thu, 21 Jan 2010 09:33, jhb@ wrote: > Author: jhb > Date: Thu Jan 21 14:33:18 2010 > New Revision: 202750 > URL: http://svn.freebsd.org/changeset/base/202750 > > Log: > MFC 189696,189697: > Add a new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that a > filesystem supports additional operations using shared vnode locks. > Currently this is used to enable shared locks for open() and close() of > read-only file descriptors. > - When an ISOPEN namei() request is performed with LOCKSHARED, use a > shared vnode lock for the leaf vnode only if the mount point has the > extended shared flag set. > - Set LOCKSHARED in vn_open_cred() for requests that specify O_RDONLY but > not O_CREAT. > - Use a shared vnode lock around VOP_CLOSE() if the file was opened with > O_RDONLY and the mountpoint has the extended shared flag set. > - Adjust md(4) to upgrade the vnode lock on the vnode it gets back from > vn_open() since it now may only have a shared vnode lock. > - Don't enable shared vnode locks on FIFO vnodes in ZFS and UFS since > FIFO's require exclusive vnode locks for their open() and close() > routines. (My recent MPSAFE patches for UDF and cd9660 already included > this change.) > - Enable extended shared operations on UFS, cd9660, and UDF. > > Modified: > stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c > stable/7/sys/dev/md/md.c > stable/7/sys/fs/cd9660/cd9660_vfsops.c > stable/7/sys/fs/udf/udf_vfsops.c > stable/7/sys/kern/vfs_lookup.c > stable/7/sys/kern/vfs_vnops.c > stable/7/sys/kern/vnode_if.src > stable/7/sys/sys/mount.h > stable/7/sys/ufs/ffs/ffs_vfsops.c > Directory Properties: > stable/7/sys/ (props changed) > stable/7/sys/cddl/contrib/opensolaris/ (props changed) > stable/7/sys/contrib/dev/acpica/ (props changed) > stable/7/sys/contrib/pf/ (props changed) > > Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c > ============================================================================== > --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jan 21 13:31:41 2010 (r202749) > +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jan 21 14:33:18 2010 (r202750) > @@ -1520,6 +1520,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, > vnode.v_type = VDIR; > vnode.v_data = rootzp; > rootzp->z_vnode = &vnode; > + VN_LOCK_ASHARE(vp); > > bzero(&zfsvfs, sizeof (zfsvfs_t)); > > > Modified: stable/7/sys/dev/md/md.c > ============================================================================== > --- stable/7/sys/dev/md/md.c Thu Jan 21 13:31:41 2010 (r202749) > +++ stable/7/sys/dev/md/md.c Thu Jan 21 14:33:18 2010 (r202750) > @@ -918,12 +918,20 @@ mdcreate_vnode(struct md_s *sc, struct m > return (error); > vfslocked = NDHASGIANT(&nd); > NDFREE(&nd, NDF_ONLY_PNBUF); > - if (nd.ni_vp->v_type != VREG || > - (error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred, td))) { > - VOP_UNLOCK(nd.ni_vp, 0, td); > - (void)vn_close(nd.ni_vp, flags, td->td_ucred, td); > - VFS_UNLOCK_GIANT(vfslocked); > - return (error ? error : EINVAL); > + if (nd.ni_vp->v_type != VREG) { > + error = EINVAL; > + goto bad; > + } > + error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred, td); > + if (error != 0) > + goto bad; > + if (VOP_ISLOCKED(nd.ni_vp, td) != LK_EXCLUSIVE) { > + vn_lock(nd.ni_vp, LK_UPGRADE | LK_RETRY, td); > + if (nd.ni_vp->v_iflag & VI_DOOMED) { > + /* Forced unmount. */ > + error = EBADF; > + goto bad; > + } > } > nd.ni_vp->v_vflag |= VV_MD; > VOP_UNLOCK(nd.ni_vp, 0, td); > @@ -942,13 +950,15 @@ mdcreate_vnode(struct md_s *sc, struct m > sc->vnode = NULL; > vn_lock(nd.ni_vp, LK_EXCLUSIVE | LK_RETRY, td); > nd.ni_vp->v_vflag &= ~VV_MD; > - VOP_UNLOCK(nd.ni_vp, 0, td); > - (void)vn_close(nd.ni_vp, flags, td->td_ucred, td); > - VFS_UNLOCK_GIANT(vfslocked); > - return (error); > + goto bad; > } > VFS_UNLOCK_GIANT(vfslocked); > return (0); > +bad: > + VOP_UNLOCK(nd.ni_vp, 0, td); > + (void)vn_close(nd.ni_vp, flags, td->td_ucred, td); > + VFS_UNLOCK_GIANT(vfslocked); > + return (error); > } > > static int > > Modified: stable/7/sys/fs/cd9660/cd9660_vfsops.c > ============================================================================== > --- stable/7/sys/fs/cd9660/cd9660_vfsops.c Thu Jan 21 13:31:41 2010 (r202749) > +++ stable/7/sys/fs/cd9660/cd9660_vfsops.c Thu Jan 21 14:33:18 2010 (r202750) > @@ -373,7 +373,8 @@ iso_mountfs(devvp, mp, td) > mp->mnt_maxsymlinklen = 0; > MNT_ILOCK(mp); > mp->mnt_flag |= MNT_LOCAL; > - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED; > + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | > + MNTK_EXTENDED_SHARED; > MNT_IUNLOCK(mp); > isomp->im_mountp = mp; > isomp->im_dev = dev; > > Modified: stable/7/sys/fs/udf/udf_vfsops.c > ============================================================================== > --- stable/7/sys/fs/udf/udf_vfsops.c Thu Jan 21 13:31:41 2010 (r202749) > +++ stable/7/sys/fs/udf/udf_vfsops.c Thu Jan 21 14:33:18 2010 (r202750) > @@ -353,7 +353,8 @@ udf_mountfs(struct vnode *devvp, struct > mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; > MNT_ILOCK(mp); > mp->mnt_flag |= MNT_LOCAL; > - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED; > + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | > + MNTK_EXTENDED_SHARED; > MNT_IUNLOCK(mp); > udfmp->im_mountp = mp; > udfmp->im_dev = dev; > > Modified: stable/7/sys/kern/vfs_lookup.c > ============================================================================== > --- stable/7/sys/kern/vfs_lookup.c Thu Jan 21 13:31:41 2010 (r202749) > +++ stable/7/sys/kern/vfs_lookup.c Thu Jan 21 14:33:18 2010 (r202750) > @@ -322,6 +322,41 @@ compute_cn_lkflags(struct mount *mp, int > return lkflags; > } > > +static __inline int > +needs_exclusive_leaf(struct mount *mp, int flags) > +{ > + > + /* > + * Intermediate nodes can use shared locks, we only need to > + * force an exclusive lock for leaf nodes. > + */ > + if ((flags & (ISLASTCN | LOCKLEAF)) != (ISLASTCN | LOCKLEAF)) > + return (0); > + > + /* Always use exclusive locks if LOCKSHARED isn't set. */ > + if (!(flags & LOCKSHARED)) > + return (1); > + > + /* > + * For lookups during open(), if the mount point supports > + * extended shared operations, then use a shared lock for the > + * leaf node, otherwise use an exclusive lock. > + */ > + if (flags & ISOPEN) { > + if (mp != NULL && > + (mp->mnt_kern_flag & MNTK_EXTENDED_SHARED)) > + return (0); > + else > + return (1); > + } > + > + /* > + * Lookup requests outside of open() that specify LOCKSHARED > + * only need a shared lock on the leaf vnode. > + */ > + return (0); > +} > + > /* > * Search a pathname. > * This is a very central and rather complicated routine. > @@ -580,8 +615,7 @@ unionlookup: > * If we're looking up the last component and we need an exclusive > * lock, adjust our lkflags. > */ > - if ((cnp->cn_flags & (ISLASTCN|LOCKSHARED|LOCKLEAF)) == > - (ISLASTCN|LOCKLEAF)) > + if (needs_exclusive_leaf(dp->v_mount, cnp->cn_flags)) > cnp->cn_lkflags = LK_EXCLUSIVE; > #ifdef NAMEI_DIAGNOSTIC > vprint("lookup in", dp); > @@ -778,8 +812,8 @@ success: > * Because of lookup_shared we may have the vnode shared locked, but > * the caller may want it to be exclusively locked. > */ > - if ((cnp->cn_flags & (ISLASTCN | LOCKSHARED | LOCKLEAF)) == > - (ISLASTCN | LOCKLEAF) && VOP_ISLOCKED(dp, td) != LK_EXCLUSIVE) { > + if (needs_exclusive_leaf(dp->v_mount, cnp->cn_flags) && > + VOP_ISLOCKED(dp, td) != LK_EXCLUSIVE) { > vn_lock(dp, LK_UPGRADE | LK_RETRY, td); > if (dp->v_iflag & VI_DOOMED) { > error = ENOENT; > > Modified: stable/7/sys/kern/vfs_vnops.c > ============================================================================== > --- stable/7/sys/kern/vfs_vnops.c Thu Jan 21 13:31:41 2010 (r202749) > +++ stable/7/sys/kern/vfs_vnops.c Thu Jan 21 14:33:18 2010 (r202750) > @@ -185,6 +185,8 @@ restart: > ndp->ni_cnd.cn_flags = ISOPEN | > ((fmode & O_NOFOLLOW) ? NOFOLLOW : FOLLOW) | > LOCKLEAF | MPSAFE | AUDITVNODE1; > + if (!(fmode & FWRITE)) > + ndp->ni_cnd.cn_flags |= LOCKSHARED; > if ((error = namei(ndp)) != 0) > return (error); > if (!mpsafe) > @@ -235,7 +237,7 @@ restart: > if (fmode & FWRITE) > vp->v_writecount++; > *flagp = fmode; > - ASSERT_VOP_ELOCKED(vp, "vn_open_cred"); > + ASSERT_VOP_LOCKED(vp, "vn_open_cred"); > if (!mpsafe) > VFS_UNLOCK_GIANT(vfslocked); > return (0); > @@ -280,12 +282,18 @@ vn_close(vp, flags, file_cred, td) > struct thread *td; > { > struct mount *mp; > - int error; > + int error, lock_flags; > + > + if (!(flags & FWRITE) && vp->v_mount != NULL && > + vp->v_mount->mnt_kern_flag & MNTK_EXTENDED_SHARED) > + lock_flags = LK_SHARED; > + else > + lock_flags = LK_EXCLUSIVE; > > VFS_ASSERT_GIANT(vp->v_mount); > > vn_start_write(vp, &mp, V_WAIT); > - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); > + vn_lock(vp, lock_flags | LK_RETRY, td); > if (flags & FWRITE) { > VNASSERT(vp->v_writecount > 0, vp, > ("vn_close: negative writecount")); > > Modified: stable/7/sys/kern/vnode_if.src > ============================================================================== > --- stable/7/sys/kern/vnode_if.src Thu Jan 21 13:31:41 2010 (r202749) > +++ stable/7/sys/kern/vnode_if.src Thu Jan 21 14:33:18 2010 (r202750) > @@ -134,7 +134,7 @@ vop_open { > }; > > > -%% close vp E E E > +%% close vp L L L > > vop_close { > IN struct vnode *vp; > > Modified: stable/7/sys/sys/mount.h > ============================================================================== > --- stable/7/sys/sys/mount.h Thu Jan 21 13:31:41 2010 (r202749) > +++ stable/7/sys/sys/mount.h Thu Jan 21 14:33:18 2010 (r202750) > @@ -328,6 +328,7 @@ void __mnt_vnode_markerfree(str > #define MNTK_SOFTDEP 0x00000004 /* async disabled by softdep */ > #define MNTK_NOINSMNTQ 0x00000008 /* insmntque is not allowed */ > #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ > +#define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ > #define MNTK_SHARED_WRITES 0x00000080 /* Allow shared locking for writes */ > #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ > #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ > @@ -335,8 +336,8 @@ void __mnt_vnode_markerfree(str > #define MNTK_SUSPEND2 0x04000000 /* block secondary writes */ > #define MNTK_SUSPENDED 0x10000000 /* write operations are suspended */ > #define MNTK_MPSAFE 0x20000000 /* Filesystem is MPSAFE. */ > -#define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ > #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ > +#define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ > > /* > * Sysctl CTL_VFS definitions. > > Modified: stable/7/sys/ufs/ffs/ffs_vfsops.c > ============================================================================== > --- stable/7/sys/ufs/ffs/ffs_vfsops.c Thu Jan 21 13:31:41 2010 (r202749) > +++ stable/7/sys/ufs/ffs/ffs_vfsops.c Thu Jan 21 14:33:18 2010 (r202750) > @@ -883,7 +883,8 @@ ffs_mountfs(devvp, mp, td) > * Initialize filesystem stat information in mount struct. > */ > MNT_ILOCK(mp); > - mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED; > + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | > + MNTK_EXTENDED_SHARED; > MNT_IUNLOCK(mp); > #ifdef UFS_EXTATTR > #ifdef UFS_EXTATTR_AUTOSTART > @@ -1440,10 +1441,9 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags > return (error); > } > /* > - * FFS supports recursive and shared locking. > + * FFS supports recursive locking. > */ > - vp->v_vnlock->lk_flags |= LK_CANRECURSE; > - vp->v_vnlock->lk_flags &= ~LK_NOSHARE; > + VN_LOCK_AREC(vp); > vp->v_data = ip; > vp->v_bufobj.bo_bsize = fs->fs_bsize; > ip->i_vnode = vp; > @@ -1518,6 +1518,10 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags > /* > * Finish inode initialization. > */ > + if (vp->v_type != VFIFO) { > + /* FFS supports shared locking for all files except fifos. */ > + VN_LOCK_ASHARE(vp); > + } > > /* > * Set up a generation number for this inode if it does not > _______________________________________________ > svn-src-stable-7@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-7 > To unsubscribe, send any mail to "svn-src-stable-7-unsubscribe@freebsd.org" > -- jhell From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 21:04:30 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 015A51065676; Thu, 21 Jan 2010 21:04:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E348A8FC22; Thu, 21 Jan 2010 21:04:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0LL4TIA045046; Thu, 21 Jan 2010 21:04:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0LL4Tfk045044; Thu, 21 Jan 2010 21:04:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001212104.o0LL4Tfk045044@svn.freebsd.org> From: John Baldwin Date: Thu, 21 Jan 2010 21:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202769 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 21:04:30 -0000 Author: jhb Date: Thu Jan 21 21:04:29 2010 New Revision: 202769 URL: http://svn.freebsd.org/changeset/base/202769 Log: Revert part of the previous change that partially reverted an earlier MFC of 199156. Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jan 21 20:57:43 2010 (r202768) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jan 21 21:04:29 2010 (r202769) @@ -1520,7 +1520,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, vnode.v_type = VDIR; vnode.v_data = rootzp; rootzp->z_vnode = &vnode; - VN_LOCK_ASHARE(vp); bzero(&zfsvfs, sizeof (zfsvfs_t)); From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 21 21:12:37 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D3D7106568B; Thu, 21 Jan 2010 21:12:37 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09F1F8FC16; Thu, 21 Jan 2010 21:12:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0LLCavc046985; Thu, 21 Jan 2010 21:12:36 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0LLCaud046982; Thu, 21 Jan 2010 21:12:36 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001212112.o0LLCaud046982@svn.freebsd.org> From: Christian Brueffer Date: Thu, 21 Jan 2010 21:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202770 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 21:12:37 -0000 Author: brueffer Date: Thu Jan 21 21:12:36 2010 New Revision: 202770 URL: http://svn.freebsd.org/changeset/base/202770 Log: MFC: r189773 by rpaulo Rename the k8temp(4) man page to amdtemp(4) and update its contents for the new families. PR: 142925 Submitted by: Tsurutani Naoki Added: stable/7/share/man/man4/amdtemp.4 - copied unchanged from r189773, head/share/man/man4/amdtemp.4 Deleted: stable/7/share/man/man4/k8temp.4 Modified: stable/7/share/man/man4/Makefile Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Thu Jan 21 21:04:29 2010 (r202769) +++ stable/7/share/man/man4/Makefile Thu Jan 21 21:12:36 2010 (r202770) @@ -20,6 +20,7 @@ MAN= aac.4 \ ale.4 \ altq.4 \ amd.4 \ + ${_amdtemp.4} \ ${_amdsmb.4} \ amr.4 \ an.4 \ @@ -146,7 +147,6 @@ MAN= aac.4 \ ixgb.4 \ jme.4 \ joy.4 \ - ${_k8temp.4} \ kbdmux.4 \ keyboard.4 \ kld.4 \ @@ -561,6 +561,7 @@ MLINKS+=xl.4 if_xl.4 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" _acpi_dock.4= acpi_dock.4 _amdsmb.4= amdsmb.4 +_amdtemp.4= amdtemp.4 _coretemp.4= coretemp.4 _cpuctl.4= cpuctl.4 _hptiop.4= hptiop.4 @@ -572,7 +573,6 @@ _if_nve.4= if_nve.4 _if_nxge.4= if_nxge.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 -_k8temp.4= k8temp.4 _lindev.4= lindev.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 Copied: stable/7/share/man/man4/amdtemp.4 (from r189773, head/share/man/man4/amdtemp.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man4/amdtemp.4 Thu Jan 21 21:12:36 2010 (r202770, copy of r189773, head/share/man/man4/amdtemp.4) @@ -0,0 +1,80 @@ +.\"- +.\" Copyright (c) 2008 Rui Paulo +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 8, 2008 +.Dt AMDTEMP 4 +.Os +.Sh NAME +.Nm amdtemp +.Nd device driver for AMD K8, K10 and K11 on-die digital thermal sensor +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device amdtemp" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +amdtemp_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the on-die digital thermal sensor present +in AMD K8, K10 and K11 processors. +.Pp +For the K8 family, the +.Nm +driver reports each cores' temperature through a sysctl node in the +corresponding CPU devices's sysctl tree, named +.Va dev.amdtemp.%d.sensor{0,1}.core{0,1} . +The driver also creates +.Va dev.cpu.%d.temperature +displaying the maximum temperature of the two sensors +located in each CPU core. +.Pp +For the K10 and K11 families, the driver creates +.Va dev.cpu.%d.temperature +with the temperature of each core. +.Sh BUGS +AMD K9 is not supported because temperature reporting has been replaced +by Maltese. +.Sh SEE ALSO +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 7.1 . +.Sh AUTHORS +.An +.An Rui Paulo Aq rpaulo@FreeBSD.org +.An Norikatsu Shigemura Aq nork@FreeBSD.org From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 02:35:40 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2340106566C; Fri, 22 Jan 2010 02:35:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1E328FC12; Fri, 22 Jan 2010 02:35:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0M2ZePj019963; Fri, 22 Jan 2010 02:35:40 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0M2Ze6e019962; Fri, 22 Jan 2010 02:35:40 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201001220235.o0M2Ze6e019962@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 22 Jan 2010 02:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202775 - stable/7/sys/dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 02:35:41 -0000 Author: np Date: Fri Jan 22 02:35:40 2010 New Revision: 202775 URL: http://svn.freebsd.org/changeset/base/202775 Log: Remove debug printf. Modified: stable/7/sys/dev/cxgb/cxgb_sge.c Modified: stable/7/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_sge.c Thu Jan 21 21:59:10 2010 (r202774) +++ stable/7/sys/dev/cxgb/cxgb_sge.c Fri Jan 22 02:35:40 2010 (r202775) @@ -1562,8 +1562,6 @@ addq_exit: mbufq_tail(&q->sendq, m); struct sge_qset *qs = txq_to_qset(q, qid); - printf("stopping q\n"); - setbit(&qs->txq_stopped, qid); smp_mb(); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 09:30:10 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4395F106566C; Fri, 22 Jan 2010 09:30:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 319578FC15; Fri, 22 Jan 2010 09:30:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0M9UAOx022817; Fri, 22 Jan 2010 09:30:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0M9UApw022815; Fri, 22 Jan 2010 09:30:10 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201001220930.o0M9UApw022815@svn.freebsd.org> From: Andriy Gapon Date: Fri, 22 Jan 2010 09:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202788 - stable/7/lib/libstand X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 09:30:10 -0000 Author: avg Date: Fri Jan 22 09:30:09 2010 New Revision: 202788 URL: http://svn.freebsd.org/changeset/base/202788 Log: MFC r202585: fix a comment typo Modified: stable/7/lib/libstand/bzipfs.c Directory Properties: stable/7/lib/libstand/ (props changed) Modified: stable/7/lib/libstand/bzipfs.c ============================================================================== --- stable/7/lib/libstand/bzipfs.c Fri Jan 22 09:27:31 2010 (r202787) +++ stable/7/lib/libstand/bzipfs.c Fri Jan 22 09:30:09 2010 (r202788) @@ -279,7 +279,7 @@ bzf_rewind(struct open_file *f) /* * Since bzip2 does not have an equivalent inflateReset function a crude * one needs to be provided. The functions all called in such a way that - * at any time an error occurs a role back can be done (effectively making + * at any time an error occurs a roll back can be done (effectively making * this rewind 'atomic', either the reset occurs successfully or not at all, * with no 'undefined' state happening). */ From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 09:37:48 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21534106568D; Fri, 22 Jan 2010 09:37:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E3C08FC0A; Fri, 22 Jan 2010 09:37:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0M9bljE025149; Fri, 22 Jan 2010 09:37:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0M9blgu025147; Fri, 22 Jan 2010 09:37:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201001220937.o0M9blgu025147@svn.freebsd.org> From: Andriy Gapon Date: Fri, 22 Jan 2010 09:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202791 - stable/7/sys/dev/acpica X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 09:37:48 -0000 Author: avg Date: Fri Jan 22 09:37:47 2010 New Revision: 202791 URL: http://svn.freebsd.org/changeset/base/202791 Log: MFC r202558: acpi_ec: clean up 'private' ivar when freeing memory Modified: stable/7/sys/dev/acpica/acpi_ec.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_ec.c Fri Jan 22 09:34:57 2010 (r202790) +++ stable/7/sys/dev/acpica/acpi_ec.c Fri Jan 22 09:37:47 2010 (r202791) @@ -467,6 +467,7 @@ acpi_ec_attach(device_t dev) sc->ec_gpehandle = params->gpe_handle; sc->ec_uid = params->uid; sc->ec_suspending = FALSE; + acpi_set_private(dev, NULL); free(params, M_TEMP); /* Attach bus resources for data and command/status ports. */ From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 09:42:42 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43ECC1065692; Fri, 22 Jan 2010 09:42:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 316678FC23; Fri, 22 Jan 2010 09:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0M9ggAf026393; Fri, 22 Jan 2010 09:42:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0M9gg7Y026376; Fri, 22 Jan 2010 09:42:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201001220942.o0M9gg7Y026376@svn.freebsd.org> From: Andriy Gapon Date: Fri, 22 Jan 2010 09:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202793 - stable/7/sys/dev/acpica X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 09:42:42 -0000 Author: avg Date: Fri Jan 22 09:42:41 2010 New Revision: 202793 URL: http://svn.freebsd.org/changeset/base/202793 Log: MFC r202567: acpi_ec: remove redundant acpi_disabled check Modified: stable/7/sys/dev/acpica/acpi_ec.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_ec.c Fri Jan 22 09:41:09 2010 (r202792) +++ stable/7/sys/dev/acpica/acpi_ec.c Fri Jan 22 09:42:41 2010 (r202793) @@ -364,8 +364,7 @@ acpi_ec_probe(device_t dev) if (params != NULL) { ecdt = 1; ret = 0; - } else if (!acpi_disabled("ec") && - ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids)) { + } else if (ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids)) { params = malloc(sizeof(struct acpi_ec_params), M_TEMP, M_WAITOK | M_ZERO); h = acpi_get_handle(dev); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 11:42:44 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C046D106566B; Fri, 22 Jan 2010 11:42:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACEA38FC1F; Fri, 22 Jan 2010 11:42:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MBgiZQ058123; Fri, 22 Jan 2010 11:42:44 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MBgi5l058119; Fri, 22 Jan 2010 11:42:44 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001221142.o0MBgi5l058119@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 22 Jan 2010 11:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202805 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 11:42:44 -0000 Author: trasz Date: Fri Jan 22 11:42:44 2010 New Revision: 202805 URL: http://svn.freebsd.org/changeset/base/202805 Log: MFC c195785: Fix permission handling for extended attributes in ZFS. Without this change, ZFS uses SunOS Alternate Data Streams semantics - each EA has its own permissions, which are set at EA creation time and - unlike SunOS - invisible to the user and impossible to change. From the user point of view, it's just broken: sometimes access is granted when it shouldn't be, sometimes it's denied when it shouldn't be. This patch makes it behave just like UFS, i.e. depend on current file permissions. Also, it fixes returned error codes (ENOATTR instead of ENOENT) and makes listextattr(2) return 0 instead of EPERM where there is no EA directory (i.e. the file never had any EA). Tested by: cperciva Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jan 22 11:42:23 2010 (r202804) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jan 22 11:42:44 2010 (r202805) @@ -2364,6 +2364,15 @@ zfs_zaccess(znode_t *zp, int mode, int f is_attr = ((zp->z_phys->zp_flags & ZFS_XATTR) && (ZTOV(zp)->v_type == VDIR)); +#ifdef __FreeBSD__ + /* + * In FreeBSD, we don't care about permissions of individual ADS. + * Note that not checking them is not just an optimization - without + * this shortcut, EA operations may bogusly fail with EACCES. + */ + if (zp->z_phys->zp_flags & ZFS_XATTR) + return (0); +#else /* * If attribute then validate against base file */ @@ -2389,6 +2398,7 @@ zfs_zaccess(znode_t *zp, int mode, int f mode |= ACE_READ_NAMED_ATTRS; } } +#endif if ((error = zfs_zaccess_common(check_zp, mode, &working_mode, &check_privs, skipaclchk, cr)) == 0) { Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Fri Jan 22 11:42:23 2010 (r202804) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Fri Jan 22 11:42:44 2010 (r202805) @@ -831,8 +831,14 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * *xvpp = NULL; + /* + * In FreeBSD, access checking for creating an EA is being done + * in zfs_setextattr(), + */ +#ifndef __FreeBSD__ if (error = zfs_zaccess(zp, ACE_WRITE_NAMED_ATTRS, 0, B_FALSE, cr)) return (error); +#endif tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_bonus(tx, zp->z_id); @@ -906,12 +912,14 @@ top: ASSERT(zp->z_phys->zp_xattr == 0); -#ifdef TODO if (!(flags & CREATE_XATTR_DIR)) { zfs_dirent_unlock(dl); +#ifdef __FreeBSD__ + return (ENOATTR); +#else return (ENOENT); - } #endif + } if (zfsvfs->z_vfs->vfs_flag & VFS_RDONLY) { zfs_dirent_unlock(dl); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Jan 22 11:42:23 2010 (r202804) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Jan 22 11:42:44 2010 (r202805) @@ -4537,6 +4537,11 @@ vop_getextattr { vnode_t *xvp = NULL, *vp; int error, flags; + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + ap->a_cred, ap->a_td, VREAD); + if (error != 0) + return (error); + error = zfs_create_attrname(ap->a_attrnamespace, ap->a_name, attrname, sizeof(attrname)); if (error != 0) @@ -4558,6 +4563,8 @@ vop_getextattr { vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { + if (error == ENOENT) + error = ENOATTR; ZFS_EXIT(zfsvfs); return (error); } @@ -4599,6 +4606,11 @@ vop_deleteextattr { vnode_t *xvp = NULL, *vp; int error, flags; + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + ap->a_cred, ap->a_td, VWRITE); + if (error != 0) + return (error); + error = zfs_create_attrname(ap->a_attrnamespace, ap->a_name, attrname, sizeof(attrname)); if (error != 0) @@ -4619,6 +4631,8 @@ vop_deleteextattr { vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { + if (error == ENOENT) + error = ENOATTR; ZFS_EXIT(zfsvfs); return (error); } @@ -4658,6 +4672,11 @@ vop_setextattr { vnode_t *xvp = NULL, *vp; int error, flags; + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + ap->a_cred, ap->a_td, VWRITE); + if (error != 0) + return (error); + error = zfs_create_attrname(ap->a_attrnamespace, ap->a_name, attrname, sizeof(attrname)); if (error != 0) @@ -4666,7 +4685,7 @@ vop_setextattr { ZFS_ENTER(zfsvfs); error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, - LOOKUP_XATTR); + LOOKUP_XATTR | CREATE_XATTR_DIR); if (error != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -4725,6 +4744,11 @@ vop_listextattr { vnode_t *xvp = NULL, *vp; int done, error, eof, pos; + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + ap->a_cred, ap->a_td, VREAD); + if (error) + return (error); + error = zfs_create_attrname(ap->a_attrnamespace, "", attrprefix, sizeof(attrprefix)); if (error != 0) @@ -4739,6 +4763,12 @@ vop_listextattr { error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, LOOKUP_XATTR); if (error != 0) { + /* + * ENOATTR means that the EA directory does not yet exist, + * i.e. there are no extended attributes there. + */ + if (error == ENOATTR) + error = 0; ZFS_EXIT(zfsvfs); return (error); } From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 14:44:16 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B0471065694; Fri, 22 Jan 2010 14:44:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A2998FC13; Fri, 22 Jan 2010 14:44:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MEiGPT099064; Fri, 22 Jan 2010 14:44:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MEiGMp099059; Fri, 22 Jan 2010 14:44:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001221444.o0MEiGMp099059@svn.freebsd.org> From: John Baldwin Date: Fri, 22 Jan 2010 14:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202810 - in stable/7/sys: kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 14:44:16 -0000 Author: jhb Date: Fri Jan 22 14:44:15 2010 New Revision: 202810 URL: http://svn.freebsd.org/changeset/base/202810 Log: MFC 193440,193442,193762,194019: - Support shared vnode locks for write operations when the offset is provided on filesystems that support it. This really improves mysql + innodb performance on ZFS. - When checking for shared writes, use the struct mount returned from vn_start_write. - Simply shared vnode locking and extend it to also include fsync. Also, in vop_write, no longer assert for exclusive locks on the vnode. - Stop asserting on exclusive locks in fsync since it can now support shared vnode locking on ZFS. Modified: stable/7/sys/kern/vfs_syscalls.c stable/7/sys/kern/vfs_vnops.c stable/7/sys/kern/vnode_if.src stable/7/sys/sys/mount.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_syscalls.c ============================================================================== --- stable/7/sys/kern/vfs_syscalls.c Fri Jan 22 14:25:17 2010 (r202809) +++ stable/7/sys/kern/vfs_syscalls.c Fri Jan 22 14:44:15 2010 (r202810) @@ -3267,7 +3267,7 @@ fsync(td, uap) struct mount *mp; struct file *fp; int vfslocked; - int error; + int error, lock_flags; AUDIT_ARG(fd, uap->fd); if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) @@ -3276,7 +3276,13 @@ fsync(td, uap) vfslocked = VFS_LOCK_GIANT(vp->v_mount); if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto drop; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + if (MNT_SHARED_WRITES(mp) || + ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) { + lock_flags = LK_SHARED; + } else { + lock_flags = LK_EXCLUSIVE; + } + vn_lock(vp, lock_flags | LK_RETRY, td); AUDIT_ARG(vnode, vp, ARG_VNODE1); if (vp->v_object != NULL) { VM_OBJECT_LOCK(vp->v_object); Modified: stable/7/sys/kern/vfs_vnops.c ============================================================================== --- stable/7/sys/kern/vfs_vnops.c Fri Jan 22 14:25:17 2010 (r202809) +++ stable/7/sys/kern/vfs_vnops.c Fri Jan 22 14:44:15 2010 (r202810) @@ -370,13 +370,9 @@ vn_rdwr(rw, vp, base, len, offset, segfl (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) return (error); - if (mp != NULL && - (mp->mnt_kern_flag & MNTK_SHARED_WRITES)) { - /* - * XXX See the next comment what should - * be done here too. - */ - lock_flags = LK_EXCLUSIVE; + if (MNT_SHARED_WRITES(mp) || + ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) { + lock_flags = LK_SHARED; } else { lock_flags = LK_EXCLUSIVE; } @@ -594,15 +590,10 @@ vn_write(fp, uio, active_cred, flags, td (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto unlock; - if (vp->v_mount != NULL && - (vp->v_mount->mnt_kern_flag & MNTK_SHARED_WRITES) && + if ((MNT_SHARED_WRITES(mp) || + ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) && (flags & FOF_OFFSET) != 0) { - /* - * XXX This should be LK_SHARED but the VFS in releng7 - * needs some patches before this can be done. - * See the similar comment above. - */ - lock_flags = LK_EXCLUSIVE; + lock_flags = LK_SHARED; } else { lock_flags = LK_EXCLUSIVE; } Modified: stable/7/sys/kern/vnode_if.src ============================================================================== --- stable/7/sys/kern/vnode_if.src Fri Jan 22 14:25:17 2010 (r202809) +++ stable/7/sys/kern/vnode_if.src Fri Jan 22 14:44:15 2010 (r202810) @@ -185,7 +185,7 @@ vop_read { }; -%% write vp E E E +%% write vp L L L %! write pre VOP_WRITE_PRE %! write post VOP_WRITE_POST @@ -245,7 +245,7 @@ vop_revoke { }; -%% fsync vp E E E +%% fsync vp L L L vop_fsync { IN struct vnode *vp; Modified: stable/7/sys/sys/mount.h ============================================================================== --- stable/7/sys/sys/mount.h Fri Jan 22 14:25:17 2010 (r202809) +++ stable/7/sys/sys/mount.h Fri Jan 22 14:44:15 2010 (r202810) @@ -339,6 +339,9 @@ void __mnt_vnode_markerfree(str #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ #define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ +#define MNT_SHARED_WRITES(mp) (((mp) != NULL) && \ + ((mp)->mnt_kern_flag & MNTK_SHARED_WRITES)) + /* * Sysctl CTL_VFS definitions. * From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 15:12:01 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF281106566C; Fri, 22 Jan 2010 15:12:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE8018FC0A; Fri, 22 Jan 2010 15:12:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MFC17w005510; Fri, 22 Jan 2010 15:12:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MFC1Ne005509; Fri, 22 Jan 2010 15:12:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001221512.o0MFC1Ne005509@svn.freebsd.org> From: John Baldwin Date: Fri, 22 Jan 2010 15:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202811 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 15:12:01 -0000 Author: jhb Date: Fri Jan 22 15:12:01 2010 New Revision: 202811 URL: http://svn.freebsd.org/changeset/base/202811 Log: MFC 191028: Use a shared vnode lock for reads in vn_rdwr(). Modified: stable/7/sys/kern/vfs_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_vnops.c ============================================================================== --- stable/7/sys/kern/vfs_vnops.c Fri Jan 22 14:44:15 2010 (r202810) +++ stable/7/sys/kern/vfs_vnops.c Fri Jan 22 15:12:01 2010 (r202811) @@ -377,15 +377,8 @@ vn_rdwr(rw, vp, base, len, offset, segfl lock_flags = LK_EXCLUSIVE; } vn_lock(vp, lock_flags | LK_RETRY, td); - } else { - /* - * XXX This should be LK_SHARED but the VFS in releng7 - * needs some patches before this can be done. - * The same applies to the lock_flags above and to a - * similar place below. - */ - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); - } + } else + vn_lock(vp, LK_SHARED | LK_RETRY, td); } ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held"); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 17:02:07 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 849A310656AC; Fri, 22 Jan 2010 17:02:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7088F8FC08; Fri, 22 Jan 2010 17:02:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MH27OO030590; Fri, 22 Jan 2010 17:02:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MH27aT030573; Fri, 22 Jan 2010 17:02:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001221702.o0MH27aT030573@svn.freebsd.org> From: John Baldwin Date: Fri, 22 Jan 2010 17:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202814 - in stable/7/sys: cam/scsi i386/acpica kern net security/audit sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 17:02:07 -0000 Author: jhb Date: Fri Jan 22 17:02:07 2010 New Revision: 202814 URL: http://svn.freebsd.org/changeset/base/202814 Log: MFC 193951: Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use vnode interlock to protect the knote fields. The locking assumes that shared vnode lock is held, thus we get exclusive access to knote either by exclusive vnode lock protection, or by shared vnode lock + vnode interlock. Unlike the change in HEAD, this does not remove kl_locked() and replace it with kl_assert_locked() and kl_assert_unlocked(). Instead, the kl_locked can now be set to NULL in which case no assertion checks are performed on the lock. The vfs kqfilter code uses this mode to disable assertion checks. This preserves the existing ABI for knlist_init(). Add convenience function knlist_init_mtx to reduce number of arguments for typical knlist initialization. Reviewed by: kib Modified: stable/7/sys/cam/scsi/scsi_target.c stable/7/sys/i386/acpica/acpi_machdep.c stable/7/sys/kern/init_main.c stable/7/sys/kern/kern_event.c stable/7/sys/kern/kern_fork.c stable/7/sys/kern/sys_pipe.c stable/7/sys/kern/tty.c stable/7/sys/kern/uipc_mqueue.c stable/7/sys/kern/uipc_socket.c stable/7/sys/kern/vfs_aio.c stable/7/sys/kern/vfs_subr.c stable/7/sys/net/bpf.c stable/7/sys/net/if_tap.c stable/7/sys/net/if_tun.c stable/7/sys/security/audit/audit_pipe.c stable/7/sys/sys/event.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_target.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_target.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/cam/scsi/scsi_target.c Fri Jan 22 17:02:07 2010 (r202814) @@ -194,7 +194,7 @@ targopen(struct cdev *dev, int flags, in TAILQ_INIT(&softc->work_queue); TAILQ_INIT(&softc->abort_queue); TAILQ_INIT(&softc->user_ccb_queue); - knlist_init(&softc->read_select.si_note, NULL, NULL, NULL, NULL); + knlist_init_mtx(&softc->read_select.si_note, NULL); return (0); } Modified: stable/7/sys/i386/acpica/acpi_machdep.c ============================================================================== --- stable/7/sys/i386/acpica/acpi_machdep.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/i386/acpica/acpi_machdep.c Fri Jan 22 17:02:07 2010 (r202814) @@ -258,7 +258,7 @@ apm_create_clone(struct cdev *dev, struc clone->acpi_sc = acpi_sc; clone->notify_status = APM_EV_NONE; bzero(&clone->sel_read, sizeof(clone->sel_read)); - knlist_init(&clone->sel_read.si_note, &acpi_mutex, NULL, NULL, NULL); + knlist_init_mtx(&clone->sel_read.si_note, &acpi_mutex); /* * The acpi device is always managed by devd(8) and is considered Modified: stable/7/sys/kern/init_main.c ============================================================================== --- stable/7/sys/kern/init_main.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/kern/init_main.c Fri Jan 22 17:02:07 2010 (r202814) @@ -435,7 +435,7 @@ proc0_init(void *dummy __unused) p->p_sysent = &null_sysvec; p->p_flag = P_SYSTEM | P_INMEM; p->p_state = PRS_NORMAL; - knlist_init(&p->p_klist, &p->p_mtx, NULL, NULL, NULL); + knlist_init_mtx(&p->p_klist, &p->p_mtx); STAILQ_INIT(&p->p_ktr); p->p_nice = NZERO; td->td_tid = PID_MAX + 1; Modified: stable/7/sys/kern/kern_event.c ============================================================================== --- stable/7/sys/kern/kern_event.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/kern/kern_event.c Fri Jan 22 17:02:07 2010 (r202814) @@ -206,11 +206,13 @@ SYSCTL_INT(_kern, OID_AUTO, kq_calloutma } while (0) #ifdef INVARIANTS #define KNL_ASSERT_LOCKED(knl) do { \ - if (!knl->kl_locked((knl)->kl_lockarg)) \ + if (knl->kl_locked != NULL && \ + !knl->kl_locked((knl)->kl_lockarg)) \ panic("knlist not locked, but should be"); \ } while (0) #define KNL_ASSERT_UNLOCKED(knl) do { \ - if (knl->kl_locked((knl)->kl_lockarg)) \ + if (knl->kl_locked != NULL && \ + knl->kl_locked((knl)->kl_lockarg)) \ panic("knlist locked, but should not be"); \ } while (0) #else /* !INVARIANTS */ @@ -576,7 +578,7 @@ kqueue(struct thread *td, struct kqueue_ mtx_init(&kq->kq_lock, "kqueue", NULL, MTX_DEF|MTX_DUPOK); TAILQ_INIT(&kq->kq_head); kq->kq_fdp = fdp; - knlist_init(&kq->kq_sel.si_note, &kq->kq_lock, NULL, NULL, NULL); + knlist_init_mtx(&kq->kq_sel.si_note, &kq->kq_lock); TASK_INIT(&kq->kq_task, 0, kqueue_task, kq); FILEDESC_XLOCK(fdp); @@ -1774,7 +1776,7 @@ knlist_init(struct knlist *knl, void *lo knl->kl_unlock = knlist_mtx_unlock; else knl->kl_unlock = kl_unlock; - if (kl_locked == NULL) + if (kl_locked == NULL && kl_lock == NULL && kl_unlock == NULL) knl->kl_locked = knlist_mtx_locked; else knl->kl_locked = kl_locked; @@ -1783,6 +1785,13 @@ knlist_init(struct knlist *knl, void *lo } void +knlist_init_mtx(struct knlist *knl, struct mtx *lock) +{ + + knlist_init(knl, lock, NULL, NULL, NULL); +} + +void knlist_destroy(struct knlist *knl) { Modified: stable/7/sys/kern/kern_fork.c ============================================================================== --- stable/7/sys/kern/kern_fork.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/kern/kern_fork.c Fri Jan 22 17:02:07 2010 (r202814) @@ -294,7 +294,7 @@ norfproc_fail: #ifdef MAC mac_init_proc(newproc); #endif - knlist_init(&newproc->p_klist, &newproc->p_mtx, NULL, NULL, NULL); + knlist_init_mtx(&newproc->p_klist, &newproc->p_mtx); STAILQ_INIT(&newproc->p_ktr); /* We have to lock the process tree while we look for a pid. */ Modified: stable/7/sys/kern/sys_pipe.c ============================================================================== --- stable/7/sys/kern/sys_pipe.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/kern/sys_pipe.c Fri Jan 22 17:02:07 2010 (r202814) @@ -332,10 +332,8 @@ pipe(td, uap) rpipe = &pp->pp_rpipe; wpipe = &pp->pp_wpipe; - knlist_init(&rpipe->pipe_sel.si_note, PIPE_MTX(rpipe), NULL, NULL, - NULL); - knlist_init(&wpipe->pipe_sel.si_note, PIPE_MTX(wpipe), NULL, NULL, - NULL); + knlist_init_mtx(&rpipe->pipe_sel.si_note, PIPE_MTX(rpipe)); + knlist_init_mtx(&wpipe->pipe_sel.si_note, PIPE_MTX(wpipe)); /* Only the forward direction pipe is backed by default */ if ((error = pipe_create(rpipe, 1)) != 0 || Modified: stable/7/sys/kern/tty.c ============================================================================== --- stable/7/sys/kern/tty.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/kern/tty.c Fri Jan 22 17:02:07 2010 (r202814) @@ -2904,8 +2904,8 @@ ttyalloc() mtx_lock(&tty_list_mutex); TAILQ_INSERT_TAIL(&tty_list, tp, t_list); mtx_unlock(&tty_list_mutex); - knlist_init(&tp->t_rsel.si_note, &tp->t_mtx, NULL, NULL, NULL); - knlist_init(&tp->t_wsel.si_note, &tp->t_mtx, NULL, NULL, NULL); + knlist_init_mtx(&tp->t_rsel.si_note, &tp->t_mtx); + knlist_init_mtx(&tp->t_wsel.si_note, &tp->t_mtx); return (tp); } Modified: stable/7/sys/kern/uipc_mqueue.c ============================================================================== --- stable/7/sys/kern/uipc_mqueue.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/kern/uipc_mqueue.c Fri Jan 22 17:02:07 2010 (r202814) @@ -1502,8 +1502,8 @@ mqueue_alloc(const struct mq_attr *attr) mq->mq_msgsize = default_msgsize; } mtx_init(&mq->mq_mutex, "mqueue", NULL, MTX_DEF); - knlist_init(&mq->mq_rsel.si_note, &mq->mq_mutex, NULL, NULL, NULL); - knlist_init(&mq->mq_wsel.si_note, &mq->mq_mutex, NULL, NULL, NULL); + knlist_init_mtx(&mq->mq_rsel.si_note, &mq->mq_mutex); + knlist_init_mtx(&mq->mq_wsel.si_note, &mq->mq_mutex); atomic_add_int(&curmq, 1); return (mq); } Modified: stable/7/sys/kern/uipc_socket.c ============================================================================== --- stable/7/sys/kern/uipc_socket.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/kern/uipc_socket.c Fri Jan 22 17:02:07 2010 (r202814) @@ -370,10 +370,8 @@ socreate(int dom, struct socket **aso, i #ifdef MAC mac_create_socket(cred, so); #endif - knlist_init(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv), - NULL, NULL, NULL); - knlist_init(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd), - NULL, NULL, NULL); + knlist_init_mtx(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv)); + knlist_init_mtx(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd)); so->so_count = 1; /* * Auto-sizing of socket buffers is managed by the protocols and @@ -439,10 +437,8 @@ sonewconn(struct socket *head, int conns mac_create_socket_from_socket(head, so); SOCK_UNLOCK(head); #endif - knlist_init(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv), - NULL, NULL, NULL); - knlist_init(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd), - NULL, NULL, NULL); + knlist_init_mtx(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv)); + knlist_init_mtx(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd)); if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) || (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { sodealloc(so); Modified: stable/7/sys/kern/vfs_aio.c ============================================================================== --- stable/7/sys/kern/vfs_aio.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/kern/vfs_aio.c Fri Jan 22 17:02:07 2010 (r202814) @@ -1486,7 +1486,7 @@ aio_aqueue(struct thread *td, struct aio aiocbe = uma_zalloc(aiocb_zone, M_WAITOK | M_ZERO); aiocbe->inputcharge = 0; aiocbe->outputcharge = 0; - knlist_init(&aiocbe->klist, AIO_MTX(ki), NULL, NULL, NULL); + knlist_init_mtx(&aiocbe->klist, AIO_MTX(ki)); error = ops->copyin(job, &aiocbe->uaiocb); if (error) { @@ -2108,7 +2108,7 @@ kern_lio_listio(struct thread *td, int m lj->lioj_flags = 0; lj->lioj_count = 0; lj->lioj_finished_count = 0; - knlist_init(&lj->klist, AIO_MTX(ki), NULL, NULL, NULL); + knlist_init_mtx(&lj->klist, AIO_MTX(ki)); ksiginfo_init(&lj->lioj_ksi); /* Modified: stable/7/sys/kern/vfs_subr.c ============================================================================== --- stable/7/sys/kern/vfs_subr.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/kern/vfs_subr.c Fri Jan 22 17:02:07 2010 (r202814) @@ -107,7 +107,6 @@ static void vnlru_free(int); static void vgonel(struct vnode *); static void vfs_knllock(void *arg); static void vfs_knlunlock(void *arg); -static int vfs_knllocked(void *arg); static void destroy_vpollinfo(struct vpollinfo *vi); /* @@ -3227,7 +3226,7 @@ v_addpollinfo(struct vnode *vp) vi = uma_zalloc(vnodepoll_zone, M_WAITOK); mtx_init(&vi->vpi_lock, "vnode pollinfo", NULL, MTX_DEF); knlist_init(&vi->vpi_selinfo.si_note, vp, vfs_knllock, - vfs_knlunlock, vfs_knllocked); + vfs_knlunlock, NULL); VI_LOCK(vp); if (vp->v_pollinfo != NULL) { VI_UNLOCK(vp); @@ -3945,7 +3944,7 @@ static struct knlist fs_knlist; static void vfs_event_init(void *arg) { - knlist_init(&fs_knlist, NULL, NULL, NULL, NULL); + knlist_init_mtx(&fs_knlist, NULL); } /* XXX - correct order? */ SYSINIT(vfs_knlist, SI_SUB_VFS, SI_ORDER_ANY, vfs_event_init, NULL); @@ -4058,14 +4057,6 @@ vfs_knlunlock(void *arg) VOP_UNLOCK(vp, 0, curthread); } -static int -vfs_knllocked(void *arg) -{ - struct vnode *vp = arg; - - return (VOP_ISLOCKED(vp, curthread) == LK_EXCLUSIVE); -} - int vfs_kqfilter(struct vop_kqfilter_args *ap) { @@ -4116,27 +4107,37 @@ filt_vfsread(struct knote *kn, long hint { struct vnode *vp = (struct vnode *)kn->kn_hook; struct vattr va; + int res; /* * filesystem is gone, so set the EOF flag and schedule * the knote for deletion. */ if (hint == NOTE_REVOKE) { + VI_LOCK(vp); kn->kn_flags |= (EV_EOF | EV_ONESHOT); + VI_UNLOCK(vp); return (1); } if (VOP_GETATTR(vp, &va, curthread->td_ucred, curthread)) return (0); + VI_LOCK(vp); kn->kn_data = va.va_size - kn->kn_fp->f_offset; - return (kn->kn_data != 0); + res = (kn->kn_data != 0); + VI_UNLOCK(vp); + return (res); } /*ARGSUSED*/ static int filt_vfswrite(struct knote *kn, long hint) { + struct vnode *vp = (struct vnode *)kn->kn_hook; + + VI_LOCK(vp); + /* * filesystem is gone, so set the EOF flag and schedule * the knote for deletion. @@ -4145,19 +4146,27 @@ filt_vfswrite(struct knote *kn, long hin kn->kn_flags |= (EV_EOF | EV_ONESHOT); kn->kn_data = 0; + VI_UNLOCK(vp); return (1); } static int filt_vfsvnode(struct knote *kn, long hint) { + struct vnode *vp = (struct vnode *)kn->kn_hook; + int res; + + VI_LOCK(vp); if (kn->kn_sfflags & hint) kn->kn_fflags |= hint; if (hint == NOTE_REVOKE) { kn->kn_flags |= EV_EOF; + VI_UNLOCK(vp); return (1); } - return (kn->kn_fflags != 0); + res = (kn->kn_fflags != 0); + VI_UNLOCK(vp); + return (res); } int Modified: stable/7/sys/net/bpf.c ============================================================================== --- stable/7/sys/net/bpf.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/net/bpf.c Fri Jan 22 17:02:07 2010 (r202814) @@ -425,7 +425,7 @@ bpfopen(struct cdev *dev, int flags, int #endif mtx_init(&d->bd_mtx, devtoname(dev), "bpf cdev lock", MTX_DEF); callout_init(&d->bd_callout, CALLOUT_MPSAFE); - knlist_init(&d->bd_sel.si_note, &d->bd_mtx, NULL, NULL, NULL); + knlist_init_mtx(&d->bd_sel.si_note, &d->bd_mtx); return (0); } Modified: stable/7/sys/net/if_tap.c ============================================================================== --- stable/7/sys/net/if_tap.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/net/if_tap.c Fri Jan 22 17:02:07 2010 (r202814) @@ -462,7 +462,7 @@ tapcreate(struct cdev *dev) tp->tap_flags |= TAP_INITED; mtx_unlock(&tp->tap_mtx); - knlist_init(&tp->tap_rsel.si_note, NULL, NULL, NULL, NULL); + knlist_init_mtx(&tp->tap_rsel.si_note, NULL); TAPDEBUG("interface %s is created. minor = %#x\n", ifp->if_xname, minor(dev)); Modified: stable/7/sys/net/if_tun.c ============================================================================== --- stable/7/sys/net/if_tun.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/net/if_tun.c Fri Jan 22 17:02:07 2010 (r202814) @@ -380,7 +380,7 @@ tuncreate(const char *name, struct cdev IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_drv_maxlen = 0; IFQ_SET_READY(&ifp->if_snd); - knlist_init(&sc->tun_rsel.si_note, NULL, NULL, NULL, NULL); + knlist_init_mtx(&sc->tun_rsel.si_note, NULL); if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); Modified: stable/7/sys/security/audit/audit_pipe.c ============================================================================== --- stable/7/sys/security/audit/audit_pipe.c Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/security/audit/audit_pipe.c Fri Jan 22 17:02:07 2010 (r202814) @@ -579,8 +579,7 @@ audit_pipe_alloc(void) return (NULL); ap->ap_qlimit = AUDIT_PIPE_QLIMIT_DEFAULT; TAILQ_INIT(&ap->ap_queue); - knlist_init(&ap->ap_selinfo.si_note, AUDIT_PIPE_MTX(ap), NULL, NULL, - NULL); + knlist_init_mtx(&ap->ap_selinfo.si_note, AUDIT_PIPE_MTX(ap)); AUDIT_PIPE_LOCK_INIT(ap); AUDIT_PIPE_SX_LOCK_INIT(ap); cv_init(&ap->ap_cv, "audit_pipe"); Modified: stable/7/sys/sys/event.h ============================================================================== --- stable/7/sys/sys/event.h Fri Jan 22 16:23:00 2010 (r202813) +++ stable/7/sys/sys/event.h Fri Jan 22 17:02:07 2010 (r202814) @@ -209,6 +209,7 @@ struct kevent_copyops { struct thread; struct proc; struct knlist; +struct mtx; extern void knote(struct knlist *list, long hint, int lockflags); extern void knote_fork(struct knlist *list, int pid); @@ -219,6 +220,7 @@ extern int knlist_empty(struct knlist *k extern void knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *), void (*kl_unlock)(void *), int (*kl_locked)(void *)); +extern void knlist_init_mtx(struct knlist *knl, struct mtx *lock); extern void knlist_destroy(struct knlist *knl); extern void knlist_cleardel(struct knlist *knl, struct thread *td, int islocked, int killkn); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 17:08:05 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C3A1106568B; Fri, 22 Jan 2010 17:08:05 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A5938FC1C; Fri, 22 Jan 2010 17:08:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MH85CY032057; Fri, 22 Jan 2010 17:08:05 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MH85ib032055; Fri, 22 Jan 2010 17:08:05 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001221708.o0MH85ib032055@svn.freebsd.org> From: Christian Brueffer Date: Fri, 22 Jan 2010 17:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202816 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 17:08:05 -0000 Author: brueffer Date: Fri Jan 22 17:08:05 2010 New Revision: 202816 URL: http://svn.freebsd.org/changeset/base/202816 Log: MFC: r201848 Free allocated sbufs before returning ENOMEM. Modified: stable/7/sys/kern/kern_cpu.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_cpu.c ============================================================================== --- stable/7/sys/kern/kern_cpu.c Fri Jan 22 17:03:49 2010 (r202815) +++ stable/7/sys/kern/kern_cpu.c Fri Jan 22 17:08:05 2010 (r202816) @@ -926,8 +926,10 @@ cpufreq_levels_sysctl(SYSCTL_HANDLER_ARG /* Get settings from the device and generate the output string. */ count = CF_MAX_LEVELS; levels = malloc(count * sizeof(*levels), M_TEMP, M_NOWAIT); - if (levels == NULL) + if (levels == NULL) { + sbuf_delete(&sb); return (ENOMEM); + } error = CPUFREQ_LEVELS(sc->dev, levels, &count); if (error) { if (error == E2BIG) @@ -965,8 +967,10 @@ cpufreq_settings_sysctl(SYSCTL_HANDLER_A /* Get settings from the device and generate the output string. */ set_count = MAX_SETTINGS; sets = malloc(set_count * sizeof(*sets), M_TEMP, M_NOWAIT); - if (sets == NULL) + if (sets == NULL) { + sbuf_delete(&sb); return (ENOMEM); + } error = CPUFREQ_DRV_SETTINGS(dev, sets, &set_count); if (error) goto out; From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 17:31:54 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 791CA106568D; Fri, 22 Jan 2010 17:31:54 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DBA48FC1F; Fri, 22 Jan 2010 17:31:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MHVsae037480; Fri, 22 Jan 2010 17:31:54 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MHVsDi037478; Fri, 22 Jan 2010 17:31:54 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001221731.o0MHVsDi037478@svn.freebsd.org> From: Doug Barton Date: Fri, 22 Jan 2010 17:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202819 - stable/7/etc/namedb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 17:31:54 -0000 Author: dougb Date: Fri Jan 22 17:31:54 2010 New Revision: 202819 URL: http://svn.freebsd.org/changeset/base/202819 Log: MFC r202582: Update named.conf for documentation IP addresses and domains Modified: stable/7/etc/namedb/named.conf Directory Properties: stable/7/etc/ (props changed) stable/7/etc/rc.d/ (props changed) Modified: stable/7/etc/namedb/named.conf ============================================================================== --- stable/7/etc/namedb/named.conf Fri Jan 22 17:30:36 2010 (r202818) +++ stable/7/etc/namedb/named.conf Fri Jan 22 17:31:54 2010 (r202819) @@ -125,7 +125,7 @@ zone "in-addr.arpa" { 1. Faster local resolution for your users 2. No spurious traffic will be sent from your network to the roots */ -// RFC 1912 +// RFC 1912 (and BCP 32 for localhost) zone "localhost" { type master; file "/etc/namedb/master/localhost-forward.db"; }; zone "127.in-addr.arpa" { type master; file "/etc/namedb/master/localhost-reverse.db"; }; zone "255.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; @@ -159,8 +159,21 @@ zone "168.192.in-addr.arpa" { type maste // Link-local/APIPA (RFCs 3330 and 3927) zone "254.169.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; -// TEST-NET for Documentation (RFC 3330) +// TEST-NET-[1-3] for Documentation (RFC 5737) zone "2.0.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "100.51.198.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "113.0.203.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; + +// IPv6 Range for Documentation (RFC 3849) +zone "0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; + +// Domain Names for Documentation and Testing (BCP 32) +zone "test" { type master; file "/etc/namedb/master/empty.db"; }; +zone "example" { type master; file "/etc/namedb/master/empty.db"; }; +zone "invalid" { type master; file "/etc/namedb/master/empty.db"; }; +zone "example.com" { type master; file "/etc/namedb/master/empty.db"; }; +zone "example.net" { type master; file "/etc/namedb/master/empty.db"; }; +zone "example.org" { type master; file "/etc/namedb/master/empty.db"; }; // Router Benchmark Testing (RFC 3330) zone "18.198.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 20:06:58 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 243FB106566B; Fri, 22 Jan 2010 20:06:58 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11A328FC0C; Fri, 22 Jan 2010 20:06:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MK6v8w072015; Fri, 22 Jan 2010 20:06:57 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MK6vFR072013; Fri, 22 Jan 2010 20:06:57 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001222006.o0MK6vFR072013@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 22 Jan 2010 20:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202825 - stable/7/sbin/dumpfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 20:06:58 -0000 Author: gavin Date: Fri Jan 22 20:06:57 2010 New Revision: 202825 URL: http://svn.freebsd.org/changeset/base/202825 Log: Merge r201647 from head: Print leading zeros in the UFS2 FSID. PR: bin/142155 Submitted by: Efstratios Karatzas gpf.kira gmail.com Approved by: ed (mentor, implicit) Modified: stable/7/sbin/dumpfs/dumpfs.c Directory Properties: stable/7/sbin/dumpfs/ (props changed) Modified: stable/7/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/7/sbin/dumpfs/dumpfs.c Fri Jan 22 20:02:22 2010 (r202824) +++ stable/7/sbin/dumpfs/dumpfs.c Fri Jan 22 20:06:57 2010 (r202825) @@ -160,7 +160,7 @@ dumpfs(const char *name) fstime = afs.fs_old_time; printf("magic\t%x (UFS1)\ttime\t%s", afs.fs_magic, ctime(&fstime)); - printf("id\t[ %x %x ]\n", afs.fs_id[0], afs.fs_id[1]); + printf("id\t[ %08x %08x ]\n", afs.fs_id[0], afs.fs_id[1]); printf("ncg\t%d\tsize\t%jd\tblocks\t%jd\n", afs.fs_ncg, (intmax_t)fssize, (intmax_t)afs.fs_dsize); break; From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 20:30:54 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C6AC1065679; Fri, 22 Jan 2010 20:30:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A5568FC18; Fri, 22 Jan 2010 20:30:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MKUsH9077429; Fri, 22 Jan 2010 20:30:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MKUsDw077427; Fri, 22 Jan 2010 20:30:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001222030.o0MKUsDw077427@svn.freebsd.org> From: John Baldwin Date: Fri, 22 Jan 2010 20:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202829 - stable/7/sys/amd64/amd64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 20:30:54 -0000 Author: jhb Date: Fri Jan 22 20:30:54 2010 New Revision: 202829 URL: http://svn.freebsd.org/changeset/base/202829 Log: MFC 189415: Make pmap_copy() more TLB friendly. Specifically, make it use the kernel's direct map instead of the pmap's recursive mapping to access the lowest level in the page table. Modified: stable/7/sys/amd64/amd64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 20:24:55 2010 (r202828) +++ stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 20:30:54 2010 (r202829) @@ -3498,9 +3498,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm if (dst_addr != src_addr) return; - if (!pmap_is_current(src_pmap)) - return; - vm_page_lock_queues(); if (dst_pmap < src_pmap) { PMAP_LOCK(dst_pmap); @@ -3562,14 +3559,16 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm continue; } - srcmpte = PHYS_TO_VM_PAGE(srcptepaddr & PG_FRAME); + srcptepaddr &= PG_FRAME; + srcmpte = PHYS_TO_VM_PAGE(srcptepaddr); KASSERT(srcmpte->wire_count > 0, ("pmap_copy: source page table page is unused")); if (va_next > end_addr) va_next = end_addr; - src_pte = vtopte(addr); + src_pte = (pt_entry_t *)PHYS_TO_DMAP(srcptepaddr); + src_pte = &src_pte[pmap_pte_index(addr)]; while (addr < va_next) { pt_entry_t ptetemp; ptetemp = *src_pte; From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 20:46:12 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBD11065670; Fri, 22 Jan 2010 20:46:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AC318FC08; Fri, 22 Jan 2010 20:46:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MKkBWd081040; Fri, 22 Jan 2010 20:46:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MKkBnD081038; Fri, 22 Jan 2010 20:46:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001222046.o0MKkBnD081038@svn.freebsd.org> From: John Baldwin Date: Fri, 22 Jan 2010 20:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202835 - stable/7/sys/amd64/amd64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 20:46:12 -0000 Author: jhb Date: Fri Jan 22 20:46:11 2010 New Revision: 202835 URL: http://svn.freebsd.org/changeset/base/202835 Log: MFC 189551: Change pmap_enter_quick_locked() so that it uses the kernel's direct map instead of the pmap's recursive mapping to access the lowest level of the page table when it maps a user-space virtual address. Modified: stable/7/sys/amd64/amd64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 20:44:34 2010 (r202834) +++ stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 20:46:11 2010 (r202835) @@ -3265,17 +3265,12 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ return (mpte); } } + pte = (pt_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(mpte)); + pte = &pte[pmap_pte_index(va)]; } else { mpte = NULL; + pte = vtopte(va); } - - /* - * This call to vtopte makes the assumption that we are - * entering the page into the current pmap. In order to support - * quick entry into any pmap, one would likely use pmap_pte. - * But that isn't as quick as vtopte. - */ - pte = vtopte(va); if (*pte) { if (mpte != NULL) { mpte->wire_count--; From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 20:52:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 229951065672; Fri, 22 Jan 2010 20:52:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FFE68FC08; Fri, 22 Jan 2010 20:52:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MKqVGu082473; Fri, 22 Jan 2010 20:52:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MKqVo9082471; Fri, 22 Jan 2010 20:52:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001222052.o0MKqVo9082471@svn.freebsd.org> From: John Baldwin Date: Fri, 22 Jan 2010 20:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202836 - stable/7/sys/amd64/amd64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 20:52:32 -0000 Author: jhb Date: Fri Jan 22 20:52:31 2010 New Revision: 202836 URL: http://svn.freebsd.org/changeset/base/202836 Log: MFC 189610: Eliminate the last use of the recursive mapping to access user-space page table pages. Now, all accesses to user-space page table pages are performed through the direct map. (The recursive mapping is only used to access kernel-space page table pages.) Eliminate the TLB invalidation on the recursive mapping when a user-space page table page is removed from the page table and when a user-space superpage is demoted. Modified: stable/7/sys/amd64/amd64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 20:46:11 2010 (r202835) +++ stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 20:52:31 2010 (r202836) @@ -1278,7 +1278,6 @@ static int _pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t *free) { - vm_offset_t pteva; /* * unmap the page table page @@ -1287,19 +1286,16 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of /* PDP page */ pml4_entry_t *pml4; pml4 = pmap_pml4e(pmap, va); - pteva = (vm_offset_t) PDPmap + amd64_ptob(m->pindex - (NUPDE + NUPDPE)); *pml4 = 0; } else if (m->pindex >= NUPDE) { /* PD page */ pdp_entry_t *pdp; pdp = pmap_pdpe(pmap, va); - pteva = (vm_offset_t) PDmap + amd64_ptob(m->pindex - NUPDE); *pdp = 0; } else { /* PTE page */ pd_entry_t *pd; pd = pmap_pde(pmap, va); - pteva = (vm_offset_t) PTmap + amd64_ptob(m->pindex); *pd = 0; } --pmap->pm_stats.resident_count; @@ -1325,12 +1321,6 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of */ atomic_subtract_rel_int(&cnt.v_wire_count, 1); - /* - * Do an invltlb to make the invalidated mapping - * take effect immediately. - */ - pmap_invalidate_page(pmap, pteva); - /* * Put page on a list so that it is released after * *ALL* TLB shootdown is done @@ -2287,9 +2277,10 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t pde_store(pde, newpde); /* - * Invalidate a stale mapping of the page table page. + * Invalidate a stale recursive mapping of the page table page. */ - pmap_invalidate_page(pmap, (vm_offset_t)vtopte(va)); + if (va >= VM_MAXUSER_ADDRESS) + pmap_invalidate_page(pmap, (vm_offset_t)vtopte(va)); /* * Demote the pv entry. This depends on the earlier demotion @@ -3737,7 +3728,7 @@ pmap_page_is_mapped(vm_page_t m) void pmap_remove_pages(pmap_t pmap) { - pd_entry_t *pde; + pd_entry_t ptepde; pt_entry_t *pte, tpte; vm_page_t free = NULL; vm_page_t m, mpte, mt; @@ -3766,23 +3757,19 @@ pmap_remove_pages(pmap_t pmap) pv = &pc->pc_pventry[idx]; inuse &= ~bitmask; - pde = vtopde(pv->pv_va); - tpte = *pde; - if ((tpte & PG_PS) != 0) - pte = pde; - else { + pte = pmap_pdpe(pmap, pv->pv_va); + ptepde = *pte; + pte = pmap_pdpe_to_pde(pte, pv->pv_va); + tpte = *pte; + if ((tpte & (PG_PS | PG_V)) == PG_V) { + ptepde = tpte; pte = (pt_entry_t *)PHYS_TO_DMAP(tpte & PG_FRAME); pte = &pte[pmap_pte_index(pv->pv_va)]; tpte = *pte & ~PG_PTE_PAT; } - - if (tpte == 0) { - printf( - "TPTE at %p IS ZERO @ VA %08lx\n", - pte, pv->pv_va); + if ((tpte & PG_V) == 0) panic("bad pte"); - } /* * We cannot remove wired pages from a process' mapping at this time @@ -3839,8 +3826,6 @@ pmap_remove_pages(pmap_t pmap) pmap_add_delayed_free_list(mpte, &free, FALSE); atomic_subtract_int(&cnt.v_wire_count, 1); } - pmap_unuse_pt(pmap, pv->pv_va, - *pmap_pdpe(pmap, pv->pv_va), &free); } else { pmap->pm_stats.resident_count--; TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); @@ -3849,8 +3834,8 @@ pmap_remove_pages(pmap_t pmap) if (TAILQ_EMPTY(&pvh->pv_list)) vm_page_flag_clear(m, PG_WRITEABLE); } - pmap_unuse_pt(pmap, pv->pv_va, *pde, &free); } + pmap_unuse_pt(pmap, pv->pv_va, ptepde, &free); } } if (allfree) { From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 21:23:09 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DFE11065693; Fri, 22 Jan 2010 21:23:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF4E8FC22; Fri, 22 Jan 2010 21:23:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MLN9u0089386; Fri, 22 Jan 2010 21:23:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MLN9VW089383; Fri, 22 Jan 2010 21:23:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001222123.o0MLN9VW089383@svn.freebsd.org> From: John Baldwin Date: Fri, 22 Jan 2010 21:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202837 - in stable/7/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 21:23:09 -0000 Author: jhb Date: Fri Jan 22 21:23:09 2010 New Revision: 202837 URL: http://svn.freebsd.org/changeset/base/202837 Log: MFC 189698,192035: Optimize the inner loop of pmap_copy(). Correct a rare use-after-free error in pmap_copy(). This error was introduced in amd64 revision 1.540 and i386 revision 1.547. However, it had no harmful effects until after a recent change, r189698, on amd64. (In other words, the error is harmless in RELENG_7.) The error is triggered by the failure to allocate a pv entry for the one and only mapping in a page table page. I am addressing the error by changing pmap_copy() to abort if either pv entry allocation or page table page allocation fails. This is appropriate because the creation of mappings by pmap_copy() is optional. They are a (possible) optimization, and not a requirement. Correct a nearby whitespace error in the i386 pmap_copy(). Modified: stable/7/sys/amd64/amd64/pmap.c stable/7/sys/i386/i386/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 20:52:31 2010 (r202836) +++ stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 21:23:09 2010 (r202837) @@ -3555,6 +3555,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm src_pte = (pt_entry_t *)PHYS_TO_DMAP(srcptepaddr); src_pte = &src_pte[pmap_pte_index(addr)]; + dstmpte = NULL; while (addr < va_next) { pt_entry_t ptetemp; ptetemp = *src_pte; @@ -3562,10 +3563,12 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm * we only virtual copy managed pages */ if ((ptetemp & PG_MANAGED) != 0) { - dstmpte = pmap_allocpte(dst_pmap, addr, - M_NOWAIT); - if (dstmpte == NULL) - break; + if (dstmpte != NULL && + dstmpte->pindex == pmap_pde_pindex(addr)) + dstmpte->wire_count++; + else if ((dstmpte = pmap_allocpte(dst_pmap, + addr, M_NOWAIT)) == NULL) + goto out; dst_pte = (pt_entry_t *) PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dstmpte)); dst_pte = &dst_pte[pmap_pte_index(addr)]; @@ -3588,6 +3591,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm addr); pmap_free_zero_pages(free); } + goto out; } if (dstmpte->wire_count >= srcmpte->wire_count) break; @@ -3596,6 +3600,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm src_pte++; } } +out: vm_page_unlock_queues(); PMAP_UNLOCK(src_pmap); PMAP_UNLOCK(dst_pmap); Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Fri Jan 22 20:52:31 2010 (r202836) +++ stable/7/sys/i386/i386/pmap.c Fri Jan 22 21:23:09 2010 (r202837) @@ -3673,7 +3673,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm dstmpte = pmap_allocpte(dst_pmap, addr, M_NOWAIT); if (dstmpte == NULL) - break; + goto out; dst_pte = pmap_pte_quick(dst_pmap, addr); if (*dst_pte == 0 && pmap_try_insert_pv_entry(dst_pmap, addr, @@ -3688,12 +3688,13 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm dst_pmap->pm_stats.resident_count++; } else { free = NULL; - if (pmap_unwire_pte_hold( dst_pmap, + if (pmap_unwire_pte_hold(dst_pmap, dstmpte, &free)) { pmap_invalidate_page(dst_pmap, addr); pmap_free_zero_pages(free); } + goto out; } if (dstmpte->wire_count >= srcmpte->wire_count) break; @@ -3702,6 +3703,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm src_pte++; } } +out: sched_unpin(); vm_page_unlock_queues(); PMAP_UNLOCK(src_pmap); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 21:36:34 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 764BA1065670; Fri, 22 Jan 2010 21:36:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0918FC22; Fri, 22 Jan 2010 21:36:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MLaYq4092820; Fri, 22 Jan 2010 21:36:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MLaYQL092818; Fri, 22 Jan 2010 21:36:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001222136.o0MLaYQL092818@svn.freebsd.org> From: John Baldwin Date: Fri, 22 Jan 2010 21:36:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202838 - stable/7/sys/amd64/amd64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 21:36:34 -0000 Author: jhb Date: Fri Jan 22 21:36:34 2010 New Revision: 202838 URL: http://svn.freebsd.org/changeset/base/202838 Log: MFC 189783: Correct accounting errors in _pmap_allocpte(). Specifically, the pmap's resident page count and the global wired page count were not correctly maintained when page table page allocation failed. Modified: stable/7/sys/amd64/amd64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 21:23:09 2010 (r202837) +++ stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 21:36:34 2010 (r202838) @@ -1442,8 +1442,6 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t * it isn't already there. */ - pmap->pm_stats.resident_count++; - if (ptepindex >= (NUPDE + NUPDPE)) { pml4_entry_t *pml4; vm_pindex_t pml4index; @@ -1469,7 +1467,8 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index, flags) == NULL) { --m->wire_count; - vm_page_free(m); + atomic_subtract_int(&cnt.v_wire_count, 1); + vm_page_free_zero(m); return (NULL); } } else { @@ -1501,7 +1500,8 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if (_pmap_allocpte(pmap, NUPDE + pdpindex, flags) == NULL) { --m->wire_count; - vm_page_free(m); + atomic_subtract_int(&cnt.v_wire_count, 1); + vm_page_free_zero(m); return (NULL); } pdp = (pdp_entry_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME); @@ -1514,7 +1514,9 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if (_pmap_allocpte(pmap, NUPDE + pdpindex, flags) == NULL) { --m->wire_count; - vm_page_free(m); + atomic_subtract_int(&cnt.v_wire_count, + 1); + vm_page_free_zero(m); return (NULL); } } else { @@ -1530,6 +1532,8 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t *pd = VM_PAGE_TO_PHYS(m) | PG_U | PG_RW | PG_V | PG_A | PG_M; } + pmap->pm_stats.resident_count++; + return m; } From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 22 23:17:07 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5E98106568B; Fri, 22 Jan 2010 23:17:07 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 925138FC08; Fri, 22 Jan 2010 23:17:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MNH73P018745; Fri, 22 Jan 2010 23:17:07 GMT (envelope-from flz@svn.freebsd.org) Received: (from flz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MNH7dd018727; Fri, 22 Jan 2010 23:17:07 GMT (envelope-from flz@svn.freebsd.org) Message-Id: <201001222317.o0MNH7dd018727@svn.freebsd.org> From: Florent Thoumie Date: Fri, 22 Jan 2010 23:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202841 - in stable/7/usr.sbin/pkg_install: add create delete info lib updating version X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 23:17:07 -0000 Author: flz Date: Fri Jan 22 23:17:07 2010 New Revision: 202841 URL: http://svn.freebsd.org/changeset/base/202841 Log: Synchronize pkg_install with HEAD. Modified: stable/7/usr.sbin/pkg_install/add/main.c stable/7/usr.sbin/pkg_install/add/perform.c stable/7/usr.sbin/pkg_install/create/main.c stable/7/usr.sbin/pkg_install/create/perform.c stable/7/usr.sbin/pkg_install/delete/Makefile stable/7/usr.sbin/pkg_install/delete/main.c stable/7/usr.sbin/pkg_install/info/Makefile stable/7/usr.sbin/pkg_install/info/main.c stable/7/usr.sbin/pkg_install/info/perform.c stable/7/usr.sbin/pkg_install/lib/lib.h stable/7/usr.sbin/pkg_install/lib/pen.c stable/7/usr.sbin/pkg_install/lib/plist.c stable/7/usr.sbin/pkg_install/lib/url.c stable/7/usr.sbin/pkg_install/updating/Makefile stable/7/usr.sbin/pkg_install/version/Makefile stable/7/usr.sbin/pkg_install/version/main.c Modified: stable/7/usr.sbin/pkg_install/add/main.c ============================================================================== --- stable/7/usr.sbin/pkg_install/add/main.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/add/main.c Fri Jan 22 23:17:07 2010 (r202841) @@ -82,13 +82,15 @@ struct { { 700000, 700099, "/packages-7.0-release" }, { 701000, 701099, "/packages-7.1-release" }, { 702000, 702099, "/packages-7.2-release" }, + { 800000, 800499, "/packages-8.0-release" }, { 300000, 399000, "/packages-3-stable" }, { 400000, 499000, "/packages-4-stable" }, { 502100, 502128, "/packages-5-current" }, { 503100, 599000, "/packages-5-stable" }, { 600100, 699000, "/packages-6-stable" }, { 700100, 799000, "/packages-7-stable" }, - { 800000, 899000, "/packages-8-current" }, + { 800500, 899000, "/packages-8-stable" }, + { 900000, 999000, "/packages-9-current" }, { 0, 9999999, "/packages-current" }, { 0, 0, NULL } }; @@ -342,7 +344,7 @@ getpackagesite(void) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: pkg_add [-viInfFrRMSK] [-t template] [-p prefix] [-P prefix] [-C chrootdir]", Modified: stable/7/usr.sbin/pkg_install/add/perform.c ============================================================================== --- stable/7/usr.sbin/pkg_install/add/perform.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/add/perform.c Fri Jan 22 23:17:07 2010 (r202841) @@ -52,9 +52,6 @@ pkg_perform(char **pkgs) return err_cnt; } -static Package Plist; -static char *Home; - /* * This is seriously ugly code following. Written very fast! * [And subsequently made even worse.. Sigh! This code was just born @@ -63,10 +60,12 @@ static char *Home; static int pkg_do(char *pkg) { + Package Plist; char pkg_fullname[FILENAME_MAX]; char playpen[FILENAME_MAX]; char extract_contents[FILENAME_MAX]; - char *where_to, *extract; + char *extract; + const char *where_to; FILE *cfile; int code; PackingList p; @@ -87,6 +86,8 @@ pkg_do(char *pkg) strcpy(playpen, FirstPen); inPlace = 0; + memset(&Plist, '\0', sizeof(Plist)); + /* Are we coming in for a second pass, everything already extracted? */ if (!pkg) { fgets(playpen, FILENAME_MAX, stdin); @@ -102,11 +103,10 @@ pkg_do(char *pkg) else { /* Is it an ftp://foo.bar.baz/file.t[bg]z specification? */ if (isURL(pkg)) { - if (!(Home = fileGetURL(NULL, pkg, KeepPackage))) { + if (!(where_to = fileGetURL(NULL, pkg, KeepPackage))) { warnx("unable to fetch '%s' by URL", pkg); return 1; } - where_to = Home; strcpy(pkg_fullname, pkg); cfile = fopen(CONTENTS_FNAME, "r"); if (!cfile) { @@ -135,13 +135,11 @@ pkg_do(char *pkg) extract = NULL; sb.st_size = 100000; /* Make up a plausible average size */ } - Home = make_playpen(playpen, sb.st_size * 4); - if (!Home) + if (!(where_to = make_playpen(playpen, sb.st_size * 4))) errx(1, "unable to make playpen for %lld bytes", (long long)sb.st_size * 4); - where_to = Home; /* Since we can call ourselves recursively, keep notes on where we came from */ if (!getenv("_TOP")) - setenv("_TOP", Home, 1); + setenv("_TOP", where_to, 1); if (unpack(pkg_fullname, extract)) { warnx( "unable to extract table of contents file from '%s' - not a package?", @@ -280,6 +278,44 @@ pkg_do(char *pkg) warnx("-f specified; proceeding anyway"); } +#if ENSURE_THAT_ALL_REQUIREMENTS_ARE_MET + /* + * Before attempting to do the slave mode bit, ensure that we've + * downloaded & processed everything we need. + * It's possible that we haven't already installed all of our + * dependencies if the dependency list was misgenerated due to + * other dynamic dependencies or if a dependency was added to a + * package without all REQUIRED_BY packages being regenerated. + */ + for (p = pkg ? Plist.head : NULL; p; p = p->next) { + const char *ext; + char *deporigin; + + if (p->type != PLIST_PKGDEP) + continue; + deporigin = (p->next->type == PLIST_DEPORIGIN) ? p->next->name : NULL; + + if (isinstalledpkg(p->name) <= 0 && + !(deporigin != NULL && matchbyorigin(deporigin, NULL) != NULL)) { + char subpkg[FILENAME_MAX], *sep; + + strlcpy(subpkg, pkg, sizeof subpkg); + if ((sep = strrchr(subpkg, '/')) != NULL) { + *sep = '\0'; + if ((sep = strrchr(subpkg, '/')) != NULL) { + *sep = '\0'; + strlcat(subpkg, "/All/", sizeof subpkg); + strlcat(subpkg, p->name, sizeof subpkg); + if ((ext = strrchr(pkg, '.')) == NULL) + ext = ".tbz"; + strlcat(subpkg, ext, sizeof subpkg); + pkg_do(subpkg); + } + } + } + } +#endif + /* Now check the packing list for dependencies */ for (p = Plist.head; p ; p = p->next) { char *deporigin; @@ -295,7 +331,8 @@ pkg_do(char *pkg) } if (isinstalledpkg(p->name) <= 0 && !(deporigin != NULL && matchbyorigin(deporigin, NULL) != NULL)) { - char path[FILENAME_MAX], *cp = NULL; + char path[FILENAME_MAX]; + const char *cp = NULL; if (!Fake) { char prefixArg[2 + MAXPATHLEN]; /* "-P" + Prefix */ @@ -333,7 +370,7 @@ pkg_do(char *pkg) } else if ((cp = fileGetURL(pkg, p->name, KeepPackage)) != NULL) { if (Verbose) - printf("Finished loading %s over FTP.\n", p->name); + printf("Finished loading %s via a URL\n", p->name); if (!fexists("+CONTENTS")) { warnx("autoloaded package %s has no +CONTENTS file?", p->name); @@ -645,7 +682,8 @@ cleanup(int sig) printf("Signal %d received, cleaning up..\n", sig); if (!Fake && zapLogDir && LogDir[0]) vsystem("%s -rf %s", REMOVE_CMD, LogDir); - leave_playpen(); + while (leave_playpen()) + ; } if (sig) exit(1); Modified: stable/7/usr.sbin/pkg_install/create/main.c ============================================================================== --- stable/7/usr.sbin/pkg_install/create/main.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/create/main.c Fri Jan 22 23:17:07 2010 (r202841) @@ -249,7 +249,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: pkg_create [-YNOhjnvyz] [-C conflicts] [-P pkgs] [-p prefix]", Modified: stable/7/usr.sbin/pkg_install/create/perform.c ============================================================================== --- stable/7/usr.sbin/pkg_install/create/perform.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/create/perform.c Fri Jan 22 23:17:07 2010 (r202841) @@ -39,11 +39,10 @@ static void make_dist(const char *, cons static int create_from_installed_recursive(const char *, const char *); static int create_from_installed(const char *, const char *, const char *); -static char *home; - int pkg_perform(char **pkgs) { + static const char *home; char *pkg = *pkgs; /* Only one arg to create */ char *cp; FILE *pkg_in, *fp; Modified: stable/7/usr.sbin/pkg_install/delete/Makefile ============================================================================== --- stable/7/usr.sbin/pkg_install/delete/Makefile Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/delete/Makefile Fri Jan 22 23:17:07 2010 (r202841) @@ -5,7 +5,6 @@ SRCS= main.c perform.c CFLAGS+= -I${.CURDIR}/../lib -WARNS?= 6 WFORMAT?= 1 DPADD= ${LIBINSTALL} ${LIBMD} Modified: stable/7/usr.sbin/pkg_install/delete/main.c ============================================================================== --- stable/7/usr.sbin/pkg_install/delete/main.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/delete/main.c Fri Jan 22 23:17:07 2010 (r202841) @@ -170,7 +170,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: pkg_delete [-dDfGinrvxX] [-p prefix] pkg-name ...", Modified: stable/7/usr.sbin/pkg_install/info/Makefile ============================================================================== --- stable/7/usr.sbin/pkg_install/info/Makefile Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/info/Makefile Fri Jan 22 23:17:07 2010 (r202841) @@ -5,7 +5,6 @@ SRCS= main.c perform.c show.c CFLAGS+= -I${.CURDIR}/../lib -WARNS?= 6 WFORMAT?= 1 DPADD= ${LIBINSTALL} ${LIBFETCH} ${LIBMD} Modified: stable/7/usr.sbin/pkg_install/info/main.c ============================================================================== --- stable/7/usr.sbin/pkg_install/info/main.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/info/main.c Fri Jan 22 23:17:07 2010 (r202841) @@ -282,7 +282,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", "usage: pkg_info [-bcdDEfgGiIjkKLmopPqQrRsvVxX] [-e package] [-l prefix]", Modified: stable/7/usr.sbin/pkg_install/info/perform.c ============================================================================== --- stable/7/usr.sbin/pkg_install/info/perform.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/info/perform.c Fri Jan 22 23:17:07 2010 (r202841) @@ -85,8 +85,6 @@ pkg_perform(char **pkgs) return err_cnt; } -static char *Home; - static int pkg_do(char *pkg) { @@ -96,7 +94,7 @@ pkg_do(char *pkg) Package plist; FILE *fp; struct stat sb; - char *cp = NULL; + const char *cp = NULL; int code = 0; if (isURL(pkg)) { @@ -138,7 +136,7 @@ pkg_do(char *pkg) code = 1; goto bail; } - Home = make_playpen(PlayPen, sb.st_size / 2); + make_playpen(PlayPen, sb.st_size / 2); if (unpack(fname, "'+*'")) { warnx("error during unpacking, no info for '%s' available", pkg); code = 1; Modified: stable/7/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/lib.h Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/lib/lib.h Fri Jan 22 23:17:07 2010 (r202841) @@ -84,14 +84,14 @@ #define DISPLAY_FNAME "+DISPLAY" #define MTREE_FNAME "+MTREE_DIRS" -#if defined(__FreeBSD_version) && __FreeBSD_version >= 800000 +#if defined(__FreeBSD_version) && __FreeBSD_version >= 900000 +#define INDEX_FNAME "INDEX-9" +#elif defined(__FreeBSD_version) && __FreeBSD_version >= 800000 #define INDEX_FNAME "INDEX-8" #elif defined(__FreeBSD_version) && __FreeBSD_version >= 700000 #define INDEX_FNAME "INDEX-7" #elif defined(__FreeBSD_version) && __FreeBSD_version >= 600000 #define INDEX_FNAME "INDEX-6" -#elif defined(__FreeBSD_version) && __FreeBSD_version >= 500036 -#define INDEX_FNAME "INDEX-5" #else #define INDEX_FNAME "INDEX" #endif @@ -102,10 +102,10 @@ #define PKG_PREFIX_VNAME "PKG_PREFIX" /* - * Version of the package tools - increase only when some - * functionality used by bsd.port.mk is changed, added or removed + * Version of the package tools - increase whenever you make a change + * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20080708 +#define PKG_INSTALL_VERSION 20090902 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) @@ -159,9 +159,9 @@ STAILQ_HEAD(reqr_by_head, reqr_by_entry) int vsystem(const char *, ...); char *vpipe(const char *, ...); void cleanup(int); -char *make_playpen(char *, off_t); +const char *make_playpen(char *, off_t); char *where_playpen(void); -void leave_playpen(void); +int leave_playpen(void); off_t min_free(const char *); /* String */ @@ -183,7 +183,7 @@ Boolean isfile(const char *); Boolean isempty(const char *); Boolean issymlink(const char *); Boolean isURL(const char *); -char *fileGetURL(const char *, const char *, int); +const char *fileGetURL(const char *, const char *, int); char *fileFindByPath(const char *, const char *); char *fileGetContents(const char *); void write_file(const char *, const char *); Modified: stable/7/usr.sbin/pkg_install/lib/pen.c ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/pen.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/lib/pen.c Fri Jan 22 23:17:07 2010 (r202841) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); /* For keeping track of where we are */ static char PenLocation[FILENAME_MAX]; -static char Previous[FILENAME_MAX]; char * where_playpen(void) @@ -76,12 +75,14 @@ find_play_pen(char *pen, off_t sz) static char *pstack[MAX_STACK]; static int pdepth = -1; -static void +static const char * pushPen(const char *pen) { if (++pdepth == MAX_STACK) errx(2, "%s: stack overflow.\n", __func__); pstack[pdepth] = strdup(pen); + + return pstack[pdepth]; } static void @@ -99,10 +100,11 @@ popPen(char *pen) * Make a temporary directory to play in and chdir() to it, returning * pathname of previous working directory. */ -char * +const char * make_playpen(char *pen, off_t sz) { char humbuf1[6], humbuf2[6]; + char cwd[FILENAME_MAX]; if (!find_play_pen(pen, sz)) return NULL; @@ -134,7 +136,7 @@ make_playpen(char *pen, off_t sz) "with more space and\ntry the command again", __func__, pen); } - if (!getcwd(Previous, FILENAME_MAX)) { + if (!getcwd(cwd, FILENAME_MAX)) { upchuck("getcwd"); return NULL; } @@ -144,34 +146,35 @@ make_playpen(char *pen, off_t sz) errx(2, "%s: can't chdir to '%s'", __func__, pen); } - if (PenLocation[0]) - pushPen(PenLocation); - strcpy(PenLocation, pen); - return Previous; + return pushPen(cwd); } /* Convenience routine for getting out of playpen */ -void +int leave_playpen() { + static char left[FILENAME_MAX]; void (*oldsig)(int); + if (!PenLocation[0]) + return 0; + /* Don't interrupt while we're cleaning up */ oldsig = signal(SIGINT, SIG_IGN); - if (Previous[0]) { - if (chdir(Previous) == FAIL) { - cleanup(0); - errx(2, "%s: can't chdir back to '%s'", __func__, Previous); - } - Previous[0] = '\0'; - } - if (PenLocation[0]) { - if (PenLocation[0] == '/' && vsystem("/bin/rm -rf %s", PenLocation)) - warnx("couldn't remove temporary dir '%s'", PenLocation); - popPen(PenLocation); + strcpy(left, PenLocation); + popPen(PenLocation); + + if (chdir(PenLocation) == FAIL) { + cleanup(0); + errx(2, "%s: can't chdir back to '%s'", __func__, PenLocation); } + + if (left[0] == '/' && vsystem("/bin/rm -rf %s", left)) + warnx("couldn't remove temporary dir '%s'", left); signal(SIGINT, oldsig); + + return 1; } off_t Modified: stable/7/usr.sbin/pkg_install/lib/plist.c ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/plist.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/lib/plist.c Fri Jan 22 23:17:07 2010 (r202841) @@ -285,6 +285,10 @@ read_plist(Package *pkg, FILE *fp) } if (*cp == '\0') { cp = NULL; + if (cmd == PLIST_PKGDEP) { + warnx("corrupted record (pkgdep line without argument), ignoring"); + cmd = FAIL; + } goto bottom; } if (cmd == PLIST_COMMENT && sscanf(cp, "PKG_FORMAT_REVISION:%d.%d\n", Modified: stable/7/usr.sbin/pkg_install/lib/url.c ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/url.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/lib/url.c Fri Jan 22 23:17:07 2010 (r202841) @@ -32,10 +32,11 @@ __FBSDID("$FreeBSD$"); * Try and fetch a file by URL, returning the directory name for where * it's unpacked, if successful. */ -char * +const char * fileGetURL(const char *base, const char *spec, int keep_package) { - char *cp, *rp, *tmp; + const char *rp; + char *cp, *tmp; char fname[FILENAME_MAX]; char pen[FILENAME_MAX]; char pkg[FILENAME_MAX]; @@ -105,7 +106,7 @@ fileGetURL(const char *base, const char fetchDebug = (Verbose > 0); if ((ftp = fetchGetURL(fname, Verbose ? "v" : NULL)) == NULL) { - printf("Error: FTP Unable to get %s: %s\n", + printf("Error: Unable to get %s: %s\n", fname, fetchLastErrString); return NULL; } Modified: stable/7/usr.sbin/pkg_install/updating/Makefile ============================================================================== --- stable/7/usr.sbin/pkg_install/updating/Makefile Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/updating/Makefile Fri Jan 22 23:17:07 2010 (r202841) @@ -5,7 +5,6 @@ SRCS= main.c CFLAGS+= -I${.CURDIR}/../lib -WARNS?= 6 WFORMAT?= 1 DPADD= ${LIBINSTALL} ${LIBFETCH} ${LIBMD} Modified: stable/7/usr.sbin/pkg_install/version/Makefile ============================================================================== --- stable/7/usr.sbin/pkg_install/version/Makefile Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/version/Makefile Fri Jan 22 23:17:07 2010 (r202841) @@ -5,7 +5,6 @@ SRCS= main.c perform.c CFLAGS+= -I${.CURDIR}/../lib -WARNS?= 6 WFORMAT?= 1 DPADD= ${LIBINSTALL} ${LIBFETCH} ${LIBMD} Modified: stable/7/usr.sbin/pkg_install/version/main.c ============================================================================== --- stable/7/usr.sbin/pkg_install/version/main.c Fri Jan 22 23:13:46 2010 (r202840) +++ stable/7/usr.sbin/pkg_install/version/main.c Fri Jan 22 23:17:07 2010 (r202841) @@ -127,7 +127,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n%s\n", "usage: pkg_version [-hIoqv] [-l limchar] [-L limchar] [[-X] -s string] [-O origin] [index]", From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 00:41:05 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CB501065679; Sat, 23 Jan 2010 00:41:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19E3C8FC18; Sat, 23 Jan 2010 00:41:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0N0f4L7042844; Sat, 23 Jan 2010 00:41:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0N0f4w3042835; Sat, 23 Jan 2010 00:41:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001230041.o0N0f4w3042835@svn.freebsd.org> From: Xin LI Date: Sat, 23 Jan 2010 00:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202853 - in stable/7: contrib/pf/man contrib/pf/pfctl sys/contrib/pf/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 00:41:05 -0000 Author: delphij Date: Sat Jan 23 00:41:04 2010 New Revision: 202853 URL: http://svn.freebsd.org/changeset/base/202853 Log: MFC r200930: Adapt OpenBSD pf's "sloopy" TCP state machine which is useful for Direct Server Return mode, where not all packets would be visible to the load balancer or gateway. This commit should be reverted when we merge future pf versions. The benefit it would provide is that this version does not break any existing public interface and thus won't be a problem if we want to MFC it to earlier FreeBSD releases. Discussed with: mlaier Obtained from: OpenBSD Sponsored by: iXsystems, Inc. Modified: stable/7/contrib/pf/man/pf.conf.5 stable/7/contrib/pf/pfctl/parse.y stable/7/contrib/pf/pfctl/pf_print_state.c stable/7/contrib/pf/pfctl/pfctl_parser.c stable/7/sys/contrib/pf/net/if_pfsync.c stable/7/sys/contrib/pf/net/if_pfsync.h stable/7/sys/contrib/pf/net/pf.c stable/7/sys/contrib/pf/net/pfvar.h Directory Properties: stable/7/contrib/pf/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/contrib/pf/man/pf.conf.5 ============================================================================== --- stable/7/contrib/pf/man/pf.conf.5 Sat Jan 23 00:32:19 2010 (r202852) +++ stable/7/contrib/pf/man/pf.conf.5 Sat Jan 23 00:41:04 2010 (r202853) @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 30, 2006 +.Dd June 10, 2008 .Dt PF.CONF 5 .Os .Sh NAME @@ -2059,6 +2059,13 @@ Changes the timeout values used for stat For a list of all valid timeout names, see .Sx OPTIONS above. +.It Ar sloppy +Uses a sloppy TCP connection tracker that does not check sequence +numbers at all, which makes insertion and ICMP teardown attacks way +easier. +This is intended to be used in situations where one does not see all +packets of a connection, i.e. in asymmetric routing situations. +Cannot be used with modulate or synproxy state. .El .Pp Multiple options can be specified, separated by commas: @@ -2923,7 +2930,7 @@ tos = "tos" ( "lowdelay" | "t [ "0x" ] number ) state-opts = state-opt [ [ "," ] state-opts ] -state-opt = ( "max" number | "no-sync" | timeout | +state-opt = ( "max" number | "no-sync" | timeout | sloppy | "source-track" [ ( "rule" | "global" ) ] | "max-src-nodes" number | "max-src-states" number | "max-src-conn" number | Modified: stable/7/contrib/pf/pfctl/parse.y ============================================================================== --- stable/7/contrib/pf/pfctl/parse.y Sat Jan 23 00:32:19 2010 (r202852) +++ stable/7/contrib/pf/pfctl/parse.y Sat Jan 23 00:41:04 2010 (r202853) @@ -128,7 +128,7 @@ enum { PF_STATE_OPT_MAX, PF_STATE_OPT_NO PF_STATE_OPT_MAX_SRC_STATES, PF_STATE_OPT_MAX_SRC_CONN, PF_STATE_OPT_MAX_SRC_CONN_RATE, PF_STATE_OPT_MAX_SRC_NODES, PF_STATE_OPT_OVERLOAD, PF_STATE_OPT_STATELOCK, - PF_STATE_OPT_TIMEOUT }; + PF_STATE_OPT_TIMEOUT, PF_STATE_OPT_SLOPPY }; enum { PF_SRCTRACK_NONE, PF_SRCTRACK, PF_SRCTRACK_GLOBAL, PF_SRCTRACK_RULE }; @@ -423,7 +423,7 @@ typedef struct { %token QUEUE PRIORITY QLIMIT RTABLE %token LOAD RULESET_OPTIMIZATION %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE -%token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH +%token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY %token TAGGED TAG IFBOUND FLOATING STATEPOLICY ROUTE %token STRING %token PORTBINARY @@ -1891,6 +1891,14 @@ pfrule : action dir logquick interface statelock = 1; r.rule_flag |= o->data.statelock; break; + case PF_STATE_OPT_SLOPPY: + if (r.rule_flag & PFRULE_STATESLOPPY) { + yyerror("state sloppy option: " + "multiple definitions"); + YYERROR; + } + r.rule_flag |= PFRULE_STATESLOPPY; + break; case PF_STATE_OPT_TIMEOUT: if (o->data.timeout.number == PFTM_ADAPTIVE_START || @@ -3216,6 +3224,14 @@ state_opt_item : MAXIMUM number { $$->next = NULL; $$->tail = $$; } + | SLOPPY { + $$ = calloc(1, sizeof(struct node_state_opt)); + if ($$ == NULL) + err(1, "state_opt_item: calloc"); + $$->type = PF_STATE_OPT_SLOPPY; + $$->next = NULL; + $$->tail = $$; + } | STRING number { int i; @@ -4101,6 +4117,13 @@ filter_consistent(struct pf_rule *r, int yyerror("keep state on block rules doesn't make sense"); problems++; } + if (r->rule_flag & PFRULE_STATESLOPPY && + (r->keep_state == PF_STATE_MODULATE || + r->keep_state == PF_STATE_SYNPROXY)) { + yyerror("sloppy state matching cannot be used with " + "synproxy state or modulate state"); + problems++; + } return (-problems); } @@ -4969,6 +4992,7 @@ lookup(char *s) { "scrub", SCRUB}, { "set", SET}, { "skip", SKIP}, + { "sloppy", SLOPPY}, { "source-hash", SOURCEHASH}, { "source-track", SOURCETRACK}, { "state", STATE}, Modified: stable/7/contrib/pf/pfctl/pf_print_state.c ============================================================================== --- stable/7/contrib/pf/pfctl/pf_print_state.c Sat Jan 23 00:32:19 2010 (r202852) +++ stable/7/contrib/pf/pfctl/pf_print_state.c Sat Jan 23 00:41:04 2010 (r202853) @@ -294,6 +294,8 @@ print_state(struct pf_state *s, int opts printf(", anchor %u", s->anchor.nr); if (s->rule.nr != -1) printf(", rule %u", s->rule.nr); + if (s->state_flags & PFSTATE_SLOPPY) + printf(", sloppy"); if (s->src_node != NULL) printf(", source-track"); if (s->nat_src_node != NULL) Modified: stable/7/contrib/pf/pfctl/pfctl_parser.c ============================================================================== --- stable/7/contrib/pf/pfctl/pfctl_parser.c Sat Jan 23 00:32:19 2010 (r202852) +++ stable/7/contrib/pf/pfctl/pfctl_parser.c Sat Jan 23 00:41:04 2010 (r202853) @@ -873,6 +873,8 @@ print_rule(struct pf_rule *r, const char opts = 1; if (r->rule_flag & PFRULE_IFBOUND) opts = 1; + if (r->rule_flag & PFRULE_STATESLOPPY) + opts = 1; for (i = 0; !opts && i < PFTM_MAX; ++i) if (r->timeout[i]) opts = 1; @@ -939,6 +941,12 @@ print_rule(struct pf_rule *r, const char printf("if-bound"); opts = 0; } + if (r->rule_flag & PFRULE_STATESLOPPY) { + if (!opts) + printf(", "); + printf("sloppy"); + opts = 0; + } for (i = 0; i < PFTM_MAX; ++i) if (r->timeout[i]) { int j; Modified: stable/7/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- stable/7/sys/contrib/pf/net/if_pfsync.c Sat Jan 23 00:32:19 2010 (r202852) +++ stable/7/sys/contrib/pf/net/if_pfsync.c Sat Jan 23 00:41:04 2010 (r202853) @@ -465,7 +465,7 @@ pfsync_insert_net_state(struct pfsync_st st->direction = sp->direction; st->log = sp->log; st->timeout = sp->timeout; - st->allow_opts = sp->allow_opts; + st->state_flags = sp->state_flags; bcopy(sp->id, &st->id, sizeof(st->id)); st->creatorid = sp->creatorid; @@ -1578,7 +1578,7 @@ pfsync_pack_state(u_int8_t action, struc sp->proto = st->proto; sp->direction = st->direction; sp->log = st->log; - sp->allow_opts = st->allow_opts; + sp->state_flags = st->state_flags; sp->timeout = st->timeout; if (flags & PFSYNC_FLAG_STALE) Modified: stable/7/sys/contrib/pf/net/if_pfsync.h ============================================================================== --- stable/7/sys/contrib/pf/net/if_pfsync.h Sat Jan 23 00:32:19 2010 (r202852) +++ stable/7/sys/contrib/pf/net/if_pfsync.h Sat Jan 23 00:41:04 2010 (r202853) @@ -80,7 +80,7 @@ struct pfsync_state { u_int8_t proto; u_int8_t direction; u_int8_t log; - u_int8_t allow_opts; + u_int8_t state_flags; u_int8_t timeout; u_int8_t sync_flags; u_int8_t updates; Modified: stable/7/sys/contrib/pf/net/pf.c ============================================================================== --- stable/7/sys/contrib/pf/net/pf.c Sat Jan 23 00:32:19 2010 (r202852) +++ stable/7/sys/contrib/pf/net/pf.c Sat Jan 23 00:41:04 2010 (r202853) @@ -254,6 +254,13 @@ int pf_test_fragment(struct pf_rule * struct pfi_kif *, struct mbuf *, void *, struct pf_pdesc *, struct pf_rule **, struct pf_ruleset **); +int pf_tcp_track_full(struct pf_state_peer *, + struct pf_state_peer *, struct pf_state **, + struct pfi_kif *, struct mbuf *, int, + struct pf_pdesc *, u_short *, int *); +int pf_tcp_track_sloppy(struct pf_state_peer *, + struct pf_state_peer *, struct pf_state **, + struct pf_pdesc *, u_short *); int pf_test_state_tcp(struct pf_state **, int, struct pfi_kif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); @@ -3529,7 +3536,10 @@ cleanup: s->nat_rule.ptr = nr; s->anchor.ptr = a; STATE_INC_COUNTERS(s); - s->allow_opts = r->allow_opts; + if (r->allow_opts) + s->state_flags |= PFSTATE_ALLOWOPTS; + if (r->rule_flag & PFRULE_STATESLOPPY) + s->state_flags |= PFSTATE_SLOPPY; s->log = r->log & PF_LOG_ALL; if (nr != NULL) s->log |= nr->log & PF_LOG_ALL; @@ -3926,7 +3936,10 @@ cleanup: s->nat_rule.ptr = nr; s->anchor.ptr = a; STATE_INC_COUNTERS(s); - s->allow_opts = r->allow_opts; + if (r->allow_opts) + s->state_flags |= PFSTATE_ALLOWOPTS; + if (r->rule_flag & PFRULE_STATESLOPPY) + s->state_flags |= PFSTATE_SLOPPY; s->log = r->log & PF_LOG_ALL; if (nr != NULL) s->log |= nr->log & PF_LOG_ALL; @@ -4239,7 +4252,10 @@ cleanup: s->nat_rule.ptr = nr; s->anchor.ptr = a; STATE_INC_COUNTERS(s); - s->allow_opts = r->allow_opts; + if (r->allow_opts) + s->state_flags |= PFSTATE_ALLOWOPTS; + if (r->rule_flag & PFRULE_STATESLOPPY) + s->state_flags |= PFSTATE_SLOPPY; s->log = r->log & PF_LOG_ALL; if (nr != NULL) s->log |= nr->log & PF_LOG_ALL; @@ -4526,7 +4542,10 @@ cleanup: s->nat_rule.ptr = nr; s->anchor.ptr = a; STATE_INC_COUNTERS(s); - s->allow_opts = r->allow_opts; + if (r->allow_opts) + s->state_flags |= PFSTATE_ALLOWOPTS; + if (r->rule_flag & PFRULE_STATESLOPPY) + s->state_flags |= PFSTATE_SLOPPY; s->log = r->log & PF_LOG_ALL; if (nr != NULL) s->log |= nr->log & PF_LOG_ALL; @@ -4667,165 +4686,15 @@ pf_test_fragment(struct pf_rule **rm, in } int -pf_test_state_tcp(struct pf_state **state, int direction, struct pfi_kif *kif, - struct mbuf *m, int off, void *h, struct pf_pdesc *pd, - u_short *reason) -{ - struct pf_state_cmp key; - struct tcphdr *th = pd->hdr.tcp; - u_int16_t win = ntohs(th->th_win); - u_int32_t ack, end, seq, orig_seq; - u_int8_t sws, dws; - int ackskew; - int copyback = 0; - struct pf_state_peer *src, *dst; - - key.af = pd->af; - key.proto = IPPROTO_TCP; - if (direction == PF_IN) { - PF_ACPY(&key.ext.addr, pd->src, key.af); - PF_ACPY(&key.gwy.addr, pd->dst, key.af); - key.ext.port = th->th_sport; - key.gwy.port = th->th_dport; - } else { - PF_ACPY(&key.lan.addr, pd->src, key.af); - PF_ACPY(&key.ext.addr, pd->dst, key.af); - key.lan.port = th->th_sport; - key.ext.port = th->th_dport; - } - - STATE_LOOKUP(); - - if (direction == (*state)->direction) { - src = &(*state)->src; - dst = &(*state)->dst; - } else { - src = &(*state)->dst; - dst = &(*state)->src; - } - - if ((*state)->src.state == PF_TCPS_PROXY_SRC) { - if (direction != (*state)->direction) { - REASON_SET(reason, PFRES_SYNPROXY); - return (PF_SYNPROXY_DROP); - } - if (th->th_flags & TH_SYN) { - if (ntohl(th->th_seq) != (*state)->src.seqlo) { - REASON_SET(reason, PFRES_SYNPROXY); - return (PF_DROP); - } -#ifdef __FreeBSD__ - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, -#else - pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, -#endif - pd->src, th->th_dport, th->th_sport, - (*state)->src.seqhi, ntohl(th->th_seq) + 1, - TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, - 0, NULL, NULL); - REASON_SET(reason, PFRES_SYNPROXY); - return (PF_SYNPROXY_DROP); - } else if (!(th->th_flags & TH_ACK) || - (ntohl(th->th_ack) != (*state)->src.seqhi + 1) || - (ntohl(th->th_seq) != (*state)->src.seqlo + 1)) { - REASON_SET(reason, PFRES_SYNPROXY); - return (PF_DROP); - } else if ((*state)->src_node != NULL && - pf_src_connlimit(state)) { - REASON_SET(reason, PFRES_SRCLIMIT); - return (PF_DROP); - } else - (*state)->src.state = PF_TCPS_PROXY_DST; - } - if ((*state)->src.state == PF_TCPS_PROXY_DST) { - struct pf_state_host *src, *dst; - - if (direction == PF_OUT) { - src = &(*state)->gwy; - dst = &(*state)->ext; - } else { - src = &(*state)->ext; - dst = &(*state)->lan; - } - if (direction == (*state)->direction) { - if (((th->th_flags & (TH_SYN|TH_ACK)) != TH_ACK) || - (ntohl(th->th_ack) != (*state)->src.seqhi + 1) || - (ntohl(th->th_seq) != (*state)->src.seqlo + 1)) { - REASON_SET(reason, PFRES_SYNPROXY); - return (PF_DROP); - } - (*state)->src.max_win = MAX(ntohs(th->th_win), 1); - if ((*state)->dst.seqhi == 1) - (*state)->dst.seqhi = htonl(arc4random()); -#ifdef __FreeBSD__ - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, - &src->addr, -#else - pf_send_tcp((*state)->rule.ptr, pd->af, &src->addr, -#endif - &dst->addr, src->port, dst->port, - (*state)->dst.seqhi, 0, TH_SYN, 0, - (*state)->src.mss, 0, 0, (*state)->tag, NULL, NULL); - REASON_SET(reason, PFRES_SYNPROXY); - return (PF_SYNPROXY_DROP); - } else if (((th->th_flags & (TH_SYN|TH_ACK)) != - (TH_SYN|TH_ACK)) || - (ntohl(th->th_ack) != (*state)->dst.seqhi + 1)) { - REASON_SET(reason, PFRES_SYNPROXY); - return (PF_DROP); - } else { - (*state)->dst.max_win = MAX(ntohs(th->th_win), 1); - (*state)->dst.seqlo = ntohl(th->th_seq); -#ifdef __FreeBSD__ - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, -#else - pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, -#endif - pd->src, th->th_dport, th->th_sport, - ntohl(th->th_ack), ntohl(th->th_seq) + 1, - TH_ACK, (*state)->src.max_win, 0, 0, 0, - (*state)->tag, NULL, NULL); -#ifdef __FreeBSD__ - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, - &src->addr, -#else - pf_send_tcp((*state)->rule.ptr, pd->af, &src->addr, -#endif - &dst->addr, src->port, dst->port, - (*state)->src.seqhi + 1, (*state)->src.seqlo + 1, - TH_ACK, (*state)->dst.max_win, 0, 0, 1, - 0, NULL, NULL); - (*state)->src.seqdiff = (*state)->dst.seqhi - - (*state)->src.seqlo; - (*state)->dst.seqdiff = (*state)->src.seqhi - - (*state)->dst.seqlo; - (*state)->src.seqhi = (*state)->src.seqlo + - (*state)->dst.max_win; - (*state)->dst.seqhi = (*state)->dst.seqlo + - (*state)->src.max_win; - (*state)->src.wscale = (*state)->dst.wscale = 0; - (*state)->src.state = (*state)->dst.state = - TCPS_ESTABLISHED; - REASON_SET(reason, PFRES_SYNPROXY); - return (PF_SYNPROXY_DROP); - } - } - - if (((th->th_flags & (TH_SYN|TH_ACK)) == TH_SYN) && - dst->state >= TCPS_FIN_WAIT_2 && - src->state >= TCPS_FIN_WAIT_2) { - if (pf_status.debug >= PF_DEBUG_MISC) { - printf("pf: state reuse "); - pf_print_state(*state); - pf_print_flags(th->th_flags); - printf("\n"); - } - /* XXX make sure it's the same direction ?? */ - (*state)->src.state = (*state)->dst.state = TCPS_CLOSED; - pf_unlink_state(*state); - *state = NULL; - return (PF_DROP); - } +pf_tcp_track_full(struct pf_state_peer *src, struct pf_state_peer *dst, + struct pf_state **state, struct pfi_kif *kif, struct mbuf *m, int off, + struct pf_pdesc *pd, u_short *reason, int *copyback) +{ + struct tcphdr *th = pd->hdr.tcp; + u_int16_t win = ntohs(th->th_win); + u_int32_t ack, end, seq, orig_seq; + u_int8_t sws, dws; + int ackskew; if (src->wscale && dst->wscale && !(th->th_flags & TH_SYN)) { sws = src->wscale & PF_WSCALE_MASK; @@ -4864,7 +4733,7 @@ pf_test_state_tcp(struct pf_state **stat pf_change_a(&th->th_seq, &th->th_sum, htonl(seq + src->seqdiff), 0); pf_change_a(&th->th_ack, &th->th_sum, htonl(ack), 0); - copyback = 1; + *copyback = 1; } else { ack = ntohl(th->th_ack); } @@ -4916,7 +4785,7 @@ pf_test_state_tcp(struct pf_state **stat pf_change_a(&th->th_seq, &th->th_sum, htonl(seq + src->seqdiff), 0); pf_change_a(&th->th_ack, &th->th_sum, htonl(ack), 0); - copyback = 1; + *copyback = 1; } end = seq + pd->p_len; if (th->th_flags & TH_SYN) @@ -4962,7 +4831,7 @@ pf_test_state_tcp(struct pf_state **stat */ if (dst->seqdiff && (th->th_off << 2) > sizeof(struct tcphdr)) { if (pf_modulate_sack(m, off, pd, th, dst)) - copyback = 1; + *copyback = 1; } @@ -4981,7 +4850,7 @@ pf_test_state_tcp(struct pf_state **stat if (dst->scrub || src->scrub) { if (pf_normalize_tcp_stateful(m, off, pd, reason, th, - *state, src, dst, ©back)) + *state, src, dst, copyback)) return (PF_DROP); } @@ -5083,7 +4952,7 @@ pf_test_state_tcp(struct pf_state **stat if (dst->scrub || src->scrub) { if (pf_normalize_tcp_stateful(m, off, pd, reason, th, - *state, src, dst, ©back)) + *state, src, dst, copyback)) return (PF_DROP); } @@ -5133,7 +5002,11 @@ pf_test_state_tcp(struct pf_state **stat pf_print_state(*state); pf_print_flags(th->th_flags); printf(" seq=%u (%u) ack=%u len=%u ackskew=%d " +#ifdef notyet "pkts=%llu:%llu dir=%s,%s\n", +#else + "pkts=%llu:%llu%s\n", +#endif seq, orig_seq, ack, pd->p_len, ackskew, #ifdef __FreeBSD__ (unsigned long long)(*state)->packets[0], @@ -5141,8 +5014,12 @@ pf_test_state_tcp(struct pf_state **stat #else (*state)->packets[0], (*state)->packets[1], #endif +#ifdef notyet direction == PF_IN ? "in" : "out", direction == (*state)->direction ? "fwd" : "rev"); +#else + ""); +#endif printf("pf: State failure on: %c %c %c %c | %c %c\n", SEQ_GEQ(src->seqhi, end) ? ' ' : '1', SEQ_GEQ(seq, src->seqlo - (dst->max_win << dws)) ? @@ -5157,6 +5034,246 @@ pf_test_state_tcp(struct pf_state **stat } /* Any packets which have gotten here are to be passed */ + return (PF_PASS); +} + +int +pf_tcp_track_sloppy(struct pf_state_peer *src, struct pf_state_peer *dst, + struct pf_state **state, struct pf_pdesc *pd, u_short *reason) +{ + struct tcphdr *th = pd->hdr.tcp; + + if (th->th_flags & TH_SYN) + if (src->state < TCPS_SYN_SENT) + src->state = TCPS_SYN_SENT; + if (th->th_flags & TH_FIN) + if (src->state < TCPS_CLOSING) + src->state = TCPS_CLOSING; + if (th->th_flags & TH_ACK) { + if (dst->state == TCPS_SYN_SENT) { + dst->state = TCPS_ESTABLISHED; + if (src->state == TCPS_ESTABLISHED && + (*state)->src_node != NULL && + pf_src_connlimit(state)) { + REASON_SET(reason, PFRES_SRCLIMIT); + return (PF_DROP); + } + } else if (dst->state == TCPS_CLOSING) { + dst->state = TCPS_FIN_WAIT_2; + } else if (src->state == TCPS_SYN_SENT && + dst->state < TCPS_SYN_SENT) { + /* + * Handle a special sloppy case where we only see one + * half of the connection. If there is a ACK after + * the initial SYN without ever seeing a packet from + * the destination, set the connection to established. + */ + dst->state = src->state = TCPS_ESTABLISHED; + if ((*state)->src_node != NULL && + pf_src_connlimit(state)) { + REASON_SET(reason, PFRES_SRCLIMIT); + return (PF_DROP); + } + } else if (src->state == TCPS_CLOSING && + dst->state == TCPS_ESTABLISHED && + dst->seqlo == 0) { + /* + * Handle the closing of half connections where we + * don't see the full bidirectional FIN/ACK+ACK + * handshake. + */ + dst->state = TCPS_CLOSING; + } + } + if (th->th_flags & TH_RST) + src->state = dst->state = TCPS_TIME_WAIT; + + /* update expire time */ + (*state)->expire = time_second; + if (src->state >= TCPS_FIN_WAIT_2 && + dst->state >= TCPS_FIN_WAIT_2) + (*state)->timeout = PFTM_TCP_CLOSED; + else if (src->state >= TCPS_CLOSING && + dst->state >= TCPS_CLOSING) + (*state)->timeout = PFTM_TCP_FIN_WAIT; + else if (src->state < TCPS_ESTABLISHED || + dst->state < TCPS_ESTABLISHED) + (*state)->timeout = PFTM_TCP_OPENING; + else if (src->state >= TCPS_CLOSING || + dst->state >= TCPS_CLOSING) + (*state)->timeout = PFTM_TCP_CLOSING; + else + (*state)->timeout = PFTM_TCP_ESTABLISHED; + + return (PF_PASS); +} + + +int +pf_test_state_tcp(struct pf_state **state, int direction, struct pfi_kif *kif, + struct mbuf *m, int off, void *h, struct pf_pdesc *pd, + u_short *reason) +{ + struct pf_state_cmp key; + struct tcphdr *th = pd->hdr.tcp; + int copyback = 0; + struct pf_state_peer *src, *dst; + + key.af = pd->af; + key.proto = IPPROTO_TCP; + if (direction == PF_IN) { + PF_ACPY(&key.ext.addr, pd->src, key.af); + PF_ACPY(&key.gwy.addr, pd->dst, key.af); + key.ext.port = th->th_sport; + key.gwy.port = th->th_dport; + } else { + PF_ACPY(&key.lan.addr, pd->src, key.af); + PF_ACPY(&key.ext.addr, pd->dst, key.af); + key.lan.port = th->th_sport; + key.ext.port = th->th_dport; + } + + STATE_LOOKUP(); + + if (direction == (*state)->direction) { + src = &(*state)->src; + dst = &(*state)->dst; + } else { + src = &(*state)->dst; + dst = &(*state)->src; + } + + if ((*state)->src.state == PF_TCPS_PROXY_SRC) { + if (direction != (*state)->direction) { + REASON_SET(reason, PFRES_SYNPROXY); + return (PF_SYNPROXY_DROP); + } + if (th->th_flags & TH_SYN) { + if (ntohl(th->th_seq) != (*state)->src.seqlo) { + REASON_SET(reason, PFRES_SYNPROXY); + return (PF_DROP); + } +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, +#else + pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, +#endif + pd->src, th->th_dport, th->th_sport, + (*state)->src.seqhi, ntohl(th->th_seq) + 1, + TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, + 0, NULL, NULL); + REASON_SET(reason, PFRES_SYNPROXY); + return (PF_SYNPROXY_DROP); + } else if (!(th->th_flags & TH_ACK) || + (ntohl(th->th_ack) != (*state)->src.seqhi + 1) || + (ntohl(th->th_seq) != (*state)->src.seqlo + 1)) { + REASON_SET(reason, PFRES_SYNPROXY); + return (PF_DROP); + } else if ((*state)->src_node != NULL && + pf_src_connlimit(state)) { + REASON_SET(reason, PFRES_SRCLIMIT); + return (PF_DROP); + } else + (*state)->src.state = PF_TCPS_PROXY_DST; + } + if ((*state)->src.state == PF_TCPS_PROXY_DST) { + struct pf_state_host *src, *dst; + + if (direction == PF_OUT) { + src = &(*state)->gwy; + dst = &(*state)->ext; + } else { + src = &(*state)->ext; + dst = &(*state)->lan; + } + if (direction == (*state)->direction) { + if (((th->th_flags & (TH_SYN|TH_ACK)) != TH_ACK) || + (ntohl(th->th_ack) != (*state)->src.seqhi + 1) || + (ntohl(th->th_seq) != (*state)->src.seqlo + 1)) { + REASON_SET(reason, PFRES_SYNPROXY); + return (PF_DROP); + } + (*state)->src.max_win = MAX(ntohs(th->th_win), 1); + if ((*state)->dst.seqhi == 1) + (*state)->dst.seqhi = htonl(arc4random()); +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + &src->addr, +#else + pf_send_tcp((*state)->rule.ptr, pd->af, &src->addr, +#endif + &dst->addr, src->port, dst->port, + (*state)->dst.seqhi, 0, TH_SYN, 0, + (*state)->src.mss, 0, 0, (*state)->tag, NULL, NULL); + REASON_SET(reason, PFRES_SYNPROXY); + return (PF_SYNPROXY_DROP); + } else if (((th->th_flags & (TH_SYN|TH_ACK)) != + (TH_SYN|TH_ACK)) || + (ntohl(th->th_ack) != (*state)->dst.seqhi + 1)) { + REASON_SET(reason, PFRES_SYNPROXY); + return (PF_DROP); + } else { + (*state)->dst.max_win = MAX(ntohs(th->th_win), 1); + (*state)->dst.seqlo = ntohl(th->th_seq); +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, +#else + pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, +#endif + pd->src, th->th_dport, th->th_sport, + ntohl(th->th_ack), ntohl(th->th_seq) + 1, + TH_ACK, (*state)->src.max_win, 0, 0, 0, + (*state)->tag, NULL, NULL); +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + &src->addr, +#else + pf_send_tcp((*state)->rule.ptr, pd->af, &src->addr, +#endif + &dst->addr, src->port, dst->port, + (*state)->src.seqhi + 1, (*state)->src.seqlo + 1, + TH_ACK, (*state)->dst.max_win, 0, 0, 1, + 0, NULL, NULL); + (*state)->src.seqdiff = (*state)->dst.seqhi - + (*state)->src.seqlo; + (*state)->dst.seqdiff = (*state)->src.seqhi - + (*state)->dst.seqlo; + (*state)->src.seqhi = (*state)->src.seqlo + + (*state)->dst.max_win; + (*state)->dst.seqhi = (*state)->dst.seqlo + + (*state)->src.max_win; + (*state)->src.wscale = (*state)->dst.wscale = 0; + (*state)->src.state = (*state)->dst.state = + TCPS_ESTABLISHED; + REASON_SET(reason, PFRES_SYNPROXY); + return (PF_SYNPROXY_DROP); + } + } + + if (((th->th_flags & (TH_SYN|TH_ACK)) == TH_SYN) && + dst->state >= TCPS_FIN_WAIT_2 && + src->state >= TCPS_FIN_WAIT_2) { + if (pf_status.debug >= PF_DEBUG_MISC) { + printf("pf: state reuse "); + pf_print_state(*state); + pf_print_flags(th->th_flags); + printf("\n"); + } + /* XXX make sure it's the same direction ?? */ + (*state)->src.state = (*state)->dst.state = TCPS_CLOSED; + pf_unlink_state(*state); + *state = NULL; + return (PF_DROP); + } + + if ((*state)->state_flags & PFSTATE_SLOPPY) { + if (pf_tcp_track_sloppy(src, dst, state, pd, reason) == PF_DROP) + return (PF_DROP); + } else { + if (pf_tcp_track_full(src, dst, state, kif, m, off, pd, reason, + ©back) == PF_DROP) + return (PF_DROP); + } /* translate source/destination address, if necessary */ if (STATE_TRANSLATE(*state)) { @@ -5534,8 +5651,9 @@ pf_test_state_icmp(struct pf_state **sta copyback = 1; } - if (!SEQ_GEQ(src->seqhi, seq) || - !SEQ_GEQ(seq, src->seqlo - (dst->max_win << dws))) { + if (!((*state)->state_flags & PFSTATE_SLOPPY) && + (!SEQ_GEQ(src->seqhi, seq) || + !SEQ_GEQ(seq, src->seqlo - (dst->max_win << dws)))) { if (pf_status.debug >= PF_DEBUG_MISC) { printf("pf: BAD ICMP %d:%d ", icmptype, pd->hdr.icmp->icmp_code); @@ -7045,7 +7163,7 @@ pf_test(int dir, struct ifnet *ifp, stru done: if (action == PF_PASS && h->ip_hl > 5 && - !((s && s->allow_opts) || r->allow_opts)) { + !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { action = PF_DROP; REASON_SET(&reason, PFRES_IPOPTIONS); log = 1; @@ -7506,7 +7624,7 @@ pf_test6(int dir, struct ifnet *ifp, str done: /* handle dangerous IPv6 extension headers. */ if (action == PF_PASS && rh_cnt && - !((s && s->allow_opts) || r->allow_opts)) { + !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { action = PF_DROP; REASON_SET(&reason, PFRES_IPOPTIONS); log = 1; Modified: stable/7/sys/contrib/pf/net/pfvar.h ============================================================================== --- stable/7/sys/contrib/pf/net/pfvar.h Sat Jan 23 00:32:19 2010 (r202852) +++ stable/7/sys/contrib/pf/net/pfvar.h Sat Jan 23 00:41:04 2010 (r202853) @@ -700,6 +700,7 @@ struct pf_rule { /* rule flags again */ #define PFRULE_IFBOUND 0x00010000 /* if-bound */ +#define PFRULE_STATESLOPPY 0x00020000 /* sloppy state tracking */ #define PFSTATE_HIWAT 10000 /* default state table size */ #define PFSTATE_ADAPT_START 6000 /* default adaptive timeout start */ @@ -800,7 +801,9 @@ struct pf_state { u_int8_t pad; #endif u_int8_t log; - u_int8_t allow_opts; + u_int8_t state_flags; +#define PFSTATE_ALLOWOPTS 0x01 +#define PFSTATE_SLOPPY 0x02 u_int8_t timeout; u_int8_t sync_flags; #define PFSTATE_NOSYNC 0x01 From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 00:46:55 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7D35106566C; Sat, 23 Jan 2010 00:46:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4AC08FC08; Sat, 23 Jan 2010 00:46:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0N0ktFv044321; Sat, 23 Jan 2010 00:46:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0N0ktIv044313; Sat, 23 Jan 2010 00:46:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001230046.o0N0ktIv044313@svn.freebsd.org> From: Xin LI Date: Sat, 23 Jan 2010 00:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202856 - in stable/7: lib/libc/sys share/man/man3 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 00:46:56 -0000 Author: delphij Date: Sat Jan 23 00:46:55 2010 New Revision: 202856 URL: http://svn.freebsd.org/changeset/base/202856 Log: MFC r201892: Add a set of manual pages for pthread[_attr]_[sg]etaffinity(3). Reviewed by: davidxu Added: stable/7/share/man/man3/pthread_affinity_np.3 - copied unchanged from r201892, head/share/man/man3/pthread_affinity_np.3 stable/7/share/man/man3/pthread_attr_affinity_np.3 - copied unchanged from r201892, head/share/man/man3/pthread_attr_affinity_np.3 Modified: stable/7/lib/libc/sys/cpuset.2 stable/7/lib/libc/sys/cpuset_getaffinity.2 stable/7/share/man/man3/Makefile stable/7/share/man/man3/pthread.3 stable/7/share/man/man3/pthread_attr.3 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) stable/7/share/man/man3/ (props changed) Modified: stable/7/lib/libc/sys/cpuset.2 ============================================================================== --- stable/7/lib/libc/sys/cpuset.2 Sat Jan 23 00:43:44 2010 (r202855) +++ stable/7/lib/libc/sys/cpuset.2 Sat Jan 23 00:46:55 2010 (r202856) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2008 +.Dd January 8, 2010 .Dt CPUSET 2 .Os .Sh NAME @@ -216,7 +216,9 @@ for allocation. .Xr cpuset 1 , .Xr cpuset_getaffinity 2 , .Xr cpuset_setaffinity 2 , -.Xr CPU_SET 3 +.Xr CPU_SET 3 , +.Xr pthread_affinity_np 3 , +.Xr pthread_attr_affinity_np 3 .Sh HISTORY The .Nm Modified: stable/7/lib/libc/sys/cpuset_getaffinity.2 ============================================================================== --- stable/7/lib/libc/sys/cpuset_getaffinity.2 Sat Jan 23 00:43:44 2010 (r202855) +++ stable/7/lib/libc/sys/cpuset_getaffinity.2 Sat Jan 23 00:46:55 2010 (r202856) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2008 +.Dd January 8, 2010 .Dt CPUSET 2 .Os .Sh NAME @@ -147,7 +147,9 @@ operation. .Xr cpuset 2 , .Xr cpuset_getid 2 , .Xr cpuset_setid 2 , -.Xr CPU_SET 3 +.Xr CPU_SET 3 , +.Xr pthread_affinity_np 3 , +.Xr pthread_attr_affinity_np 3 .Sh HISTORY The .Nm Modified: stable/7/share/man/man3/Makefile ============================================================================== --- stable/7/share/man/man3/Makefile Sat Jan 23 00:43:44 2010 (r202855) +++ stable/7/share/man/man3/Makefile Sat Jan 23 00:46:55 2010 (r202856) @@ -152,8 +152,10 @@ MLINKS+= tree.3 RB_EMPTY.3 \ .if ${MK_LIBTHR} != "no" || ${MK_LIBKSE} != "no" PTHREAD_MAN= pthread.3 \ + pthread_affinity_np.3 \ pthread_atfork.3 \ pthread_attr.3 \ + pthread_attr_affinity_np.3 \ pthread_attr_get_np.3 \ pthread_attr_setcreatesuspend_np.3 \ pthread_barrierattr.3 \ @@ -215,7 +217,9 @@ PTHREAD_MAN= pthread.3 \ pthread_testcancel.3 \ pthread_yield.3 -PTHREAD_MLINKS= pthread_attr.3 pthread_attr_destroy.3 \ +PTHREAD_MLINKS= pthread_affinity_np.3 pthread_getaffinity_np.3 \ + pthread_affinity_np.3 pthread_setaffinity_np.3 +PTHREAD_MLINKS+=pthread_attr.3 pthread_attr_destroy.3 \ pthread_attr.3 pthread_attr_getdetachstate.3 \ pthread_attr.3 pthread_attr_getguardsize.3 \ pthread_attr.3 pthread_attr_getinheritsched.3 \ @@ -235,6 +239,8 @@ PTHREAD_MLINKS= pthread_attr.3 pthread_a pthread_attr.3 pthread_attr_setstack.3 \ pthread_attr.3 pthread_attr_setstackaddr.3 \ pthread_attr.3 pthread_attr_setstacksize.3 +PTHREAD_MLINKS+=pthread_attr_affinity_np.3 pthread_attr_getaffinity_np.3 \ + pthread_attr_affinity_np.3 pthread_attr_setaffinity_np.3 PTHREAD_MLINKS+=pthread_barrierattr.3 pthread_barrierattr_destroy.3 \ pthread_barrierattr.3 pthread_barrierattr_getpshared.3 \ pthread_barrierattr.3 pthread_barrierattr_init.3 \ Modified: stable/7/share/man/man3/pthread.3 ============================================================================== --- stable/7/share/man/man3/pthread.3 Sat Jan 23 00:43:44 2010 (r202855) +++ stable/7/share/man/man3/pthread.3 Sat Jan 23 00:46:55 2010 (r202856) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2007 +.Dd January 8, 2010 .Dt PTHREAD 3 .Os .Sh NAME @@ -478,7 +478,9 @@ They contain both thread-safe versions o functions and the thread functions. Threaded applications are linked with one of these libraries. .Sh SEE ALSO +.Xr pthread_affinity_np 3 , .Xr pthread_atfork 3 , +.Xr pthread_attr 3 , .Xr pthread_cancel 3 , .Xr pthread_cleanup_pop 3 , .Xr pthread_cleanup_push 3 , Copied: stable/7/share/man/man3/pthread_affinity_np.3 (from r201892, head/share/man/man3/pthread_affinity_np.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man3/pthread_affinity_np.3 Sat Jan 23 00:46:55 2010 (r202856, copy of r201892, head/share/man/man3/pthread_affinity_np.3) @@ -0,0 +1,157 @@ +.\"- +.\" Copyright (c) 2010 Xin LI +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 8, 2010 +.Dt PTHREAD_AFFINITY_NP 3 +.Os +.Sh NAME +.Nm pthread_getaffinity_np , +.Nm pthread_setaffinity_np +.Nd manage CPU affinity +.Sh LIBRARY +.Lb libpthread +.Sh SYNOPSIS +.In pthread_np.h +.Ft int +.Fn pthread_getaffinity_np "pthread_t td" "size_t cpusetsize" "cpuset_t *cpusetp" +.Ft int +.Fn pthread_setaffinity_np "pthread_t td" "size_t cpusetsize" "const cpuset_t *cpusetp" +.Sh DESCRIPTION +.Fn pthread_getaffinity_np +and +.Fn pthread_setaffinity_np +allow the manipulation of sets of CPUs available to specified thread. +.Pp +Masks of type +.Ft cpuset_t +are composed using the +.Xr CPU_SET 2 +macros. +The kernel tolerates large sets as long as all CPUs specified +in the set exist. +Sets smaller than the kernel uses generate an error on calls to +.Fn pthread_getaffinity_np +even if the result set would fit within the user supplied set. +Calls to +.Fn pthread_setaffinity_np +tolerate small sets with no restrictions. +.Pp +The supplied mask should have a size of +.Fa cpusetsize +bytes. +This size is usually provided by calling +.Li sizeof(cpuset_t) +which is ultimately determined by the value of +.Dv CPU_SETSIZE +as defined in +.In sys/cpuset.h . +.Pp +.Fn pthread_getaffinity_np +retrieves the +mask from the thread specified by +.Fa td , +and stores it in the space provided by +.Fa cpumaskp . +.Pp +.Fn pthread_setaffinity_np +attempts to set the mask for the thread specified by +.Fa td +to the value in +.Fa cpumaskp . +.Pp +.Sh RETURN VALUES +If successful, the +.Fn pthread_getaffinity_np +and +.Fn pthread_setaffinity_np +functions will return zero. +Otherwise an error number will be returned +to indicate the error. +.Sh ERRORS +The +.Fn pthread_getaffinity_np +and +.Fn pthread_setaffinity_np +functions may fail if: +.Bl -tag -width Er +.It Bq Er EDEADLK +The +.Fn pthread_setaffinity_np +call would leave a thread without a valid CPU to run on because the set +does not overlap with the thread's anonymous mask. +.It Bq Er EFAULT +The +.Fa cpumaskp +pointer passed was invalid. +.It Bq Er ESRCH +The thread specified by the +.Fa td +argument could not be found. +.It Bq Er ERANGE +The +.Fa cpusetsize +was either preposterously large or smaller than the kernel set size. +.It Bq Er EPERM +The calling thread did not have the credentials required to complete the +operation. +.El +.Sh SEE ALSO +.Xr cpuset 1 , +.Xr cpuset 2 , +.Xr cpuset_getid 2 , +.Xr cpuset_setid 2 , +.Xr CPU_SET 3 , +.Xr pthread 3 , +.Xr pthread_attr_get_affinity_np 3 , +.Xr pthread_attr_set_affinity_np 3 . +.Sh STANDARDS +The +.Nm pthread_getaffinity_np +and +.Nm pthread_setaffinity_np +functions are non-standard +.Fx +extensions and may be not available on other operating systems. +.Sh HISTORY +The +.Nm pthread_getaffinity_np +and +.Nm pthread_setaffinity_np +function first appeared in +.Fx 7.2 . +.Sh AUTHORS +.An -nosplit +The +.Nm pthread_getaffinity_np +and +.Nm pthread_setaffinity_np +functions were written by +.An David Xu +.Aq davidxu@FreeBSD.org , +and this manpage was written by +.An Xin LI +.Aq delphij@FreeBSD.org . Modified: stable/7/share/man/man3/pthread_attr.3 ============================================================================== --- stable/7/share/man/man3/pthread_attr.3 Sat Jan 23 00:43:44 2010 (r202855) +++ stable/7/share/man/man3/pthread_attr.3 Sat Jan 23 00:46:55 2010 (r202856) @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 28, 2000 +.Dd January 8, 2010 .Dt PTHREAD_ATTR 3 .Os .Sh NAME @@ -209,9 +209,9 @@ Invalid or unsupported value for .El .Sh SEE ALSO .Xr pthread_attr_get_np 3 , +.Xr pthread_attr_affinity_np 3 , .Xr pthread_create 3 .Sh STANDARDS -The .Fn pthread_attr_init , .Fn pthread_attr_destroy , .Fn pthread_attr_setstacksize , Copied: stable/7/share/man/man3/pthread_attr_affinity_np.3 (from r201892, head/share/man/man3/pthread_attr_affinity_np.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man3/pthread_attr_affinity_np.3 Sat Jan 23 00:46:55 2010 (r202856, copy of r201892, head/share/man/man3/pthread_attr_affinity_np.3) @@ -0,0 +1,150 @@ +.\"- +.\" Copyright (c) 2010 Xin LI +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 8, 2010 +.Dt PTHREAD_ATTR_AFFINITY_NP 3 +.Os +.Sh NAME +.Nm pthread_attr_getaffinity_np , +.Nm pthread_attr_setaffinity_np +.Nd manage CPU affinity in thread attribute object +.Sh LIBRARY +.Lb libpthread +.Sh SYNOPSIS +.In pthread_np.h +.Ft int +.Fn pthread_attr_getaffinity_np "const pthread_attr_t *pattr" "size_t cpusetsize" "cpuset_t *cpusetp" +.Ft int +.Fn pthread_attr_setaffinity_np "pthread_attr_t *pattr" "size_t cpusetsize" "const cpuset_t *cpusetp" +.Sh DESCRIPTION +.Fn pthread_attr_getaffinity_np +and +.Fn pthread_attr_setaffinity_np +allow the manipulation of sets of CPUs available to specified thread attribute object. +.Pp +Masks of type +.Ft cpuset_t +are composed using the +.Xr CPU_SET 2 +macros. +The kernel tolerates large sets as long as all CPUs specified +in the set exist. +Sets smaller than the kernel uses generate an error on calls to +.Fn pthread_attr_getaffinity_np +even if the result set would fit within the user supplied set. +Calls to +.Fn pthread_attr_setaffinity_np +tolerate small sets with no restrictions. +.Pp +The supplied mask should have a size of +.Fa cpusetsize +bytes. +This size is usually provided by calling +.Li sizeof(cpuset_t) +which is ultimately determined by the value of +.Dv CPU_SETSIZE +as defined in +.In sys/cpuset.h . +.Pp +.Fn pthread_attr_getaffinity_np +retrieves the +mask from the thread attribute object specified by +.Fa pattr , +and stores it in the space provided by +.Fa cpumaskp . +.Pp +.Fn pthread_attr_setaffinity_np +set the mask for the thread attribute object specified by +.Fa pattr +to the value in +.Fa cpumaskp . +.Pp +.Sh RETURN VALUES +If successful, the +.Fn pthread_attr_getaffinity_np +and +.Fn pthread_attr_setaffinity_np +functions will return zero. +Otherwise an error number will be returned +to indicate the error. +.Sh ERRORS +The +.Fn pthread_attr_getaffinity_np +and +.Fn pthread_attr_setaffinity_np +functions will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa pattr +or the attribute specified by it is NULL. +.El +.Pp +The +.Fn pthread_attr_setaffinity_np +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa pattr +or the attribute specified by it is NULL. +.It Bq Er ENOMEM +Insufficient memory exists to store the cpuset mask. +.El +.Sh SEE ALSO +.Xr cpuset 1 , +.Xr cpuset 2 , +.Xr cpuset_getid 2 , +.Xr cpuset_setid 2 , +.Xr CPU_SET 3 , +.Xr pthread_get_affinity_np 3 , +.Xr pthread_set_affinity_np 3 . +.Sh STANDARDS +The +.Nm pthread_attr_getaffinity_np +and +.Nm pthread_attr_setaffinity_np +functions are non-standard +.Fx +extensions and may be not available on other operating systems. +.Sh HISTORY +The +.Nm pthread_attr_getaffinity_np +and +.Nm pthread_attr_setaffinity_np +functions first appeared in +.Fx 7.2 . +.Sh AUTHORS +.An -nosplit +The +.Nm pthread_attr_getaffinity_np +and +.Nm pthread_attr_setaffinity_np +functions were written by +.An David Xu Aq davidxu@FreeBSD.org , +and this manpage was written by +.An Xin LI Aq delphij@FreeBSD.org . From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 00:49:51 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0680F1065694; Sat, 23 Jan 2010 00:49:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E94458FC1D; Sat, 23 Jan 2010 00:49:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0N0nouQ045091; Sat, 23 Jan 2010 00:49:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0N0no7B045089; Sat, 23 Jan 2010 00:49:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001230049.o0N0no7B045089@svn.freebsd.org> From: Xin LI Date: Sat, 23 Jan 2010 00:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202858 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 00:49:51 -0000 Author: delphij Date: Sat Jan 23 00:49:50 2010 New Revision: 202858 URL: http://svn.freebsd.org/changeset/base/202858 Log: MFC r201894: Fix formatting. Modified: stable/7/share/man/man4/uart.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/uart.4 ============================================================================== --- stable/7/share/man/man4/uart.4 Sat Jan 23 00:49:10 2010 (r202857) +++ stable/7/share/man/man4/uart.4 Sat Jan 23 00:49:50 2010 (r202858) @@ -28,11 +28,9 @@ .Dd March 12, 2008 .Dt UART 4 .Os -.\" .Sh NAME .Nm uart .Nd driver for Universal Asynchronous Receiver/Transmitter (UART) devices -.\" .Sh SYNOPSIS .Cd "device uart" .Pp @@ -42,7 +40,6 @@ .Cd "device scc" .Cd "device uart" .Pp -.Bd -ragged offset -compact In .Pa /boot/device.hints : .Cd hint.uart.0.disabled="1" From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 00:53:03 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1FD21065679; Sat, 23 Jan 2010 00:53:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D14728FC24; Sat, 23 Jan 2010 00:53:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0N0r3HY046041; Sat, 23 Jan 2010 00:53:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0N0r3tu046039; Sat, 23 Jan 2010 00:53:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001230053.o0N0r3tu046039@svn.freebsd.org> From: Xin LI Date: Sat, 23 Jan 2010 00:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202860 - stable/7/usr.sbin/burncd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 00:53:04 -0000 Author: delphij Date: Sat Jan 23 00:53:03 2010 New Revision: 202860 URL: http://svn.freebsd.org/changeset/base/202860 Log: MFC r202709: Give the right value when complaining it being wrong. Reported by: danfe Modified: stable/7/usr.sbin/burncd/burncd.c Directory Properties: stable/7/usr.sbin/burncd/ (props changed) Modified: stable/7/usr.sbin/burncd/burncd.c ============================================================================== --- stable/7/usr.sbin/burncd/burncd.c Sat Jan 23 00:52:32 2010 (r202859) +++ stable/7/usr.sbin/burncd/burncd.c Sat Jan 23 00:53:03 2010 (r202860) @@ -151,7 +151,7 @@ main(int argc, char **argv) else speed = atoi(env_speed) * 177; if (speed <= 0) - errx(EX_USAGE, "Invalid speed: %s", optarg); + errx(EX_USAGE, "Invalid speed: %s", env_speed); if (argc == 0) usage(); From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 01:20:59 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A80B2106566B; Sat, 23 Jan 2010 01:20:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D2898FC23; Sat, 23 Jan 2010 01:20:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0N1KxwJ052998; Sat, 23 Jan 2010 01:20:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0N1KxJV052995; Sat, 23 Jan 2010 01:20:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001230120.o0N1KxJV052995@svn.freebsd.org> From: Xin LI Date: Sat, 23 Jan 2010 01:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202861 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 01:20:59 -0000 Author: delphij Date: Sat Jan 23 01:20:59 2010 New Revision: 202861 URL: http://svn.freebsd.org/changeset/base/202861 Log: MFC r202268: o Add PCI ID for BCM 5756. o Don't enable BGE_FLAG_BER_BUG on both 5722 and 5756, and based on their PCI IDs rather than their chip IDs. Reported by: several PC-BSD users via kmoore Reviewed by: yongari, imp, jhb, davidch Sponsored by: iXsystems, Inc. Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Sat Jan 23 00:53:03 2010 (r202860) +++ stable/7/sys/dev/bge/if_bge.c Sat Jan 23 01:20:59 2010 (r202861) @@ -187,6 +187,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5754M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755M }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5756 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761E }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761S }, @@ -2612,7 +2613,8 @@ bge_attach(device_t dev) sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5787) { - if (sc->bge_chipid != BGE_CHIPID_BCM5722_A0) + if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 && + pci_get_device(dev) != BCOM_DEVICEID_BCM5756) sc->bge_flags |= BGE_FLAG_JITTER_BUG; } else if (sc->bge_asicrev != BGE_ASICREV_BCM5906) sc->bge_flags |= BGE_FLAG_BER_BUG; Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Sat Jan 23 00:53:03 2010 (r202860) +++ stable/7/sys/dev/bge/if_bgereg.h Sat Jan 23 01:20:59 2010 (r202861) @@ -2138,6 +2138,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5754M 0x1672 #define BCOM_DEVICEID_BCM5755 0x167B #define BCOM_DEVICEID_BCM5755M 0x1673 +#define BCOM_DEVICEID_BCM5756 0x1674 #define BCOM_DEVICEID_BCM5761 0x1681 #define BCOM_DEVICEID_BCM5761E 0x1680 #define BCOM_DEVICEID_BCM5761S 0x1688 From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 05:37:11 2010 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 8B646106566B for ; Sat, 23 Jan 2010 05:37:11 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 14126151921 for ; Sat, 23 Jan 2010 05:37:10 +0000 (UTC) Received: (qmail 21445 invoked from network); 23 Jan 2010 05:37:10 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2010 05:37:10 -0000 Message-ID: <4B5A8B06.2090608@freebsd.org> Date: Fri, 22 Jan 2010 21:37:10 -0800 From: Colin Percival User-Agent: Thunderbird 2.0.0.23 (X11/20091215) MIME-Version: 1.0 To: Edward Tomasz Napierala References: <201001221142.o0MBgi5l058119@svn.freebsd.org> In-Reply-To: <201001221142.o0MBgi5l058119@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r202805 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 05:37:11 -0000 Edward Tomasz Napierala wrote: > Log: > MFC c195785: Thanks! > Fix permission handling for extended attributes in ZFS. [...] For the record, ZFS extattrs on stable/7 are still completely broken for reasons entirely unrelated to this (namei_atvp is not implemented, and as a result any attempt to look for extended attributes end up looking for files in .) but I have a patch which I expect to commit RSN (just waiting for review). -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 08:43:11 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C6D2106566C; Sat, 23 Jan 2010 08:43:11 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C83C8FC15; Sat, 23 Jan 2010 08:43:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0N8hBrt052112; Sat, 23 Jan 2010 08:43:11 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0N8hB0u052110; Sat, 23 Jan 2010 08:43:11 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201001230843.o0N8hB0u052110@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 23 Jan 2010 08:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202875 - stable/7/sys/dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 08:43:11 -0000 Author: np Date: Sat Jan 23 08:43:11 2010 New Revision: 202875 URL: http://svn.freebsd.org/changeset/base/202875 Log: MFC r202863 Don't forget to release the adapter lock for a no-op. Modified: stable/7/sys/dev/cxgb/cxgb_main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_main.c Sat Jan 23 08:37:04 2010 (r202874) +++ stable/7/sys/dev/cxgb/cxgb_main.c Sat Jan 23 08:43:11 2010 (r202875) @@ -2061,6 +2061,8 @@ fail: p->if_flags = ifp->if_flags; } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) error = cxgb_uninit_locked(p); + else + ADAPTER_UNLOCK(sc); ADAPTER_LOCK_ASSERT_NOTOWNED(sc); break; From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 14:13:22 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07DF910656B8; Sat, 23 Jan 2010 14:13:22 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9B068FC28; Sat, 23 Jan 2010 14:13:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0NEDLRC027684; Sat, 23 Jan 2010 14:13:21 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0NEDLFH027681; Sat, 23 Jan 2010 14:13:21 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001231413.o0NEDLFH027681@svn.freebsd.org> From: Christian Brueffer Date: Sat, 23 Jan 2010 14:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202886 - stable/7/share/man/man3 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 14:13:22 -0000 Author: brueffer Date: Sat Jan 23 14:13:21 2010 New Revision: 202886 URL: http://svn.freebsd.org/changeset/base/202886 Log: MFC: r202162 Various fixes. Modified: stable/7/share/man/man3/pthread_affinity_np.3 stable/7/share/man/man3/pthread_attr_affinity_np.3 Directory Properties: stable/7/share/man/man3/ (props changed) Modified: stable/7/share/man/man3/pthread_affinity_np.3 ============================================================================== --- stable/7/share/man/man3/pthread_affinity_np.3 Sat Jan 23 14:12:40 2010 (r202885) +++ stable/7/share/man/man3/pthread_affinity_np.3 Sat Jan 23 14:13:21 2010 (r202886) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd January 12, 2010 .Dt PTHREAD_AFFINITY_NP 3 .Os .Sh NAME @@ -44,17 +44,17 @@ .Fn pthread_getaffinity_np and .Fn pthread_setaffinity_np -allow the manipulation of sets of CPUs available to specified thread. +allow the manipulation of sets of CPUs available to the specified thread. .Pp Masks of type .Ft cpuset_t are composed using the -.Xr CPU_SET 2 +.Xr CPU_SET 3 macros. The kernel tolerates large sets as long as all CPUs specified in the set exist. Sets smaller than the kernel uses generate an error on calls to -.Fn pthread_getaffinity_np +.Fn pthread_getaffinity_np even if the result set would fit within the user supplied set. Calls to .Fn pthread_setaffinity_np @@ -75,14 +75,13 @@ retrieves the mask from the thread specified by .Fa td , and stores it in the space provided by -.Fa cpumaskp . +.Fa cpusetp . .Pp .Fn pthread_setaffinity_np attempts to set the mask for the thread specified by .Fa td to the value in -.Fa cpumaskp . -.Pp +.Fa cpusetp . .Sh RETURN VALUES If successful, the .Fn pthread_getaffinity_np @@ -105,7 +104,7 @@ call would leave a thread without a vali does not overlap with the thread's anonymous mask. .It Bq Er EFAULT The -.Fa cpumaskp +.Fa cpusetp pointer passed was invalid. .It Bq Er ESRCH The thread specified by the @@ -127,7 +126,7 @@ operation. .Xr CPU_SET 3 , .Xr pthread 3 , .Xr pthread_attr_get_affinity_np 3 , -.Xr pthread_attr_set_affinity_np 3 . +.Xr pthread_attr_set_affinity_np 3 .Sh STANDARDS The .Nm pthread_getaffinity_np Modified: stable/7/share/man/man3/pthread_attr_affinity_np.3 ============================================================================== --- stable/7/share/man/man3/pthread_attr_affinity_np.3 Sat Jan 23 14:12:40 2010 (r202885) +++ stable/7/share/man/man3/pthread_attr_affinity_np.3 Sat Jan 23 14:13:21 2010 (r202886) @@ -31,7 +31,7 @@ .Sh NAME .Nm pthread_attr_getaffinity_np , .Nm pthread_attr_setaffinity_np -.Nd manage CPU affinity in thread attribute object +.Nd manage CPU affinity in thread attribute objects .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS @@ -41,20 +41,21 @@ .Ft int .Fn pthread_attr_setaffinity_np "pthread_attr_t *pattr" "size_t cpusetsize" "const cpuset_t *cpusetp" .Sh DESCRIPTION +The .Fn pthread_attr_getaffinity_np and .Fn pthread_attr_setaffinity_np -allow the manipulation of sets of CPUs available to specified thread attribute object. +functions allow the manipulation of sets of CPUs available to the specified thread attribute object. .Pp Masks of type .Ft cpuset_t are composed using the -.Xr CPU_SET 2 +.Xr CPU_SET 3 macros. The kernel tolerates large sets as long as all CPUs specified in the set exist. Sets smaller than the kernel uses generate an error on calls to -.Fn pthread_attr_getaffinity_np +.Fn pthread_attr_getaffinity_np even if the result set would fit within the user supplied set. Calls to .Fn pthread_attr_setaffinity_np @@ -75,14 +76,13 @@ retrieves the mask from the thread attribute object specified by .Fa pattr , and stores it in the space provided by -.Fa cpumaskp . +.Fa cpusetp . .Pp .Fn pthread_attr_setaffinity_np -set the mask for the thread attribute object specified by +sets the mask for the thread attribute object specified by .Fa pattr to the value in -.Fa cpumaskp . -.Pp +.Fa cpusetp . .Sh RETURN VALUES If successful, the .Fn pthread_attr_getaffinity_np @@ -101,7 +101,8 @@ functions will fail if: .It Bq Er EINVAL The .Fa pattr -or the attribute specified by it is NULL. +or the attribute specified by it is +.Dv NULL . .El .Pp The @@ -111,7 +112,8 @@ function will fail if: .It Bq Er EINVAL The .Fa pattr -or the attribute specified by it is NULL. +or the attribute specified by it is +.Dv NULL . .It Bq Er ENOMEM Insufficient memory exists to store the cpuset mask. .El @@ -122,7 +124,7 @@ Insufficient memory exists to store the .Xr cpuset_setid 2 , .Xr CPU_SET 3 , .Xr pthread_get_affinity_np 3 , -.Xr pthread_set_affinity_np 3 . +.Xr pthread_set_affinity_np 3 .Sh STANDARDS The .Nm pthread_attr_getaffinity_np From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 15:28:18 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD5A710656C2; Sat, 23 Jan 2010 15:28:18 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBEE98FC13; Sat, 23 Jan 2010 15:28:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0NFSIdQ044147; Sat, 23 Jan 2010 15:28:18 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0NFSIDg044145; Sat, 23 Jan 2010 15:28:18 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201001231528.o0NFSIDg044145@svn.freebsd.org> From: Ken Smith Date: Sat, 23 Jan 2010 15:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202888 - stable/7/sys/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 15:28:19 -0000 Author: kensmith Date: Sat Jan 23 15:28:18 2010 New Revision: 202888 URL: http://svn.freebsd.org/changeset/base/202888 Log: Adjust to indicate we've begun the 7.3-RELEASE release cycle. Approved by: re (implicit) Modified: stable/7/sys/conf/newvers.sh Modified: stable/7/sys/conf/newvers.sh ============================================================================== --- stable/7/sys/conf/newvers.sh Sat Jan 23 14:56:16 2010 (r202887) +++ stable/7/sys/conf/newvers.sh Sat Jan 23 15:28:18 2010 (r202888) @@ -31,8 +31,8 @@ # $FreeBSD$ TYPE="FreeBSD" -REVISION="7.2" -BRANCH="STABLE" +REVISION="7.3" +BRANCH="PRERELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 19:01:26 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF92C106566C; Sat, 23 Jan 2010 19:01:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD95C8FC19; Sat, 23 Jan 2010 19:01:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0NJ1PMV091558; Sat, 23 Jan 2010 19:01:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0NJ1Peo091556; Sat, 23 Jan 2010 19:01:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001231901.o0NJ1Peo091556@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 23 Jan 2010 19:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202895 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 19:01:26 -0000 Author: kib Date: Sat Jan 23 19:01:25 2010 New Revision: 202895 URL: http://svn.freebsd.org/changeset/base/202895 Log: MFC r186277: The quotactl, statfs and fstatfs syscall implementations may dereference NULL pointer to struct mount if the looked up vnode is reclaimed. Also, these syscalls only mnt_ref() the mp, still allowing it to be unmounted; only struct mount memory is kept from being reused. Lock the vnode when doing name lookup, then reference its mount point, unlock the vnode and vfs_busy the mountpoint. This sequence shall take care of both races. MFC r188141 (by trasz): In some situations, mnt_lockref could go negative due to vfs_unbusy() being called without calling vfs_busy() first. This made umount(8) hang waiting for mnt_lockref to become zero, which would never happen. MFC r196887: In fhopen, vfs_ref() the mount point while vnode is unlocked, to prevent vn_start_write(NULL, &mp) from operating on potentially freed or reused struct mount *. Remove unmatched vfs_rel() in cleanup. Approved by: re (bz) Modified: stable/7/sys/kern/vfs_syscalls.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_syscalls.c ============================================================================== --- stable/7/sys/kern/vfs_syscalls.c Sat Jan 23 18:42:28 2010 (r202894) +++ stable/7/sys/kern/vfs_syscalls.c Sat Jan 23 19:01:25 2010 (r202895) @@ -200,19 +200,21 @@ quotactl(td, uap) AUDIT_ARG(uid, uap->uid); if (jailed(td->td_ucred) && !prison_quotas) return (EPERM); - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE | AUDITVNODE1, + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) return (error); vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); mp = nd.ni_vp->v_mount; - if ((error = vfs_busy(mp, 0, NULL, td))) { - vrele(nd.ni_vp); + vfs_ref(mp); + vput(nd.ni_vp); + error = vfs_busy(mp, 0, NULL, td); + vfs_rel(mp); + if (error) { VFS_UNLOCK_GIANT(vfslocked); return (error); } - vrele(nd.ni_vp); error = VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg, td); vfs_unbusy(mp, td); VFS_UNLOCK_GIANT(vfslocked); @@ -306,6 +308,12 @@ kern_statfs(struct thread *td, char *pat vfs_ref(mp); NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); + error = vfs_busy(mp, 0, NULL, td); + vfs_rel(mp); + if (error) { + VFS_UNLOCK_GIANT(vfslocked); + return (error); + } #ifdef MAC error = mac_check_mount_stat(td->td_ucred, mp); if (error) @@ -329,7 +337,7 @@ kern_statfs(struct thread *td, char *pat } *buf = *sp; out: - vfs_rel(mp); + vfs_unbusy(mp); VFS_UNLOCK_GIANT(vfslocked); if (mtx_owned(&Giant)) printf("statfs(%d): %s: %d\n", vfslocked, path, error); @@ -387,10 +395,16 @@ kern_fstatfs(struct thread *td, int fd, vfs_ref(mp); VOP_UNLOCK(vp, 0, td); fdrop(fp, td); - if (vp->v_iflag & VI_DOOMED) { + if (mp == NULL) { error = EBADF; goto out; } + error = vfs_busy(mp, 0, NULL, td); + vfs_rel(mp); + if (error) { + VFS_UNLOCK_GIANT(vfslocked); + return (error); + } #ifdef MAC error = mac_check_mount_stat(td->td_ucred, mp); if (error) @@ -415,7 +429,7 @@ kern_fstatfs(struct thread *td, int fd, *buf = *sp; out: if (mp) - vfs_rel(mp); + vfs_unbusy(mp); VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -4177,13 +4191,16 @@ fhopen(td, uap) goto bad; } if (fmode & O_TRUNC) { + vfs_ref(mp); VOP_UNLOCK(vp, 0, td); /* XXX */ if ((error = vn_start_write(NULL, &mp, V_WAIT | PCATCH)) != 0) { vrele(vp); + vfs_rel(mp); goto out; } VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); /* XXX */ + vfs_rel(mp); #ifdef MAC /* * We don't yet have fp->f_cred, so use td->td_ucred, which @@ -4261,7 +4278,6 @@ fhopen(td, uap) VOP_UNLOCK(vp, 0, td); fdrop(fp, td); - vfs_rel(mp); VFS_UNLOCK_GIANT(vfslocked); td->td_retval[0] = indx; return (0); From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 23 22:37:35 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1454E106566C; Sat, 23 Jan 2010 22:37:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02A4C8FC15; Sat, 23 Jan 2010 22:37:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0NMbYtJ039528; Sat, 23 Jan 2010 22:37:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0NMbYPl039526; Sat, 23 Jan 2010 22:37:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001232237.o0NMbYPl039526@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 23 Jan 2010 22:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202902 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 22:37:35 -0000 Author: kib Date: Sat Jan 23 22:37:34 2010 New Revision: 202902 URL: http://svn.freebsd.org/changeset/base/202902 Log: Fix vfs_unbusy() calls in r202895. Reported by: Michael Butler Approved by: re (bz) Modified: stable/7/sys/kern/vfs_syscalls.c Modified: stable/7/sys/kern/vfs_syscalls.c ============================================================================== --- stable/7/sys/kern/vfs_syscalls.c Sat Jan 23 22:21:56 2010 (r202901) +++ stable/7/sys/kern/vfs_syscalls.c Sat Jan 23 22:37:34 2010 (r202902) @@ -337,7 +337,7 @@ kern_statfs(struct thread *td, char *pat } *buf = *sp; out: - vfs_unbusy(mp); + vfs_unbusy(mp, td); VFS_UNLOCK_GIANT(vfslocked); if (mtx_owned(&Giant)) printf("statfs(%d): %s: %d\n", vfslocked, path, error); @@ -429,7 +429,7 @@ kern_fstatfs(struct thread *td, int fd, *buf = *sp; out: if (mp) - vfs_unbusy(mp); + vfs_unbusy(mp, td); VFS_UNLOCK_GIANT(vfslocked); return (error); }