From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 03:43:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92660106566C; Sun, 15 Jul 2012 03:43:57 +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 7D2BA8FC15; Sun, 15 Jul 2012 03:43:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6F3hv5e023958; Sun, 15 Jul 2012 03:43:57 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6F3hv1X023956; Sun, 15 Jul 2012 03:43:57 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201207150343.q6F3hv1X023956@svn.freebsd.org> From: Ken Smith Date: Sun, 15 Jul 2012 03:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238460 - stable/9/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 03:43:57 -0000 Author: kensmith Date: Sun Jul 15 03:43:56 2012 New Revision: 238460 URL: http://svn.freebsd.org/changeset/base/238460 Log: 9.1-BETA1 builds done, shift back to PRERELEASE for the rest of the 9.1 release cycle. Approved by: re (implicit) Modified: stable/9/sys/conf/newvers.sh Modified: stable/9/sys/conf/newvers.sh ============================================================================== --- stable/9/sys/conf/newvers.sh Sat Jul 14 21:28:11 2012 (r238459) +++ stable/9/sys/conf/newvers.sh Sun Jul 15 03:43:56 2012 (r238460) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.1" -BRANCH="BETA1" +BRANCH="PRERELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 04:15:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15CA51065673; Sun, 15 Jul 2012 04:15:28 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00E7F8FC0C; Sun, 15 Jul 2012 04:15:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6F4FRHv025307; Sun, 15 Jul 2012 04:15:27 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6F4FRsP025305; Sun, 15 Jul 2012 04:15:27 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201207150415.q6F4FRsP025305@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 15 Jul 2012 04:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238461 - head/usr.sbin/pkg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 04:15:28 -0000 Author: kan Date: Sun Jul 15 04:15:27 2012 New Revision: 238461 URL: http://svn.freebsd.org/changeset/base/238461 Log: Make pkg bootstrap program ask for confirmation before proceeding. The previous behaviour was to silently download and install the pkg package, without ever telling user about what it was doing and why. Discussed with: bapt Reviewed by: kib Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sun Jul 15 03:43:56 2012 (r238460) +++ head/usr.sbin/pkg/pkg.c Sun Jul 15 04:15:27 2012 (r238461) @@ -389,6 +389,28 @@ cleanup: return (ret); } +static const char confirmation_message[] = +"The package management tool is not yet installed on your system.\n" +"Do you want to fetch and install it now? [y/N]: "; + +static int +pkg_query_yes_no(void) +{ + int ret, c; + + c = getchar(); + + if (c == 'y' || c == 'Y') + ret = 1; + else + ret = 0; + + while (c != '\n' && c != EOF) + c = getchar(); + + return (ret); +} + int main(__unused int argc, char *argv[]) { @@ -397,9 +419,21 @@ main(__unused int argc, char *argv[]) snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); - if (access(pkgpath, X_OK) == -1) + if (access(pkgpath, X_OK) == -1) { + /* + * Do not ask for confirmation if either of stdin or stdout is + * not tty. Check the environment to see if user has answer + * tucked in there already. + */ + if (getenv("ALWAYS_ASSUME_YES") == NULL && + isatty(fileno(stdin))) { + printf("%s", confirmation_message); + if (pkg_query_yes_no() == 0) + exit(EXIT_FAILURE); + } if (bootstrap_pkg() != 0) exit(EXIT_FAILURE); + } execv(pkgpath, argv); From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 05:24:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83ADC106566B; Sun, 15 Jul 2012 05:24:20 +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 6E6498FC08; Sun, 15 Jul 2012 05:24:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6F5OKug028082; Sun, 15 Jul 2012 05:24:20 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6F5OKV2028080; Sun, 15 Jul 2012 05:24:20 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201207150524.q6F5OKV2028080@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 15 Jul 2012 05:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238462 - stable/9/sys/dev/cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 05:24:20 -0000 Author: np Date: Sun Jul 15 05:24:19 2012 New Revision: 238462 URL: http://svn.freebsd.org/changeset/base/238462 Log: MFC r238313: Fix a bug in code that calculates the number of the first interrupt vector for a port. This affected the gigabit ports of T422 cards (the ones with 2x10G ports and 2x1G ports). Approved by: re (kib) Modified: stable/9/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/9/sys/dev/cxgbe/t4_sge.c Sun Jul 15 04:15:27 2012 (r238461) +++ stable/9/sys/dev/cxgbe/t4_sge.c Sun Jul 15 05:24:19 2012 (r238462) @@ -401,14 +401,16 @@ first_vector(struct port_info *pi) return (0); for_each_port(sc, i) { + struct port_info *p = sc->port[i]; + if (i == pi->port_id) break; #ifdef TCP_OFFLOAD if (sc->flags & INTR_DIRECT) - rc += pi->nrxq + pi->nofldrxq; + rc += p->nrxq + p->nofldrxq; else - rc += max(pi->nrxq, pi->nofldrxq); + rc += max(p->nrxq, p->nofldrxq); #else /* * Not compiled with offload support and intr_count > 1. Only @@ -419,7 +421,7 @@ first_vector(struct port_info *pi) ("%s: intr_count %d, !INTR_DIRECT", __func__, sc->intr_count)); - rc += pi->nrxq; + rc += p->nrxq; #endif } From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 05:35:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48EE8106566B; Sun, 15 Jul 2012 05:35:15 +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 3383E8FC0A; Sun, 15 Jul 2012 05:35:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6F5ZFMP028564; Sun, 15 Jul 2012 05:35:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6F5ZENg028556; Sun, 15 Jul 2012 05:35:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207150535.q6F5ZENg028556@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Jul 2012 05:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238463 - in head/sys/boot/arm/at91: bootspi libat91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 05:35:15 -0000 Author: imp Date: Sun Jul 15 05:35:14 2012 New Revision: 238463 URL: http://svn.freebsd.org/changeset/base/238463 Log: Use the pin number rather than the hybrid pin number + name. Modified: head/sys/boot/arm/at91/bootspi/ee.c head/sys/boot/arm/at91/libat91/at91rm9200.h head/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c head/sys/boot/arm/at91/libat91/eeprom.c head/sys/boot/arm/at91/libat91/emac_init.c head/sys/boot/arm/at91/libat91/lib_AT91RM9200.h head/sys/boot/arm/at91/libat91/spi_flash.c Modified: head/sys/boot/arm/at91/bootspi/ee.c ============================================================================== --- head/sys/boot/arm/at91/bootspi/ee.c Sun Jul 15 05:24:19 2012 (r238462) +++ head/sys/boot/arm/at91/bootspi/ee.c Sun Jul 15 05:35:14 2012 (r238463) @@ -59,11 +59,11 @@ EEInit(void) AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC; - pPio->PIO_ASR = AT91C_PA25_TWD | AT91C_PA26_TWCK; - pPio->PIO_PDR = AT91C_PA25_TWD | AT91C_PA26_TWCK; + pPio->PIO_ASR = AT91C_PIO_PA25 | AT91C_PIO_PA26; + pPio->PIO_PDR = AT91C_PIO_PA25 | AT91C_PIO_PA26; - pPio->PIO_MDDR = ~AT91C_PA25_TWD; - pPio->PIO_MDER = AT91C_PA25_TWD; + pPio->PIO_MDDR = ~AT91C_PIO_PA25; + pPio->PIO_MDER = AT91C_PIO_PA25; pPMC->PMC_PCER = 1u << AT91C_ID_TWI; Modified: head/sys/boot/arm/at91/libat91/at91rm9200.h ============================================================================== --- head/sys/boot/arm/at91/libat91/at91rm9200.h Sun Jul 15 05:24:19 2012 (r238462) +++ head/sys/boot/arm/at91/libat91/at91rm9200.h Sun Jul 15 05:35:14 2012 (r238463) @@ -2311,7 +2311,7 @@ typedef struct _AT91S_BFC { // ========== Register definition for BFC peripheral ========== #define AT91C_BFC_MR ((AT91_REG *) 0xFFFFFFC0) // (BFC) BFC Mode Register -#include +#include // ***************************************************************************** // PERIPHERAL ID DEFINITIONS FOR AT91RM9200 Modified: head/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c ============================================================================== --- head/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c Sun Jul 15 05:24:19 2012 (r238462) +++ head/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c Sun Jul 15 05:35:14 2012 (r238463) @@ -188,8 +188,8 @@ _init(void) AT91C_BASE_PIOC->PIO_PDR = 0xffff0000; #endif // Configure DBGU -use local routine optimized for space - AT91C_BASE_PIOA->PIO_ASR = AT91C_PA31_DTXD | AT91C_PA30_DRXD; - AT91C_BASE_PIOA->PIO_PDR = AT91C_PA31_DTXD | AT91C_PA30_DRXD; + AT91C_BASE_PIOA->PIO_ASR = AT91C_PIO_PA31 | AT91C_PIO_PA30; + AT91C_BASE_PIOA->PIO_PDR = AT91C_PIO_PA31 | AT91C_PIO_PA30; pUSART->US_IDR = (unsigned int) -1; pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS; Modified: head/sys/boot/arm/at91/libat91/eeprom.c ============================================================================== --- head/sys/boot/arm/at91/libat91/eeprom.c Sun Jul 15 05:24:19 2012 (r238462) +++ head/sys/boot/arm/at91/libat91/eeprom.c Sun Jul 15 05:35:14 2012 (r238463) @@ -58,11 +58,11 @@ InitEEPROM(void) AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC; - pPio->PIO_ASR = AT91C_PA25_TWD | AT91C_PA26_TWCK; - pPio->PIO_PDR = AT91C_PA25_TWD | AT91C_PA26_TWCK; + pPio->PIO_ASR = AT91C_PIO_PA25 | AT91C_PIO_PA26; + pPio->PIO_PDR = AT91C_PIO_PA25 | AT91C_PIO_PA26; - pPio->PIO_MDDR = ~AT91C_PA25_TWD; - pPio->PIO_MDER = AT91C_PA25_TWD; + pPio->PIO_MDDR = ~AT91C_PIO_PA25; + pPio->PIO_MDER = AT91C_PIO_PA25; pPMC->PMC_PCER = 1u << AT91C_ID_TWI; Modified: head/sys/boot/arm/at91/libat91/emac_init.c ============================================================================== --- head/sys/boot/arm/at91/libat91/emac_init.c Sun Jul 15 05:24:19 2012 (r238462) +++ head/sys/boot/arm/at91/libat91/emac_init.c Sun Jul 15 05:35:14 2012 (r238463) @@ -85,24 +85,24 @@ EMAC_SetMACAddress(unsigned char mac[6]) AT91C_BASE_PMC->PMC_PCER = 1u << AT91C_ID_EMAC; AT91C_BASE_PIOA->PIO_ASR = - AT91C_PA14_ERXER | AT91C_PA12_ERX0 | AT91C_PA13_ERX1 | - AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 | - AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC | - AT91C_PA7_ETXCK_EREFCK; + AT91C_PIO_PA14 | AT91C_PIO_PA12 | AT91C_PIO_PA13 | + AT91C_PIO_PA8 | AT91C_PIO_PA16 | AT91C_PIO_PA9 | + AT91C_PIO_PA10 | AT91C_PIO_PA11 | AT91C_PIO_PA15 | + AT91C_PIO_PA7; AT91C_BASE_PIOA->PIO_PDR = - AT91C_PA14_ERXER | AT91C_PA12_ERX0 | AT91C_PA13_ERX1 | - AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 | - AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC | - AT91C_PA7_ETXCK_EREFCK; + AT91C_PIO_PA14 | AT91C_PIO_PA12 | AT91C_PIO_PA13 | + AT91C_PIO_PA8 | AT91C_PIO_PA16 | AT91C_PIO_PA9 | + AT91C_PIO_PA10 | AT91C_PIO_PA11 | AT91C_PIO_PA15 | + AT91C_PIO_PA7; #if defined(BOOT_KB920X) | defined(BOOT_BWCT) /* Really !RMII */ AT91C_BASE_PIOB->PIO_BSR = - AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER | - AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV | - AT91C_PB18_ECOL | AT91C_PB19_ERXCK; + AT91C_PIO_PB12 | AT91C_PIO_PB13 | AT91C_PIO_PB14 | + AT91C_PIO_PB15 | AT91C_PIO_PB16 | AT91C_PIO_PB17 | + AT91C_PIO_PB18 | AT91C_PIO_PB19; AT91C_BASE_PIOB->PIO_PDR = - AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER | - AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV | - AT91C_PB18_ECOL | AT91C_PB19_ERXCK; + AT91C_PIO_PB12 | AT91C_PIO_PB13 | AT91C_PIO_PB14 | + AT91C_PIO_PB15 | AT91C_PIO_PB16 | AT91C_PIO_PB17 | + AT91C_PIO_PB18 | AT91C_PIO_PB19; #endif pEmac->EMAC_CTL = 0; Modified: head/sys/boot/arm/at91/libat91/lib_AT91RM9200.h ============================================================================== --- head/sys/boot/arm/at91/libat91/lib_AT91RM9200.h Sun Jul 15 05:24:19 2012 (r238462) +++ head/sys/boot/arm/at91/libat91/lib_AT91RM9200.h Sun Jul 15 05:35:14 2012 (r238463) @@ -134,17 +134,17 @@ AT91F_MCI_CfgPIO(void) // Configure PIO controllers to periph mode AT91F_PIO_CfgPeriph( AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA28_MCCDA ) | - ((unsigned int) AT91C_PA29_MCDA0 ) | - ((unsigned int) AT91C_PA27_MCCK ), // Peripheral A + ((unsigned int) AT91C_PIO_PA28 ) | + ((unsigned int) AT91C_PIO_PA29 ) | + ((unsigned int) AT91C_PIO_PA27 ), // Peripheral A 0); // Peripheral B // Configure PIO controllers to periph mode AT91F_PIO_CfgPeriph( AT91C_BASE_PIOB, // PIO controller base address 0, // Peripheral A - ((unsigned int) AT91C_PB5_MCDA3 ) | - ((unsigned int) AT91C_PB3_MCDA1 ) | - ((unsigned int) AT91C_PB4_MCDA2 )); // Peripheral B + ((unsigned int) AT91C_PIO_PB5 ) | + ((unsigned int) AT91C_PIO_PB3 ) | + ((unsigned int) AT91C_PIO_PB4 )); // Peripheral B } Modified: head/sys/boot/arm/at91/libat91/spi_flash.c ============================================================================== --- head/sys/boot/arm/at91/libat91/spi_flash.c Sun Jul 15 05:24:19 2012 (r238462) +++ head/sys/boot/arm/at91/libat91/spi_flash.c Sun Jul 15 05:35:14 2012 (r238463) @@ -223,10 +223,10 @@ SPI_InitFlash(void) // enable CS0, CLK, MOSI, MISO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; - pPio->PIO_ASR = AT91C_PA3_NPCS0 | AT91C_PA1_MOSI | AT91C_PA0_MISO | - AT91C_PA2_SPCK; - pPio->PIO_PDR = AT91C_PA3_NPCS0 | AT91C_PA1_MOSI | AT91C_PA0_MISO | - AT91C_PA2_SPCK; + pPio->PIO_ASR = AT91C_PIO_PA3 | AT91C_PIO_PA1 | AT91C_PIO_PA0 | + AT91C_PIO_PA2; + pPio->PIO_PDR = AT91C_PIO_PA3 | AT91C_PIO_PA1 | AT91C_PIO_PA0 | + AT91C_PIO_PA2; // enable clocks to SPI AT91C_BASE_PMC->PMC_PCER = 1u << AT91C_ID_SPI; From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 05:38:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF915106564A; Sun, 15 Jul 2012 05:38: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 DB88E8FC12; Sun, 15 Jul 2012 05:38:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6F5chqA028730; Sun, 15 Jul 2012 05:38:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6F5chom028728; Sun, 15 Jul 2012 05:38:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207150538.q6F5chom028728@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Jul 2012 05:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238464 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 05:38:44 -0000 Author: imp Date: Sun Jul 15 05:38:43 2012 New Revision: 238464 URL: http://svn.freebsd.org/changeset/base/238464 Log: Force overwrite of gz file, to make NO_CLEAN builds work. Modified: head/sys/conf/Makefile.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Sun Jul 15 05:35:14 2012 (r238463) +++ head/sys/conf/Makefile.arm Sun Jul 15 05:38:43 2012 (r238464) @@ -105,7 +105,7 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$ >opt_kernname.h eval $$(stat -s ${KERNEL_KO}.tmp) && \ echo "#define KERNSIZE $$st_size" >>opt_kernname.h - gzip -9 ${KERNEL_KO}.tmp + gzip -f9 ${KERNEL_KO}.tmp eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \ echo "#define KERNCOMPSIZE $$st_size" >>opt_kernname.h ${CC} -O2 -ffreestanding -DKZIP -I. -I$S -c $S/kern/inflate.c -o \ From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 05:41:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 650011065670; Sun, 15 Jul 2012 05:41:44 +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 4F2608FC1A; Sun, 15 Jul 2012 05:41:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6F5fiiX028890; Sun, 15 Jul 2012 05:41:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6F5fiGj028883; Sun, 15 Jul 2012 05:41:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207150541.q6F5fiGj028883@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Jul 2012 05:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238465 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 05:41:44 -0000 Author: imp Date: Sun Jul 15 05:41:43 2012 New Revision: 238465 URL: http://svn.freebsd.org/changeset/base/238465 Log: Configure the peripheral pins for MCI devices. Eliminate the now-unused at91_pio_rm9200.h. Deleted: head/sys/arm/at91/at91_pio_rm9200.h Modified: head/sys/arm/at91/at91rm9200_devices.c head/sys/arm/at91/at91rm9200var.h head/sys/arm/at91/board_bwct.c head/sys/arm/at91/board_hl200.c head/sys/arm/at91/board_kb920x.c head/sys/arm/at91/board_tsc4370.c Modified: head/sys/arm/at91/at91rm9200_devices.c ============================================================================== --- head/sys/arm/at91/at91rm9200_devices.c Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/at91rm9200_devices.c Sun Jul 15 05:41:43 2012 (r238465) @@ -80,6 +80,10 @@ at91rm9200_config_uart(unsigned devid, u * to do. */ + /* + * Current boards supported don't need the extras, but they should be + * implemented. But that should wait until the new pin api goes in. + */ switch (devid) { case AT91_ID_DBGU: at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA30, 0); /* DRXD */ @@ -122,3 +126,17 @@ at91rm9200_config_uart(unsigned devid, u break; } } + +void +at91rm9200_config_mci(int has_4wire) +{ + /* XXX TODO chip changed GPIO, other slots, etc */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA27, 0); /* MCCK */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA28, 1); /* MCCDA */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA29, 1); /* MCDA0 */ + if (has_4wire) { + at91_pio_use_periph_b(AT91RM92_PIOB_BASE, AT91C_PIO_PB3, 1); /* MCDA1 */ + at91_pio_use_periph_b(AT91RM92_PIOB_BASE, AT91C_PIO_PB4, 1); /* MCDA2 */ + at91_pio_use_periph_b(AT91RM92_PIOB_BASE, AT91C_PIO_PB5, 1); /* MCDA3 */ + } +} Modified: head/sys/arm/at91/at91rm9200var.h ============================================================================== --- head/sys/arm/at91/at91rm9200var.h Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/at91rm9200var.h Sun Jul 15 05:41:43 2012 (r238465) @@ -50,4 +50,9 @@ void at91rm9200_set_subtype(enum at91_so void at91rm9200_config_uart(unsigned devid, unsigned unit, unsigned pinmask); +/* + * MCI (sd/mmc card support) + */ +void at91rm9200_config_mci(int has_4wire); + #endif /* ARM_AT91_AT91RM9200VAR_H */ Modified: head/sys/arm/at91/board_bwct.c ============================================================================== --- head/sys/arm/at91/board_bwct.c Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/board_bwct.c Sun Jul 15 05:41:43 2012 (r238465) @@ -45,6 +45,9 @@ board_init(void) */ at91rm9200_config_uart(AT91_ID_DBGU, 0, 0); /* DBGU just Tx and Rx */ + at91rm9200_config_mci(0); + /* Configure ethernet */ + return (at91_ramsize()); } Modified: head/sys/arm/at91/board_hl200.c ============================================================================== --- head/sys/arm/at91/board_hl200.c Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/board_hl200.c Sun Jul 15 05:41:43 2012 (r238465) @@ -34,8 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include BOARD_INIT long board_init(void) @@ -51,6 +49,16 @@ board_init(void) at91rm9200_config_uart(AT91_ID_DBGU, 0, 0); /* DBGU just Tx and Rx */ at91rm9200_config_uart(AT91RM9200_ID_USART0, 1, 0); /* Tx and Rx */ + at91rm9200_config_mci(0); /* HOTe HL200 unknown 1 vs 4 wire */ + + /* Enable CF card slot */ + /* Enable sound thing */ + /* Enable VGA chip */ + /* Enable ethernet */ + /* Enable TWI + RTC */ + /* Enable USB Host */ + /* Enable USB Device (gadget) */ + return (at91_ramsize()); } Modified: head/sys/arm/at91/board_kb920x.c ============================================================================== --- head/sys/arm/at91/board_kb920x.c Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/board_kb920x.c Sun Jul 15 05:41:43 2012 (r238465) @@ -32,10 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include -#include BOARD_INIT long board_init(void) @@ -54,13 +51,14 @@ board_init(void) at91rm9200_config_uart(AT91RM9200_ID_USART3, 3, /* Tx, Rx, CTS, RTS - RS485 */ AT91_UART_CTS | AT91_UART_RTS); - /* MMC/SD Interface */ - at91_pio_use_periph_a(AT91RM92_PIOA_BASE,AT91C_PA27_MCCK, 0); - at91_pio_use_periph_a(AT91RM92_PIOA_BASE,AT91C_PA28_MCCDA, 1); - at91_pio_use_periph_a(AT91RM92_PIOA_BASE,AT91C_PA29_MCDA0, 1); - at91_pio_use_periph_b(AT91RM92_PIOB_BASE,AT91C_PB3_MCDA1, 1); - at91_pio_use_periph_b(AT91RM92_PIOB_BASE,AT91C_PB4_MCDA2, 1); - at91_pio_use_periph_b(AT91RM92_PIOB_BASE,AT91C_PB5_MCDA3, 1); + at91rm9200_config_mci(1); + + /* CFE interface */ + /* ethernet interface */ + /* lcd interface */ + /* USB host */ + /* USB device (gadget) */ + /* TWI */ return (at91_ramsize()); } Modified: head/sys/arm/at91/board_tsc4370.c ============================================================================== --- head/sys/arm/at91/board_tsc4370.c Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/board_tsc4370.c Sun Jul 15 05:41:43 2012 (r238465) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include BOARD_INIT long board_init(void) @@ -49,6 +49,15 @@ board_init(void) at91rm9200_config_uart(AT91RM9200_ID_USART2, 3, 0); /* Tx and Rx */ at91rm9200_config_uart(AT91RM9200_ID_USART3, 4, 0); /* Tx and Rx */ + at91rm9200_config_mci(0); /* tsc4370 board has only 1 wire */ + /* Newer boards may have 4 wires */ + + /* Configure TWI */ + /* Configure SPI + dataflash */ + /* Configure SSC */ + /* Configure USB Host */ + /* Configure FPGA attached to chip selects */ + /* Pin assignment */ /* Assert PA24 low -- talk to rubidium */ at91_pio_use_gpio(AT91RM92_PIOA_BASE, AT91C_PIO_PA24); From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 05:49:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63C64106566B; Sun, 15 Jul 2012 05:49:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 353E68FC0A; Sun, 15 Jul 2012 05:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6F5n3hD029231; Sun, 15 Jul 2012 05:49:03 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6F5n2jg029228; Sun, 15 Jul 2012 05:49:02 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201207150549.q6F5n2jg029228@svn.freebsd.org> From: Rui Paulo Date: Sun, 15 Jul 2012 05:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238466 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 05:49:03 -0000 Author: rpaulo Date: Sun Jul 15 05:49:02 2012 New Revision: 238466 URL: http://svn.freebsd.org/changeset/base/238466 Log: The JP1082 device doesn't respond to the MII_BMSR command and it turns out that it has an unusable PHY. It still works, although very slowly, without a PHY, so I implemented non-PHY support in the udav driver. Modified: head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/if_udavreg.h Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Sun Jul 15 05:41:43 2012 (r238465) +++ head/sys/dev/usb/net/if_udav.c Sun Jul 15 05:49:02 2012 (r238466) @@ -169,7 +169,7 @@ MODULE_DEPEND(udav, ether, 1, 1, 1); MODULE_DEPEND(udav, miibus, 1, 1, 1); MODULE_VERSION(udav, 1); -static const struct usb_ether_methods udav_ue_methods = { +static struct usb_ether_methods udav_ue_methods = { .ue_attach_post = udav_attach_post, .ue_start = udav_start, .ue_init = udav_init, @@ -206,7 +206,8 @@ static const STRUCT_USB_HOST_ID udav_dev {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, /* Kontron AG USB Ethernet */ {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, - {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)}, + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, + UDAV_FLAG_NO_PHY)}, }; static void @@ -259,6 +260,16 @@ udav_attach(device_t dev) goto detach; } + /* + * The JP1082 has an unusable PHY and provides no link information. + */ + if (sc->sc_flags & UDAV_FLAG_NO_PHY) { + udav_ue_methods.ue_tick = NULL; + udav_ue_methods.ue_mii_upd = NULL; + udav_ue_methods.ue_mii_sts = NULL; + sc->sc_flags |= UDAV_FLAG_LINK; + } + ue->ue_sc = sc; ue->ue_dev = dev; ue->ue_udev = uaa->device; @@ -712,7 +723,8 @@ udav_stop(struct usb_ether *ue) UDAV_LOCK_ASSERT(sc, MA_OWNED); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - sc->sc_flags &= ~UDAV_FLAG_LINK; + if (!(sc->sc_flags & UDAV_FLAG_NO_PHY)) + sc->sc_flags &= ~UDAV_FLAG_LINK; /* * stop all the transfers, if not already stopped: Modified: head/sys/dev/usb/net/if_udavreg.h ============================================================================== --- head/sys/dev/usb/net/if_udavreg.h Sun Jul 15 05:41:43 2012 (r238465) +++ head/sys/dev/usb/net/if_udavreg.h Sun Jul 15 05:49:02 2012 (r238466) @@ -159,6 +159,7 @@ struct udav_softc { int sc_flags; #define UDAV_FLAG_LINK 0x0001 #define UDAV_FLAG_EXT_PHY 0x0040 +#define UDAV_FLAG_NO_PHY 0x0080 }; #define UDAV_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 06:08:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 669351065670; Sun, 15 Jul 2012 06:08:12 +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 38FB98FC14; Sun, 15 Jul 2012 06:08:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6F68C6I030040; Sun, 15 Jul 2012 06:08:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6F68C4M030039; Sun, 15 Jul 2012 06:08:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207150608.q6F68C4M030039@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Jul 2012 06:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238467 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 06:08:12 -0000 Author: imp Date: Sun Jul 15 06:08:11 2012 New Revision: 238467 URL: http://svn.freebsd.org/changeset/base/238467 Log: These were never used, remove them. Deleted: head/sys/arm/at91/hints.at91rm9200 head/sys/arm/at91/hints.at91sam9261 From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 10:19:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CEC2106564A; Sun, 15 Jul 2012 10:19:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 364A28FC08; Sun, 15 Jul 2012 10:19:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FAJiQm041100; Sun, 15 Jul 2012 10:19:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FAJhis041090; Sun, 15 Jul 2012 10:19:43 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207151019.q6FAJhis041090@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Jul 2012 10:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238468 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 10:19:44 -0000 Author: jilles Date: Sun Jul 15 10:19:43 2012 New Revision: 238468 URL: http://svn.freebsd.org/changeset/base/238468 Log: sh: Expand assignment-like words specially for export/readonly/local. Examples: export x=~ now expands the tilde local y=$1 is now safe, even if $1 contains IFS characters or metacharacters. For a word to "look like an assignment", it must start with a name followed by an equals sign, none of which may be quoted. The special treatment applies when the first word (potentially after "command") is "export", "readonly" or "local". There may be quoting characters but no expansions. If "local" is overridden with a function there is no special treatment ("export" and "readonly" cannot be overridden with a function). If things like local arr=(1 2 3) are ever allowed in the future, they cannot call a "local" function. This would either be a run-time error or it would call the builtin. This matches Austin Group bug #351, planned for the next issue of POSIX.1. PR: bin/166771 Added: head/tools/regression/bin/sh/expansion/export2.0 (contents, props changed) head/tools/regression/bin/sh/expansion/export3.0 (contents, props changed) head/tools/regression/bin/sh/expansion/local1.0 (contents, props changed) head/tools/regression/bin/sh/expansion/local2.0 (contents, props changed) head/tools/regression/bin/sh/expansion/readonly1.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/exec.c head/bin/sh/exec.h head/bin/sh/sh.1 Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jul 15 06:08:11 2012 (r238467) +++ head/bin/sh/eval.c Sun Jul 15 10:19:43 2012 (r238468) @@ -672,6 +672,52 @@ out: result->fd, result->buf, result->nleft, result->jp)); } +static int +mustexpandto(const char *argtext, const char *mask) +{ + for (;;) { + if (*argtext == CTLQUOTEMARK || *argtext == CTLQUOTEEND) { + argtext++; + continue; + } + if (*argtext == CTLESC) + argtext++; + else if (BASESYNTAX[(int)*argtext] == CCTL) + return (0); + if (*argtext != *mask) + return (0); + if (*argtext == '\0') + return (1); + argtext++; + mask++; + } +} + +static int +isdeclarationcmd(struct narg *arg) +{ + int have_command = 0; + + if (arg == NULL) + return (0); + while (mustexpandto(arg->text, "command")) { + have_command = 1; + arg = &arg->next->narg; + if (arg == NULL) + return (0); + /* + * To also allow "command -p" and "command --" as part of + * a declaration command, add code here. + * We do not do this, as ksh does not do it either and it + * is not required by POSIX. + */ + } + return (mustexpandto(arg->text, "export") || + mustexpandto(arg->text, "readonly") || + (mustexpandto(arg->text, "local") && + (have_command || !isfunc("local")))); +} + /* * Check if a builtin can safely be executed in the same process, * even though it should be in a subshell (command substitution). @@ -743,11 +789,12 @@ evalcommand(union node *cmd, int flags, exitstatus = 0; for (argp = cmd->ncmd.args ; argp ; argp = argp->narg.next) { if (varflag && isassignment(argp->narg.text)) { - expandarg(argp, &varlist, EXP_VARTILDE); + expandarg(argp, varflag == 1 ? &varlist : &arglist, + EXP_VARTILDE); continue; - } + } else if (varflag == 1) + varflag = isdeclarationcmd(&argp->narg) ? 2 : 0; expandarg(argp, &arglist, EXP_FULL | EXP_TILDE); - varflag = 0; } *arglist.lastp = NULL; *varlist.lastp = NULL; Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sun Jul 15 06:08:11 2012 (r238467) +++ head/bin/sh/exec.c Sun Jul 15 10:19:43 2012 (r238468) @@ -648,6 +648,19 @@ unsetfunc(const char *name) return (0); } + +/* + * Check if a function by a certain name exists. + */ +int +isfunc(const char *name) +{ + struct tblentry *cmdp; + cmdp = cmdlookup(name, 0); + return (cmdp != NULL && cmdp->cmdtype == CMDFUNCTION); +} + + /* * Shared code for the following builtin commands: * type, command -v, command -V Modified: head/bin/sh/exec.h ============================================================================== --- head/bin/sh/exec.h Sun Jul 15 06:08:11 2012 (r238467) +++ head/bin/sh/exec.h Sun Jul 15 10:19:43 2012 (r238468) @@ -72,5 +72,6 @@ void hashcd(void); void changepath(const char *); void defun(const char *, union node *); int unsetfunc(const char *); +int isfunc(const char *); int typecmd_impl(int, char **, int, const char *); void clearcmdentry(void); Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Jul 15 06:08:11 2012 (r238467) +++ head/bin/sh/sh.1 Sun Jul 15 10:19:43 2012 (r238468) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd November 5, 2011 +.Dd July 15, 2012 .Dt SH 1 .Os .Sh NAME @@ -1164,6 +1164,20 @@ Assignments are expanded differently fro tilde expansion is also performed after the equals sign and after any colon and usernames are also terminated by colons, and field splitting and pathname expansion are not performed. +.Pp +This special expansion applies not only to assignments that form a simple +command by themselves or precede a command word, +but also to words passed to the +.Ic export , +.Ic local +or +.Ic readonly +built-in commands that have this form. +For this, the builtin's name must be literal +(not the result of an expansion) +and may optionally be preceded by one or more literal instances of +.Ic command +without options. .Ss Positional Parameters A positional parameter is a parameter denoted by a number greater than zero. The shell sets these initially to the values of its command line Added: head/tools/regression/bin/sh/expansion/export2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/export2.0 Sun Jul 15 10:19:43 2012 (r238468) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +w='@ @' +check() { + [ "$v" = "$w" ] || echo "Expected $w got $v" +} + +export v=$w +check + +HOME=/known/value +check() { + [ "$v" = ~ ] || echo "Expected $HOME got $v" +} + +export v=~ +check + +check() { + [ "$v" = "x:$HOME" ] || echo "Expected x:$HOME got $v" +} + +export v=x:~ +check Added: head/tools/regression/bin/sh/expansion/export3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/export3.0 Sun Jul 15 10:19:43 2012 (r238468) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +w='@ @' +check() { + [ "$v" = "$w" ] || echo "Expected $w got $v" +} + +command export v=$w +check +command command export v=$w +check + +HOME=/known/value +check() { + [ "$v" = ~ ] || echo "Expected $HOME got $v" +} + +command export v=~ +check +command command export v=~ +check + +check() { + [ "$v" = "x:$HOME" ] || echo "Expected x:$HOME got $v" +} + +command export v=x:~ +check +command command export v=x:~ +check Added: head/tools/regression/bin/sh/expansion/local1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/local1.0 Sun Jul 15 10:19:43 2012 (r238468) @@ -0,0 +1,28 @@ +# $FreeBSD$ + +run_test() { + w='@ @' + check() { + [ "$v" = "$w" ] || echo "Expected $w got $v" + } + + local v=$w + check + + HOME=/known/value + check() { + [ "$v" = ~ ] || echo "Expected $HOME got $v" + } + + local v=~ + check + + check() { + [ "$v" = "x:$HOME" ] || echo "Expected x:$HOME got $v" + } + + local v=x:~ + check +} + +run_test Added: head/tools/regression/bin/sh/expansion/local2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/local2.0 Sun Jul 15 10:19:43 2012 (r238468) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +run_test() { + w='@ @' + check() { + [ "$v" = "$w" ] || echo "Expected $w got $v" + } + + command local v=$w + check + command command local v=$w + check + + HOME=/known/value + check() { + [ "$v" = ~ ] || echo "Expected $HOME got $v" + } + + command local v=~ + check + command command local v=~ + check + + check() { + [ "$v" = "x:$HOME" ] || echo "Expected x:$HOME got $v" + } + + command local v=x:~ + check + command command local v=x:~ + check +} + +run_test Added: head/tools/regression/bin/sh/expansion/readonly1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/readonly1.0 Sun Jul 15 10:19:43 2012 (r238468) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +w='@ @' + +v=0 HOME=/known/value +readonly v=~:~/:$w +[ "$v" = "$HOME:$HOME/:$w" ] || echo "Expected $HOME/:$w got $v" From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 10:22:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77566106566C; Sun, 15 Jul 2012 10:22:14 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 628678FC12; Sun, 15 Jul 2012 10:22:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FAMEwu041246; Sun, 15 Jul 2012 10:22:14 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FAMEJL041244; Sun, 15 Jul 2012 10:22:14 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207151022.q6FAMEJL041244@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Jul 2012 10:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238469 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 10:22:14 -0000 Author: jilles Date: Sun Jul 15 10:22:13 2012 New Revision: 238469 URL: http://svn.freebsd.org/changeset/base/238469 Log: sh: Add a simple test for the "local" builtin. Added: head/tools/regression/bin/sh/builtins/local1.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/local1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/local1.0 Sun Jul 15 10:22:13 2012 (r238469) @@ -0,0 +1,13 @@ +# $FreeBSD$ +# A commonly used but non-POSIX builtin. + +f() { + local x + x=2 + [ "$x" = 2 ] +} +x=1 +f || exit 3 +[ "$x" = 1 ] || exit 3 +f || exit 3 +[ "$x" = 1 ] || exit 3 From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 10:49:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0E1E1065670; Sun, 15 Jul 2012 10:49:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC1778FC14; Sun, 15 Jul 2012 10:49:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FAnHbZ042781; Sun, 15 Jul 2012 10:49:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FAnHNN042778; Sun, 15 Jul 2012 10:49:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207151049.q6FAnHNN042778@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Jul 2012 10:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238470 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 10:49:17 -0000 Author: jilles Date: Sun Jul 15 10:49:16 2012 New Revision: 238470 URL: http://svn.freebsd.org/changeset/base/238470 Log: sh: Remove unused variable in_dowait. Modified: head/bin/sh/jobs.c head/bin/sh/jobs.h Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Jul 15 10:22:13 2012 (r238469) +++ head/bin/sh/jobs.c Sun Jul 15 10:49:16 2012 (r238470) @@ -84,7 +84,6 @@ static struct job *jobmru; /* most recen static pid_t initialpgrp; /* pgrp of shell on invocation */ #endif int in_waitcmd = 0; /* are we in waitcmd()? */ -int in_dowait = 0; /* are we in dowait()? */ volatile sig_atomic_t breakwaitcmd = 0; /* should wait be terminated? */ static int ttyfd = -1; @@ -1023,14 +1022,12 @@ dowait(int block, struct job *job) int sig; int coredump; - in_dowait++; TRACE(("dowait(%d) called\n", block)); do { pid = waitproc(block, &status); TRACE(("wait returns %d, status=%d\n", (int)pid, status)); } while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) || (pid > 0 && WIFSTOPPED(status) && !iflag)); - in_dowait--; if (pid == -1 && errno == ECHILD && job != NULL) job->state = JOBDONE; if (breakwaitcmd != 0) { Modified: head/bin/sh/jobs.h ============================================================================== --- head/bin/sh/jobs.h Sun Jul 15 10:22:13 2012 (r238469) +++ head/bin/sh/jobs.h Sun Jul 15 10:49:16 2012 (r238470) @@ -84,7 +84,6 @@ enum { extern int job_warning; /* user was warned about stopped jobs */ extern int in_waitcmd; /* are we in waitcmd()? */ -extern int in_dowait; /* are we in dowait()? */ extern volatile sig_atomic_t breakwaitcmd; /* break wait to process traps? */ void setjobctl(int); From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 10:53:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 99779106564A; Sun, 15 Jul 2012 10:53:49 +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 8419B8FC18; Sun, 15 Jul 2012 10:53:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FArnat042995; Sun, 15 Jul 2012 10:53:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FArnqO042991; Sun, 15 Jul 2012 10:53:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207151053.q6FArnqO042991@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 15 Jul 2012 10:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238471 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 10:53:49 -0000 Author: kib Date: Sun Jul 15 10:53:48 2012 New Revision: 238471 URL: http://svn.freebsd.org/changeset/base/238471 Log: Import the DragonFly BSD commit 4f0bc915b65fcf5a23214f6d221d65c80be68ad4 by John Marino , with the following (edited) commit message Date: Sat, 24 Mar 2012 06:40:50 +0100 Subject: [PATCH 1/1] rtld: Implement DT_RUNPATH and -z nodefaultlib DT_RUNPATH is incorrectly being considered as an alias of DT_RPATH. The purpose of DT_RUNPATH is to have two different types of rpath: one that can be overridden by the environment variable LD_LIBRARY_PATH and one that can't. With the currently implementation, LD_LIBRARY_PATH will always trump any embedded rpath or runpath tags. Current path search order by rtld: ================================== LD_LIBRARY_PATH DT_RPATH / DT_RUNPATH (always the same) ldconfig hints file (default: /var/run/ld-elf.so.hints) /usr/lib New path search order by rtld: ============================== DT_RPATH of the calling object if no DT_RUNPATH DT_RPATH of the main binary if no DT_RUNPATH and binary isn't calling obj LD_LIBRARY_PATH DT_RUNPATH ldconfig hints file /usr/lib The new path search matches how the linux runtime loader works. The other major added feature is support for linker flag "-z nodefaultlib". When this flag is passed to the linker, rtld will skip all references to the standard library search path ("/usr/lib" in this case but it could handle more color delimited paths) except in DT_RPATH and DT_RUNPATH. New path search order by rtld with -z nodefaultlib flag set: ============================================================ DT_RPATH of the calling object if no DT_RUNPATH DT_RPATH of the main binary if no DT_RUNPATH and binary isn't calling obj LD_LIBRARY_PATH DT_RUNPATH ldconfig hints file (skips all references to /usr/lib) FreeBSD notes: - we fixed some bugs which were submitted to DragonFly and merged there as commit 1ff8a2bd3eb6e5587174c6a983303ea3a79e0002; - we added LD_LIBRARY_PATH_RPATH environment variable to switch to the previous behaviour of considering DT_RPATH a synonym for DT_RUNPATH; - the FreeBSD default search path is /lib:/usr/lib and not /usr/lib. Reviewed by: kan MFC after: 1 month MFC note: flip the ld_library_path_rpath default value for stable/9 Modified: head/libexec/rtld-elf/rtld.1 head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/rtld.1 ============================================================================== --- head/libexec/rtld-elf/rtld.1 Sun Jul 15 10:49:16 2012 (r238470) +++ head/libexec/rtld-elf/rtld.1 Sun Jul 15 10:53:48 2012 (r238471) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2009 +.Dd June 28, 2012 .Dt RTLD 1 .Os .Sh NAME @@ -86,14 +86,39 @@ dynamic linker. After the dynamic linker has finished loading, relocating, and initializing the program and its required shared objects, it transfers control to the entry point of the program. +The following search order is used to locate required shared objects: .Pp -To locate the required shared objects in the file system, -.Nm -may use a -.Dq hints -file prepared by the +.Bl -enum -offset indent -compact +.It +.Dv DT_RPATH +of the referencing object unless that object also contains a +.Dv DT_RUNPATH +tag +.It +.Dv DT_RPATH +of the program unless the referencing object contains a +.Dv DT_RUNPATH +tag +.It +Path indicated by +.Ev LD_LIBRARY_PATH +environment variable +.It +.Dv DT_RUNPATH +of the referencing object +.It +Hints file produced by the .Xr ldconfig 8 -utility. +utility +.It +The +.Pa /lib +and +.Pa /usr/lib +directories, unless the referencing object was linked using the +.Dq Fl z Ar nodefaultlib +option +.El .Pp The .Nm @@ -143,6 +168,20 @@ This variable is unset for set-user-ID a A colon separated list of directories, overriding the default search path for shared libraries. This variable is unset for set-user-ID and set-group-ID programs. +.It Ev LD_LIBRARY_PATH_RPATH +If the variable is specified and has a value starting with +any of \'y\', \'Y\' or \'1\' symbols, the path specified by +.Ev LD_LIBRARY_PATH +variable is allowed to override the path from +.Dv DT_RPATH +for binaries which does not contain +.Dv DT_RUNPATH +tag. +For such binaries, when the variable +.Ev LD_LIBRARY_PATH_RPATH +is set, +.Dq Fl z Ar nodefaultlib +link-time option is ignored as well. .It Ev LD_PRELOAD A list of shared libraries, separated by colons and/or white space, to be linked in before any Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sun Jul 15 10:49:16 2012 (r238470) +++ head/libexec/rtld-elf/rtld.c Sun Jul 15 10:53:48 2012 (r238471) @@ -80,8 +80,9 @@ typedef void * (*path_enum_proc) (const static const char *basename(const char *); static void die(void) __dead2; static void digest_dynamic1(Obj_Entry *, int, const Elf_Dyn **, - const Elf_Dyn **); -static void digest_dynamic2(Obj_Entry *, const Elf_Dyn *, const Elf_Dyn *); + const Elf_Dyn **, const Elf_Dyn **); +static void digest_dynamic2(Obj_Entry *, const Elf_Dyn *, const Elf_Dyn *, + const Elf_Dyn *); static void digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static Obj_Entry *dlcheck(void *); @@ -94,7 +95,7 @@ static void errmsg_restore(char *); static char *errmsg_save(void); static void *fill_search_info(const char *, size_t, void *); static char *find_library(const char *, const Obj_Entry *); -static const char *gethints(void); +static const char *gethints(bool); static void init_dag(Obj_Entry *); static void init_rtld(caddr_t, Elf_Auxinfo **); static void initlist_add_neededs(Needed_Entry *, Objlist *); @@ -233,6 +234,8 @@ size_t tls_static_space; /* Static TLS s int tls_dtv_generation = 1; /* Used to detect when dtv size changes */ int tls_max_index = 1; /* Largest module index allocated */ +bool ld_library_path_rpath = false; + /* * Fill in a DoneList with an allocation large enough to hold all of * the currently-loaded objects. Keep this as a macro since it calls @@ -323,6 +326,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ Obj_Entry **preload_tail; Objlist initlist; RtldLockState lockstate; + char *library_path_rpath; int mib[2]; size_t len; @@ -394,7 +398,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ if (unsetenv(LD_ "PRELOAD") || unsetenv(LD_ "LIBMAP") || unsetenv(LD_ "LIBRARY_PATH") || unsetenv(LD_ "LIBMAP_DISABLE") || unsetenv(LD_ "DEBUG") || unsetenv(LD_ "ELF_HINTS_PATH") || - unsetenv(LD_ "LOADFLTR")) { + unsetenv(LD_ "LOADFLTR") || unsetenv(LD_ "LIBRARY_PATH_RPATH")) { _rtld_error("environment corrupt; aborting"); die(); } @@ -406,6 +410,15 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ ld_preload = getenv(LD_ "PRELOAD"); ld_elf_hints_path = getenv(LD_ "ELF_HINTS_PATH"); ld_loadfltr = getenv(LD_ "LOADFLTR") != NULL; + library_path_rpath = getenv(LD_ "LIBRARY_PATH_RPATH"); + if (library_path_rpath != NULL) { + if (library_path_rpath[0] == 'y' || + library_path_rpath[0] == 'Y' || + library_path_rpath[0] == '1') + ld_library_path_rpath = true; + else + ld_library_path_rpath = false; + } dangerous_ld_env = libmap_disable || (libmap_override != NULL) || (ld_library_path != NULL) || (ld_preload != NULL) || (ld_elf_hints_path != NULL) || ld_loadfltr; @@ -828,7 +841,7 @@ die(void) */ static void digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath, - const Elf_Dyn **dyn_soname) + const Elf_Dyn **dyn_soname, const Elf_Dyn **dyn_runpath) { const Elf_Dyn *dynp; Needed_Entry **needed_tail = &obj->needed; @@ -843,6 +856,7 @@ digest_dynamic1(Obj_Entry *obj, int earl *dyn_rpath = NULL; *dyn_soname = NULL; + *dyn_runpath = NULL; obj->bind_now = false; for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; dynp++) { @@ -1009,7 +1023,6 @@ digest_dynamic1(Obj_Entry *obj, int earl break; case DT_RPATH: - case DT_RUNPATH: /* XXX: process separately */ /* * We have to wait until later to process this, because we * might not have gotten the address of the string table yet. @@ -1021,6 +1034,10 @@ digest_dynamic1(Obj_Entry *obj, int earl *dyn_soname = dynp; break; + case DT_RUNPATH: + *dyn_runpath = dynp; + break; + case DT_INIT: obj->init = (Elf_Addr) (obj->relocbase + dynp->d_un.d_ptr); break; @@ -1114,6 +1131,8 @@ digest_dynamic1(Obj_Entry *obj, int earl obj->z_nodelete = true; if (dynp->d_un.d_val & DF_1_LOADFLTR) obj->z_loadfltr = true; + if (dynp->d_un.d_val & DF_1_NODEFLIB) + obj->z_nodeflib = true; break; default: @@ -1153,7 +1172,7 @@ digest_dynamic1(Obj_Entry *obj, int earl static void digest_dynamic2(Obj_Entry *obj, const Elf_Dyn *dyn_rpath, - const Elf_Dyn *dyn_soname) + const Elf_Dyn *dyn_soname, const Elf_Dyn *dyn_runpath) { if (obj->z_origin && obj->origin_path == NULL) { @@ -1162,7 +1181,12 @@ digest_dynamic2(Obj_Entry *obj, const El die(); } - if (dyn_rpath != NULL) { + if (dyn_runpath != NULL) { + obj->runpath = (char *)obj->strtab + dyn_runpath->d_un.d_val; + if (obj->z_origin) + obj->runpath = origin_subst(obj->runpath, obj->origin_path); + } + else if (dyn_rpath != NULL) { obj->rpath = (char *)obj->strtab + dyn_rpath->d_un.d_val; if (obj->z_origin) obj->rpath = origin_subst(obj->rpath, obj->origin_path); @@ -1177,9 +1201,10 @@ digest_dynamic(Obj_Entry *obj, int early { const Elf_Dyn *dyn_rpath; const Elf_Dyn *dyn_soname; + const Elf_Dyn *dyn_runpath; - digest_dynamic1(obj, early, &dyn_rpath, &dyn_soname); - digest_dynamic2(obj, dyn_rpath, dyn_soname); + digest_dynamic1(obj, early, &dyn_rpath, &dyn_soname, &dyn_runpath); + digest_dynamic2(obj, dyn_rpath, dyn_soname, dyn_runpath); } /* @@ -1389,43 +1414,71 @@ gnu_hash(const char *s) * loaded shared object, whose library search path will be searched. * * The search order is: + * DT_RPATH in the referencing file _unless_ DT_RUNPATH is present (1) + * DT_RPATH of the main object if DSO without defined DT_RUNPATH (1) * LD_LIBRARY_PATH - * rpath in the referencing file - * ldconfig hints - * /lib:/usr/lib + * DT_RUNPATH in the referencing file + * ldconfig hints (if -z nodefaultlib, filter out default library directories + * from list) + * /lib:/usr/lib _unless_ the referencing file is linked with -z nodefaultlib + * + * (1) Handled in digest_dynamic2 - rpath left NULL if runpath defined. */ static char * find_library(const char *xname, const Obj_Entry *refobj) { char *pathname; char *name; + bool objgiven; + objgiven = refobj != NULL; if (strchr(xname, '/') != NULL) { /* Hard coded pathname */ if (xname[0] != '/' && !trust) { _rtld_error("Absolute pathname required for shared object \"%s\"", xname); return NULL; } - if (refobj != NULL && refobj->z_origin) + if (objgiven && refobj->z_origin) return origin_subst(xname, refobj->origin_path); else return xstrdup(xname); } - if (libmap_disable || (refobj == NULL) || + if (libmap_disable || !objgiven || (name = lm_find(refobj->path, xname)) == NULL) name = (char *)xname; dbg(" Searching for \"%s\"", name); - if ((pathname = search_library_path(name, ld_library_path)) != NULL || - (refobj != NULL && - (pathname = search_library_path(name, refobj->rpath)) != NULL) || - (pathname = search_library_path(name, gethints())) != NULL || - (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL) - return pathname; + /* + * If refobj->rpath != NULL, then refobj->runpath is NULL. Fall + * back to pre-conforming behaviour if user requested so with + * LD_LIBRARY_PATH_RPATH environment variable and ignore -z + * nodeflib. + */ + if (objgiven && refobj->rpath != NULL && ld_library_path_rpath) { + if ((pathname = search_library_path(name, ld_library_path)) != NULL || + (refobj != NULL && + (pathname = search_library_path(name, refobj->rpath)) != NULL) || + (pathname = search_library_path(name, gethints(false))) != NULL || + (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL) + return (pathname); + } else { + if ((objgiven && + (pathname = search_library_path(name, refobj->rpath)) != NULL) || + (objgiven && refobj->runpath == NULL && refobj != obj_main && + (pathname = search_library_path(name, obj_main->rpath)) != NULL) || + (pathname = search_library_path(name, ld_library_path)) != NULL || + (objgiven && + (pathname = search_library_path(name, refobj->runpath)) != NULL) || + (pathname = search_library_path(name, gethints(refobj->z_nodeflib))) + != NULL || + (objgiven && !refobj->z_nodeflib && + (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL)) + return (pathname); + } - if(refobj != NULL && refobj->path != NULL) { + if (objgiven && refobj->path != NULL) { _rtld_error("Shared object \"%s\" not found, required by \"%s\"", name, basename(refobj->path)); } else { @@ -1520,41 +1573,142 @@ find_symdef(unsigned long symnum, const /* * Return the search path from the ldconfig hints file, reading it if - * necessary. Returns NULL if there are problems with the hints file, + * necessary. If nostdlib is true, then the default search paths are + * not added to result. + * + * Returns NULL if there are problems with the hints file, * or if the search path there is empty. */ static const char * -gethints(void) +gethints(bool nostdlib) { - static char *hints; - - if (hints == NULL) { - int fd; + static char *hints, *filtered_path; struct elfhints_hdr hdr; + struct fill_search_info_args sargs, hargs; + struct dl_serinfo smeta, hmeta, *SLPinfo, *hintinfo; + struct dl_serpath *SLPpath, *hintpath; char *p; + unsigned int SLPndx, hintndx, fndx, fcount; + int fd; + size_t flen; + bool skip; - /* Keep from trying again in case the hints file is bad. */ - hints = ""; - - if ((fd = open(ld_elf_hints_path, O_RDONLY)) == -1) - return NULL; - if (read(fd, &hdr, sizeof hdr) != sizeof hdr || - hdr.magic != ELFHINTS_MAGIC || - hdr.version != 1) { - close(fd); - return NULL; + /* First call, read the hints file */ + if (hints == NULL) { + /* Keep from trying again in case the hints file is bad. */ + hints = ""; + + if ((fd = open(ld_elf_hints_path, O_RDONLY)) == -1) + return (NULL); + if (read(fd, &hdr, sizeof hdr) != sizeof hdr || + hdr.magic != ELFHINTS_MAGIC || + hdr.version != 1) { + close(fd); + return (NULL); + } + p = xmalloc(hdr.dirlistlen + 1); + if (lseek(fd, hdr.strtab + hdr.dirlist, SEEK_SET) == -1 || + read(fd, p, hdr.dirlistlen + 1) != + (ssize_t)hdr.dirlistlen + 1) { + free(p); + close(fd); + return (NULL); + } + hints = p; + close(fd); } - p = xmalloc(hdr.dirlistlen + 1); - if (lseek(fd, hdr.strtab + hdr.dirlist, SEEK_SET) == -1 || - read(fd, p, hdr.dirlistlen + 1) != (ssize_t)hdr.dirlistlen + 1) { - free(p); - close(fd); - return NULL; + + /* + * If caller agreed to receive list which includes the default + * paths, we are done. Otherwise, if we still did not + * calculated filtered result, do it now. + */ + if (!nostdlib) + return (hints[0] != '\0' ? hints : NULL); + if (filtered_path != NULL) + goto filt_ret; + + /* + * Obtain the list of all configured search paths, and the + * list of the default paths. + * + * First estimate the size of the results. + */ + smeta.dls_size = __offsetof(struct dl_serinfo, dls_serpath); + smeta.dls_cnt = 0; + hmeta.dls_size = __offsetof(struct dl_serinfo, dls_serpath); + hmeta.dls_cnt = 0; + + sargs.request = RTLD_DI_SERINFOSIZE; + sargs.serinfo = &smeta; + hargs.request = RTLD_DI_SERINFOSIZE; + hargs.serinfo = &hmeta; + + path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &sargs); + path_enumerate(p, fill_search_info, &hargs); + + SLPinfo = xmalloc(smeta.dls_size); + hintinfo = xmalloc(hmeta.dls_size); + + /* + * Next fetch both sets of paths. + */ + sargs.request = RTLD_DI_SERINFO; + sargs.serinfo = SLPinfo; + sargs.serpath = &SLPinfo->dls_serpath[0]; + sargs.strspace = (char *)&SLPinfo->dls_serpath[smeta.dls_cnt]; + + hargs.request = RTLD_DI_SERINFO; + hargs.serinfo = hintinfo; + hargs.serpath = &hintinfo->dls_serpath[0]; + hargs.strspace = (char *)&hintinfo->dls_serpath[hmeta.dls_cnt]; + + path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &sargs); + path_enumerate(p, fill_search_info, &hargs); + + /* + * Now calculate the difference between two sets, by excluding + * standard paths from the full set. + */ + fndx = 0; + fcount = 0; + filtered_path = xmalloc(hdr.dirlistlen + 1); + hintpath = &hintinfo->dls_serpath[0]; + for (hintndx = 0; hintndx < hmeta.dls_cnt; hintndx++, hintpath++) { + skip = false; + SLPpath = &SLPinfo->dls_serpath[0]; + /* + * Check each standard path against current. + */ + for (SLPndx = 0; SLPndx < smeta.dls_cnt; SLPndx++, SLPpath++) { + /* matched, skip the path */ + if (!strcmp(hintpath->dls_name, SLPpath->dls_name)) { + skip = true; + break; + } + } + if (skip) + continue; + /* + * Not matched against any standard path, add the path + * to result. Separate consequtive paths with ':'. + */ + if (fcount > 0) { + filtered_path[fndx] = ':'; + fndx++; + } + fcount++; + flen = strlen(hintpath->dls_name); + strncpy((filtered_path + fndx), hintpath->dls_name, flen); + fndx += flen; } - hints = p; - close(fd); - } - return hints[0] != '\0' ? hints : NULL; + filtered_path[fndx] = '\0'; + + free(SLPinfo); + free(hintinfo); + +filt_ret: + return (filtered_path[0] != '\0' ? filtered_path : NULL); } static void @@ -1600,6 +1754,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * Obj_Entry objtmp; /* Temporary rtld object */ const Elf_Dyn *dyn_rpath; const Elf_Dyn *dyn_soname; + const Elf_Dyn *dyn_runpath; /* * Conjure up an Obj_Entry structure for the dynamic linker. @@ -1616,7 +1771,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * #endif if (RTLD_IS_DYNAMIC()) { objtmp.dynamic = rtld_dynamic(&objtmp); - digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname); + digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname, &dyn_runpath); assert(objtmp.needed == NULL); #if !defined(__mips__) /* MIPS has a bogus DT_TEXTREL. */ @@ -1642,7 +1797,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * if (aux_info[AT_OSRELDATE] != NULL) osreldate = aux_info[AT_OSRELDATE]->a_un.a_val; - digest_dynamic2(&obj_rtld, dyn_rpath, dyn_soname); + digest_dynamic2(&obj_rtld, dyn_rpath, dyn_soname, dyn_runpath); /* Replace the path with a dynamically allocated copy. */ obj_rtld.path = xstrdup(PATH_RTLD); @@ -3070,14 +3225,6 @@ dl_iterate_phdr(__dl_iterate_hdr_callbac return (error); } -struct fill_search_info_args { - int request; - unsigned int flags; - Dl_serinfo *serinfo; - Dl_serpath *serpath; - char *strspace; -}; - static void * fill_search_info(const char *dir, size_t dirlen, void *param) { @@ -3087,7 +3234,7 @@ fill_search_info(const char *dir, size_t if (arg->request == RTLD_DI_SERINFOSIZE) { arg->serinfo->dls_cnt ++; - arg->serinfo->dls_size += sizeof(Dl_serpath) + dirlen + 1; + arg->serinfo->dls_size += sizeof(struct dl_serpath) + dirlen + 1; } else { struct dl_serpath *s_entry; @@ -3117,10 +3264,12 @@ do_search_info(const Obj_Entry *obj, int _info.dls_size = __offsetof(struct dl_serinfo, dls_serpath); _info.dls_cnt = 0; - path_enumerate(ld_library_path, fill_search_info, &args); path_enumerate(obj->rpath, fill_search_info, &args); - path_enumerate(gethints(), fill_search_info, &args); - path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &args); + path_enumerate(ld_library_path, fill_search_info, &args); + path_enumerate(obj->runpath, fill_search_info, &args); + path_enumerate(gethints(obj->z_nodeflib), fill_search_info, &args); + if (!obj->z_nodeflib) + path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &args); if (request == RTLD_DI_SERINFOSIZE) { @@ -3139,20 +3288,26 @@ do_search_info(const Obj_Entry *obj, int args.serpath = &info->dls_serpath[0]; args.strspace = (char *)&info->dls_serpath[_info.dls_cnt]; + args.flags = LA_SER_RUNPATH; + if (path_enumerate(obj->rpath, fill_search_info, &args) != NULL) + return (-1); + args.flags = LA_SER_LIBPATH; if (path_enumerate(ld_library_path, fill_search_info, &args) != NULL) return (-1); args.flags = LA_SER_RUNPATH; - if (path_enumerate(obj->rpath, fill_search_info, &args) != NULL) + if (path_enumerate(obj->runpath, fill_search_info, &args) != NULL) return (-1); args.flags = LA_SER_CONFIG; - if (path_enumerate(gethints(), fill_search_info, &args) != NULL) + if (path_enumerate(gethints(obj->z_nodeflib), fill_search_info, &args) + != NULL) return (-1); args.flags = LA_SER_DEFAULT; - if (path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &args) != NULL) + if (!obj->z_nodeflib && + path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &args) != NULL) return (-1); return (0); } Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Sun Jul 15 10:49:16 2012 (r238470) +++ head/libexec/rtld-elf/rtld.h Sun Jul 15 10:53:48 2012 (r238471) @@ -222,6 +222,7 @@ typedef struct Struct_Obj_Entry { const Elf_Hashelt *chain_zero_gnu; /* GNU hash table value array (Zeroed) */ char *rpath; /* Search path specified in object */ + char *runpath; /* Search path with different priority */ Needed_Entry *needed; /* Shared objects needed by this one (%) */ Needed_Entry *needed_filtees; Needed_Entry *needed_aux_filtees; @@ -258,6 +259,7 @@ typedef struct Struct_Obj_Entry { bool z_nodelete : 1; /* Do not unload the object and dependencies */ bool z_noopen : 1; /* Do not load on dlopen */ bool z_loadfltr : 1; /* Immediately load filtees */ + bool z_nodeflib : 1; /* Don't search default library path */ bool ref_nodel : 1; /* Refcount increased to prevent dlclose */ bool init_scanned: 1; /* Object is already on init list. */ bool on_fini_list: 1; /* Object is already on fini list. */ @@ -321,6 +323,14 @@ struct Struct_RtldLockState { sigjmp_buf env; }; +struct fill_search_info_args { + int request; + unsigned int flags; + struct dl_serinfo *serinfo; + struct dl_serpath *serpath; + char *strspace; +}; + /* * The pack of arguments and results for the symbol lookup functions. */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 10:54:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1E04106585C; Sun, 15 Jul 2012 10:54:11 +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 9272B8FC17; Sun, 15 Jul 2012 10:54:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FAsBuw043054; Sun, 15 Jul 2012 10:54:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FAsBIk043046; Sun, 15 Jul 2012 10:54:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207151054.q6FAsBIk043046@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 15 Jul 2012 10:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238472 - in head/contrib/gcc/config: arm i386 ia64 mips rs6000 sparc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 10:54:11 -0000 Author: kib Date: Sun Jul 15 10:54:10 2012 New Revision: 238472 URL: http://svn.freebsd.org/changeset/base/238472 Log: Pass --enable-new-dtags to the linker invocation by default. If desired, one can turn off the generation of post-ELF standard dtags by overriding it with --disable-new-dtags after the default switch. Immediate effect of the change is that -rpath path is now stored both in DT_RPATH and DT_RUNPATH tags, which is the right way to provide rpath for dynamic linker supporting DT_RUNPATH per specification. Reviewed by: kan MFC after: 1 month Modified: head/contrib/gcc/config/arm/freebsd.h head/contrib/gcc/config/i386/freebsd.h head/contrib/gcc/config/i386/freebsd64.h head/contrib/gcc/config/ia64/freebsd.h head/contrib/gcc/config/mips/freebsd.h head/contrib/gcc/config/rs6000/freebsd.h head/contrib/gcc/config/sparc/freebsd.h Modified: head/contrib/gcc/config/arm/freebsd.h ============================================================================== --- head/contrib/gcc/config/arm/freebsd.h Sun Jul 15 10:53:48 2012 (r238471) +++ head/contrib/gcc/config/arm/freebsd.h Sun Jul 15 10:54:10 2012 (r238472) @@ -50,7 +50,7 @@ %{rdynamic:-export-dynamic} \ %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \ %{static:-Bstatic}} \ - %{!static:--hash-style=both} \ + %{!static:--hash-style=both --enable-new-dtags} \ %{symbolic:-Bsymbolic} \ -X %{mbig-endian:-EB} %{mlittle-endian:-EL}" Modified: head/contrib/gcc/config/i386/freebsd.h ============================================================================== --- head/contrib/gcc/config/i386/freebsd.h Sun Jul 15 10:53:48 2012 (r238471) +++ head/contrib/gcc/config/i386/freebsd.h Sun Jul 15 10:54:10 2012 (r238472) @@ -49,7 +49,7 @@ Boston, MA 02110-1301, USA. */ %{rdynamic: -export-dynamic} \ %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \ %{static:-Bstatic}} \ - %{!static:--hash-style=both} \ + %{!static:--hash-style=both --enable-new-dtags} \ %{symbolic:-Bsymbolic}" /* Reset our STARTFILE_SPEC which was properly set in config/freebsd.h Modified: head/contrib/gcc/config/i386/freebsd64.h ============================================================================== --- head/contrib/gcc/config/i386/freebsd64.h Sun Jul 15 10:53:48 2012 (r238471) +++ head/contrib/gcc/config/i386/freebsd64.h Sun Jul 15 10:54:10 2012 (r238472) @@ -54,5 +54,5 @@ Boston, MA 02110-1301, USA. */ %{rdynamic:-export-dynamic} \ %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \ %{static:-Bstatic}} \ - %{!static:--hash-style=both} \ + %{!static:--hash-style=both --enable-new-dtags} \ %{symbolic:-Bsymbolic}" Modified: head/contrib/gcc/config/ia64/freebsd.h ============================================================================== --- head/contrib/gcc/config/ia64/freebsd.h Sun Jul 15 10:53:48 2012 (r238471) +++ head/contrib/gcc/config/ia64/freebsd.h Sun Jul 15 10:54:10 2012 (r238472) @@ -27,6 +27,7 @@ Boston, MA 02110-1301, USA. */ %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ + %{!static:--enable-new-dtags} \ %{symbolic:-Bsymbolic} \ %{!shared: \ %{!static: \ Modified: head/contrib/gcc/config/mips/freebsd.h ============================================================================== --- head/contrib/gcc/config/mips/freebsd.h Sun Jul 15 10:53:48 2012 (r238471) +++ head/contrib/gcc/config/mips/freebsd.h Sun Jul 15 10:54:10 2012 (r238472) @@ -56,6 +56,7 @@ Boston, MA 02110-1301, USA. */ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ + %{!static:--enable-new-dtags} \ %{!shared: \ %{!static: \ %{rdynamic: -export-dynamic} \ Modified: head/contrib/gcc/config/rs6000/freebsd.h ============================================================================== --- head/contrib/gcc/config/rs6000/freebsd.h Sun Jul 15 10:53:48 2012 (r238471) +++ head/contrib/gcc/config/rs6000/freebsd.h Sun Jul 15 10:54:10 2012 (r238472) @@ -180,6 +180,7 @@ extern int dot_symbols; %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ + %{!static:--enable-new-dtags} \ %{!shared: \ %{!static: \ %{rdynamic: -export-dynamic} \ Modified: head/contrib/gcc/config/sparc/freebsd.h ============================================================================== --- head/contrib/gcc/config/sparc/freebsd.h Sun Jul 15 10:53:48 2012 (r238471) +++ head/contrib/gcc/config/sparc/freebsd.h Sun Jul 15 10:54:10 2012 (r238472) @@ -53,7 +53,7 @@ Boston, MA 02110-1301, USA. */ %{rdynamic:-export-dynamic} \ %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \ %{static:-Bstatic}} \ - %{!static:--hash-style=both} \ + %{!static:--hash-style=both --enable-new-dtags} \ %{symbolic:-Bsymbolic}" From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 10:55:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D0FA7106566C; Sun, 15 Jul 2012 10:55:43 +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 BBD958FC28; Sun, 15 Jul 2012 10:55:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FAthkE043161; Sun, 15 Jul 2012 10:55:43 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FAthDK043159; Sun, 15 Jul 2012 10:55:43 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207151055.q6FAthDK043159@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Jul 2012 10:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238473 - stable/9/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 10:55:43 -0000 Author: brueffer Date: Sun Jul 15 10:55:43 2012 New Revision: 238473 URL: http://svn.freebsd.org/changeset/base/238473 Log: MFC: r237921 Similar to all.log, mention that /var/log/console.log has to be created and chmod'ed to make logging work. Approved by: re (kib) Modified: stable/9/etc/syslog.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/syslog.conf ============================================================================== --- stable/9/etc/syslog.conf Sun Jul 15 10:54:10 2012 (r238472) +++ stable/9/etc/syslog.conf Sun Jul 15 10:55:43 2012 (r238473) @@ -16,6 +16,7 @@ cron.* /var/log/cron *.=debug /var/log/debug.log *.emerg * # uncomment this to log all writes to /dev/console to /var/log/console.log +# touch /var/log/console.log and chmod it to mode 600 before it will work #console.info /var/log/console.log # uncomment this to enable logging of all log messages to /var/log/all.log # touch /var/log/all.log and chmod it to mode 600 before it will work From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 11:04:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDD8C1065672; Sun, 15 Jul 2012 11:04: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 C8F798FC14; Sun, 15 Jul 2012 11:04:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FB4Zue043582; Sun, 15 Jul 2012 11:04:35 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FB4ZTF043580; Sun, 15 Jul 2012 11:04:35 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207151104.q6FB4ZTF043580@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Jul 2012 11:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238474 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 11:04:36 -0000 Author: brueffer Date: Sun Jul 15 11:04:35 2012 New Revision: 238474 URL: http://svn.freebsd.org/changeset/base/238474 Log: MFC: r237921 Similar to all.log, mention that /var/log/console.log has to be created and chmod'ed to make logging work. Modified: stable/8/etc/syslog.conf Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/syslog.conf ============================================================================== --- stable/8/etc/syslog.conf Sun Jul 15 10:55:43 2012 (r238473) +++ stable/8/etc/syslog.conf Sun Jul 15 11:04:35 2012 (r238474) @@ -16,6 +16,7 @@ cron.* /var/log/cron *.=debug /var/log/debug.log *.emerg * # uncomment this to log all writes to /dev/console to /var/log/console.log +# touch /var/log/console.log and chmod it to mode 600 before it will work #console.info /var/log/console.log # uncomment this to enable logging of all log messages to /var/log/all.log # touch /var/log/all.log and chmod it to mode 600 before it will work From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 11:04:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07C8B1065694; Sun, 15 Jul 2012 11:04: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 DD80E8FC19; Sun, 15 Jul 2012 11:04:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FB4n3c043632; Sun, 15 Jul 2012 11:04:49 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FB4noC043626; Sun, 15 Jul 2012 11:04:49 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207151104.q6FB4noC043626@svn.freebsd.org> From: Michael Tuexen Date: Sun, 15 Jul 2012 11:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238475 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 11:04:50 -0000 Author: tuexen Date: Sun Jul 15 11:04:49 2012 New Revision: 238475 URL: http://svn.freebsd.org/changeset/base/238475 Log: #ifdef INET and INET6 consistently. This also fixes a bug, where it was done wrong. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jul 15 11:04:35 2012 (r238474) +++ head/sys/netinet/sctp_output.c Sun Jul 15 11:04:49 2012 (r238475) @@ -8432,12 +8432,14 @@ again_one_more_time: } /* now lets add any data within the MTU constraints */ switch (((struct sockaddr *)&net->ro._l_addr)->sa_family) { +#ifdef INET case AF_INET: if (net->mtu > (sizeof(struct ip) + sizeof(struct sctphdr))) omtu = net->mtu - (sizeof(struct ip) + sizeof(struct sctphdr)); else omtu = 0; break; +#endif #ifdef INET6 case AF_INET6: if (net->mtu > (sizeof(struct ip6_hdr) + sizeof(struct sctphdr))) @@ -12165,7 +12167,7 @@ sctp_lower_sosend(struct socket *so, union sctp_sockstore *raddr = (union sctp_sockstore *)addr; switch (raddr->sa.sa_family) { -#if defined(INET) +#ifdef INET case AF_INET: if (raddr->sin.sin_len != sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); @@ -12175,7 +12177,7 @@ sctp_lower_sosend(struct socket *so, port = raddr->sin.sin_port; break; #endif -#if defined(INET6) +#ifdef INET6 case AF_INET6: if (raddr->sin6.sin6_len != sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Jul 15 11:04:35 2012 (r238474) +++ head/sys/netinet/sctp_pcb.c Sun Jul 15 11:04:49 2012 (r238475) @@ -3016,6 +3016,7 @@ continue_anyway: memset(&store_sa, 0, sizeof(store_sa)); switch (addr->sa_family) { +#ifdef INET case AF_INET: { struct sockaddr_in *sin; @@ -3025,6 +3026,8 @@ continue_anyway: sin->sin_port = 0; break; } +#endif +#ifdef INET6 case AF_INET6: { struct sockaddr_in6 *sin6; @@ -3034,6 +3037,7 @@ continue_anyway: sin6->sin6_port = 0; break; } +#endif default: break; } @@ -5195,12 +5199,16 @@ sctp_destination_is_reachable(struct sct } /* NOTE: all "scope" checks are done when local addresses are added */ switch (destaddr->sa_family) { +#ifdef INET6 case AF_INET6: answer = inp->ip_inp.inp.inp_vflag & INP_IPV6; break; +#endif +#ifdef INET case AF_INET: answer = inp->ip_inp.inp.inp_vflag & INP_IPV4; break; +#endif default: /* invalid family, so it's unreachable */ answer = 0; @@ -5291,7 +5299,7 @@ sctp_add_local_addr_ep(struct sctp_inpcb inp->ip_inp.inp.inp_vflag |= INP_IPV6; break; #endif -#ifdef INET6 +#ifdef INET case AF_INET: inp->ip_inp.inp.inp_vflag |= INP_IPV4; break; Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Jul 15 11:04:35 2012 (r238474) +++ head/sys/netinet/sctp_usrreq.c Sun Jul 15 11:04:49 2012 (r238475) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET6) +#ifdef INET6 #endif #include #include Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Jul 15 11:04:35 2012 (r238474) +++ head/sys/netinet/sctputil.c Sun Jul 15 11:04:49 2012 (r238475) @@ -5637,7 +5637,7 @@ found_one: memcpy(from, &sin6, sizeof(struct sockaddr_in6)); } #endif -#if defined(INET6) +#ifdef INET6 { struct sockaddr_in6 lsa6, *from6; @@ -6534,7 +6534,7 @@ sctp_bindx_delete_address(struct sctp_in return; } addr_touse = sa; -#if defined(INET6) +#ifdef INET6 if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun Jul 15 11:04:35 2012 (r238474) +++ head/sys/netinet6/sctp6_usrreq.c Sun Jul 15 11:04:49 2012 (r238475) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET6) +#ifdef INET6 #include #endif #include @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #ifdef IPSEC #include -#if defined(INET6) +#ifdef INET6 #include #endif /* INET6 */ #endif /* IPSEC */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 11:13:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10D2A106566B; Sun, 15 Jul 2012 11:13:10 +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 EF3588FC0A; Sun, 15 Jul 2012 11:13:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FBD9h9044067; Sun, 15 Jul 2012 11:13:09 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FBD9dX044065; Sun, 15 Jul 2012 11:13:09 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207151113.q6FBD9dX044065@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 15 Jul 2012 11:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238476 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 11:13:10 -0000 Author: bz Date: Sun Jul 15 11:13:09 2012 New Revision: 238476 URL: http://svn.freebsd.org/changeset/base/238476 Log: MFC r238222: As mentioned in the commit message of r237571 (copied from a prototype patch of mine) also check if the 2nd in6_setscope() failed and return the error in that case. Approved by: re (kib) Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Sun Jul 15 11:04:49 2012 (r238475) +++ stable/9/sys/netinet6/in6.c Sun Jul 15 11:13:09 2012 (r238476) @@ -1341,7 +1341,9 @@ in6_purgeaddr_mc(struct ifnet *ifp, stru sin6.sin6_family = AF_INET6; memcpy(&sin6.sin6_addr, &satosin6(ifa0->ifa_addr)->sin6_addr, sizeof(sin6.sin6_addr)); - in6_setscope(&sin6.sin6_addr, ifa0->ifa_ifp, NULL); + error = in6_setscope(&sin6.sin6_addr, ifa0->ifa_ifp, NULL); + if (error != 0) + return (error); } rt = in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, RT_DEFAULT_FIB); From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 11:18:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 429AA106566B; Sun, 15 Jul 2012 11:18:53 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DA628FC16; Sun, 15 Jul 2012 11:18:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FBIrhg044357; Sun, 15 Jul 2012 11:18:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FBIqV3044355; Sun, 15 Jul 2012 11:18:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207151118.q6FBIqV3044355@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Jul 2012 11:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238477 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 11:18:53 -0000 Author: jilles Date: Sun Jul 15 11:18:52 2012 New Revision: 238477 URL: http://svn.freebsd.org/changeset/base/238477 Log: sh: Reset pendingsigs before checking pending traps, not after. Otherwise, a signal arriving at exactly the right moment might not be processed until another signal arrived. Modified: head/bin/sh/trap.c Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Sun Jul 15 11:13:09 2012 (r238476) +++ head/bin/sh/trap.c Sun Jul 15 11:18:52 2012 (r238477) @@ -416,6 +416,7 @@ dotrap(void) in_dotrap++; for (;;) { + pendingsigs = 0; for (i = 1; i < NSIG; i++) { if (gotsig[i]) { gotsig[i] = 0; @@ -467,7 +468,6 @@ dotrap(void) break; } in_dotrap--; - pendingsigs = 0; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 11:26:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05E08106564A; Sun, 15 Jul 2012 11:26: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 E584B8FC18; Sun, 15 Jul 2012 11:26:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FBQO3V044684; Sun, 15 Jul 2012 11:26:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FBQO7X044682; Sun, 15 Jul 2012 11:26:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207151126.q6FBQO7X044682@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Jul 2012 11:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238478 - stable/9/usr.bin/stat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 11:26:25 -0000 Author: brueffer Date: Sun Jul 15 11:26:24 2012 New Revision: 238478 URL: http://svn.freebsd.org/changeset/base/238478 Log: MFC: r234577 Remove duplicate -l description. Approved by: re (kib) Modified: stable/9/usr.bin/stat/stat.1 Directory Properties: stable/9/usr.bin/stat/ (props changed) Modified: stable/9/usr.bin/stat/stat.1 ============================================================================== --- stable/9/usr.bin/stat/stat.1 Sun Jul 15 11:18:52 2012 (r238477) +++ stable/9/usr.bin/stat/stat.1 Sun Jul 15 11:26:24 2012 (r238478) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 5, 2010 +.Dd April 22, 2012 .Dt STAT 1 .Os .Sh NAME @@ -140,10 +140,6 @@ If the link is broken or the target does fall back on .Xr lstat 2 and report information about the link. -.It Fl l -Display output in -.Ic ls Fl lT -format. .It Fl n Do not force a newline to appear at the end of each piece of output. .It Fl q From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 11:27:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6C9A1065677; Sun, 15 Jul 2012 11:27:15 +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 B0C4C8FC1F; Sun, 15 Jul 2012 11:27:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FBRF0d044758; Sun, 15 Jul 2012 11:27:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FBRFR9044756; Sun, 15 Jul 2012 11:27:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207151127.q6FBRFR9044756@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 15 Jul 2012 11:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238479 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 11:27:15 -0000 Author: bz Date: Sun Jul 15 11:27:15 2012 New Revision: 238479 URL: http://svn.freebsd.org/changeset/base/238479 Log: MFC r238248: Implement handling of "atomic fragements" as outlined in draft-gont-6man-ipv6-atomic-fragments to mitigate one class of possible fragmentation-based attacks. Approved by: re (kib) Modified: stable/9/sys/netinet6/frag6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/frag6.c ============================================================================== --- stable/9/sys/netinet6/frag6.c Sun Jul 15 11:26:24 2012 (r238478) +++ stable/9/sys/netinet6/frag6.c Sun Jul 15 11:27:15 2012 (r238479) @@ -221,6 +221,19 @@ frag6_input(struct mbuf **mp, int *offp, /* offset now points to data portion */ offset += sizeof(struct ip6_frag); + /* + * XXX-BZ RFC XXXX (draft-gont-6man-ipv6-atomic-fragments) + * Handle "atomic" fragments (offset and m bit set to 0) upfront, + * unrelated to any reassembly. Just skip the fragment header. + */ + if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) { + /* XXX-BZ we want dedicated counters for this. */ + V_ip6stat.ip6s_reassembled++; + in6_ifstat_inc(dstifp, ifs6_reass_ok); + *offp = offset; + return (ip6f->ip6f_nxt); + } + IP6Q_LOCK(); /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 11:28:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05D141065670; Sun, 15 Jul 2012 11:28:04 +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 E4E3A8FC1A; Sun, 15 Jul 2012 11:28:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FBS3iR044836; Sun, 15 Jul 2012 11:28:03 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FBS34j044834; Sun, 15 Jul 2012 11:28:03 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207151128.q6FBS34j044834@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Jul 2012 11:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238480 - stable/8/usr.bin/stat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 11:28:04 -0000 Author: brueffer Date: Sun Jul 15 11:28:03 2012 New Revision: 238480 URL: http://svn.freebsd.org/changeset/base/238480 Log: MFC: r234577 Remove duplicate -l description. Modified: stable/8/usr.bin/stat/stat.1 Directory Properties: stable/8/usr.bin/stat/ (props changed) Modified: stable/8/usr.bin/stat/stat.1 ============================================================================== --- stable/8/usr.bin/stat/stat.1 Sun Jul 15 11:27:15 2012 (r238479) +++ stable/8/usr.bin/stat/stat.1 Sun Jul 15 11:28:03 2012 (r238480) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 5, 2010 +.Dd April 22, 2012 .Dt STAT 1 .Os .Sh NAME @@ -140,10 +140,6 @@ If the link is broken or the target does fall back on .Xr lstat 2 and report information about the link. -.It Fl l -Display output in -.Ic ls Fl lT -format. .It Fl n Do not force a newline to appear at the end of each piece of output. .It Fl q From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 11:39:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DB29106564A; Sun, 15 Jul 2012 11:39:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 647DB8FC16; Sun, 15 Jul 2012 11:39:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FBdaPc045364; Sun, 15 Jul 2012 11:39:36 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FBda4c045344; Sun, 15 Jul 2012 11:39:36 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201207151139.q6FBda4c045344@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 15 Jul 2012 11:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238481 - in stable/9: . bin/rcp etc include lib/libcrypt lib/libutil libexec/rshd release/picobsd/tinyware/passwd share/examples/etc sys/mips/rmi usr.bin/login usr.bin/passwd usr.bin/r... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 11:39:36 -0000 Author: des Date: Sun Jul 15 11:39:35 2012 New Revision: 238481 URL: http://svn.freebsd.org/changeset/base/238481 Log: MFH r236751: document sha256 / sha512 support MFH r236892: remove mention of auth.conf from programs that don't use it MFH r236963: remove dead code relating to auth.conf MFH r236965 r236966 r236967 r237005 r237006 r237011: retire auth.conf Approved by: re Deleted: stable/9/etc/auth.conf stable/9/lib/libutil/auth.3 stable/9/lib/libutil/auth.conf.5 Modified: stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/bin/rcp/rcp.1 stable/9/etc/Makefile stable/9/include/paths.h stable/9/lib/libcrypt/Makefile stable/9/lib/libcrypt/crypt.3 stable/9/lib/libcrypt/crypt.c stable/9/lib/libutil/Makefile stable/9/lib/libutil/auth.c stable/9/lib/libutil/login.conf.5 stable/9/lib/libutil/property.3 stable/9/libexec/rshd/rshd.8 stable/9/release/picobsd/tinyware/passwd/passwd.c stable/9/share/examples/etc/README.examples stable/9/sys/mips/rmi/rootfs_list.txt stable/9/usr.bin/login/login.1 stable/9/usr.bin/passwd/passwd.1 stable/9/usr.bin/rlogin/rlogin.1 stable/9/usr.bin/rsh/rsh.1 Directory Properties: stable/9/ (props changed) stable/9/bin/rcp/ (props changed) stable/9/etc/ (props changed) stable/9/include/ (props changed) stable/9/lib/libcrypt/ (props changed) stable/9/lib/libutil/ (props changed) stable/9/libexec/rshd/ (props changed) stable/9/release/picobsd/tinyware/passwd/ (props changed) stable/9/share/examples/etc/ (props changed) stable/9/sys/ (props changed) stable/9/usr.bin/login/ (props changed) stable/9/usr.bin/passwd/ (props changed) stable/9/usr.bin/rlogin/ (props changed) stable/9/usr.bin/rsh/ (props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/ObsoleteFiles.inc Sun Jul 15 11:39:35 2012 (r238481) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20120713: auth.conf removed +OLD_FILES+=etc/auth.conf +OLD_FILES+=usr/share/examples/etc/auth.conf +OLD_FILES+=usr/share/man/man3/auth.3.gz +OLD_FILES+=usr/share/man/man5/auth.conf.5.gz # 20120415: new clang import which bumps version from 3.0 to 3.1 OLD_FILES+=usr/include/clang/3.0/altivec.h OLD_FILES+=usr/include/clang/3.0/avxintrin.h Modified: stable/9/bin/rcp/rcp.1 ============================================================================== --- stable/9/bin/rcp/rcp.1 Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/bin/rcp/rcp.1 Sun Jul 15 11:39:35 2012 (r238481) @@ -116,17 +116,11 @@ The .Nm utility handles third party copies, where neither source nor target files are on the current machine. -.Sh FILES -.Bl -tag -width ".Pa /etc/auth.conf" -compact -.It Pa /etc/auth.conf -configure authentication services -.El .Sh SEE ALSO .Xr cp 1 , .Xr ftp 1 , .Xr rlogin 1 , .Xr rsh 1 , -.Xr auth.conf 5 , .Xr hosts.equiv 5 .Sh HISTORY The Modified: stable/9/etc/Makefile ============================================================================== --- stable/9/etc/Makefile Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/etc/Makefile Sun Jul 15 11:39:35 2012 (r238481) @@ -7,18 +7,47 @@ SUBDIR= sendmail .endif -BIN1= auth.conf \ - crontab devd.conf devfs.conf \ - ddb.conf dhclient.conf disktab fbtab \ - ftpusers gettytab group \ - hosts hosts.allow hosts.equiv \ - inetd.conf libalias.conf login.access login.conf mac.conf motd \ - netconfig network.subr networks newsyslog.conf nsswitch.conf \ - phones profile protocols \ - rc rc.bsdextended rc.firewall rc.initdiskless \ - rc.sendmail rc.shutdown \ - rc.subr remote rpc services shells \ - sysctl.conf syslog.conf termcap.small +BIN1= crontab \ + devd.conf \ + devfs.conf \ + ddb.conf \ + dhclient.conf \ + disktab \ + fbtab \ + ftpusers \ + gettytab \ + group \ + hosts \ + hosts.allow \ + hosts.equiv \ + inetd.conf \ + libalias.conf \ + login.access \ + login.conf \ + mac.conf \ + motd \ + netconfig \ + network.subr \ + networks \ + newsyslog.conf \ + nsswitch.conf \ + phones \ + profile \ + protocols \ + rc \ + rc.bsdextended \ + rc.firewall \ + rc.initdiskless \ + rc.sendmail \ + rc.shutdown \ + rc.subr \ + remote \ + rpc \ + services \ + shells \ + sysctl.conf \ + syslog.conf \ + termcap.small .if exists(${.CURDIR}/etc.${MACHINE}/ttys) BIN1+= etc.${MACHINE}/ttys Modified: stable/9/include/paths.h ============================================================================== --- stable/9/include/paths.h Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/include/paths.h Sun Jul 15 11:39:35 2012 (r238481) @@ -42,7 +42,6 @@ /* Locate system binaries. */ #define _PATH_SYSPATH "/sbin:/usr/sbin" -#define _PATH_AUTHCONF "/etc/auth.conf" #define _PATH_BSHELL "/bin/sh" #define _PATH_CAPABILITY "/etc/capability" #define _PATH_CAPABILITY_DB "/etc/capability.db" Modified: stable/9/lib/libcrypt/Makefile ============================================================================== --- stable/9/lib/libcrypt/Makefile Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/lib/libcrypt/Makefile Sun Jul 15 11:39:35 2012 (r238481) @@ -26,11 +26,7 @@ SRCS+= crypt-des.c crypt-blowfish.c blo CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BLOWFISH .endif -# And the auth_getval() code and support. -.PATH: ${.CURDIR}/../libutil -SRCS+= auth.c property.c -.for sym in auth_getval property_find properties_read properties_free \ - MD4Init MD4Final MD4Update MD4Pad \ +.for sym in MD4Init MD4Final MD4Update MD4Pad \ MD5Init MD5Final MD5Update MD5Pad \ SHA256_Init SHA256_Final SHA256_Update \ SHA512_Init SHA512_Final SHA512_Update Modified: stable/9/lib/libcrypt/crypt.3 ============================================================================== --- stable/9/lib/libcrypt/crypt.3 Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/lib/libcrypt/crypt.3 Sun Jul 15 11:39:35 2012 (r238481) @@ -242,12 +242,6 @@ The .Fn crypt_set_format function sets the default encoding format according to the supplied .Fa string . -.Pp -The global default format can be set using the -.Pa /etc/auth.conf -file using the -.Va crypt_default -property. .Sh RETURN VALUES The .Fn crypt @@ -264,9 +258,7 @@ Otherwise, a value of 0 is returned. .Sh SEE ALSO .Xr login 1 , .Xr passwd 1 , -.Xr auth_getval 3 , .Xr getpass 3 , -.Xr auth.conf 5 , .Xr passwd 5 .Sh HISTORY A rotor-based Modified: stable/9/lib/libcrypt/crypt.c ============================================================================== --- stable/9/lib/libcrypt/crypt.c Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/lib/libcrypt/crypt.c Sun Jul 15 11:39:35 2012 (r238481) @@ -79,23 +79,23 @@ static const struct { } }; +#ifdef HAS_DES +#define CRYPT_DEFAULT "des" +#else +#define CRYPT_DEFAULT "md5" +#endif + static int crypt_type = -1; static void crypt_setdefault(void) { - char *def; size_t i; if (crypt_type != -1) return; - def = auth_getval("crypt_default"); - if (def == NULL) { - crypt_type = 0; - return; - } for (i = 0; i < sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) { - if (strcmp(def, crypt_types[i].name) == 0) { + if (strcmp(CRYPT_DEFAULT, crypt_types[i].name) == 0) { crypt_type = (int)i; return; } Modified: stable/9/lib/libutil/Makefile ============================================================================== --- stable/9/lib/libutil/Makefile Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/lib/libutil/Makefile Sun Jul 15 11:39:35 2012 (r238481) @@ -8,7 +8,7 @@ SHLIBDIR?= /lib LIB= util SHLIB_MAJOR= 9 -SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c gr_util.c \ +SRCS= _secure_path.c expand_number.c flopen.c fparseln.c gr_util.c \ hexdump.c humanize_number.c kinfo_getfile.c kinfo_getfile.c \ kinfo_getallproc.c kinfo_getproc.c kinfo_getvmmap.c kld.c \ login_auth.c login_cap.c \ @@ -27,16 +27,15 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../li MAN+= kld.3 login_auth.3 login_tty.3 pty.3 \ login_cap.3 login_class.3 login_times.3 login_ok.3 \ - _secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \ + _secure_path.3 uucplock.3 property.3 realhostname.3 \ realhostname_sa.3 trimdomain.3 fparseln.3 humanize_number.3 \ pidfile.3 flopen.3 expand_number.3 hexdump.3 \ kinfo_getfile.3 kinfo_getallproc.3 kinfo_getproc.3 \ kinfo_getvmmap.3 quotafile.3 -MAN+= login.conf.5 auth.conf.5 +MAN+= login.conf.5 MLINKS+= kld.3 kld_isloaded.3 kld.3 kld_load.3 MLINKS+= property.3 properties_read.3 property.3 properties_free.3 MLINKS+= property.3 property_find.3 -MLINKS+= auth.3 auth_getval.3 MLINKS+= pty.3 openpty.3 pty.3 forkpty.3 MLINKS+=login_cap.3 login_getclassbyname.3 login_cap.3 login_close.3 \ login_cap.3 login_getclass.3 login_cap.3 login_getuserclass.3 \ Modified: stable/9/lib/libutil/auth.c ============================================================================== --- stable/9/lib/libutil/auth.c Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/lib/libutil/auth.c Sun Jul 15 11:39:35 2012 (r238481) @@ -31,40 +31,14 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include -#include -#include -#include - -static properties P; - -static int -initauthconf(const char *path) -{ - int fd; +#include - if (!P) { - if ((fd = open(path, O_RDONLY)) < 0) { - syslog(LOG_ERR, "initauthconf: unable to open file: %s", path); - return 1; - } - P = properties_read(fd); - close(fd); - if (!P) { - syslog(LOG_ERR, "initauthconf: unable to parse file: %s", path); - return 1; - } - } - return 0; -} +#include char * auth_getval(const char *name) { - if (!P && initauthconf(_PATH_AUTHCONF)) - return NULL; - else - return property_find(P, name); + + (void)name; + return (NULL); } Modified: stable/9/lib/libutil/login.conf.5 ============================================================================== --- stable/9/lib/libutil/login.conf.5 Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/lib/libutil/login.conf.5 Sun Jul 15 11:39:35 2012 (r238481) @@ -269,7 +269,9 @@ multiplied by 5 seconds. allowed before the login fails. .It "passwd_format string md5 The encryption format that new or changed passwords will use. -Valid values include "des", "md5" and "blf". +Valid values include "des", "md5", "blf", "sha256" and "sha512"; see +.Xr crypt 3 +for details. NIS clients using a .No non- Ns Fx NIS server should probably use "des". Modified: stable/9/lib/libutil/property.3 ============================================================================== --- stable/9/lib/libutil/property.3 Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/lib/libutil/property.3 Sun Jul 15 11:39:35 2012 (r238481) @@ -91,8 +91,6 @@ are desired, the entire value should be characters. Any line beginning with a # or ; character is assumed to be a comment and will be ignored. -.Sh SEE ALSO -.Xr auth_getval 3 .Sh AUTHORS .An Jordan Hubbard .Sh BUGS Modified: stable/9/libexec/rshd/rshd.8 ============================================================================== --- stable/9/libexec/rshd/rshd.8 Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/libexec/rshd/rshd.8 Sun Jul 15 11:39:35 2012 (r238481) @@ -237,7 +237,6 @@ and is not preceded by a flag byte. .Xr gethostbyaddr 3 , .Xr rcmd 3 , .Xr ruserok 3 , -.Xr auth.conf 5 , .Xr hosts 5 , .Xr hosts.equiv 5 , .Xr login.conf 5 , Modified: stable/9/release/picobsd/tinyware/passwd/passwd.c ============================================================================== --- stable/9/release/picobsd/tinyware/passwd/passwd.c Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/release/picobsd/tinyware/passwd/passwd.c Sun Jul 15 11:39:35 2012 (r238481) @@ -64,10 +64,6 @@ int yp_errno = YP_TRUE; extern int yp_passwd( char * ); #endif -#ifdef KERBEROS -#include "krb.h" -#endif - #include "extern.h" static void usage(void); @@ -81,26 +77,12 @@ main(argc, argv) { int ch; char *uname; -#ifdef KERBEROS - char *iflag = 0, *rflag = 0, *uflag = 0; - char *k; -#endif #ifdef YP -#ifdef KERBEROS - char realm[REALM_SZ]; -#define OPTIONS "d:h:lysfoi:r:u:" -#else #define OPTIONS "d:h:lysfo" -#endif -#else -#ifdef KERBEROS - char realm[REALM_SZ]; -#define OPTIONS "li:r:u:" #else #define OPTIONS "l" #endif -#endif #ifdef YP int res = 0; @@ -113,17 +95,6 @@ main(argc, argv) case 'l': /* change local password file */ use_local_passwd = 1; break; -#ifdef KERBEROS - case 'i': - iflag = optarg; - break; - case 'r': - rflag = optarg; - break; - case 'u': - uflag = optarg; - break; -#endif /* KERBEROS */ #ifdef YP case 'y': /* Change NIS password */ __use_yp = 1; @@ -182,46 +153,29 @@ main(argc, argv) /* * If NIS is turned on in the password database, use it, else punt. */ -#ifdef KERBEROS - if (__use_yp || (iflag == NULL && rflag == NULL && uflag == NULL)) { -#endif - res = use_yp(uname, 0, 0); - if (res == USER_YP_ONLY) { - if (!use_local_passwd) { - exit(yp_passwd(uname)); - } else { + res = use_yp(uname, 0, 0); + if (res == USER_YP_ONLY) { + if (!use_local_passwd) { + exit(yp_passwd(uname)); + } else { /* * Reject -l flag if NIS is turned on and the user * doesn't exist in the local password database. */ - errx(1, "unknown local user: %s", uname); - } - } else if (res == USER_LOCAL_ONLY) { - /* - * Reject -y flag if user only exists locally. - */ - if (__use_yp) - errx(1, "unknown NIS user: %s", uname); - } else if (res == USER_YP_AND_LOCAL) { - if (!use_local_passwd && (yp_in_pw_file || __use_yp)) - exit(yp_passwd(uname)); + errx(1, "unknown local user: %s", uname); } -#ifdef KERBEROS + } else if (res == USER_LOCAL_ONLY) { + /* + * Reject -y flag if user only exists locally. + */ + if (__use_yp) + errx(1, "unknown NIS user: %s", uname); + } else if (res == USER_YP_AND_LOCAL) { + if (!use_local_passwd && (yp_in_pw_file || __use_yp)) + exit(yp_passwd(uname)); } #endif -#endif - if (!use_local_passwd) { -#ifdef KERBEROS - k = auth_getval("auth_list"); - if (k && strstr(k, "kerberos")) - if(krb_get_lrealm(realm, 0) == KSUCCESS) { - setuid(getuid()); - fprintf(stderr, "realm %s\n", realm); - exit(krb_passwd(argv[0], iflag, rflag, uflag)); - } -#endif - } exit(local_passwd(uname)); } @@ -230,21 +184,10 @@ usage() { #ifdef YP -#ifdef KERBEROS - fprintf(stderr, "%s\n%s\n", - "usage: passwd [-l] [-i instance] [-r realm] [-u fullname]", - " passwd [-l] [-y] [-o] [-d domain [-h host]] [user]"); -#else (void)fprintf(stderr, "usage: passwd [-l] [-y] [-o] [-d domain [-h host]] [user]\n"); -#endif #else -#ifdef KERBEROS - fprintf(stderr, - "usage: passwd [-l] [-i instance] [-r realm] [-u fullname] [user]\n"); -#else - (void)fprintf(stderr, "usage: passwd user\n"); -#endif + (void)fprintf(stderr, "usage: passwd [-l] user\n"); #endif exit(1); } Modified: stable/9/share/examples/etc/README.examples ============================================================================== --- stable/9/share/examples/etc/README.examples Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/share/examples/etc/README.examples Sun Jul 15 11:39:35 2012 (r238481) @@ -9,7 +9,6 @@ This directory contains the following fi amd.map - filesystem automounter lookup resolution map (see amd(8)) apmd.conf - configuration file for apmd(8) -auth.conf - authentication capability database (see auth.conf(5)) bsd-style-copyright - copyright style for bsd system crontab - system scheduled command table (see crontab(5)) csh.cshrc - sample .cshrc (see csh(1)) Modified: stable/9/sys/mips/rmi/rootfs_list.txt ============================================================================== --- stable/9/sys/mips/rmi/rootfs_list.txt Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/sys/mips/rmi/rootfs_list.txt Sun Jul 15 11:39:35 2012 (r238481) @@ -1,3 +1,5 @@ +# $FreeBSD$ +# # This is the list of files that # should be in your rootfs (copy it from # the build world nfsmount dir. When the rge0 @@ -321,7 +323,6 @@ ./etc/ssh/moduli ./etc/ssl ./etc/ssl/openssl.cnf -./etc/auth.conf ./etc/crontab ./etc/devd.conf ./etc/devfs.conf Modified: stable/9/usr.bin/login/login.1 ============================================================================== --- stable/9/usr.bin/login/login.1 Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/usr.bin/login/login.1 Sun Jul 15 11:39:35 2012 (r238481) @@ -137,8 +137,6 @@ message-of-the-day system mailboxes .It Pa \&.hushlogin makes login quieter -.It Pa /etc/auth.conf -configure authentication services .It Pa /etc/pam.d/login .Xr pam 8 configuration file Modified: stable/9/usr.bin/passwd/passwd.1 ============================================================================== --- stable/9/usr.bin/passwd/passwd.1 Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/usr.bin/passwd/passwd.1 Sun Jul 15 11:39:35 2012 (r238481) @@ -221,8 +221,6 @@ a Version 7 format password file temporary copy of the password file .It Pa /etc/login.conf login class capabilities database -.It Pa /etc/auth.conf -configure authentication services .El .Sh SEE ALSO .Xr chpass 1 , Modified: stable/9/usr.bin/rlogin/rlogin.1 ============================================================================== --- stable/9/usr.bin/rlogin/rlogin.1 Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/usr.bin/rlogin/rlogin.1 Sun Jul 15 11:39:35 2012 (r238481) @@ -128,7 +128,6 @@ Determines the user's terminal type. .Bl -tag -width /etc/hosts -compact .It Pa /etc/hosts .It Pa /etc/hosts.equiv -.It Pa /etc/auth.conf .It Ev $HOME Ns Pa /.rhosts .El .Sh SEE ALSO @@ -138,7 +137,6 @@ Determines the user's terminal type. .Xr setsockopt 2 , .Xr ruserok 3 , .Xr tty 4 , -.Xr auth.conf 5 , .Xr hosts 5 , .Xr hosts.equiv 5 , .Xr rlogind 8 , Modified: stable/9/usr.bin/rsh/rsh.1 ============================================================================== --- stable/9/usr.bin/rsh/rsh.1 Sun Jul 15 11:28:03 2012 (r238480) +++ stable/9/usr.bin/rsh/rsh.1 Sun Jul 15 11:39:35 2012 (r238481) @@ -125,14 +125,12 @@ to .Sh FILES .Bl -tag -width /etc/hosts -compact .It Pa /etc/hosts -.It Pa /etc/auth.conf .El .Sh SEE ALSO .Xr rlogin 1 , .Xr setsockopt 2 , .Xr rcmd 3 , .Xr ruserok 3 , -.Xr auth.conf 5 , .Xr hosts 5 , .Xr hosts.equiv 5 , .Xr rlogind 8 , From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 11:39:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E2861065673; Sun, 15 Jul 2012 11:39:57 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F331F8FC12; Sun, 15 Jul 2012 11:39:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FBduqB045417; Sun, 15 Jul 2012 11:39:56 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FBduP0045411; Sun, 15 Jul 2012 11:39:56 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201207151139.q6FBduP0045411@svn.freebsd.org> From: Isabell Long Date: Sun, 15 Jul 2012 11:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238482 - in stable/9/lib/libc: stdlib stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 11:39:57 -0000 Author: issyl0 (doc committer) Date: Sun Jul 15 11:39:56 2012 New Revision: 238482 URL: http://svn.freebsd.org/changeset/base/238482 Log: MFC r237573: Add more locale-specific functions to the relevant man pages and Makefiles: - libc/stdtime/strftime.3 - libc/stdtime/strptime.3 - libc/stdlib/strfmon.3 Approved by: gabor (mentor) Approved by: re (kib) Modified: stable/9/lib/libc/stdlib/Makefile.inc stable/9/lib/libc/stdlib/strfmon.3 stable/9/lib/libc/stdtime/Makefile.inc stable/9/lib/libc/stdtime/strftime.3 stable/9/lib/libc/stdtime/strptime.3 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) Modified: stable/9/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/9/lib/libc/stdlib/Makefile.inc Sun Jul 15 11:39:35 2012 (r238481) +++ stable/9/lib/libc/stdlib/Makefile.inc Sun Jul 15 11:39:56 2012 (r238482) @@ -42,6 +42,7 @@ MLINKS+=rand.3 rand_r.3 rand.3 srand.3 r MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \ random.3 srandomdev.3 MLINKS+=radixsort.3 sradixsort.3 +MLINKS+=strfmon.3 strfmon_l.3 MLINKS+=strtod.3 strtof.3 strtod.3 strtold.3 MLINKS+=strtol.3 strtoll.3 strtol.3 strtoq.3 strtol.3 strtoimax.3 MLINKS+=strtoul.3 strtoull.3 strtoul.3 strtouq.3 strtoul.3 strtoumax.3 Modified: stable/9/lib/libc/stdlib/strfmon.3 ============================================================================== --- stable/9/lib/libc/stdlib/strfmon.3 Sun Jul 15 11:39:35 2012 (r238481) +++ stable/9/lib/libc/stdlib/strfmon.3 Sun Jul 15 11:39:56 2012 (r238482) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2002 +.Dd June 25, 2012 .Dt STRFMON 3 .Os .Sh NAME @@ -36,6 +36,8 @@ .In monetary.h .Ft ssize_t .Fn strfmon "char * restrict s" "size_t maxsize" "const char * restrict format" "..." +.Ft ssize_t +.Fn strfmon_l "char * restrict s" "size_t maxsize" "locale_t loc" "const char * restrict format" "..." .Sh DESCRIPTION The .Fn strfmon @@ -47,6 +49,12 @@ No more than .Fa maxsize bytes are placed into the array. .Pp +The +.Fn strfmon_l +function does the same as +.Fn strfmon +but takes an explicit locale rather than using the current locale. +.Pp The format string is composed of zero or more directives: ordinary characters (not .Cm % ) , @@ -129,6 +137,11 @@ the contents of the array are indetermin and .Va errno is set to indicate the error. +.Pp +The +.Fn strfmon_l +function returns the same values as +.Fn strfmon . .Sh ERRORS The .Fn strfmon @@ -149,6 +162,10 @@ The function conforms to .St -p1003.1-2001 . +The +.Fn strfmon_l +function conforms to +.St -p1003.1-2008 . .Sh AUTHORS .An -nosplit The Modified: stable/9/lib/libc/stdtime/Makefile.inc ============================================================================== --- stable/9/lib/libc/stdtime/Makefile.inc Sun Jul 15 11:39:35 2012 (r238481) +++ stable/9/lib/libc/stdtime/Makefile.inc Sun Jul 15 11:39:56 2012 (r238482) @@ -18,4 +18,6 @@ MLINKS+=ctime.3 asctime.3 ctime.3 diffti ctime.3 localtime.3 ctime.3 mktime.3 ctime.3 timegm.3 \ ctime.3 ctime_r.3 ctime.3 localtime_r.3 ctime.3 gmtime_r.3 \ ctime.3 asctime_r.3 +MLINKS+=strftime.3 strftime_l.3 +MLINKS+=strptime.3 strptime_l.3 MLINKS+=time2posix.3 posix2time.3 Modified: stable/9/lib/libc/stdtime/strftime.3 ============================================================================== --- stable/9/lib/libc/stdtime/strftime.3 Sun Jul 15 11:39:35 2012 (r238481) +++ stable/9/lib/libc/stdtime/strftime.3 Sun Jul 15 11:39:56 2012 (r238482) @@ -32,7 +32,7 @@ .\" @(#)strftime.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 4, 2004 +.Dd June 25, 2012 .Dt STRFTIME 3 .Os .Sh NAME @@ -49,6 +49,8 @@ .Fa "const char * restrict format" .Fa "const struct tm * restrict timeptr" .Fc +.Ft size_t +.Fn strftime_l "char *restrict buf" "size_t maxsize" "const char * restrict format" "const struct tm *restrict timeptr" "locale_t loc" .Sh DESCRIPTION The .Fn strftime @@ -58,6 +60,11 @@ into the buffer .Fa buf according to the string pointed to by .Fa format . +The function +.Fn strftime_l +does the same as +.Fn strftime +but takes an explicit locale rather than using the current locale. .Pp The .Fa format @@ -268,6 +275,10 @@ The peculiar week number and year in the and .Ql \&%V are defined in ISO 8601: 1988. +The +.Fn strftime_l +function conforms to +.St -p1003.1-2008 . .Sh BUGS There is no conversion specification for the phase of the moon. .Pp Modified: stable/9/lib/libc/stdtime/strptime.3 ============================================================================== --- stable/9/lib/libc/stdtime/strptime.3 Sun Jul 15 11:39:35 2012 (r238481) +++ stable/9/lib/libc/stdtime/strptime.3 Sun Jul 15 11:39:56 2012 (r238482) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" " -.Dd January 4, 2003 +.Dd June 25, 2012 .Dt STRPTIME 3 .Os .Sh NAME @@ -41,6 +41,10 @@ .Fa "const char * restrict format" .Fa "struct tm * restrict timeptr" .Fc +.In time.h +.In xlocale.h +.Ft char * +.Fn strptime_l "const char * restrict buf" "const char * restrict format" "struct tm * restrict timeptr" "locale_t loc" .Sh DESCRIPTION The .Fn strptime @@ -53,6 +57,11 @@ and fills in the elements of the structu The resulting values will be relative to the local time zone. Thus, it can be considered the reverse operation of .Xr strftime 3 . +The +.Fn strptime_l +function does the same as +.Fn strptime , +but takes an explicit locale rather than using the current locale. .Pp The .Fa format @@ -104,6 +113,9 @@ that has not been required to satisfy th It returns .Dv NULL if one of the conversions failed. +.Fn strptime_l +returns the same values as +.Fn strptime . .Sh SEE ALSO .Xr date 1 , .Xr scanf 3 , From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 11:52:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E90A41065673; Sun, 15 Jul 2012 11:52:24 +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 D488A8FC0A; Sun, 15 Jul 2012 11:52:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FBqO2P046000; Sun, 15 Jul 2012 11:52:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FBqOEc045998; Sun, 15 Jul 2012 11:52:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207151152.q6FBqOEc045998@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Jul 2012 11:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238483 - head/lib/libc/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 11:52:25 -0000 Author: brueffer Date: Sun Jul 15 11:52:24 2012 New Revision: 238483 URL: http://svn.freebsd.org/changeset/base/238483 Log: Jump to the failed label instead of doing cleanup ourselves. Obtained from: DragonFly BSD MFC after: 2 weeks Modified: head/lib/libc/rpc/getnetpath.c Modified: head/lib/libc/rpc/getnetpath.c ============================================================================== --- head/lib/libc/rpc/getnetpath.c Sun Jul 15 11:39:56 2012 (r238482) +++ head/lib/libc/rpc/getnetpath.c Sun Jul 15 11:52:24 2012 (r238483) @@ -99,9 +99,8 @@ setnetpath() return (NULL); } if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) { - free(np_sessionp); syslog (LOG_ERR, "rpc: failed to open " NETCONFIG); - return (NULL); + goto failed; } np_sessionp->valid = NP_VALID; np_sessionp->ncp_list = NULL; From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 12:00:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8097D106564A; Sun, 15 Jul 2012 12:00:48 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EE928FC17; Sun, 15 Jul 2012 12:00:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FC0m8D046386; Sun, 15 Jul 2012 12:00:48 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FC0lxY046383; Sun, 15 Jul 2012 12:00:47 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201207151200.q6FC0lxY046383@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 15 Jul 2012 12:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238484 - in stable/9: etc lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 12:00:48 -0000 Author: des Date: Sun Jul 15 12:00:47 2012 New Revision: 238484 URL: http://svn.freebsd.org/changeset/base/238484 Log: MFH r237269: switch default password hash to sha512. Approved by: re Modified: stable/9/etc/login.conf stable/9/lib/libutil/login.conf.5 Directory Properties: stable/9/etc/ (props changed) stable/9/lib/libutil/ (props changed) Modified: stable/9/etc/login.conf ============================================================================== --- stable/9/etc/login.conf Sun Jul 15 11:52:24 2012 (r238483) +++ stable/9/etc/login.conf Sun Jul 15 12:00:47 2012 (r238484) @@ -23,7 +23,7 @@ # AND SEMANTICS'' section of getcap(3) for more escape sequences). default:\ - :passwd_format=md5:\ + :passwd_format=sha512:\ :copyright=/etc/COPYRIGHT:\ :welcome=/etc/motd:\ :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\ Modified: stable/9/lib/libutil/login.conf.5 ============================================================================== --- stable/9/lib/libutil/login.conf.5 Sun Jul 15 11:52:24 2012 (r238483) +++ stable/9/lib/libutil/login.conf.5 Sun Jul 15 12:00:47 2012 (r238484) @@ -267,7 +267,7 @@ The backoff delay is the number of tries multiplied by 5 seconds. .It "login-retries number 10 The number of login attempts allowed before the login fails. -.It "passwd_format string md5 The encryption format that new or +.It "passwd_format string sha512 The encryption format that new or" changed passwords will use. Valid values include "des", "md5", "blf", "sha256" and "sha512"; see .Xr crypt 3 From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 12:13:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47A921065673; Sun, 15 Jul 2012 12:13:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 326CB8FC0C; Sun, 15 Jul 2012 12:13:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FCDGEa047018; Sun, 15 Jul 2012 12:13:16 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FCDFEv047016; Sun, 15 Jul 2012 12:13:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201207151213.q6FCDFEv047016@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 15 Jul 2012 12:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238485 - stable/9/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 12:13:16 -0000 Author: des Date: Sun Jul 15 12:13:15 2012 New Revision: 238485 URL: http://svn.freebsd.org/changeset/base/238485 Log: MFH r237270: no need to specify passive mode, it is the default. Approved by: re Modified: stable/9/etc/login.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/login.conf ============================================================================== --- stable/9/etc/login.conf Sun Jul 15 12:00:47 2012 (r238484) +++ stable/9/etc/login.conf Sun Jul 15 12:13:15 2012 (r238485) @@ -26,7 +26,7 @@ default:\ :passwd_format=sha512:\ :copyright=/etc/COPYRIGHT:\ :welcome=/etc/motd:\ - :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\ + :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ :path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\ :nologin=/var/run/nologin:\ :cputime=unlimited:\ From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 14:40:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 723C31065670; Sun, 15 Jul 2012 14:40:50 +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 2341F8FC14; Sun, 15 Jul 2012 14:40:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FEensZ053148; Sun, 15 Jul 2012 14:40:49 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FEenD6053146; Sun, 15 Jul 2012 14:40:49 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207151440.q6FEenD6053146@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Jul 2012 14:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238486 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 14:40:51 -0000 Author: brueffer Date: Sun Jul 15 14:40:49 2012 New Revision: 238486 URL: http://svn.freebsd.org/changeset/base/238486 Log: Fix typo in a message. Obtained from: DragonFly BSD (change 7a817ab191e4898404a9037c55850e47d177308c) MFC after: 3 days Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Jul 15 12:13:15 2012 (r238485) +++ head/sys/dev/isp/isp.c Sun Jul 15 14:40:49 2012 (r238486) @@ -2286,7 +2286,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin goto out; } else if (plp->plogx_status != PLOGX_STATUS_IOCBERR) { isp_prt(isp, ISP_LOGWARN, - "status 0x%x on port login IOCB chanel %d", + "status 0x%x on port login IOCB channel %d", plp->plogx_status, chan); rval = -1; goto out; From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 15:22:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16112106566B; Sun, 15 Jul 2012 15:22:14 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01A5E8FC0C; Sun, 15 Jul 2012 15:22:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FFMDkj054985; Sun, 15 Jul 2012 15:22:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FFMDKw054983; Sun, 15 Jul 2012 15:22:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207151522.q6FFMDKw054983@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Jul 2012 15:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238488 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 15:22:14 -0000 Author: jilles Date: Sun Jul 15 15:22:13 2012 New Revision: 238488 URL: http://svn.freebsd.org/changeset/base/238488 Log: ps: Fix memory leak when showing start/lstart for swapped-out process. Spotted by: scan-build (uqs) Modified: head/bin/ps/print.c Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Sun Jul 15 15:00:28 2012 (r238487) +++ head/bin/ps/print.c Sun Jul 15 15:22:13 2012 (r238488) @@ -387,12 +387,13 @@ started(KINFO *k, VARENT *ve __unused) size_t buflen = 100; char *buf; + if (!k->ki_valid) + return (NULL); + buf = malloc(buflen); if (buf == NULL) errx(1, "malloc failed"); - if (!k->ki_valid) - return (NULL); if (use_ampm < 0) use_ampm = (*nl_langinfo(T_FMT_AMPM) != '\0'); then = k->ki_p->ki_start.tv_sec; @@ -415,12 +416,13 @@ lstarted(KINFO *k, VARENT *ve __unused) char *buf; size_t buflen = 100; + if (!k->ki_valid) + return (NULL); + buf = malloc(buflen); if (buf == NULL) errx(1, "malloc failed"); - if (!k->ki_valid) - return (NULL); then = k->ki_p->ki_start.tv_sec; (void)strftime(buf, buflen, "%c", localtime(&then)); return (buf); From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 15:50:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E54C1065670; Sun, 15 Jul 2012 15:50:13 +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 090E28FC17; Sun, 15 Jul 2012 15:50:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FFoCKt056168; Sun, 15 Jul 2012 15:50:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FFoCMo056166; Sun, 15 Jul 2012 15:50:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207151550.q6FFoCMo056166@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Jul 2012 15:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238491 - head/sys/fs/smbfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 15:50:13 -0000 Author: brueffer Date: Sun Jul 15 15:50:12 2012 New Revision: 238491 URL: http://svn.freebsd.org/changeset/base/238491 Log: Save a bzero() by using M_ZERO. Obtained from: Dragonfly BSD (change 4faaf07c3d7ddd120deed007370aaf4d90b72ebb) MFC after: 2 weeks Modified: head/sys/fs/smbfs/smbfs_node.c Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Sun Jul 15 15:23:31 2012 (r238490) +++ head/sys/fs/smbfs/smbfs_node.c Sun Jul 15 15:50:12 2012 (r238491) @@ -223,7 +223,7 @@ loop: if (fap == NULL) return ENOENT; - np = malloc(sizeof *np, M_SMBNODE, M_WAITOK); + np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp); if (error) { free(np, M_SMBNODE); @@ -235,7 +235,6 @@ loop: return (error); } vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG; - bzero(np, sizeof(*np)); vp->v_data = np; np->n_vnode = vp; np->n_mount = VFSTOSMBFS(mp); From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 16:04:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A804C106566C; Sun, 15 Jul 2012 16:04:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id B86C58FC08; Sun, 15 Jul 2012 16:04:25 +0000 (UTC) Received: by eabm6 with SMTP id m6so1528522eab.13 for ; Sun, 15 Jul 2012 09:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=dJr0Yc3z0Cdi/hTHXKPvkf8CPN9eDy5Xc+VtwAYQy3g=; b=Xr/vWzMczi48W8l6KONE/NNSWnxlAQmqY61BTOzGGTo6Saz/RP2n1dYBzou6z761od OrieDi+nAeMDcuqfytgHRcdU1NGdFnrypsi33lbrpOUTTpobqSHouRHm/szxS8xyY1/1 vM6b2aLEvIfMt5/qXzGcGkH0FMhREkQoTS3tmlyxFjbT9dAnPGMlqyQcDjNK8OWWKvgN iIfqToNTW+8odxLQqw5tMZ+2rhvsFMy8X2GirCpdiZh0xGtuokVxkeInC3Jcnwg818+F O4GjzJ5MiFybZdhvffo4X1esfYVeopYl7a7Bf8Lmz0OSIVk1YZwl56st4RxTi6njcYwN QZ6Q== Received: by 10.14.179.193 with SMTP id h41mr5520492eem.2.1342368259376; Sun, 15 Jul 2012 09:04:19 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id t6sm11592785eeo.17.2012.07.15.09.04.17 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 Jul 2012 09:04:17 -0700 (PDT) Date: Sun, 15 Jul 2012 18:04:10 +0200 From: Mateusz Guzik To: Christian Brueffer Message-ID: <20120715160410.GA22600@dft-labs.eu> References: <201207151550.q6FFoCMo056166@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201207151550.q6FFoCMo056166@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238491 - head/sys/fs/smbfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 16:04:26 -0000 On Sun, Jul 15, 2012 at 03:50:12PM +0000, Christian Brueffer wrote: > Author: brueffer > Date: Sun Jul 15 15:50:12 2012 > New Revision: 238491 > URL: http://svn.freebsd.org/changeset/base/238491 > > Log: > Save a bzero() by using M_ZERO. > > Obtained from: Dragonfly BSD (change 4faaf07c3d7ddd120deed007370aaf4d90b72ebb) > MFC after: 2 weeks > > Modified: > head/sys/fs/smbfs/smbfs_node.c > > Modified: head/sys/fs/smbfs/smbfs_node.c > ============================================================================== > --- head/sys/fs/smbfs/smbfs_node.c Sun Jul 15 15:23:31 2012 (r238490) > +++ head/sys/fs/smbfs/smbfs_node.c Sun Jul 15 15:50:12 2012 (r238491) > @@ -223,7 +223,7 @@ loop: > if (fap == NULL) > return ENOENT; > > - np = malloc(sizeof *np, M_SMBNODE, M_WAITOK); > + np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); > error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp); > if (error) { > free(np, M_SMBNODE); > @@ -235,7 +235,6 @@ loop: > return (error); > } > vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG; > - bzero(np, sizeof(*np)); > vp->v_data = np; > np->n_vnode = vp; > np->n_mount = VFSTOSMBFS(mp); How about moving this malloc right before np is actually used? While here some style(9) fixes. http://people.freebsd.org/~mjg/patches/smbfs_node-malloc.patch Completely untested (even compile-time); I guess the idea is clear. :) -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 16:23:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87C261065674; Sun, 15 Jul 2012 16:23:53 +0000 (UTC) (envelope-from SRS0=dIDz=FQ=FreeBSD.org=brueffer@srs.kundenserver.de) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by mx1.freebsd.org (Postfix) with ESMTP id EDCC28FC0C; Sun, 15 Jul 2012 16:23:52 +0000 (UTC) Received: from hd948344f.sedadby.dyn.perspektivbredband.net (hd948344f.sedadby.dyn.perspektivbredband.net [217.72.52.79]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0Lo5Nc-1TW71538My-00gEfU; Sun, 15 Jul 2012 18:23:52 +0200 Message-ID: <5002EE96.2060104@FreeBSD.org> Date: Sun, 15 Jul 2012 18:23:50 +0200 From: Christian Brueffer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Mateusz Guzik References: <201207151550.q6FFoCMo056166@svn.freebsd.org> <20120715160410.GA22600@dft-labs.eu> In-Reply-To: <20120715160410.GA22600@dft-labs.eu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:ntJrFCmH4SHkZS6Z2BSj11SztBHxiAO86bgNnpfhIN9 pYJ4ASILDxf05nCgY/CCuh+QpvGY0YNMgxT1h8xN3EjXjRFnku 8XOD+q+jWAOergx7Bei+yn3dznjYs7gMQd5BcZhjxi5Yt9DI+7 tEX/1wyi0oclqjhjMUl+mJvjEUEjown+9gnqeqIoEp1tsTli5E UjoorYUSV41R+0UWIN12HrgSbX6U+DTINRjINcZ6oIvxyk9Uip E2Hw1kd5a6ZRgtDJPfTTi2n7bGDodALgmdrmFoaN+ewPABvlyl 9WZuSU2UDZvi28KqiEpN13zLHMZ3ATqgdgOBDX0W5m4kDI4QOa v/QZMUMTwSx/BtClQfDJ+rwKnYOHSRYzWSh0rf2VlayjbNOsHp LeaheWd4O2enQ== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238491 - head/sys/fs/smbfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 16:23:53 -0000 On 7/15/12 18:04 , Mateusz Guzik wrote: > On Sun, Jul 15, 2012 at 03:50:12PM +0000, Christian Brueffer wrote: >> Author: brueffer >> Date: Sun Jul 15 15:50:12 2012 >> New Revision: 238491 >> URL: http://svn.freebsd.org/changeset/base/238491 >> >> Log: >> Save a bzero() by using M_ZERO. >> >> Obtained from: Dragonfly BSD (change 4faaf07c3d7ddd120deed007370aaf4d90b72ebb) >> MFC after: 2 weeks >> >> Modified: >> head/sys/fs/smbfs/smbfs_node.c >> >> Modified: head/sys/fs/smbfs/smbfs_node.c >> ============================================================================== >> --- head/sys/fs/smbfs/smbfs_node.c Sun Jul 15 15:23:31 2012 (r238490) >> +++ head/sys/fs/smbfs/smbfs_node.c Sun Jul 15 15:50:12 2012 (r238491) >> @@ -223,7 +223,7 @@ loop: >> if (fap == NULL) >> return ENOENT; >> >> - np = malloc(sizeof *np, M_SMBNODE, M_WAITOK); >> + np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); >> error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp); >> if (error) { >> free(np, M_SMBNODE); >> @@ -235,7 +235,6 @@ loop: >> return (error); >> } >> vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG; >> - bzero(np, sizeof(*np)); >> vp->v_data = np; >> np->n_vnode = vp; >> np->n_mount = VFSTOSMBFS(mp); > > How about moving this malloc right before np is actually used? > While here some style(9) fixes. > > http://people.freebsd.org/~mjg/patches/smbfs_node-malloc.patch > > Completely untested (even compile-time); I guess the idea is clear. :) > Looks good to me. Want to give your shiny new commit bit a spin? ;-) If not, I'll handle it. Chris From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 16:26:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A5E81065674; Sun, 15 Jul 2012 16:26:24 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4CBE58FC08; Sun, 15 Jul 2012 16:26:23 +0000 (UTC) Received: by eabm6 with SMTP id m6so1531091eab.13 for ; Sun, 15 Jul 2012 09:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=WGSoQJkC0P/bfXTjRMB5qtXYTri0iQ7HZJBzquGV4Qw=; b=zNUddLGN9NlHrUseNDzWq2BaTVvXLtHQJmkjVpKYLgCBWvpTQgU/xHAMgSLOaHE0XZ NiBYcCe6FempKJ96wvi24ebQE3uq40Sl4fw2mLQoqiFdL22fFarnG7z1FyPv+Xqe/VTR 4ijM3phx+4q63Ttpm6N0VXTS1JR47JuJnwFnvJoK9NLkNNX+q8wdZDFhfttyFqCkgLN4 36LhsNld07cOfn6hr1G3gLuB5VgpJXL/MUNyjsyr0rftjpA9LGETjkmQkFGU4IwcN0Xy xB82jPHGvuJ1UcF0FqjVWgRuOdyGf3hpstodSl5exUeCsLDQixX+WvfYkJ6NTuOzXYnB Bjog== Received: by 10.14.213.133 with SMTP id a5mr5546892eep.4.1342369582370; Sun, 15 Jul 2012 09:26:22 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id h48sm11703563eem.9.2012.07.15.09.26.21 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 Jul 2012 09:26:21 -0700 (PDT) Date: Sun, 15 Jul 2012 18:26:14 +0200 From: Mateusz Guzik To: Christian Brueffer Message-ID: <20120715162614.GB22600@dft-labs.eu> References: <201207151550.q6FFoCMo056166@svn.freebsd.org> <20120715160410.GA22600@dft-labs.eu> <5002EE96.2060104@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5002EE96.2060104@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238491 - head/sys/fs/smbfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 16:26:24 -0000 On Sun, Jul 15, 2012 at 06:23:50PM +0200, Christian Brueffer wrote: > On 7/15/12 18:04 , Mateusz Guzik wrote: > > On Sun, Jul 15, 2012 at 03:50:12PM +0000, Christian Brueffer wrote: > >> Author: brueffer > >> Date: Sun Jul 15 15:50:12 2012 > >> New Revision: 238491 > >> URL: http://svn.freebsd.org/changeset/base/238491 > >> > >> Log: > >> Save a bzero() by using M_ZERO. > >> > >> Obtained from: Dragonfly BSD (change 4faaf07c3d7ddd120deed007370aaf4d90b72ebb) > >> MFC after: 2 weeks > >> > >> Modified: > >> head/sys/fs/smbfs/smbfs_node.c > >> > >> Modified: head/sys/fs/smbfs/smbfs_node.c > >> ============================================================================== > >> --- head/sys/fs/smbfs/smbfs_node.c Sun Jul 15 15:23:31 2012 (r238490) > >> +++ head/sys/fs/smbfs/smbfs_node.c Sun Jul 15 15:50:12 2012 (r238491) > >> @@ -223,7 +223,7 @@ loop: > >> if (fap == NULL) > >> return ENOENT; > >> > >> - np = malloc(sizeof *np, M_SMBNODE, M_WAITOK); > >> + np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); > >> error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp); > >> if (error) { > >> free(np, M_SMBNODE); > >> @@ -235,7 +235,6 @@ loop: > >> return (error); > >> } > >> vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG; > >> - bzero(np, sizeof(*np)); > >> vp->v_data = np; > >> np->n_vnode = vp; > >> np->n_mount = VFSTOSMBFS(mp); > > > > How about moving this malloc right before np is actually used? > > While here some style(9) fixes. > > > > http://people.freebsd.org/~mjg/patches/smbfs_node-malloc.patch > > > > Completely untested (even compile-time); I guess the idea is clear. :) > > > > Looks good to me. Want to give your shiny new commit bit a spin? ;-) > Not this time, I currently have no way to test it. :) > If not, I'll handle it. > Please do. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 17:44:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D70F106566B; Sun, 15 Jul 2012 17:44:28 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 485EA8FC0A; Sun, 15 Jul 2012 17:44:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FHiSsc061388; Sun, 15 Jul 2012 17:44:28 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FHiSSf061385; Sun, 15 Jul 2012 17:44:28 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201207151744.q6FHiSSf061385@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 15 Jul 2012 17:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238492 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 17:44:28 -0000 Author: melifaro Date: Sun Jul 15 17:44:27 2012 New Revision: 238492 URL: http://svn.freebsd.org/changeset/base/238492 Log: Permit changing MTU in 6to4 relay. This behavior is recommended by RFC 4213 clause 3.2. Sometimes fragmentation is the least evil. For example, some Linux IPVS kernels forwards ICMPv6 checksums to real servers incorrectly. Reviewed by: hrs(previous version) Approved by: kib(mentor) MFC after: 1 week Modified: head/sys/net/if_stf.c Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Sun Jul 15 15:50:12 2012 (r238491) +++ head/sys/net/if_stf.c Sun Jul 15 17:44:27 2012 (r238492) @@ -793,7 +793,7 @@ stf_rtrequest(cmd, rt, info) struct rt_addrinfo *info; { RT_LOCK_ASSERT(rt); - rt->rt_rmx.rmx_mtu = IPV6_MMTU; + rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; } static int @@ -806,7 +806,7 @@ stf_ioctl(ifp, cmd, data) struct ifreq *ifr; struct sockaddr_in6 *sin6; struct in_addr addr; - int error; + int error, mtu; error = 0; switch (cmd) { @@ -840,6 +840,18 @@ stf_ioctl(ifp, cmd, data) error = EAFNOSUPPORT; break; + case SIOCGIFMTU: + break; + + case SIOCSIFMTU: + ifr = (struct ifreq *)data; + mtu = ifr->ifr_mtu; + /* RFC 4213 3.2 ideal world MTU */ + if (mtu < IPV6_MINMTU || mtu > IF_MAXMTU - 20) + return (EINVAL); + ifp->if_mtu = mtu; + break; + default: error = EINVAL; break; From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 18:12:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7161F106566B; Sun, 15 Jul 2012 18:12:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 576348FC0C; Sun, 15 Jul 2012 18:12:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FICAli062918; Sun, 15 Jul 2012 18:12:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FICA26062915; Sun, 15 Jul 2012 18:12:10 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201207151812.q6FICA26062915@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 15 Jul 2012 18:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238493 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 18:12:10 -0000 Author: hselasky Date: Sun Jul 15 18:12:09 2012 New Revision: 238493 URL: http://svn.freebsd.org/changeset/base/238493 Log: Add new USB device ID. PR: usb/169789 MFC after: 1 week Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sun Jul 15 17:44:27 2012 (r238492) +++ head/sys/dev/usb/serial/u3g.c Sun Jul 15 18:12:09 2012 (r238493) @@ -282,6 +282,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(HUAWEI, E143F, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E173, 0), U3G_DEV(HUAWEI, E173_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, E3131, 0), + U3G_DEV(HUAWEI, E3131_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, E180V, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Jul 15 17:44:27 2012 (r238492) +++ head/sys/dev/usb/usbdevs Sun Jul 15 18:12:09 2012 (r238493) @@ -1894,6 +1894,8 @@ product HUAWEI E143F 0x143f 3G modem product HUAWEI E1752 0x1446 3G modem product HUAWEI K3765 0x1465 3G modem product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider +product HUAWEI E3131_INIT 0x14fe 3G modem initial +product HUAWEI E3131 0x1506 3G modem product HUAWEI K3765_INIT 0x1520 K3765 Initial product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 18:14:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58A6E1065670; Sun, 15 Jul 2012 18:14:05 +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 4250F8FC08; Sun, 15 Jul 2012 18:14:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FIE5Ed063041; Sun, 15 Jul 2012 18:14:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FIE5Cq063039; Sun, 15 Jul 2012 18:14:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207151814.q6FIE5Cq063039@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 15 Jul 2012 18:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238494 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 18:14:05 -0000 Author: bz Date: Sun Jul 15 18:14:04 2012 New Revision: 238494 URL: http://svn.freebsd.org/changeset/base/238494 Log: MFC r238222: As mentioned in the commit message of r237571 (copied from a prototype patch of mine) also check if the 2nd in6_setscope() failed and return the error in that case. Modified: stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Sun Jul 15 18:12:09 2012 (r238493) +++ stable/8/sys/netinet6/in6.c Sun Jul 15 18:14:04 2012 (r238494) @@ -1235,7 +1235,9 @@ in6_purgeaddr_mc(struct ifnet *ifp, stru sin6.sin6_family = AF_INET6; memcpy(&sin6.sin6_addr, &satosin6(ifa0->ifa_addr)->sin6_addr, sizeof(sin6.sin6_addr)); - in6_setscope(&sin6.sin6_addr, ifa0->ifa_ifp, NULL); + error = in6_setscope(&sin6.sin6_addr, ifa0->ifa_ifp, NULL); + if (error != 0) + return (error); } rt = in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, RT_DEFAULT_FIB); From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 18:20:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3A7B1065673; Sun, 15 Jul 2012 18:20:09 +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 CE70C8FC0A; Sun, 15 Jul 2012 18:20:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FIK9Z7063427; Sun, 15 Jul 2012 18:20:09 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FIK9Au063425; Sun, 15 Jul 2012 18:20:09 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207151820.q6FIK9Au063425@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 15 Jul 2012 18:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238495 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 18:20:10 -0000 Author: bz Date: Sun Jul 15 18:20:09 2012 New Revision: 238495 URL: http://svn.freebsd.org/changeset/base/238495 Log: MFC r238248: Implement handling of "atomic fragements" as outlined in draft-gont-6man-ipv6-atomic-fragments to mitigate one class of possible fragmentation-based attacks. Modified: stable/8/sys/netinet6/frag6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/frag6.c ============================================================================== --- stable/8/sys/netinet6/frag6.c Sun Jul 15 18:14:04 2012 (r238494) +++ stable/8/sys/netinet6/frag6.c Sun Jul 15 18:20:09 2012 (r238495) @@ -221,6 +221,19 @@ frag6_input(struct mbuf **mp, int *offp, /* offset now points to data portion */ offset += sizeof(struct ip6_frag); + /* + * XXX-BZ RFC XXXX (draft-gont-6man-ipv6-atomic-fragments) + * Handle "atomic" fragments (offset and m bit set to 0) upfront, + * unrelated to any reassembly. Just skip the fragment header. + */ + if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) { + /* XXX-BZ we want dedicated counters for this. */ + V_ip6stat.ip6s_reassembled++; + in6_ifstat_inc(dstifp, ifs6_reass_ok); + *offp = offset; + return (ip6f->ip6f_nxt); + } + IP6Q_LOCK(); /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 19:05:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 892A91065674; Sun, 15 Jul 2012 19:05:59 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 738DD8FC15; Sun, 15 Jul 2012 19:05:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FJ5xcc066382; Sun, 15 Jul 2012 19:05:59 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FJ5xW4066380; Sun, 15 Jul 2012 19:05:59 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201207151905.q6FJ5xW4066380@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 15 Jul 2012 19:05: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: r238497 - stable/7/sbin/mount_ntfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 19:05:59 -0000 Author: jh Date: Sun Jul 15 19:05:58 2012 New Revision: 238497 URL: http://svn.freebsd.org/changeset/base/238497 Log: MFC r230642: Remove trailing whitespace. Modified: stable/7/sbin/mount_ntfs/mount_ntfs.c Directory Properties: stable/7/sbin/mount_ntfs/ (props changed) Modified: stable/7/sbin/mount_ntfs/mount_ntfs.c ============================================================================== --- stable/7/sbin/mount_ntfs/mount_ntfs.c Sun Jul 15 19:04:12 2012 (r238496) +++ stable/7/sbin/mount_ntfs/mount_ntfs.c Sun Jul 15 19:05:58 2012 (r238497) @@ -162,7 +162,7 @@ main(argc, argv) } /* - * Resolve the mountpoint with realpath(3) and remove unnecessary + * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ (void)checkpath(dir, mntpath); From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 19:10:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A23E5106564A; Sun, 15 Jul 2012 19:10:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 890FE8FC0C; Sun, 15 Jul 2012 19:10:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FJA1Re066654; Sun, 15 Jul 2012 19:10:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FJA1A1066653; Sun, 15 Jul 2012 19:10:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207151910.q6FJA1A1066653@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 15 Jul 2012 19:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238498 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 19:10:01 -0000 Author: glebius Date: Sun Jul 15 19:10:00 2012 New Revision: 238498 URL: http://svn.freebsd.org/changeset/base/238498 Log: Use M_NOWAIT while holding the pf giant lock. Modified: head/sys/contrib/pf/net/pf_if.c Modified: head/sys/contrib/pf/net/pf_if.c ============================================================================== --- head/sys/contrib/pf/net/pf_if.c Sun Jul 15 19:05:58 2012 (r238497) +++ head/sys/contrib/pf/net/pf_if.c Sun Jul 15 19:10:00 2012 (r238498) @@ -506,8 +506,7 @@ pfi_dynaddr_setup(struct pf_addr_wrap *a if (aw->type != PF_ADDR_DYNIFTL) return (0); #ifdef __FreeBSD__ - /* XXX: revisit! */ - if ((dyn = pool_get(&V_pfi_addr_pl, PR_WAITOK | PR_ZERO)) + if ((dyn = pool_get(&V_pfi_addr_pl, PR_NOWAIT | PR_ZERO)) #else if ((dyn = pool_get(&pfi_addr_pl, PR_WAITOK | PR_LIMITFAIL | PR_ZERO)) #endif From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 19:52:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F38C106566B; Sun, 15 Jul 2012 19:52:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E461B8FC08; Sun, 15 Jul 2012 19:52:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FJqNDo069133; Sun, 15 Jul 2012 19:52:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FJqNhi069130; Sun, 15 Jul 2012 19:52:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207151952.q6FJqNhi069130@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 15 Jul 2012 19:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238500 - stable/9/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 19:52:24 -0000 Author: glebius Date: Sun Jul 15 19:52:23 2012 New Revision: 238500 URL: http://svn.freebsd.org/changeset/base/238500 Log: Merge r237929, r237930 from head: ------------------------------------------------------------------------ r237929 | glebius | 2012-07-01 19:30:43 +0400 (вс, 01 июл 2012) | 6 lines In g_mirror_regular_request() upon successful delivery treat BIO_DELETE requests same way as BIO_WRITE removing them from queue. This fixes panic with BIO_DELETE operations on geom_mirror. Reviewed by: pjd ------------------------------------------------------------------------ r237930 | glebius | 2012-07-01 19:43:52 +0400 (вс, 01 июл 2012) | 20 lines Make geom_mirror more friendly to SSDs. To properly support TRIM, we need to pass BIO_DELETE requests down to providers that support it. Also, we need to announce our support for BIO_DELETE to upper consumer. This requires: - In g_mirror_start() return true for "GEOM::candelete" request. - In g_mirror_init_disk() probe below provider for "GEOM::candelete" attribute, and mark disk with a flag if it does support BIO_DELETE. - In g_mirror_register_request() distribute BIO_DELETE requests only to those disks, that do support it. Note that we announce "GEOM::candelete" as true unconditionally of whether we have TRIM-capable media down below or not. This is made intentionally, because upper consumer (usually UFS) requests the attribite only once at mount time. And if user ever migrates his mirror from HDDs to SSDs, then he/she would get TRIM working without remounting filesystem. Reviewed by: pjd Approved by: re (kib) Modified: stable/9/sys/geom/mirror/g_mirror.c stable/9/sys/geom/mirror/g_mirror.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Sun Jul 15 19:32:02 2012 (r238499) +++ stable/9/sys/geom/mirror/g_mirror.c Sun Jul 15 19:52:23 2012 (r238500) @@ -439,7 +439,7 @@ g_mirror_init_disk(struct g_mirror_softc struct g_mirror_metadata *md, int *errorp) { struct g_mirror_disk *disk; - int error; + int i, error; disk = malloc(sizeof(*disk), M_MIRROR, M_NOWAIT | M_ZERO); if (disk == NULL) { @@ -454,6 +454,11 @@ g_mirror_init_disk(struct g_mirror_softc disk->d_state = G_MIRROR_DISK_STATE_NONE; disk->d_priority = md->md_priority; disk->d_flags = md->md_dflags; + error = g_getattr("GEOM::candelete", disk->d_consumer, &i); + if (error != 0) + goto fail; + if (i) + disk->d_flags |= G_MIRROR_DISK_FLAG_CANDELETE; if (md->md_provider[0] != '\0') disk->d_flags |= G_MIRROR_DISK_FLAG_HARDCODED; disk->d_sync.ds_consumer = NULL; @@ -890,7 +895,8 @@ g_mirror_regular_request(struct bio *bp) if (pbp->bio_children == pbp->bio_inbed) { G_MIRROR_LOGREQ(3, pbp, "Request delivered."); pbp->bio_completed = pbp->bio_length; - if (pbp->bio_cmd == BIO_WRITE) { + if (pbp->bio_cmd == BIO_WRITE || + pbp->bio_cmd == BIO_DELETE) { bioq_remove(&sc->sc_inflight, pbp); /* Release delayed sync requests if possible. */ g_mirror_sync_release(sc); @@ -1083,7 +1089,9 @@ g_mirror_start(struct bio *bp) g_mirror_flush(sc, bp); return; case BIO_GETATTR: - if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { + if (g_handleattr_int(bp, "GEOM::candelete", 1)) + return; + else if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { g_mirror_kernel_dump(bp); return; } @@ -1630,6 +1638,9 @@ g_mirror_register_request(struct bio *bp default: continue; } + if (bp->bio_cmd == BIO_DELETE && + (disk->d_flags & G_MIRROR_DISK_FLAG_CANDELETE) == 0) + continue; cbp = g_clone_bio(bp); if (cbp == NULL) { for (cbp = bioq_first(&queue); cbp != NULL; Modified: stable/9/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.h Sun Jul 15 19:32:02 2012 (r238499) +++ stable/9/sys/geom/mirror/g_mirror.h Sun Jul 15 19:52:23 2012 (r238500) @@ -59,10 +59,12 @@ #define G_MIRROR_DISK_FLAG_INACTIVE 0x0000000000000008ULL #define G_MIRROR_DISK_FLAG_HARDCODED 0x0000000000000010ULL #define G_MIRROR_DISK_FLAG_BROKEN 0x0000000000000020ULL +#define G_MIRROR_DISK_FLAG_CANDELETE 0x0000000000000040ULL #define G_MIRROR_DISK_FLAG_MASK (G_MIRROR_DISK_FLAG_DIRTY | \ G_MIRROR_DISK_FLAG_SYNCHRONIZING | \ G_MIRROR_DISK_FLAG_FORCE_SYNC | \ - G_MIRROR_DISK_FLAG_INACTIVE) + G_MIRROR_DISK_FLAG_INACTIVE | \ + G_MIRROR_DISK_FLAG_CANDELETE) #define G_MIRROR_DEVICE_FLAG_NOAUTOSYNC 0x0000000000000001ULL #define G_MIRROR_DEVICE_FLAG_NOFAILSYNC 0x0000000000000002ULL From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 20:16:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 492CA106566C; Sun, 15 Jul 2012 20:16:18 +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 33A228FC0A; Sun, 15 Jul 2012 20:16:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FKGI4r070494; Sun, 15 Jul 2012 20:16:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FKGHOi070488; Sun, 15 Jul 2012 20:16:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207152016.q6FKGHOi070488@svn.freebsd.org> From: Michael Tuexen Date: Sun, 15 Jul 2012 20:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238501 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 20:16:18 -0000 Author: tuexen Date: Sun Jul 15 20:16:17 2012 New Revision: 238501 URL: http://svn.freebsd.org/changeset/base/238501 Log: Changes which improve compilation if neither INET nor INET6 is defined. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sun Jul 15 19:52:23 2012 (r238500) +++ head/sys/netinet/sctp_asconf.c Sun Jul 15 20:16:17 2012 (r238501) @@ -2747,13 +2747,14 @@ sctp_process_initack_addresses(struct sc struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; struct sctp_ifa *sctp_ifa; - struct sctp_ipv6addr_param addr_store; #ifdef INET6 + struct sctp_ipv6addr_param addr6_store; struct sockaddr_in6 sin6; #endif #ifdef INET + struct sctp_ipv4addr_param addr4_store; struct sockaddr_in sin; #endif @@ -2802,7 +2803,7 @@ sctp_process_initack_addresses(struct sc a6p = (struct sctp_ipv6addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv6addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr6_store); if (plen != sizeof(struct sctp_ipv6addr_param) || a6p == NULL) { return; @@ -2821,7 +2822,7 @@ sctp_process_initack_addresses(struct sc /* get the entire IPv4 address param */ a4p = (struct sctp_ipv4addr_param *)sctp_m_getptr(m, offset, sizeof(struct sctp_ipv4addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr4_store); if (plen != sizeof(struct sctp_ipv4addr_param) || a4p == NULL) { return; @@ -2899,16 +2900,17 @@ sctp_addr_in_initack(struct mbuf *m, uin { struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; - struct sctp_ipv6addr_param addr_store; #ifdef INET struct sockaddr_in *sin; struct sctp_ipv4addr_param *a4p; + struct sctp_ipv6addr_param addr4_store; #endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *a6p; + struct sctp_ipv6addr_param addr6_store; struct sockaddr_in6 sin6_tmp; #endif @@ -2954,7 +2956,7 @@ sctp_addr_in_initack(struct mbuf *m, uin a6p = (struct sctp_ipv6addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv6addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr6_store); if (a6p == NULL) { return (0); } @@ -2984,7 +2986,7 @@ sctp_addr_in_initack(struct mbuf *m, uin a4p = (struct sctp_ipv4addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv4addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr4_store); if (a4p == NULL) { return (0); } Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jul 15 19:52:23 2012 (r238500) +++ head/sys/netinet/sctp_output.c Sun Jul 15 20:16:17 2012 (r238501) @@ -3799,6 +3799,7 @@ sctp_get_ect(struct sctp_tcb *stcb) } } +#if defined(INET) || defined(INET6) static void sctp_handle_no_route(struct sctp_tcb *stcb, struct sctp_nets *net, @@ -3843,6 +3844,8 @@ sctp_handle_no_route(struct sctp_tcb *st } } +#endif + static int sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, /* may be NULL */ @@ -3882,14 +3885,18 @@ sctp_lowlevel_chunk_output(struct sctp_i * interface and smallest_mtu size as well. */ /* Will need ifdefs around this */ - struct mbuf *o_pak; struct mbuf *newm; struct sctphdr *sctphdr; int packet_length; int ret; uint32_t vrf_id; + +#if defined(INET) || defined(INET6) + struct mbuf *o_pak; sctp_route_t *ro = NULL; struct udphdr *udp = NULL; + +#endif uint8_t tos_value; #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Sun Jul 15 19:52:23 2012 (r238500) +++ head/sys/netinet/sctp_uio.h Sun Jul 15 20:16:17 2012 (r238501) @@ -1124,10 +1124,10 @@ struct sctpstat { #define SCTP_STAT_DECR_GAUGE32(_x) SCTP_STAT_DECR(_x) union sctp_sockstore { -#if defined(INET) || !defined(_KERNEL) +#if defined(INET) struct sockaddr_in sin; #endif -#if defined(INET6) || !defined(_KERNEL) +#if defined(INET6) struct sockaddr_in6 sin6; #endif struct sockaddr sa; Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Jul 15 19:52:23 2012 (r238500) +++ head/sys/netinet/sctp_usrreq.c Sun Jul 15 20:16:17 2012 (r238501) @@ -5258,7 +5258,6 @@ sctp_setopt(struct socket *so, int optna case SCTP_BINDX_ADD_ADDR: { struct sctp_getaddresses *addrs; - size_t sz; struct thread *td; td = (struct thread *)p; @@ -5266,8 +5265,7 @@ sctp_setopt(struct socket *so, int optna optsize); #ifdef INET if (addrs->addr->sa_family == AF_INET) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; @@ -5280,8 +5278,7 @@ sctp_setopt(struct socket *so, int optna #endif #ifdef INET6 if (addrs->addr->sa_family == AF_INET6) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; @@ -5305,7 +5302,6 @@ sctp_setopt(struct socket *so, int optna case SCTP_BINDX_REM_ADDR: { struct sctp_getaddresses *addrs; - size_t sz; struct thread *td; td = (struct thread *)p; @@ -5313,8 +5309,7 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(addrs, optval, struct sctp_getaddresses, optsize); #ifdef INET if (addrs->addr->sa_family == AF_INET) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; @@ -5327,8 +5322,7 @@ sctp_setopt(struct socket *so, int optna #endif #ifdef INET6 if (addrs->addr->sa_family == AF_INET6) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun Jul 15 19:52:23 2012 (r238500) +++ head/sys/netinet6/sctp6_usrreq.c Sun Jul 15 20:16:17 2012 (r238501) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#ifdef INET6 #include #include #include @@ -1240,3 +1241,5 @@ struct pr_usrreqs sctp6_usrreqs = { .pru_sosend = sctp_sosend, .pru_soreceive = sctp_soreceive }; + +#endif From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 20:29:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1FDEF106564A; Sun, 15 Jul 2012 20:29:49 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AB498FC12; Sun, 15 Jul 2012 20:29:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FKTmKf071324; Sun, 15 Jul 2012 20:29:48 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FKTmfW071319; Sun, 15 Jul 2012 20:29:48 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201207152029.q6FKTmfW071319@svn.freebsd.org> From: Matthew D Fleming Date: Sun, 15 Jul 2012 20:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238502 - in head/sys: kern vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 20:29:49 -0000 Author: mdf Date: Sun Jul 15 20:29:48 2012 New Revision: 238502 URL: http://svn.freebsd.org/changeset/base/238502 Log: Fix a bug with memguard(9) on 32-bit architectures without a VM_KMEM_MAX_SIZE. The code was not taking into account the size of the kernel_map, which the kmem_map is allocated from, so it could produce a sub-map size too large to fit. The simplest solution is to ignore VM_KMEM_MAX entirely and base the memguard map's size off the kernel_map's size, since this is always relevant and always smaller. Found by: Justin Hibbits Modified: head/sys/kern/kern_malloc.c head/sys/vm/memguard.c head/sys/vm/memguard.h head/sys/vm/vm_map.h Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Sun Jul 15 20:16:17 2012 (r238501) +++ head/sys/kern/kern_malloc.c Sun Jul 15 20:29:48 2012 (r238502) @@ -744,7 +744,7 @@ kmeminit(void *dummy) vm_kmem_size = 2 * mem_size * PAGE_SIZE; #ifdef DEBUG_MEMGUARD - tmp = memguard_fudge(vm_kmem_size, vm_kmem_size_max); + tmp = memguard_fudge(vm_kmem_size, kernel_map); #else tmp = vm_kmem_size; #endif Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Sun Jul 15 20:16:17 2012 (r238501) +++ head/sys/vm/memguard.c Sun Jul 15 20:29:48 2012 (r238502) @@ -159,16 +159,18 @@ SYSCTL_ULONG(_vm_memguard, OID_AUTO, fre * the kmem_map. The memguard memory will be a submap. */ unsigned long -memguard_fudge(unsigned long km_size, unsigned long km_max) +memguard_fudge(unsigned long km_size, const struct vm_map *parent_map) { - u_long mem_pgs = cnt.v_page_count; + u_long mem_pgs, parent_size; vm_memguard_divisor = 10; TUNABLE_INT_FETCH("vm.memguard.divisor", &vm_memguard_divisor); + parent_size = vm_map_max(parent_map) - vm_map_min(parent_map) + + PAGE_SIZE; /* Pick a conservative value if provided value sucks. */ if ((vm_memguard_divisor <= 0) || - ((km_size / vm_memguard_divisor) == 0)) + ((parent_size / vm_memguard_divisor) == 0)) vm_memguard_divisor = 10; /* * Limit consumption of physical pages to @@ -177,21 +179,19 @@ memguard_fudge(unsigned long km_size, un * This prevents memguard's page promotions from completely * using up memory, since most malloc(9) calls are sub-page. */ + mem_pgs = cnt.v_page_count; memguard_physlimit = (mem_pgs / vm_memguard_divisor) * PAGE_SIZE; /* * We want as much KVA as we can take safely. Use at most our - * allotted fraction of kmem_max. Limit this to twice the - * physical memory to avoid using too much memory as pagetable - * pages. - */ - memguard_mapsize = km_max / vm_memguard_divisor; - /* size must be multiple of PAGE_SIZE */ - memguard_mapsize = round_page(memguard_mapsize); - if (memguard_mapsize == 0 || - memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) + * allotted fraction of the parent map's size. Limit this to + * twice the physical memory to avoid using too much memory as + * pagetable pages (size must be multiple of PAGE_SIZE). + */ + memguard_mapsize = round_page(parent_size / vm_memguard_divisor); + if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; - if (km_max > 0 && km_size + memguard_mapsize > km_max) - return (km_max); + if (km_size + memguard_mapsize > parent_size) + memguard_mapsize = 0; return (km_size + memguard_mapsize); } Modified: head/sys/vm/memguard.h ============================================================================== --- head/sys/vm/memguard.h Sun Jul 15 20:16:17 2012 (r238501) +++ head/sys/vm/memguard.h Sun Jul 15 20:29:48 2012 (r238502) @@ -35,7 +35,7 @@ struct malloc_type; struct vm_map; #ifdef DEBUG_MEMGUARD -unsigned long memguard_fudge(unsigned long, unsigned long); +unsigned long memguard_fudge(unsigned long, const struct vm_map *); void memguard_init(struct vm_map *); void *memguard_alloc(unsigned long, int); void *memguard_realloc(void *, unsigned long, struct malloc_type *, int); Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sun Jul 15 20:16:17 2012 (r238501) +++ head/sys/vm/vm_map.h Sun Jul 15 20:29:48 2012 (r238502) @@ -200,13 +200,13 @@ struct vm_map { #ifdef _KERNEL static __inline vm_offset_t -vm_map_max(vm_map_t map) +vm_map_max(const struct vm_map *map) { return (map->max_offset); } static __inline vm_offset_t -vm_map_min(vm_map_t map) +vm_map_min(const struct vm_map *map) { return (map->min_offset); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 20:31:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9C16106564A; Sun, 15 Jul 2012 20:31:46 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 82E068FC08; Sun, 15 Jul 2012 20:31:46 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so9594120pbb.13 for ; Sun, 15 Jul 2012 13:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=K/lYFVD4ZbZPwsoPB9ZFgacBaFHyX2GgVDrzDt5kJZE=; b=SNHnU67tYxcPma/jBjcAh8/giZbyfRTaxivkzf1XmkKc8gwjrbLoO8WHrWTd/RfBLU pLVvMCZ4Txeq/UMFv2l2Sq76IvsKezpipI/NFmHi34zrV3H8SAbbwa4AUEllA1Npq2cf Bz9VOhy8lectr2exF+LjiM/3K6lLZP4RubIbPb+p71nysmXN9OxCnnmzIi6+VEHF0HKS ZNO8EPP4pZUWZ+MxzPlL6/kTq8byn93YcYlGsCu9fQ2GSHDaVL1/ffoA2BZ/Gs8iGUd7 Ed1DY5vyhmesTJ1AZdP08cuHBIvvsCG1Gx/GwHwhkzNFBH/vKQZpmfec67Os/AWAcoTV dMcQ== MIME-Version: 1.0 Received: by 10.68.195.97 with SMTP id id1mr22193844pbc.91.1342384306305; Sun, 15 Jul 2012 13:31:46 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.68.208.168 with HTTP; Sun, 15 Jul 2012 13:31:46 -0700 (PDT) In-Reply-To: <201207152029.q6FKTmfW071319@svn.freebsd.org> References: <201207152029.q6FKTmfW071319@svn.freebsd.org> Date: Sun, 15 Jul 2012 13:31:46 -0700 X-Google-Sender-Auth: FaVLU0NAuDyQ9EA_Qdox1_WwUWU Message-ID: From: mdf@FreeBSD.org To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: svn commit: r238502 - in head/sys: kern vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 20:31:46 -0000 On Sun, Jul 15, 2012 at 1:29 PM, Matthew D Fleming wrote: > Author: mdf > Date: Sun Jul 15 20:29:48 2012 > New Revision: 238502 > URL: http://svn.freebsd.org/changeset/base/238502 > > Log: > Fix a bug with memguard(9) on 32-bit architectures without a > VM_KMEM_MAX_SIZE. > > The code was not taking into account the size of the kernel_map, which > the kmem_map is allocated from, so it could produce a sub-map size too > large to fit. The simplest solution is to ignore VM_KMEM_MAX entirely > and base the memguard map's size off the kernel_map's size, since this > is always relevant and always smaller. > > Found by: Justin Hibbits MFC after: 3 days Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 20:38:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0294106564A; Sun, 15 Jul 2012 20:38:02 +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 B08B78FC14; Sun, 15 Jul 2012 20:38:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FKc20L071893; Sun, 15 Jul 2012 20:38:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FKc2iF071890; Sun, 15 Jul 2012 20:38:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201207152038.q6FKc2iF071890@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jul 2012 20:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238503 - in stable/9/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 20:38:02 -0000 Author: avg Date: Sun Jul 15 20:38:02 2012 New Revision: 238503 URL: http://svn.freebsd.org/changeset/base/238503 Log: MFC r238168,238169: further dtrace disassembler fixes for long nop decoding - segment-override prefixes are not invalid in long mode - fix nopw (0f 1f) behavior with respect to modifiers Reported by: emaste Tested by: emaste Obtained from: Illumos commit 13442:4adbe6de60c8 Approved by: re (kib) Modified: stable/9/sys/cddl/dev/dtrace/amd64/dis_tables.c stable/9/sys/cddl/dev/dtrace/i386/dis_tables.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/amd64/dis_tables.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/amd64/dis_tables.c Sun Jul 15 20:29:48 2012 (r238502) +++ stable/9/sys/cddl/dev/dtrace/amd64/dis_tables.c Sun Jul 15 20:38:02 2012 (r238503) @@ -815,7 +815,7 @@ const instable_t dis_op0F[16][16] = { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), /* [18] */ IND(dis_op0F18), INVALID, INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, TNS("nopw", M), +/* [1C] */ INVALID, INVALID, INVALID, TS("nopw", Mw), }, { /* [20] */ TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), /* [24] */ TSx("mov",SREG), INVALID, TSx("mov",SREG), INVALID, @@ -1146,14 +1146,14 @@ const instable_t dis_distable[16][16] = /* [1,C] */ TNS("sbbb",IA), TS("sbb",IA), TSx("push",SEG), TSx("pop",SEG), }, { /* [2,0] */ TNS("andb",RMw), TS("and",RMw), TNS("andb",MRw), TS("and",MRw), -/* [2,4] */ TNS("andb",IA), TS("and",IA), TNSx("%es:",OVERRIDE), TNSx("daa",NORM), +/* [2,4] */ TNS("andb",IA), TS("and",IA), TNS("%es:",OVERRIDE), TNSx("daa",NORM), /* [2,8] */ TNS("subb",RMw), TS("sub",RMw), TNS("subb",MRw), TS("sub",MRw), -/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNSx("%cs:",OVERRIDE), TNSx("das",NORM), +/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNS("%cs:",OVERRIDE), TNSx("das",NORM), }, { /* [3,0] */ TNS("xorb",RMw), TS("xor",RMw), TNS("xorb",MRw), TS("xor",MRw), -/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNSx("%ss:",OVERRIDE), TNSx("aaa",NORM), +/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNS("%ss:",OVERRIDE), TNSx("aaa",NORM), /* [3,8] */ TNS("cmpb",RMw), TS("cmp",RMw), TNS("cmpb",MRw), TS("cmp",MRw), -/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNSx("%ds:",OVERRIDE), TNSx("aas",NORM), +/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNS("%ds:",OVERRIDE), TNSx("aas",NORM), }, { /* [4,0] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), /* [4,4] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), Modified: stable/9/sys/cddl/dev/dtrace/i386/dis_tables.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/i386/dis_tables.c Sun Jul 15 20:29:48 2012 (r238502) +++ stable/9/sys/cddl/dev/dtrace/i386/dis_tables.c Sun Jul 15 20:38:02 2012 (r238503) @@ -815,7 +815,7 @@ const instable_t dis_op0F[16][16] = { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), /* [18] */ IND(dis_op0F18), INVALID, INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, TNS("nopw", M), +/* [1C] */ INVALID, INVALID, INVALID, TS("nopw", Mw), }, { /* [20] */ TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), /* [24] */ TSx("mov",SREG), INVALID, TSx("mov",SREG), INVALID, @@ -1146,14 +1146,14 @@ const instable_t dis_distable[16][16] = /* [1,C] */ TNS("sbbb",IA), TS("sbb",IA), TSx("push",SEG), TSx("pop",SEG), }, { /* [2,0] */ TNS("andb",RMw), TS("and",RMw), TNS("andb",MRw), TS("and",MRw), -/* [2,4] */ TNS("andb",IA), TS("and",IA), TNSx("%es:",OVERRIDE), TNSx("daa",NORM), +/* [2,4] */ TNS("andb",IA), TS("and",IA), TNS("%es:",OVERRIDE), TNSx("daa",NORM), /* [2,8] */ TNS("subb",RMw), TS("sub",RMw), TNS("subb",MRw), TS("sub",MRw), -/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNSx("%cs:",OVERRIDE), TNSx("das",NORM), +/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNS("%cs:",OVERRIDE), TNSx("das",NORM), }, { /* [3,0] */ TNS("xorb",RMw), TS("xor",RMw), TNS("xorb",MRw), TS("xor",MRw), -/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNSx("%ss:",OVERRIDE), TNSx("aaa",NORM), +/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNS("%ss:",OVERRIDE), TNSx("aaa",NORM), /* [3,8] */ TNS("cmpb",RMw), TS("cmp",RMw), TNS("cmpb",MRw), TS("cmp",MRw), -/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNSx("%ds:",OVERRIDE), TNSx("aas",NORM), +/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNS("%ds:",OVERRIDE), TNSx("aas",NORM), }, { /* [4,0] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), /* [4,4] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 20:39:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 994C9106564A; Sun, 15 Jul 2012 20:39:22 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 852308FC08; Sun, 15 Jul 2012 20:39:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FKdMZC072015; Sun, 15 Jul 2012 20:39:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FKdMal072013; Sun, 15 Jul 2012 20:39:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207152039.q6FKdMal072013@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Jul 2012 20:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238504 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 20:39:22 -0000 Author: jilles Date: Sun Jul 15 20:39:21 2012 New Revision: 238504 URL: http://svn.freebsd.org/changeset/base/238504 Log: libc: Remove some unused strings from getaddrinfo(). Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Sun Jul 15 20:38:02 2012 (r238503) +++ head/lib/libc/net/getaddrinfo.c Sun Jul 15 20:39:21 2012 (r238504) @@ -155,7 +155,6 @@ struct explore { int e_af; int e_socktype; int e_protocol; - const char *e_protostr; int e_wild; #define WILD_AF(ex) ((ex)->e_wild & 0x01) #define WILD_SOCKTYPE(ex) ((ex)->e_wild & 0x02) @@ -164,21 +163,21 @@ struct explore { static const struct explore explore[] = { #if 0 - { PF_LOCAL, ANY, ANY, NULL, 0x01 }, + { PF_LOCAL, ANY, ANY, 0x01 }, #endif #ifdef INET6 - { PF_INET6, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, - { PF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, - { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 }, - { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 }, - { PF_INET6, SOCK_RAW, ANY, NULL, 0x05 }, -#endif - { PF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, - { PF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, - { PF_INET, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 }, - { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 }, - { PF_INET, SOCK_RAW, ANY, NULL, 0x05 }, - { -1, 0, 0, NULL, 0 }, + { PF_INET6, SOCK_DGRAM, IPPROTO_UDP, 0x07 }, + { PF_INET6, SOCK_STREAM, IPPROTO_TCP, 0x07 }, + { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, 0x03 }, + { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 }, + { PF_INET6, SOCK_RAW, ANY, 0x05 }, +#endif + { PF_INET, SOCK_DGRAM, IPPROTO_UDP, 0x07 }, + { PF_INET, SOCK_STREAM, IPPROTO_TCP, 0x07 }, + { PF_INET, SOCK_STREAM, IPPROTO_SCTP, 0x03 }, + { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 }, + { PF_INET, SOCK_RAW, ANY, 0x05 }, + { -1, 0, 0, 0 }, }; #ifdef INET6 From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 20:40:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D1341065670; Sun, 15 Jul 2012 20:40:11 +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 3E7068FC17; Sun, 15 Jul 2012 20:40:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FKeBWC072104; Sun, 15 Jul 2012 20:40:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FKeBtu072101; Sun, 15 Jul 2012 20:40:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201207152040.q6FKeBtu072101@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jul 2012 20:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238505 - in stable/8/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 20:40:11 -0000 Author: avg Date: Sun Jul 15 20:40:10 2012 New Revision: 238505 URL: http://svn.freebsd.org/changeset/base/238505 Log: MFC r238168,238169: further dtrace disassembler fixes for long nop decoding - segment-override prefixes are not invalid in long mode - fix nopw (0f 1f) behavior with respect to modifiers Reported by: emaste Tested by: emaste Obtained from: Illumos commit 13442:4adbe6de60c8 Modified: stable/8/sys/cddl/dev/dtrace/amd64/dis_tables.c stable/8/sys/cddl/dev/dtrace/i386/dis_tables.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/dev/dtrace/amd64/dis_tables.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/amd64/dis_tables.c Sun Jul 15 20:39:21 2012 (r238504) +++ stable/8/sys/cddl/dev/dtrace/amd64/dis_tables.c Sun Jul 15 20:40:10 2012 (r238505) @@ -815,7 +815,7 @@ const instable_t dis_op0F[16][16] = { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), /* [18] */ IND(dis_op0F18), INVALID, INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, TNS("nopw", M), +/* [1C] */ INVALID, INVALID, INVALID, TS("nopw", Mw), }, { /* [20] */ TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), /* [24] */ TSx("mov",SREG), INVALID, TSx("mov",SREG), INVALID, @@ -1146,14 +1146,14 @@ const instable_t dis_distable[16][16] = /* [1,C] */ TNS("sbbb",IA), TS("sbb",IA), TSx("push",SEG), TSx("pop",SEG), }, { /* [2,0] */ TNS("andb",RMw), TS("and",RMw), TNS("andb",MRw), TS("and",MRw), -/* [2,4] */ TNS("andb",IA), TS("and",IA), TNSx("%es:",OVERRIDE), TNSx("daa",NORM), +/* [2,4] */ TNS("andb",IA), TS("and",IA), TNS("%es:",OVERRIDE), TNSx("daa",NORM), /* [2,8] */ TNS("subb",RMw), TS("sub",RMw), TNS("subb",MRw), TS("sub",MRw), -/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNSx("%cs:",OVERRIDE), TNSx("das",NORM), +/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNS("%cs:",OVERRIDE), TNSx("das",NORM), }, { /* [3,0] */ TNS("xorb",RMw), TS("xor",RMw), TNS("xorb",MRw), TS("xor",MRw), -/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNSx("%ss:",OVERRIDE), TNSx("aaa",NORM), +/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNS("%ss:",OVERRIDE), TNSx("aaa",NORM), /* [3,8] */ TNS("cmpb",RMw), TS("cmp",RMw), TNS("cmpb",MRw), TS("cmp",MRw), -/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNSx("%ds:",OVERRIDE), TNSx("aas",NORM), +/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNS("%ds:",OVERRIDE), TNSx("aas",NORM), }, { /* [4,0] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), /* [4,4] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), Modified: stable/8/sys/cddl/dev/dtrace/i386/dis_tables.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/i386/dis_tables.c Sun Jul 15 20:39:21 2012 (r238504) +++ stable/8/sys/cddl/dev/dtrace/i386/dis_tables.c Sun Jul 15 20:40:10 2012 (r238505) @@ -815,7 +815,7 @@ const instable_t dis_op0F[16][16] = { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), /* [18] */ IND(dis_op0F18), INVALID, INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, TNS("nopw", M), +/* [1C] */ INVALID, INVALID, INVALID, TS("nopw", Mw), }, { /* [20] */ TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), /* [24] */ TSx("mov",SREG), INVALID, TSx("mov",SREG), INVALID, @@ -1146,14 +1146,14 @@ const instable_t dis_distable[16][16] = /* [1,C] */ TNS("sbbb",IA), TS("sbb",IA), TSx("push",SEG), TSx("pop",SEG), }, { /* [2,0] */ TNS("andb",RMw), TS("and",RMw), TNS("andb",MRw), TS("and",MRw), -/* [2,4] */ TNS("andb",IA), TS("and",IA), TNSx("%es:",OVERRIDE), TNSx("daa",NORM), +/* [2,4] */ TNS("andb",IA), TS("and",IA), TNS("%es:",OVERRIDE), TNSx("daa",NORM), /* [2,8] */ TNS("subb",RMw), TS("sub",RMw), TNS("subb",MRw), TS("sub",MRw), -/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNSx("%cs:",OVERRIDE), TNSx("das",NORM), +/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNS("%cs:",OVERRIDE), TNSx("das",NORM), }, { /* [3,0] */ TNS("xorb",RMw), TS("xor",RMw), TNS("xorb",MRw), TS("xor",MRw), -/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNSx("%ss:",OVERRIDE), TNSx("aaa",NORM), +/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNS("%ss:",OVERRIDE), TNSx("aaa",NORM), /* [3,8] */ TNS("cmpb",RMw), TS("cmp",RMw), TNS("cmpb",MRw), TS("cmp",MRw), -/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNSx("%ds:",OVERRIDE), TNSx("aas",NORM), +/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNS("%ds:",OVERRIDE), TNSx("aas",NORM), }, { /* [4,0] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), /* [4,4] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 20:48:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 188781065686; Sun, 15 Jul 2012 20:48:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 040008FC08; Sun, 15 Jul 2012 20:48:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FKmLcO072641; Sun, 15 Jul 2012 20:48:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FKmLjE072639; Sun, 15 Jul 2012 20:48:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207152048.q6FKmLjE072639@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Jul 2012 20:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238506 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 20:48:22 -0000 Author: adrian Date: Sun Jul 15 20:48:21 2012 New Revision: 238506 URL: http://svn.freebsd.org/changeset/base/238506 Log: Log the number of handled decsriptors and valid descriptors when hitting RXEOL. Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sun Jul 15 20:40:10 2012 (r238505) +++ head/sys/dev/ath/if_ath_rx_edma.c Sun Jul 15 20:48:21 2012 (r238506) @@ -428,8 +428,9 @@ ath_edma_recv_proc_queue(struct ath_soft ATH_PCU_LOCK(sc); if (dosched && sc->sc_kickpcu) { CTR0(ATH_KTR_ERR, "ath_edma_recv_proc_queue(): kickpcu"); - device_printf(sc->sc_dev, "%s: handled %d descriptors\n", - __func__, ngood); + device_printf(sc->sc_dev, + "%s: handled npkts %d ngood %d\n", + __func__, npkts, ngood); /* * XXX TODO: what should occur here? Just re-poke and From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 20:51:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9B50106564A; Sun, 15 Jul 2012 20:51:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B53A8FC14; Sun, 15 Jul 2012 20:51:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FKpgNT072866; Sun, 15 Jul 2012 20:51:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FKpgSK072862; Sun, 15 Jul 2012 20:51:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207152051.q6FKpgSK072862@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Jul 2012 20:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238507 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 20:51:42 -0000 Author: adrian Date: Sun Jul 15 20:51:41 2012 New Revision: 238507 URL: http://svn.freebsd.org/changeset/base/238507 Log: Handle RX Keymiss events. The AR9003 series NICs implement a separate RX error to signal that a Keycache miss occured. The earlier NICs would not set the key index valid bit. I'll dig into the difference between "no key index bit set" and "keycache miss". Modified: head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun Jul 15 20:48:21 2012 (r238506) +++ head/sys/dev/ath/if_ath_rx.c Sun Jul 15 20:51:41 2012 (r238507) @@ -534,6 +534,14 @@ ath_rx_pkt(struct ath_softc *sc, struct goto rx_accept; sc->sc_stats.ast_rx_badcrypt++; } + /* + * Similar as above - if the failure was a keymiss + * just punt it up to the upper layers for now. + */ + if (rs->rs_status & HAL_RXERR_KEYMISS) { + sc->sc_stats.ast_rx_keymiss++; + goto rx_accept; + } if (rs->rs_status & HAL_RXERR_MIC) { sc->sc_stats.ast_rx_badmic++; /* Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Sun Jul 15 20:48:21 2012 (r238506) +++ head/sys/dev/ath/if_ath_sysctl.c Sun Jul 15 20:51:41 2012 (r238507) @@ -934,6 +934,8 @@ ath_sysctl_stats_attach(struct ath_softc SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_mcastq_overflow", CTLFLAG_RD, &sc->sc_stats.ast_tx_mcastq_overflow, 0, "Number of multicast frames exceeding maximum mcast queue depth"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_keymiss", CTLFLAG_RD, + &sc->sc_stats.ast_rx_keymiss, 0, ""); /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Sun Jul 15 20:48:21 2012 (r238506) +++ head/sys/dev/ath/if_athioctl.h Sun Jul 15 20:51:41 2012 (r238507) @@ -161,7 +161,9 @@ struct ath_stats { u_int32_t ast_tx_aggr_ok; /* aggregate TX ok */ u_int32_t ast_tx_aggr_fail; /* aggregate TX failed */ u_int32_t ast_tx_mcastq_overflow; /* multicast queue overflow */ - u_int32_t ast_pad[1]; + u_int32_t ast_rx_keymiss; + + u_int32_t ast_pad[16]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 21:12:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEED91065670; Sun, 15 Jul 2012 21:12:22 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA7AE8FC08; Sun, 15 Jul 2012 21:12:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FLCMr0074192; Sun, 15 Jul 2012 21:12:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FLCM0t074190; Sun, 15 Jul 2012 21:12:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207152112.q6FLCM0t074190@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Jul 2012 21:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238508 - head/bin/stty X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 21:12:23 -0000 Author: jilles Date: Sun Jul 15 21:12:22 2012 New Revision: 238508 URL: http://svn.freebsd.org/changeset/base/238508 Log: stty: Mark usage() __dead2. This reduces code size a little and should fix a scan-build warning. Modified: head/bin/stty/extern.h Modified: head/bin/stty/extern.h ============================================================================== --- head/bin/stty/extern.h Sun Jul 15 20:51:41 2012 (r238507) +++ head/bin/stty/extern.h Sun Jul 15 21:12:22 2012 (r238508) @@ -40,6 +40,6 @@ int ksearch(char ***, struct info *); int msearch(char ***, struct info *); void optlist(void); void print(struct termios *, struct winsize *, int, enum FMT); -void usage(void); +void usage(void) __dead2; extern struct cchar cchars1[], cchars2[]; From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 21:20:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43FC3106564A; Sun, 15 Jul 2012 21:20:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 159BE8FC08; Sun, 15 Jul 2012 21:20:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FLKVI5074703; Sun, 15 Jul 2012 21:20:31 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FLKVCn074700; Sun, 15 Jul 2012 21:20:31 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207152120.q6FLKVCn074700@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 15 Jul 2012 21:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238509 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 21:20:32 -0000 Author: pfg Date: Sun Jul 15 21:20:31 2012 New Revision: 238509 URL: http://svn.freebsd.org/changeset/base/238509 Log: Use libc's strndup() instead of Dtrace's reimplementation. Corresponds partially to OpenSolaris change: PSARC 2010/299 GNU/Linux/BSD compatibility functions 6901783 strndup would be nice MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c Sun Jul 15 21:12:22 2012 (r238508) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c Sun Jul 15 21:20:31 2012 (r238509) @@ -29,23 +29,6 @@ #include #include -#include - -/* - * Create a copy of string s, but only duplicate the first n bytes. - */ -char * -strndup(const char *s, size_t n) -{ - char *s2 = malloc(n + 1); - - if (s2 == NULL) - longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); - - (void) strncpy(s2, s, n); - s2[n] = '\0'; - return (s2); -} /* * Transform string s inline, converting each embedded C escape sequence string Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Sun Jul 15 21:12:22 2012 (r238508) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h Sun Jul 15 21:20:31 2012 (r238509) @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,14 +19,12 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _DT_STRING_H #define _DT_STRING_H -#pragma ident "%Z%%M% %I% %E% SMI" #include #include @@ -36,7 +33,6 @@ extern "C" { #endif -extern char *strndup(const char *, size_t); extern size_t stresc2chr(char *); extern char *strchr2esc(const char *, size_t); extern const char *strbasename(const char *); From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 21:46:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 588BA1065672; Sun, 15 Jul 2012 21:46:20 +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 43DF28FC16; Sun, 15 Jul 2012 21:46:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6FLkK4t076248; Sun, 15 Jul 2012 21:46:20 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6FLkKZB076246; Sun, 15 Jul 2012 21:46:20 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207152146.q6FLkKZB076246@svn.freebsd.org> From: Alan Cox Date: Sun, 15 Jul 2012 21:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238510 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 21:46:20 -0000 Author: alc Date: Sun Jul 15 21:46:19 2012 New Revision: 238510 URL: http://svn.freebsd.org/changeset/base/238510 Log: Correct an off-by-one error in vm_reserv_alloc_contig() that resulted in the last reservation of a multi-reservation allocation not being initialized. Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sun Jul 15 21:20:31 2012 (r238509) +++ head/sys/vm/vm_reserv.c Sun Jul 15 21:46:19 2012 (r238510) @@ -457,7 +457,7 @@ vm_reserv_alloc_contig(vm_object_t objec m += VM_LEVEL_0_NPAGES; first += VM_LEVEL_0_NPAGES; allocpages -= VM_LEVEL_0_NPAGES; - } while (allocpages > VM_LEVEL_0_NPAGES); + } while (allocpages > 0); return (m_ret); /* From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 02:10:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0796106566B; Mon, 16 Jul 2012 02:10:26 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A8228FC0A; Mon, 16 Jul 2012 02:10:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G2AQM7094516; Mon, 16 Jul 2012 02:10:26 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G2AQf5094514; Mon, 16 Jul 2012 02:10:26 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207160210.q6G2AQf5094514@svn.freebsd.org> From: David Xu Date: Mon, 16 Jul 2012 02:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238513 - stable/9/lib/libc/i386/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 02:10:26 -0000 Author: davidxu Date: Mon Jul 16 02:10:26 2012 New Revision: 238513 URL: http://svn.freebsd.org/changeset/base/238513 Log: MFC r238328: Executing CPUID with EAX set to 1 to actually get feature flags. PR: 169730 Approved by: re (kib) Modified: stable/9/lib/libc/i386/gen/getcontextx.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/i386/gen/getcontextx.c ============================================================================== --- stable/9/lib/libc/i386/gen/getcontextx.c Mon Jul 16 00:21:05 2012 (r238512) +++ stable/9/lib/libc/i386/gen/getcontextx.c Mon Jul 16 02:10:26 2012 (r238513) @@ -68,7 +68,7 @@ __getcontextx_size(void) " movl %%ebx,%1\n" " popl %%ebx\n" : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (0x0)); + : "0" (0x1)); if ((p[2] & CPUID2_OSXSAVE) != 0) { __asm __volatile( " pushl %%ebx\n" From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 06:43:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EC7271065763; Mon, 16 Jul 2012 06:43:05 +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 D73178FC18; Mon, 16 Jul 2012 06:43:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G6h5xh011997; Mon, 16 Jul 2012 06:43:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G6h5di011993; Mon, 16 Jul 2012 06:43:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207160643.q6G6h5di011993@svn.freebsd.org> From: Michael Tuexen Date: Mon, 16 Jul 2012 06:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238514 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 06:43:06 -0000 Author: tuexen Date: Mon Jul 16 06:43:04 2012 New Revision: 238514 URL: http://svn.freebsd.org/changeset/base/238514 Log: Allow netstat to be build if INET is not defined in the kernel. Thanks to Garrett Cooper for reporting the issue. MFC after: 3 days X-MFC: 238501 Modified: head/usr.bin/netstat/Makefile head/usr.bin/netstat/sctp.c Modified: head/usr.bin/netstat/Makefile ============================================================================== --- head/usr.bin/netstat/Makefile Mon Jul 16 02:10:26 2012 (r238513) +++ head/usr.bin/netstat/Makefile Mon Jul 16 06:43:04 2012 (r238514) @@ -13,6 +13,10 @@ CFLAGS+=-fno-strict-aliasing CFLAGS+=-DIPSEC CFLAGS+=-DSCTP +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+=-DINET +.endif + .if ${MK_INET6_SUPPORT} != "no" SRCS+= inet6.c CFLAGS+=-DINET6 Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Mon Jul 16 02:10:26 2012 (r238513) +++ head/usr.bin/netstat/sctp.c Mon Jul 16 06:43:04 2012 (r238514) @@ -107,6 +107,7 @@ struct xraddr_entry { * If numeric_addr has been supplied, give * numeric value, otherwise try for symbolic name. */ +#ifdef INET static char * inetname(struct in_addr *inp) { @@ -146,6 +147,7 @@ inetname(struct in_addr *inp) } return (line); } +#endif #ifdef INET6 static char ntop_buf[INET6_ADDRSTRLEN]; @@ -197,9 +199,11 @@ sctp_print_address(union sctp_sockstore int width; switch (address->sa.sa_family) { +#ifdef INET case AF_INET: sprintf(line, "%.*s.", Wflag ? 39 : 16, inetname(&address->sin.sin_addr)); break; +#endif #ifdef INET6 case AF_INET6: sprintf(line, "%.*s.", Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr)); From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 06:56:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04870106564A; Mon, 16 Jul 2012 06:56:47 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE7D68FC08; Mon, 16 Jul 2012 06:56:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G6uk0J013224; Mon, 16 Jul 2012 06:56:46 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G6ukJ4013222; Mon, 16 Jul 2012 06:56:46 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201207160656.q6G6ukJ4013222@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 16 Jul 2012 06:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238515 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 06:56:47 -0000 Author: melifaro Date: Mon Jul 16 06:56:46 2012 New Revision: 238515 URL: http://svn.freebsd.org/changeset/base/238515 Log: MFC r237479, r238265 Finally fix lookup (account remaining '\0') and deletion (provide valid key length for radix lookup). Submitted by: Ihor Kaharlichenko (prev version) Approved by: kib(mentor) Sponsored by: Shtorm ISP Modified: stable/8/sys/netinet/ipfw/ip_fw_table.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_table.c Mon Jul 16 06:43:04 2012 (r238514) +++ stable/8/sys/netinet/ipfw/ip_fw_table.c Mon Jul 16 06:56:46 2012 (r238515) @@ -344,9 +344,12 @@ ipfw_del_table_entry(struct ip_fw_chain struct xaddr_iface ifname, ifmask; memset(&ifname, 0, sizeof(ifname)); + /* Include last \0 into comparison */ + mlen++; + /* Set 'total' structure length */ - KEY_LEN(ifname) = mlen; - KEY_LEN(ifmask) = mlen; + KEY_LEN(ifname) = KEY_LEN_IFACE + mlen; + KEY_LEN(ifmask) = KEY_LEN_IFACE + mlen; /* Assume direct match */ /* FIXME: Add interface pattern matching */ #if 0 @@ -568,7 +571,8 @@ ipfw_lookup_table_extended(struct ip_fw_ break; case IPFW_TABLE_INTERFACE: - KEY_LEN(iface) = strlcpy(iface.ifname, (char *)paddr, IF_NAMESIZE); + KEY_LEN(iface) = KEY_LEN_IFACE + + strlcpy(iface.ifname, (char *)paddr, IF_NAMESIZE) + 1; /* Assume direct match */ /* FIXME: Add interface pattern matching */ xent = (struct table_xentry *)(rnh->rnh_lookup(&iface, NULL, rnh)); From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 07:08:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7CC21065672; Mon, 16 Jul 2012 07:08:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A21848FC14; Mon, 16 Jul 2012 07:08:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G78Yb7013945; Mon, 16 Jul 2012 07:08:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G78YEu013943; Mon, 16 Jul 2012 07:08:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207160708.q6G78YEu013943@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 16 Jul 2012 07:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238516 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 07:08:34 -0000 Author: glebius Date: Mon Jul 16 07:08:34 2012 New Revision: 238516 URL: http://svn.freebsd.org/changeset/base/238516 Log: If ip_output() returns EMSGSIZE to tcp_output(), then the latter calls tcp_mtudisc(), which in its turn may call tcp_output(). Under certain conditions (must admit they are very special) an infinite recursion can happen. To avoid recursion we can pass struct route to ip_output() and obtain correct mtu. This allows us not to use tcp_mtudisc() but call tcp_mss_update() directly. PR: kern/155585 Submitted by: Andrey Zonov (original version of patch) Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Jul 16 06:56:46 2012 (r238515) +++ head/sys/netinet/tcp_output.c Mon Jul 16 07:08:34 2012 (r238516) @@ -180,7 +180,7 @@ tcp_output(struct tcpcb *tp) int idle, sendalot; int sack_rxmit, sack_bytes_rxmt; struct sackhole *p; - int tso; + int tso, mtu; struct tcpopt to; #if 0 int maxburst = TCP_MAXBURST; @@ -226,6 +226,7 @@ again: tcp_sack_adjust(tp); sendalot = 0; tso = 0; + mtu = 0; off = tp->snd_nxt - tp->snd_una; sendwin = min(tp->snd_wnd, tp->snd_cwnd); @@ -1209,6 +1210,9 @@ timer: */ #ifdef INET6 if (isipv6) { + struct route_in6 ro; + + bzero(&ro, sizeof(ro)); /* * we separately set hoplimit for every segment, since the * user might want to change the value via setsockopt. @@ -1218,10 +1222,13 @@ timer: ip6->ip6_hlim = in6_selecthlim(tp->t_inpcb, NULL); /* TODO: IPv6 IP6TOS_ECT bit on */ - error = ip6_output(m, - tp->t_inpcb->in6p_outputopts, NULL, - ((so->so_options & SO_DONTROUTE) ? - IP_ROUTETOIF : 0), NULL, NULL, tp->t_inpcb); + error = ip6_output(m, tp->t_inpcb->in6p_outputopts, &ro, + ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), + NULL, NULL, tp->t_inpcb); + + if (error == EMSGSIZE && ro.ro_rt != NULL) + mtu = ro.ro_rt->rt_rmx.rmx_mtu; + RO_RTFREE(&ro); } #endif /* INET6 */ #if defined(INET) && defined(INET6) @@ -1229,6 +1236,9 @@ timer: #endif #ifdef INET { + struct route ro; + + bzero(&ro, sizeof(ro)); ip->ip_len = m->m_pkthdr.len; #ifdef INET6 if (tp->t_inpcb->inp_vflag & INP_IPV6PROTO) @@ -1245,9 +1255,13 @@ timer: if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss) ip->ip_off |= IP_DF; - error = ip_output(m, tp->t_inpcb->inp_options, NULL, + error = ip_output(m, tp->t_inpcb->inp_options, &ro, ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0, tp->t_inpcb); + + if (error == EMSGSIZE && ro.ro_rt != NULL) + mtu = ro.ro_rt->rt_rmx.rmx_mtu; + RO_RTFREE(&ro); } #endif /* INET */ if (error) { @@ -1294,21 +1308,18 @@ out: * For some reason the interface we used initially * to send segments changed to another or lowered * its MTU. - * - * tcp_mtudisc() will find out the new MTU and as - * its last action, initiate retransmission, so it - * is important to not do so here. - * * If TSO was active we either got an interface * without TSO capabilits or TSO was turned off. - * Disable it for this connection as too and - * immediatly retry with MSS sized segments generated - * by this function. + * If we obtained mtu from ip_output() then update + * it and try again. */ if (tso) tp->t_flags &= ~TF_TSO; - tcp_mtudisc(tp->t_inpcb, -1); - return (0); + if (mtu != 0) { + tcp_mss_update(tp, -1, mtu, NULL, NULL); + goto again; + } + return (error); case EHOSTDOWN: case EHOSTUNREACH: case ENETDOWN: From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 07:20:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 155261065674; Mon, 16 Jul 2012 07:20:44 +0000 (UTC) (envelope-from samspeed@mail.ru) Received: from fallback1.mail.ru (fallback1.mail.ru [94.100.176.18]) by mx1.freebsd.org (Postfix) with ESMTP id 149448FC16; Mon, 16 Jul 2012 07:20:43 +0000 (UTC) Received: from f159.mail.ru (f159.mail.ru [217.69.128.111]) by fallback1.mail.ru (mPOP.Fallback_MX) with ESMTP id F389673D4D7; Mon, 16 Jul 2012 11:15:30 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Content-Type:Message-ID:Reply-To:In-Reply-To:References:Date:Mime-Version:Subject:Cc:To:From; bh=DNtZq+BkfOtFyg4TIx55bhCwqq7lWEqJQUdJUWh85AA=; b=KrCrgUN7Ddb11qavXZFMXHJfKcvr8pht8tA3dY9dkcQnIqrnuZ6BekRknhJ+u6dhsMzJvYD6D5msRAcflEal0EGc7mAcKtROxiUUOb/v88vTlHPIl8Y7m2S9gOHTXkYl; Received: from mail by f159.mail.ru with local (envelope-from ) id 1SqfWc-0001Ux-CS; Mon, 16 Jul 2012 11:15:22 +0400 Received: from [85.113.141.24] by e.mail.ru with HTTP; Mon, 16 Jul 2012 11:15:22 +0400 From: =?UTF-8?B?QW5kcmV5IFNtYWdpbg==?= To: =?UTF-8?B?R2xlYiBTbWlybm9mZg==?= Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: [85.113.141.24] Date: Mon, 16 Jul 2012 11:15:22 +0400 References: <201207160708.q6G78YEu013943@svn.freebsd.org> In-Reply-To: <201207160708.q6G78YEu013943@svn.freebsd.org> X-Priority: Message-ID: <1342422922.364785252@f159.mail.ru> X-Spam: Not detected X-Mras: Ok Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238516 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?UTF-8?B?QW5kcmV5IFNtYWdpbg==?= List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 07:20:44 -0000 VGhhbmsgeW91IHZlcnkgbXVjaCAhISEgCgoKTW9uLCAxNiBKdWwgMjAxMiAwNzowODozNCArMDAw MCAoVVRDKSDQvtGCIEdsZWIgU21pcm5vZmYgPGdsZWJpdXNARnJlZUJTRC5vcmc+OgogCiAgCiAg CkF1dGhvcjogZ2xlYml1cwpEYXRlOiBNb24gSnVsIDE2IDA3OjA4OjM0IDIwMTIKTmV3IFJldmlz aW9uOiAyMzg1MTYKVVJMOiBodHRwOi8vc3ZuLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzIz ODUxNgoKTG9nOgrCoMKgSWYgaXBfb3V0cHV0KCkgcmV0dXJucyBFTVNHU0laRSB0byB0Y3Bfb3V0 cHV0KCksIHRoZW4gdGhlIGxhdHRlciBjYWxscwrCoMKgdGNwX210dWRpc2MoKSwgd2hpY2ggaW4g aXRzIHR1cm4gbWF5IGNhbGwgdGNwX291dHB1dCgpLiBVbmRlciBjZXJ0YWluCsKgwqBjb25kaXRp b25zIChtdXN0IGFkbWl0IHRoZXkgYXJlIHZlcnkgc3BlY2lhbCkgYW4gaW5maW5pdGUgcmVjdXJz aW9uIGNhbgrCoMKgaGFwcGVuLgrCoMKgCsKgwqBUbyBhdm9pZCByZWN1cnNpb24gd2UgY2FuIHBh c3Mgc3RydWN0IHJvdXRlIHRvIGlwX291dHB1dCgpIGFuZCBvYnRhaW4KwqDCoGNvcnJlY3QgbXR1 LiBUaGlzIGFsbG93cyB1cyBub3QgdG8gdXNlIHRjcF9tdHVkaXNjKCkgYnV0IGNhbGwgdGNwX21z c191cGRhdGUoKQrCoMKgZGlyZWN0bHkuCsKgwqAKwqDCoFBSOiBrZXJuLzE1NTU4NQrCoMKgU3Vi bWl0dGVkIGJ5OiBBbmRyZXkgWm9ub3YgPGFuZHJleSB6b25vdi5vcmc+IChvcmlnaW5hbCB2ZXJz aW9uIG9mIHBhdGNoKQoKTW9kaWZpZWQ6CsKgwqBoZWFkL3N5cy9uZXRpbmV0L3RjcF9vdXRwdXQu YwoKTW9kaWZpZWQ6IGhlYWQvc3lzL25ldGluZXQvdGNwX291dHB1dC5jCj09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PQotLS0gaGVhZC9zeXMvbmV0aW5ldC90Y3Bfb3V0cHV0LmMgTW9uIEp1bCAxNiAwNjo1 Njo0NiAyMDEyIChyMjM4NTE1KQorKysgaGVhZC9zeXMvbmV0aW5ldC90Y3Bfb3V0cHV0LmMgTW9u IEp1bCAxNiAwNzowODozNCAyMDEyIChyMjM4NTE2KQpAQCAtMTgwLDcgKzE4MCw3IEBAIHRjcF9v dXRwdXQoc3RydWN0IHRjcGNiICp0cCkKwqAgaW50IGlkbGUsIHNlbmRhbG90OwrCoCBpbnQgc2Fj a19yeG1pdCwgc2Fja19ieXRlc19yeG10OwrCoCBzdHJ1Y3Qgc2Fja2hvbGUgKnA7Ci0gaW50IHRz bzsKKyBpbnQgdHNvLCBtdHU7CsKgIHN0cnVjdCB0Y3BvcHQgdG87CsKgI2lmIDAKwqAgaW50IG1h eGJ1cnN0ID0gVENQX01BWEJVUlNUOwpAQCAtMjI2LDYgKzIyNiw3IEBAIGFnYWluOgrCoCB0Y3Bf c2Fja19hZGp1c3QodHApOwrCoCBzZW5kYWxvdCA9IDA7CsKgIHRzbyA9IDA7CisgbXR1ID0gMDsK wqAgb2ZmID0gdHAtPnNuZF9ueHQgLSB0cC0+c25kX3VuYTsKwqAgc2VuZHdpbiA9IG1pbih0cC0+ c25kX3duZCwgdHAtPnNuZF9jd25kKTsKwqAKQEAgLTEyMDksNiArMTIxMCw5IEBAIHRpbWVyOgrC oCAqLyAKwqAjaWZkZWYgSU5FVDYKwqAgaWYgKGlzaXB2NikgeworIHN0cnVjdCByb3V0ZV9pbjYg cm87CisKKyBiemVybygmcm8sIHNpemVvZihybykpOwrCoCAvKgrCoCAqIHdlIHNlcGFyYXRlbHkg c2V0IGhvcGxpbWl0IGZvciBldmVyeSBzZWdtZW50LCBzaW5jZSB0aGUKwqAgKiB1c2VyIG1pZ2h0 IHdhbnQgdG8gY2hhbmdlIHRoZSB2YWx1ZSB2aWEgc2V0c29ja29wdC4KQEAgLTEyMTgsMTAgKzEy MjIsMTMgQEAgdGltZXI6CsKgIGlwNi0+aXA2X2hsaW0gPSBpbjZfc2VsZWN0aGxpbSh0cC0+dF9p bnBjYiwgTlVMTCk7CsKgCsKgIC8qIFRPRE86IElQdjYgSVA2VE9TX0VDVCBiaXQgb24gKi8gCi0g ZXJyb3IgPSBpcDZfb3V0cHV0KG0sCi0gdHAtPnRfaW5wY2ItPmluNnBfb3V0cHV0b3B0cywgTlVM TCwKLSAoKHNvLT5zb19vcHRpb25zICYgU09fRE9OVFJPVVRFKSA/Ci0gSVBfUk9VVEVUT0lGIDog MCksIE5VTEwsIE5VTEwsIHRwLT50X2lucGNiKTsKKyBlcnJvciA9IGlwNl9vdXRwdXQobSwgdHAt PnRfaW5wY2ItPmluNnBfb3V0cHV0b3B0cywgJnJvLAorICgoc28tPnNvX29wdGlvbnMgJiBTT19E T05UUk9VVEUpID8gSVBfUk9VVEVUT0lGIDogMCksCisgTlVMTCwgTlVMTCwgdHAtPnRfaW5wY2Ip OworCisgaWYgKGVycm9yID09IEVNU0dTSVpFICYmIHJvLnJvX3J0ICE9IE5VTEwpCisgbXR1ID0g cm8ucm9fcnQtPnJ0X3JteC5ybXhfbXR1OworIFJPX1JURlJFRSgmcm8pOwrCoCB9CsKgI2VuZGlm IC8qIElORVQ2ICovIArCoCNpZiBkZWZpbmVkKElORVQpICYmIGRlZmluZWQoSU5FVDYpCkBAIC0x MjI5LDYgKzEyMzYsOSBAQCB0aW1lcjoKwqAjZW5kaWYKwqAjaWZkZWYgSU5FVArCoMKgwqDCoMKg eworIHN0cnVjdCByb3V0ZSBybzsKKworIGJ6ZXJvKCZybywgc2l6ZW9mKHJvKSk7CsKgIGlwLT5p cF9sZW4gPSBtLT5tX3BrdGhkci5sZW47CsKgI2lmZGVmIElORVQ2CsKgIGlmICh0cC0+dF9pbnBj Yi0+aW5wX3ZmbGFnICYgSU5QX0lQVjZQUk9UTykKQEAgLTEyNDUsOSArMTI1NSwxMyBAQCB0aW1l cjoKwqAgaWYgKFZfcGF0aF9tdHVfZGlzY292ZXJ5ICYmIHRwLT50X21heG9wZCA+IFZfdGNwX21p bm1zcykKwqAgaXAtPmlwX29mZiB8PSBJUF9ERjsKwqAKLSBlcnJvciA9IGlwX291dHB1dChtLCB0 cC0+dF9pbnBjYi0+aW5wX29wdGlvbnMsIE5VTEwsCisgZXJyb3IgPSBpcF9vdXRwdXQobSwgdHAt PnRfaW5wY2ItPmlucF9vcHRpb25zLCAmcm8sCsKgICgoc28tPnNvX29wdGlvbnMgJiBTT19ET05U Uk9VVEUpID8gSVBfUk9VVEVUT0lGIDogMCksIDAsCsKgIHRwLT50X2lucGNiKTsKKworIGlmIChl cnJvciA9PSBFTVNHU0laRSAmJiByby5yb19ydCAhPSBOVUxMKQorIG10dSA9IHJvLnJvX3J0LT5y dF9ybXgucm14X210dTsKKyBST19SVEZSRUUoJnJvKTsKwqDCoMKgwqDCoH0KwqAjZW5kaWYgLyog SU5FVCAqLyAKwqAgaWYgKGVycm9yKSB7CkBAIC0xMjk0LDIxICsxMzA4LDE4IEBAIG91dDoKwqAg KiBGb3Igc29tZSByZWFzb24gdGhlIGludGVyZmFjZSB3ZSB1c2VkIGluaXRpYWxseQrCoCAqIHRv IHNlbmQgc2VnbWVudHMgY2hhbmdlZCB0byBhbm90aGVyIG9yIGxvd2VyZWQKwqAgKiBpdHMgTVRV LgotICoKLSAqIHRjcF9tdHVkaXNjKCkgd2lsbCBmaW5kIG91dCB0aGUgbmV3IE1UVSBhbmQgYXMK LSAqIGl0cyBsYXN0IGFjdGlvbiwgaW5pdGlhdGUgcmV0cmFuc21pc3Npb24sIHNvIGl0Ci0gKiBp cyBpbXBvcnRhbnQgdG8gbm90IGRvIHNvIGhlcmUuCi0gKgrCoCAqIElmIFRTTyB3YXMgYWN0aXZl IHdlIGVpdGhlciBnb3QgYW4gaW50ZXJmYWNlCsKgICogd2l0aG91dCBUU08gY2FwYWJpbGl0cyBv ciBUU08gd2FzIHR1cm5lZCBvZmYuCi0gKiBEaXNhYmxlIGl0IGZvciB0aGlzIGNvbm5lY3Rpb24g YXMgdG9vIGFuZAotICogaW1tZWRpYXRseSByZXRyeSB3aXRoIE1TUyBzaXplZCBzZWdtZW50cyBn ZW5lcmF0ZWQKLSAqIGJ5IHRoaXMgZnVuY3Rpb24uCisgKiBJZiB3ZSBvYnRhaW5lZCBtdHUgZnJv bSBpcF9vdXRwdXQoKSB0aGVuIHVwZGF0ZQorICogaXQgYW5kIHRyeSBhZ2Fpbi4KwqAgKi8gCsKg IGlmICh0c28pCsKgIHRwLT50X2ZsYWdzICY9IH5URl9UU087Ci0gdGNwX210dWRpc2ModHAtPnRf aW5wY2IsIC0xKTsKLSByZXR1cm4gKDApOworIGlmIChtdHUgIT0gMCkgeworIHRjcF9tc3NfdXBk YXRlKHRwLCAtMSwgbXR1LCBOVUxMLCBOVUxMKTsKKyBnb3RvIGFnYWluOworIH0KKyByZXR1cm4g KGVycm9yKTsKwqAgY2FzZSBFSE9TVERPV046CsKgIGNhc2UgRUhPU1RVTlJFQUNIOgrCoCBjYXNl IEVORVRET1dOOgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f Xwpzdm4tc3JjLWFsbEBmcmVlYnNkLm9yZyBtYWlsaW5nIGxpc3QKaHR0cDovL2xpc3RzLmZyZWVi c2Qub3JnL21haWxtYW4vbGlzdGluZm8vc3ZuLXNyYy1hbGwKVG8gdW5zdWJzY3JpYmUsIHNlbmQg YW55IG1haWwgdG8gInN2bi1zcmMtYWxsLXVuc3Vic2NyaWJlQGZyZWVic2Qub3JnIgogICAgCg== From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 07:22:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 447191065670; Mon, 16 Jul 2012 07:22:23 +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 2F26D8FC17; Mon, 16 Jul 2012 07:22:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G7MN6o014821; Mon, 16 Jul 2012 07:22:23 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G7MMnf014819; Mon, 16 Jul 2012 07:22:22 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207160722.q6G7MMnf014819@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 16 Jul 2012 07:22: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: r238517 - stable/7/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 07:22:23 -0000 Author: bz Date: Mon Jul 16 07:22:22 2012 New Revision: 238517 URL: http://svn.freebsd.org/changeset/base/238517 Log: MFC r238248: Implement handling of "atomic fragements" as outlined in draft-gont-6man-ipv6-atomic-fragments to mitigate one class of possible fragmentation-based attacks. Modified: stable/7/sys/netinet6/frag6.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/netinet6/frag6.c ============================================================================== --- stable/7/sys/netinet6/frag6.c Mon Jul 16 07:08:34 2012 (r238516) +++ stable/7/sys/netinet6/frag6.c Mon Jul 16 07:22:22 2012 (r238517) @@ -209,6 +209,19 @@ frag6_input(struct mbuf **mp, int *offp, /* offset now points to data portion */ offset += sizeof(struct ip6_frag); + /* + * XXX-BZ RFC XXXX (draft-gont-6man-ipv6-atomic-fragments) + * Handle "atomic" fragments (offset and m bit set to 0) upfront, + * unrelated to any reassembly. Just skip the fragment header. + */ + if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) { + /* XXX-BZ we want dedicated counters for this. */ + ip6stat.ip6s_reassembled++; + in6_ifstat_inc(dstifp, ifs6_reass_ok); + *offp = offset; + return (ip6f->ip6f_nxt); + } + IP6Q_LOCK(); /* From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 08:16:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 469721065670; Mon, 16 Jul 2012 08:16:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3084B8FC16; Mon, 16 Jul 2012 08:16:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G8Gfww018736; Mon, 16 Jul 2012 08:16:41 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G8Gf7k018734; Mon, 16 Jul 2012 08:16:41 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201207160816.q6G8Gf7k018734@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 16 Jul 2012 08:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238520 - stable/9/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 08:16:42 -0000 Author: ae Date: Mon Jul 16 08:16:41 2012 New Revision: 238520 URL: http://svn.freebsd.org/changeset/base/238520 Log: MFC r238281: We don't need to check the result of sending signal when R flag is specified. Submitted by: Ilya A. Arkhipov Approved by: re (kib) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/9/usr.sbin/newsyslog/ (props changed) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/9/usr.sbin/newsyslog/newsyslog.c Mon Jul 16 08:13:30 2012 (r238519) +++ stable/9/usr.sbin/newsyslog/newsyslog.c Mon Jul 16 08:16:41 2012 (r238520) @@ -1972,7 +1972,8 @@ do_zipwork(struct zipwork_entry *zwork) else pgm_name++; - if (zwork->zw_swork != NULL && zwork->zw_swork->sw_pidok <= 0) { + if (zwork->zw_swork != NULL && zwork->zw_swork->run_cmd == 0 && + zwork->zw_swork->sw_pidok <= 0) { warnx( "log %s not compressed because daemon(s) not notified", zwork->zw_fname); From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 08:17:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48FCA1065674; Mon, 16 Jul 2012 08:17:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33BAE8FC1C; Mon, 16 Jul 2012 08:17:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G8HVgN018842; Mon, 16 Jul 2012 08:17:31 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G8HUVf018840; Mon, 16 Jul 2012 08:17:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201207160817.q6G8HUVf018840@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 16 Jul 2012 08:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238521 - stable/8/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 08:17:31 -0000 Author: ae Date: Mon Jul 16 08:17:30 2012 New Revision: 238521 URL: http://svn.freebsd.org/changeset/base/238521 Log: MFC r238281: We don't need to check the result of sending signal when R flag is specified. Submitted by: Ilya A. Arkhipov Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Mon Jul 16 08:16:41 2012 (r238520) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Mon Jul 16 08:17:30 2012 (r238521) @@ -1937,7 +1937,8 @@ do_zipwork(struct zipwork_entry *zwork) else pgm_name++; - if (zwork->zw_swork != NULL && zwork->zw_swork->sw_pidok <= 0) { + if (zwork->zw_swork != NULL && zwork->zw_swork->run_cmd == 0 && + zwork->zw_swork->sw_pidok <= 0) { warnx( "log %s not compressed because daemon(s) not notified", zwork->zw_fname); From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 08:30:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6AC81065801 for ; Mon, 16 Jul 2012 08:30:04 +0000 (UTC) (envelope-from bounces+73574-8822-svn-src-all=freebsd.org@sendgrid.me) Received: from o3.shared.sendgrid.net (o3.shared.sendgrid.net [208.117.48.85]) by mx1.freebsd.org (Postfix) with SMTP id 55CD08FC19 for ; Mon, 16 Jul 2012 08:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=FaKrm5dHPpTcYGAQusunveywHxY=; b=AegcSlw0e8WS/SSh4ieJnDRlFRJy U+/aS+Vb9g3KceMOBivD6Ks5qrid4+rxKtVNuxjkWAmWqi/Zi54SV+Xpl4pQ74sv aXFVPWcmY2Ag+wZBs3EVZjMAkIlYU044wqlx9tRh6vxHk06zMOZ7ZpZxZGd4mE4j onMY7umA2DH9rrw= Received: by 10.36.109.169 with SMTP id mf6.18844.5003D10B4 Mon, 16 Jul 2012 03:30:03 -0500 (CDT) Received: from mail.tarsnap.com (unknown [10.9.180.5]) by mi15 (SG) with ESMTP id 5003d10b.2035.148d6e for ; Mon, 16 Jul 2012 03:30:03 -0500 (CST) Received: (qmail 46039 invoked from network); 16 Jul 2012 08:27:53 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 16 Jul 2012 08:27:53 -0000 Received: (qmail 73436 invoked from network); 16 Jul 2012 08:28:16 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 16 Jul 2012 08:28:16 -0000 Message-ID: <5003D0A0.3050209@freebsd.org> Date: Mon, 16 Jul 2012 01:28:16 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120627 Thunderbird/13.0.1 MIME-Version: 1.0 To: Konstantin Belousov References: <201206301636.q5UGaNCB029813@svn.freebsd.org> In-Reply-To: <201206301636.q5UGaNCB029813@svn.freebsd.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Sendgrid-EID: A6W2xSVPHetogaU8rnzccWwgBYtN+QvIzXyjfe/10PG7cIK5ytolqqXCTAchPLFwNfRbwbyiTu7eCa6Wnr8gtXwsGVLvWHOMJulFxFoqOYAS/MVJF9IqKQ+DFTq6/KDuRajmq1biazBtgRP6qMUBbw== X-SendGrid-Contentd-ID: {"test_id":1342427403} Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237847 - head/usr.bin/killall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 08:30:04 -0000 On 06/30/12 09:36, Konstantin Belousov wrote: > New Revision: 237847 > URL: http://svn.freebsd.org/changeset/base/237847 > > Log: > Once in a month, when the moon is full, killall mistakenly considers > living process as a zombie and refuses to kill it. The cause is that > the code masks ki_stat with SZOMB to compare with SZOMB, but ki_stat > is not a mask. > > Possibly reported by: cperciva For the archives: Judging by the frequency with which I was seeing killall failing to send a signal and the fact I haven't seen it happen since I applied this patch, I'm 99.9999% confident that this was indeed the bug I was running into. Hopefully everybody else is sending signals to specific pids rather than using killall during log rotation like I am. :-) -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 09:17:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 24DD31065677; Mon, 16 Jul 2012 09:17:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 96A5E150A87; Mon, 16 Jul 2012 09:17:20 +0000 (UTC) Message-ID: <5003DC20.9020703@FreeBSD.org> Date: Mon, 16 Jul 2012 02:17:20 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120621 Thunderbird/13.0.1 MIME-Version: 1.0 To: Michael Tuexen References: <201207160643.q6G6h5di011993@svn.freebsd.org> In-Reply-To: <201207160643.q6G6h5di011993@svn.freebsd.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238514 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 09:17:21 -0000 Is it my imagination or did this break the build? On 07/15/2012 23:43, Michael Tuexen wrote: > Author: tuexen > Date: Mon Jul 16 06:43:04 2012 > New Revision: 238514 > URL: http://svn.freebsd.org/changeset/base/238514 > > Log: > Allow netstat to be build if INET is not defined in the kernel. > Thanks to Garrett Cooper for reporting the issue. > > MFC after: 3 days > X-MFC: 238501 > > Modified: > head/usr.bin/netstat/Makefile > head/usr.bin/netstat/sctp.c > > Modified: head/usr.bin/netstat/Makefile > ============================================================================== > --- head/usr.bin/netstat/Makefile Mon Jul 16 02:10:26 2012 (r238513) > +++ head/usr.bin/netstat/Makefile Mon Jul 16 06:43:04 2012 (r238514) > @@ -13,6 +13,10 @@ CFLAGS+=-fno-strict-aliasing > CFLAGS+=-DIPSEC > CFLAGS+=-DSCTP > > +.if ${MK_INET_SUPPORT} != "no" > +CFLAGS+=-DINET > +.endif > + > .if ${MK_INET6_SUPPORT} != "no" > SRCS+= inet6.c > CFLAGS+=-DINET6 > > Modified: head/usr.bin/netstat/sctp.c > ============================================================================== > --- head/usr.bin/netstat/sctp.c Mon Jul 16 02:10:26 2012 (r238513) > +++ head/usr.bin/netstat/sctp.c Mon Jul 16 06:43:04 2012 (r238514) > @@ -107,6 +107,7 @@ struct xraddr_entry { > * If numeric_addr has been supplied, give > * numeric value, otherwise try for symbolic name. > */ > +#ifdef INET > static char * > inetname(struct in_addr *inp) > { > @@ -146,6 +147,7 @@ inetname(struct in_addr *inp) > } > return (line); > } > +#endif > > #ifdef INET6 > static char ntop_buf[INET6_ADDRSTRLEN]; > @@ -197,9 +199,11 @@ sctp_print_address(union sctp_sockstore > int width; > > switch (address->sa.sa_family) { > +#ifdef INET > case AF_INET: > sprintf(line, "%.*s.", Wflag ? 39 : 16, inetname(&address->sin.sin_addr)); > break; > +#endif > #ifdef INET6 > case AF_INET6: > sprintf(line, "%.*s.", Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr)); > -- Change is hard. From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 09:35:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9623B106564A; Mon, 16 Jul 2012 09:35:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80CFB8FC12; Mon, 16 Jul 2012 09:35:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G9ZmU6025584; Mon, 16 Jul 2012 09:35:48 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G9ZmIb025581; Mon, 16 Jul 2012 09:35:48 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201207160935.q6G9ZmIb025581@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Jul 2012 09:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238526 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 09:35:48 -0000 Author: hselasky Date: Mon Jul 16 09:35:47 2012 New Revision: 238526 URL: http://svn.freebsd.org/changeset/base/238526 Log: Add new USB device ID. PR: usb/169789 MFC after: 1 week Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Mon Jul 16 09:02:43 2012 (r238525) +++ head/sys/dev/usb/serial/u3g.c Mon Jul 16 09:35:47 2012 (r238526) @@ -359,6 +359,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMM2, MF330, 0), U3G_DEV(QUALCOMM2, SIM5218, 0), U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMM2, GOBI2000, 0), U3G_DEV(QUALCOMMINC, AC2726, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), U3G_DEV(QUALCOMMINC, AC8710, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jul 16 09:02:43 2012 (r238525) +++ head/sys/dev/usb/usbdevs Mon Jul 16 09:35:47 2012 (r238526) @@ -2705,6 +2705,7 @@ product QUALCOMM2 CDMA_MSM 0x3196 CDMA T product QUALCOMM2 AC8700 0x6000 AC8700 product QUALCOMM2 VW110L 0x1000 Vertex Wireless 110L modem product QUALCOMM2 SIM5218 0x9000 SIM5218 +product QUALCOMM2 GOBI2000 0x9204 Qualcomm Gobi 2000 product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 09:38:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E87121065672; Mon, 16 Jul 2012 09:38:19 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9E7F8FC08; Mon, 16 Jul 2012 09:38:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6G9cJtN025821; Mon, 16 Jul 2012 09:38:19 GMT (envelope-from pgj@svn.freebsd.org) Received: (from pgj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6G9cJOL025816; Mon, 16 Jul 2012 09:38:19 GMT (envelope-from pgj@svn.freebsd.org) Message-Id: <201207160938.q6G9cJOL025816@svn.freebsd.org> From: Gabor Pali Date: Mon, 16 Jul 2012 09:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238527 - in head: sys/kern sys/sys usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 09:38:20 -0000 Author: pgj (ports committer) Date: Mon Jul 16 09:38:19 2012 New Revision: 238527 URL: http://svn.freebsd.org/changeset/base/238527 Log: - Add support for displaying process stack memory regions. Approved by: rwatson MFC after: 3 days Modified: head/sys/kern/kern_proc.c head/sys/sys/user.h head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat_vm.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Jul 16 09:35:47 2012 (r238526) +++ head/sys/kern/kern_proc.c Mon Jul 16 09:38:19 2012 (r238527) @@ -2189,6 +2189,10 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_flags |= KVME_FLAG_NEEDS_COPY; if (entry->eflags & MAP_ENTRY_NOCOREDUMP) kve->kve_flags |= KVME_FLAG_NOCOREDUMP; + if (entry->eflags & MAP_ENTRY_GROWS_UP) + kve->kve_flags |= KVME_FLAG_GROWS_UP; + if (entry->eflags & MAP_ENTRY_GROWS_DOWN) + kve->kve_flags |= KVME_FLAG_GROWS_DOWN; last_timestamp = map->timestamp; vm_map_unlock_read(map); Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Mon Jul 16 09:35:47 2012 (r238526) +++ head/sys/sys/user.h Mon Jul 16 09:38:19 2012 (r238527) @@ -413,6 +413,8 @@ struct kinfo_file { #define KVME_FLAG_NEEDS_COPY 0x00000002 #define KVME_FLAG_NOCOREDUMP 0x00000004 #define KVME_FLAG_SUPER 0x00000008 +#define KVME_FLAG_GROWS_UP 0x00000010 +#define KVME_FLAG_GROWS_DOWN 0x00000020 #if defined(__amd64__) #define KINFO_OVMENTRY_SIZE 1168 Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Mon Jul 16 09:35:47 2012 (r238526) +++ head/usr.bin/procstat/procstat.1 Mon Jul 16 09:38:19 2012 (r238527) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2012 +.Dd July 11, 2012 .Dt PROCSTAT 1 .Os .Sh NAME @@ -433,6 +433,10 @@ copy-on-write needs copy .It S one or more superpage mappings are used +.It D +grows down (top-down stack) +.It U +grows up (bottom-up stack) .El .Sh EXIT STATUS .Ex -std Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Mon Jul 16 09:35:47 2012 (r238526) +++ head/usr.bin/procstat/procstat_vm.c Mon Jul 16 09:38:19 2012 (r238527) @@ -72,7 +72,9 @@ procstat_vm(struct kinfo_proc *kipp) printf("%-1s", kve->kve_flags & KVME_FLAG_COW ? "C" : "-"); printf("%-1s", kve->kve_flags & KVME_FLAG_NEEDS_COPY ? "N" : "-"); - printf("%-1s ", kve->kve_flags & KVME_FLAG_SUPER ? "S" : "-"); + printf("%-1s", kve->kve_flags & KVME_FLAG_SUPER ? "S" : "-"); + printf("%-1s ", kve->kve_flags & KVME_FLAG_GROWS_UP ? "U" : + kve->kve_flags & KVME_FLAG_GROWS_DOWN ? "D" : "-"); switch (kve->kve_type) { case KVME_TYPE_NONE: str = "--"; From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 10:08:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 647831065670; Mon, 16 Jul 2012 10:08:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 640A88FC1B; Mon, 16 Jul 2012 10:08:50 +0000 (UTC) Received: from [192.168.1.103] (p5481A29D.dip.t-dialin.net [84.129.162.157]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 98D071C0C0BD4; Mon, 16 Jul 2012 12:08:48 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Michael Tuexen In-Reply-To: <5003DC20.9020703@FreeBSD.org> Date: Mon, 16 Jul 2012 12:08:36 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <476489F5-A114-4DAF-9030-AE35D76EEDD5@FreeBSD.org> References: <201207160643.q6G6h5di011993@svn.freebsd.org> <5003DC20.9020703@FreeBSD.org> To: Doug Barton X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238514 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 10:08:51 -0000 On Jul 16, 2012, at 11:17 AM, Doug Barton wrote: > Is it my imagination or did this break the build? I think it should have fixed the build, which was broken by r238501. Or am I missing something? Best regards Michael >=20 > On 07/15/2012 23:43, Michael Tuexen wrote: >> Author: tuexen >> Date: Mon Jul 16 06:43:04 2012 >> New Revision: 238514 >> URL: http://svn.freebsd.org/changeset/base/238514 >>=20 >> Log: >> Allow netstat to be build if INET is not defined in the kernel. >> Thanks to Garrett Cooper for reporting the issue. >>=20 >> MFC after: 3 days >> X-MFC: 238501 >>=20 >> Modified: >> head/usr.bin/netstat/Makefile >> head/usr.bin/netstat/sctp.c >>=20 >> Modified: head/usr.bin/netstat/Makefile >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/usr.bin/netstat/Makefile Mon Jul 16 02:10:26 2012 = (r238513) >> +++ head/usr.bin/netstat/Makefile Mon Jul 16 06:43:04 2012 = (r238514) >> @@ -13,6 +13,10 @@ CFLAGS+=3D-fno-strict-aliasing >> CFLAGS+=3D-DIPSEC >> CFLAGS+=3D-DSCTP >>=20 >> +.if ${MK_INET_SUPPORT} !=3D "no" >> +CFLAGS+=3D-DINET >> +.endif >> + >> .if ${MK_INET6_SUPPORT} !=3D "no" >> SRCS+=3D inet6.c >> CFLAGS+=3D-DINET6 >>=20 >> Modified: head/usr.bin/netstat/sctp.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/usr.bin/netstat/sctp.c Mon Jul 16 02:10:26 2012 = (r238513) >> +++ head/usr.bin/netstat/sctp.c Mon Jul 16 06:43:04 2012 = (r238514) >> @@ -107,6 +107,7 @@ struct xraddr_entry { >> * If numeric_addr has been supplied, give >> * numeric value, otherwise try for symbolic name. >> */ >> +#ifdef INET >> static char * >> inetname(struct in_addr *inp) >> { >> @@ -146,6 +147,7 @@ inetname(struct in_addr *inp) >> } >> return (line); >> } >> +#endif >>=20 >> #ifdef INET6 >> static char ntop_buf[INET6_ADDRSTRLEN]; >> @@ -197,9 +199,11 @@ sctp_print_address(union sctp_sockstore=20 >> int width; >>=20 >> switch (address->sa.sa_family) { >> +#ifdef INET >> case AF_INET: >> sprintf(line, "%.*s.", Wflag ? 39 : 16, = inetname(&address->sin.sin_addr)); >> break; >> +#endif >> #ifdef INET6 >> case AF_INET6: >> sprintf(line, "%.*s.", Wflag ? 39 : 16, = inet6name(&address->sin6.sin6_addr)); >>=20 >=20 >=20 > --=20 >=20 > Change is hard. >=20 >=20 >=20 >=20 From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 10:12:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB7A2106564A; Mon, 16 Jul 2012 10:12:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B56E48FC18; Mon, 16 Jul 2012 10:12:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GAC7Z8028556; Mon, 16 Jul 2012 10:12:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GAC7pc028553; Mon, 16 Jul 2012 10:12:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201207161012.q6GAC7pc028553@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Jul 2012 10:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238529 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 10:12:07 -0000 Author: hselasky Date: Mon Jul 16 10:12:07 2012 New Revision: 238529 URL: http://svn.freebsd.org/changeset/base/238529 Log: Add new USB device ID. PR: usb/169789 Submitted by: Ruslan Bukin MFC after: 1 week Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Mon Jul 16 09:50:29 2012 (r238528) +++ head/sys/dev/usb/serial/u3g.c Mon Jul 16 10:12:07 2012 (r238529) @@ -359,6 +359,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMM2, MF330, 0), U3G_DEV(QUALCOMM2, SIM5218, 0), U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMM2, GOBI2000_QDL, 0), U3G_DEV(QUALCOMM2, GOBI2000, 0), U3G_DEV(QUALCOMMINC, AC2726, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jul 16 09:50:29 2012 (r238528) +++ head/sys/dev/usb/usbdevs Mon Jul 16 10:12:07 2012 (r238529) @@ -2705,7 +2705,8 @@ product QUALCOMM2 CDMA_MSM 0x3196 CDMA T product QUALCOMM2 AC8700 0x6000 AC8700 product QUALCOMM2 VW110L 0x1000 Vertex Wireless 110L modem product QUALCOMM2 SIM5218 0x9000 SIM5218 -product QUALCOMM2 GOBI2000 0x9204 Qualcomm Gobi 2000 +product QUALCOMM2 GOBI2000_QDL 0x9204 Qualcomm Gobi 2000 QDL +product QUALCOMM2 GOBI2000 0x9205 Qualcomm Gobi 2000 modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 15:56:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3B48106566C; Mon, 16 Jul 2012 15:56:40 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7456B8FC0C; Mon, 16 Jul 2012 15:56:40 +0000 (UTC) Received: by obbun3 with SMTP id un3so12121706obb.13 for ; Mon, 16 Jul 2012 08:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=erzAqp3+LGjwfQjpy868lBkeIgosoxoxrvkrjY7VgRU=; b=AZlebJ08JvbkxoISHXtE66XWNwz3OKrQ5JWcSk6NgOKRIRiGxdToyiPan/bsd/Mfaw vRFVdwh5yufUBzVYrEJxlMjHTu3Od3dE0LdLBxLuTeZENDqoWdlIn7sfU78WV3u5C3mF fLi7oakpPoklULSCLsMLrXkDl20gc4x7V3nxjZ6auRTuD2bhaO+RJe1OwslEvkED/0ur rMeCfT+RTv9hedTLR+S4KJWa3yWjDn15jNxafo/6fvVeWui6uT4lmoHD3hMjRJUTSkoj x+SpZSLOQsKKSKVk4OI5E/O241eVqT0PbSTwB5bXJ3tzEbKq3h8W6QiXeSe6FchoHitj 1Ytg== MIME-Version: 1.0 Received: by 10.182.8.6 with SMTP id n6mr16336057oba.39.1342454200090; Mon, 16 Jul 2012 08:56:40 -0700 (PDT) Received: by 10.76.84.7 with HTTP; Mon, 16 Jul 2012 08:56:40 -0700 (PDT) In-Reply-To: <5003DC20.9020703@FreeBSD.org> References: <201207160643.q6G6h5di011993@svn.freebsd.org> <5003DC20.9020703@FreeBSD.org> Date: Mon, 16 Jul 2012 08:56:40 -0700 Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Michael Tuexen Subject: Re: svn commit: r238514 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 15:56:41 -0000 On Mon, Jul 16, 2012 at 2:17 AM, Doug Barton wrote: > Is it my imagination or did this break the build? Don't think so, but I'm running a buildworld with -DWITHOUT_INET -DWITHOUT_INET6 and -DWITHOUT_INET -DWITH_INET6, just to be sure. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 16:49:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B571106566C; Mon, 16 Jul 2012 16:49:16 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 0168E8FC0A; Mon, 16 Jul 2012 16:49:16 +0000 (UTC) Received: from [192.168.1.103] (p5481A29D.dip.t-dialin.net [84.129.162.157]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 907301C0B4603; Mon, 16 Jul 2012 18:49:14 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Michael Tuexen In-Reply-To: Date: Mon, 16 Jul 2012 18:49:13 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <201207160643.q6G6h5di011993@svn.freebsd.org> <5003DC20.9020703@FreeBSD.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r238514 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 16:49:16 -0000 On Jul 16, 2012, at 5:56 PM, Garrett Cooper wrote: > On Mon, Jul 16, 2012 at 2:17 AM, Doug Barton wrote: >> Is it my imagination or did this break the build? > > Don't think so, but I'm running a buildworld with -DWITHOUT_INET > -DWITHOUT_INET6 and -DWITHOUT_INET -DWITH_INET6, just to be sure. Please let me know if there are still any issues. I think it should be fixed now (meaning that it compiles (which I broke) and meaning that it actually works (which I fixed). Best regards Michael > Thanks, > -Garrett > From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 16:50:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E660106566B; Mon, 16 Jul 2012 16:50:29 +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 299038FC21; Mon, 16 Jul 2012 16:50:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GGoTRi060574; Mon, 16 Jul 2012 16:50:29 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GGoSCo060571; Mon, 16 Jul 2012 16:50:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207161650.q6GGoSCo060571@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 16 Jul 2012 16:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238533 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 16:50:29 -0000 Author: trasz Date: Mon Jul 16 16:50:28 2012 New Revision: 238533 URL: http://svn.freebsd.org/changeset/base/238533 Log: Add back spare fields reused in r238213. According to Attilio, the rule is to use reuse spares only when MFC-ing, not in CURRENT. Modified: head/sys/geom/geom.h Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Mon Jul 16 11:58:44 2012 (r238532) +++ head/sys/geom/geom.h Mon Jul 16 16:50:28 2012 (r238533) @@ -110,6 +110,7 @@ struct g_class { g_ioctl_t *ioctl; g_provgone_t *providergone; g_resize_t *resize; + void *spare2; /* * The remaining elements are private */ @@ -141,6 +142,7 @@ struct g_geom { g_ioctl_t *ioctl; g_provgone_t *providergone; g_resize_t *resize; + void *spare1; void *softc; unsigned flags; #define G_GEOM_WITHER 1 From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 17:41:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0FA0B106566C; Mon, 16 Jul 2012 17:41:39 +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 EF82E8FC08; Mon, 16 Jul 2012 17:41:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GHfceh065367; Mon, 16 Jul 2012 17:41:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GHfcBH065365; Mon, 16 Jul 2012 17:41:38 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207161741.q6GHfcBH065365@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 16 Jul 2012 17:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238534 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 17:41:39 -0000 Author: trasz Date: Mon Jul 16 17:41:38 2012 New Revision: 238534 URL: http://svn.freebsd.org/changeset/base/238534 Log: The resize GEOM event has no references, thus cannot be canceled. Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Mon Jul 16 16:50:28 2012 (r238533) +++ head/sys/geom/geom_subr.c Mon Jul 16 17:41:38 2012 (r238534) @@ -615,8 +615,6 @@ g_resize_provider_event(void *arg, int f off_t size; g_topology_assert(); - if (flag == EV_CANCEL) - return; if (g_shutdown) return; From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 17:48:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 00D06106567C; Mon, 16 Jul 2012 17:48:44 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C79CB8FC1C; Mon, 16 Jul 2012 17:48:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GHmhHH066154; Mon, 16 Jul 2012 17:48:43 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GHmhaQ066153; Mon, 16 Jul 2012 17:48:43 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201207161748.q6GHmhaQ066153@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 16 Jul 2012 17:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238535 - head/share/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 17:48:44 -0000 Author: gnn Date: Mon Jul 16 17:48:43 2012 New Revision: 238535 URL: http://svn.freebsd.org/changeset/base/238535 Log: Add a script that traces NFS attribute cache accesses. Submitted by: rwatson MFC after: 2 weeks Added: head/share/dtrace/nfsattrstats (contents, props changed) Added: head/share/dtrace/nfsattrstats ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/nfsattrstats Mon Jul 16 17:48:43 2012 (r238535) @@ -0,0 +1,74 @@ +#!/bin/sh +# +# Copyright (c) 2012 Robert N. M. Watson +# All rights reserved. +# +# This software was developed at the University of Cambridge Computer +# Laboratory with support from a grant from Google, Inc. +# +# 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$ +# +# This script creates a trace of NFS RPCs, NFS attribute cache +# activity, and NFS access cache activity, along with the system call +# that instigated the activity. Notice that NFS events may happen +# outside of the context of a system call, most likely due to the VM +# system paging from NFS, in which case the system call name is +# reported as "-" + +/usr/sbin/dtrace -n ' +#pragma D option quiet + +dtrace:::BEGIN +{ + printf("probe\targ0\texecutable\tsyscall\n"); +} + +syscall:::entry +{ + + self->syscallname = probefunc; +} + +syscall:::return +{ + + self->syscallname = ""; +} + +nfsclient::: +/self->syscallname != 0 && self->syscallname != ""/ +{ + + printf("%s\t%s\t%s\t%s\n", probemod, stringof(arg0), execname, + self->syscallname); +} + +nfsclient::: +/self->syscallname == 0 || self->syscallname == ""/ +{ + + printf("%s\t%s\t%s\t%s\n", probemod, stringof(arg0), execname, + self->syscallname); +} +' From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 18:13:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DA831065672; Mon, 16 Jul 2012 18:13:44 +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 2963B8FC1A; Mon, 16 Jul 2012 18:13:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GIDi8l068183; Mon, 16 Jul 2012 18:13:44 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GIDhm1068181; Mon, 16 Jul 2012 18:13:43 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207161813.q6GIDhm1068181@svn.freebsd.org> From: Alan Cox Date: Mon, 16 Jul 2012 18:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238536 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 18:13:44 -0000 Author: alc Date: Mon Jul 16 18:13:43 2012 New Revision: 238536 URL: http://svn.freebsd.org/changeset/base/238536 Log: Various improvements to vm_contig_grow_cache(). Most notably, even when it can't sleep, it can still move clean pages from the inactive queue to the cache. Also, when a page is cached, there is no need to restart the scan. The "next" page pointer held by vm_contig_launder() is still valid. Finally, add a comment summarizing what vm_contig_grow_cache() does based upon the value of "tries". MFC after: 3 weeks Modified: head/sys/vm/vm_contig.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Mon Jul 16 17:48:43 2012 (r238535) +++ head/sys/vm/vm_contig.c Mon Jul 16 18:13:43 2012 (r238536) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); #include static int -vm_contig_launder_page(vm_page_t m, vm_page_t *next) +vm_contig_launder_page(vm_page_t m, vm_page_t *next, int tries) { vm_object_t object; vm_page_t m_tmp; @@ -92,7 +92,10 @@ vm_contig_launder_page(vm_page_t m, vm_p int vfslocked; mtx_assert(&vm_page_queue_mtx, MA_OWNED); - vm_page_lock_assert(m, MA_OWNED); + if (!vm_pageout_page_lock(m, next) || m->hold_count != 0) { + vm_page_unlock(m); + return (EAGAIN); + } object = m->object; if (!VM_OBJECT_TRYLOCK(object) && (!vm_pageout_fallback_object_lock(m, next) || m->hold_count != 0)) { @@ -100,7 +103,13 @@ vm_contig_launder_page(vm_page_t m, vm_p VM_OBJECT_UNLOCK(object); return (EAGAIN); } - if (vm_page_sleep_if_busy(m, TRUE, "vpctw0")) { + if ((m->oflags & VPO_BUSY) != 0 || m->busy != 0) { + if (tries == 0) { + vm_page_unlock(m); + VM_OBJECT_UNLOCK(object); + return (EAGAIN); + } + vm_page_sleep(m, "vpctw0"); VM_OBJECT_UNLOCK(object); vm_page_lock_queues(); return (EBUSY); @@ -110,7 +119,7 @@ vm_contig_launder_page(vm_page_t m, vm_p pmap_remove_all(m); if (m->dirty != 0) { vm_page_unlock(m); - if ((object->flags & OBJ_DEAD) != 0) { + if (tries == 0 || (object->flags & OBJ_DEAD) != 0) { VM_OBJECT_UNLOCK(object); return (EAGAIN); } @@ -146,34 +155,25 @@ vm_contig_launder_page(vm_page_t m, vm_p vm_page_unlock(m); } VM_OBJECT_UNLOCK(object); - return (0); + return (EAGAIN); } static int -vm_contig_launder(int queue, vm_paddr_t low, vm_paddr_t high) +vm_contig_launder(int queue, int tries, vm_paddr_t low, vm_paddr_t high) { vm_page_t m, next; vm_paddr_t pa; int error; TAILQ_FOREACH_SAFE(m, &vm_page_queues[queue].pl, pageq, next) { - - /* Skip marker pages */ + KASSERT(m->queue == queue, + ("vm_contig_launder: page %p's queue is not %d", m, queue)); if ((m->flags & PG_MARKER) != 0) continue; - pa = VM_PAGE_TO_PHYS(m); if (pa < low || pa + PAGE_SIZE > high) continue; - - if (!vm_pageout_page_lock(m, &next) || m->hold_count != 0) { - vm_page_unlock(m); - continue; - } - KASSERT(m->queue == queue, - ("vm_contig_launder: page %p's queue is not %d", m, queue)); - error = vm_contig_launder_page(m, &next); - vm_page_lock_assert(m, MA_NOTOWNED); + error = vm_contig_launder_page(m, &next, tries); if (error == 0) return (TRUE); if (error == EBUSY) @@ -183,7 +183,15 @@ vm_contig_launder(int queue, vm_paddr_t } /* - * Increase the number of cached pages. + * Increase the number of cached pages. The specified value, "tries", + * determines which categories of pages are cached: + * + * 0: All clean, inactive pages within the specified physical address range + * are cached. Will not sleep. + * 1: The vm_lowmem handlers are called. All inactive pages within + * the specified physical address range are cached. May sleep. + * 2: The vm_lowmem handlers are called. All inactive and active pages + * within the specified physical address range are cached. May sleep. */ void vm_contig_grow_cache(int tries, vm_paddr_t low, vm_paddr_t high) @@ -206,15 +214,16 @@ vm_contig_grow_cache(int tries, vm_paddr } vm_page_lock_queues(); inactl = 0; - inactmax = tries < 1 ? 0 : cnt.v_inactive_count; + inactmax = cnt.v_inactive_count; actl = 0; actmax = tries < 2 ? 0 : cnt.v_active_count; again: - if (inactl < inactmax && vm_contig_launder(PQ_INACTIVE, low, high)) { + if (inactl < inactmax && vm_contig_launder(PQ_INACTIVE, tries, low, + high)) { inactl++; goto again; } - if (actl < actmax && vm_contig_launder(PQ_ACTIVE, low, high)) { + if (actl < actmax && vm_contig_launder(PQ_ACTIVE, tries, low, high)) { actl++; goto again; } From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 20:17:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B9731065673; Mon, 16 Jul 2012 20:17:20 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5D48FC08; Mon, 16 Jul 2012 20:17:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GKHKr6078815; Mon, 16 Jul 2012 20:17:20 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GKHKrt078811; Mon, 16 Jul 2012 20:17:20 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201207162017.q6GKHKrt078811@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 16 Jul 2012 20:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238537 - in head/sys: cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 20:17:20 -0000 Author: gnn Date: Mon Jul 16 20:17:19 2012 New Revision: 238537 URL: http://svn.freebsd.org/changeset/base/238537 Log: Add support for walltimestamp in DTrace. Submitted by: Fabian Keil MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c head/sys/kern/kern_tc.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jul 16 18:13:43 2012 (r238536) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Jul 16 20:17:19 2012 (r238537) @@ -47,6 +47,8 @@ extern uintptr_t dtrace_in_probe_addr; extern int dtrace_in_probe; +extern void dtrace_getnanotime(struct timespec *tsp); + int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); typedef struct dtrace_invop_hdlr { @@ -461,8 +463,11 @@ dtrace_gethrtime() uint64_t dtrace_gethrestime(void) { - printf("%s(%d): XXX\n",__func__,__LINE__); - return (0); + struct timespec current_time; + + dtrace_getnanotime(¤t_time); + + return (current_time.tv_sec * 1000000000UL + current_time.tv_nsec); } /* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jul 16 18:13:43 2012 (r238536) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Jul 16 20:17:19 2012 (r238537) @@ -49,6 +49,8 @@ extern uintptr_t kernelbase; extern uintptr_t dtrace_in_probe_addr; extern int dtrace_in_probe; +extern void dtrace_getnanotime(struct timespec *tsp); + int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); typedef struct dtrace_invop_hdlr { @@ -462,8 +464,11 @@ dtrace_gethrtime() uint64_t dtrace_gethrestime(void) { - printf("%s(%d): XXX\n",__func__,__LINE__); - return (0); + struct timespec current_time; + + dtrace_getnanotime(¤t_time); + + return (current_time.tv_sec * 1000000000UL + current_time.tv_nsec); } /* Function to handle DTrace traps during probes. See i386/i386/trap.c */ Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Mon Jul 16 18:13:43 2012 (r238536) +++ head/sys/kern/kern_tc.c Mon Jul 16 20:17:19 2012 (r238537) @@ -122,6 +122,8 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, static void tc_windup(void); static void cpu_tick_calibrate(int); +void dtrace_getnanotime(struct timespec *tsp); + static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS) { @@ -960,6 +962,24 @@ getmicrotime(struct timeval *tvp) #endif /* FFCLOCK */ /* + * This is a clone of getnanotime and used for walltimestamps. + * The dtrace_ prefix prevents fbt from creating probes for + * it so walltimestamp can be safely used in all fbt probes. + */ +void +dtrace_getnanotime(struct timespec *tsp) +{ + struct timehands *th; + u_int gen; + + do { + th = timehands; + gen = th->th_generation; + *tsp = th->th_nanotime; + } while (gen == 0 || gen != th->th_generation); +} + +/* * System clock currently providing time to the system. Modifiable via sysctl * when the FFCLOCK option is defined. */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 20:43:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26293106566B; Mon, 16 Jul 2012 20:43:29 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 110578FC12; Mon, 16 Jul 2012 20:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GKhSvC081006; Mon, 16 Jul 2012 20:43:28 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GKhS67081004; Mon, 16 Jul 2012 20:43:28 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207162043.q6GKhS67081004@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 16 Jul 2012 20:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238538 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 20:43:29 -0000 Author: trociny Date: Mon Jul 16 20:43:28 2012 New Revision: 238538 URL: http://svn.freebsd.org/changeset/base/238538 Log: Metaflush on/off values don't need quotes. Reviewed by: pjd MFC after: 3 days Modified: head/sbin/hastd/hast.conf.5 Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Mon Jul 16 20:17:19 2012 (r238537) +++ head/sbin/hastd/hast.conf.5 Mon Jul 16 20:43:28 2012 (r238538) @@ -63,7 +63,7 @@ checksum compression timeout exec -metaflush "on" | "off" +metaflush on | off pidfile on { @@ -89,14 +89,14 @@ resource { local timeout exec - metaflush "on" | "off" + metaflush on | off on { # Resource-node section name # Required local - metaflush "on" | "off" + metaflush on | off # Required remote source @@ -106,7 +106,7 @@ resource { name # Required local - metaflush "on" | "off" + metaflush on | off # Required remote source From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 22:07:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D53C31065672; Mon, 16 Jul 2012 22:07:30 +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 C04538FC14; Mon, 16 Jul 2012 22:07:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GM7Ujl087236; Mon, 16 Jul 2012 22:07:30 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GM7UNS087234; Mon, 16 Jul 2012 22:07:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207162207.q6GM7UNS087234@svn.freebsd.org> From: Christian Brueffer Date: Mon, 16 Jul 2012 22:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238539 - head/sys/fs/smbfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 22:07:31 -0000 Author: brueffer Date: Mon Jul 16 22:07:29 2012 New Revision: 238539 URL: http://svn.freebsd.org/changeset/base/238539 Log: Simply error handling by moving the allocation of np down to where it is actually used. While here, improve style a little. Submitted by: mjg MFC after: 2 weeks Modified: head/sys/fs/smbfs/smbfs_node.c Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Mon Jul 16 20:43:28 2012 (r238538) +++ head/sys/fs/smbfs/smbfs_node.c Mon Jul 16 22:07:29 2012 (r238539) @@ -223,17 +223,15 @@ loop: if (fap == NULL) return ENOENT; - np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp); - if (error) { - free(np, M_SMBNODE); - return error; - } + if (error != 0) + return (error); error = insmntque(vp, mp); /* XXX: Too early for mpsafe fs */ - if (error != 0) { - free(np, M_SMBNODE); + if (error != 0) return (error); - } + + np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); + vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG; vp->v_data = np; np->n_vnode = vp; From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 22:10:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0782A106566B; Mon, 16 Jul 2012 22:10:06 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 99F068FC16; Mon, 16 Jul 2012 22:10:04 +0000 (UTC) Received: by lbon10 with SMTP id n10so10063515lbo.13 for ; Mon, 16 Jul 2012 15:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=brT2GhHfnd68e+lZY4eO5GeW7Bn/YhsovJ+BHS3iccc=; b=RIbbfuFidbd95iisNH0jBb6A7tvo6WiyS0rLskMX493beiOMzOO6y22ZU+GQWXbCLe vH3q9g66zcnAdMKI1seniq0YzQZhp4I8kfMj4mxfoe9ra9kFJJCVxAO+eYuL/3JX2/x7 yQ647m3JhH+C1wNhite0geKKIpk5sl5QC1LPAUUzncrGZrsW6M1zc69ESvgMxmgVkiA4 UtssaB6JPFP9wihGE3mgpekTYl105iiGsaYVcB7/dlWatwOPr070lReEJ3aoCaRkQWRA v0ag+wpfCH4eUjyaq4t2ScEh8sTyEU4Zu70x5PglU8ShGqjF8Zb9SOkpGB6HBI2Ip4it XubA== MIME-Version: 1.0 Received: by 10.112.45.4 with SMTP id i4mr97134lbm.79.1342476603469; Mon, 16 Jul 2012 15:10:03 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.27.65 with HTTP; Mon, 16 Jul 2012 15:10:03 -0700 (PDT) In-Reply-To: <201207162207.q6GM7UNS087234@svn.freebsd.org> References: <201207162207.q6GM7UNS087234@svn.freebsd.org> Date: Mon, 16 Jul 2012 23:10:03 +0100 X-Google-Sender-Auth: BKHfDTcRP7lbli-D1uUwO1hxsK4 Message-ID: From: Attilio Rao To: Christian Brueffer , Mateusz Guzik Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238539 - head/sys/fs/smbfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 22:10:06 -0000 2012/7/16 Christian Brueffer : > Author: brueffer > Date: Mon Jul 16 22:07:29 2012 > New Revision: 238539 > URL: http://svn.freebsd.org/changeset/base/238539 > > Log: > Simply error handling by moving the allocation of np down to where it is > actually used. While here, improve style a little. Too bad that the biggest bug here is still in place. Right now smbfs inserts in the mount list half-constructed vnodes. Maybe you are interested in fixing this? Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 22:15:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A90001065670; Mon, 16 Jul 2012 22:15:30 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 943028FC08; Mon, 16 Jul 2012 22:15:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6GMFUuB087942; Mon, 16 Jul 2012 22:15:30 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6GMFUql087940; Mon, 16 Jul 2012 22:15:30 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201207162215.q6GMFUql087940@svn.freebsd.org> From: Isabell Long Date: Mon, 16 Jul 2012 22:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238540 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 22:15:30 -0000 Author: issyl0 (doc committer) Date: Mon Jul 16 22:15:30 2012 New Revision: 238540 URL: http://svn.freebsd.org/changeset/base/238540 Log: In ipfw(8), make the text about dynamic rules consistent. PR: docs/120539 Approved by: gabor (mentor) MFC after: 5 days Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Jul 16 22:07:29 2012 (r238539) +++ head/sbin/ipfw/ipfw.8 Mon Jul 16 22:15:30 2012 (r238540) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2012 +.Dd July 16, 2012 .Dt IPFW 8 .Os .Sh NAME @@ -2967,9 +2967,11 @@ This will let the firewall install dynam those connection which start with a regular SYN packet coming from the inside of our network. Dynamic rules are checked when encountering the first -.Cm check-state -or +occurrence of a +.Cm check-state , .Cm keep-state +or +.Cm limit rule. A .Cm check-state From owner-svn-src-all@FreeBSD.ORG Mon Jul 16 22:41:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 9115F1065673; Mon, 16 Jul 2012 22:41:28 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id ED011150D37; Mon, 16 Jul 2012 22:41:27 +0000 (UTC) Message-ID: <50049897.5050002@FreeBSD.org> Date: Mon, 16 Jul 2012 15:41:27 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120621 Thunderbird/13.0.1 MIME-Version: 1.0 To: Michael Tuexen References: <201207160643.q6G6h5di011993@svn.freebsd.org> <5003DC20.9020703@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238514 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 22:41:28 -0000 On 07/16/2012 09:49, Michael Tuexen wrote: > On Jul 16, 2012, at 5:56 PM, Garrett Cooper wrote: > >> On Mon, Jul 16, 2012 at 2:17 AM, Doug Barton wrote: >>> Is it my imagination or did this break the build? >> >> Don't think so, but I'm running a buildworld with -DWITHOUT_INET >> -DWITHOUT_INET6 and -DWITHOUT_INET -DWITH_INET6, just to be sure. > Please let me know if there are still any issues. I think it should > be fixed now (meaning that it compiles (which I broke) and meaning > that it actually works (which I fixed). I waited a while after your change and the tinderbox was still failing. Not too long after your first mail (responding to me) it stopped failing, so it was probably just a timing issue. Sorry for the noise. Doug -- Change is hard. From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 02:02:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC5BD106566C; Tue, 17 Jul 2012 02:02:40 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8ACC78FC15; Tue, 17 Jul 2012 02:02:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6H22eu7004757; Tue, 17 Jul 2012 02:02:40 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6H22efr004755; Tue, 17 Jul 2012 02:02:40 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207170202.q6H22efr004755@svn.freebsd.org> From: David Xu Date: Tue, 17 Jul 2012 02:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238541 - stable/8/lib/libc/i386/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 02:02:41 -0000 Author: davidxu Date: Tue Jul 17 02:02:40 2012 New Revision: 238541 URL: http://svn.freebsd.org/changeset/base/238541 Log: MFC r238328: Executing CPUID with EAX set to 1 to actually get feature flags. PR: 169730 Modified: stable/8/lib/libc/i386/gen/getcontextx.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/i386/gen/getcontextx.c ============================================================================== --- stable/8/lib/libc/i386/gen/getcontextx.c Mon Jul 16 22:15:30 2012 (r238540) +++ stable/8/lib/libc/i386/gen/getcontextx.c Tue Jul 17 02:02:40 2012 (r238541) @@ -68,7 +68,7 @@ __getcontextx_size(void) " movl %%ebx,%1\n" " popl %%ebx\n" : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (0x0)); + : "0" (0x1)); if ((p[2] & CPUID2_OSXSAVE) != 0) { __asm __volatile( " pushl %%ebx\n" From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 02:05:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F10F1065670; Tue, 17 Jul 2012 02:05:40 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2068F8FC0A; Tue, 17 Jul 2012 02:05:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6H25daT005003; Tue, 17 Jul 2012 02:05:39 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6H25deA004998; Tue, 17 Jul 2012 02:05:39 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201207170205.q6H25deA004998@svn.freebsd.org> From: Kevin Lo Date: Tue, 17 Jul 2012 02:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238542 - in head/share/man: man4 man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 02:05:40 -0000 Author: kevlo Date: Tue Jul 17 02:05:39 2012 New Revision: 238542 URL: http://svn.freebsd.org/changeset/base/238542 Log: Put parenthesis around sizeof args. Modified: head/share/man/man4/gpib.4 head/share/man/man9/ieee80211_node.9 head/share/man/man9/kernel_mount.9 head/share/man/man9/malloc.9 Modified: head/share/man/man4/gpib.4 ============================================================================== --- head/share/man/man4/gpib.4 Tue Jul 17 02:02:40 2012 (r238541) +++ head/share/man/man4/gpib.4 Tue Jul 17 02:05:39 2012 (r238542) @@ -63,7 +63,7 @@ main(int argc, char **argv) { int dmm; unsigned char buf[100]; - char vbuf[sizeof buf * 4]; + char vbuf[sizeof(buf) * 4]; /* DVM */ dmm = ibdev(0, (argc > 1? atoi(argv[1]): 7), 0, @@ -71,7 +71,7 @@ main(int argc, char **argv) if (dmm < 0) errx(1, "ibdev = %d\\n", dmm); ibwrt(dmm, "*IDN?\\r\\n", 7); - ibrd(dmm, buf, sizeof buf - 1); + ibrd(dmm, buf, sizeof(buf) - 1); strvisx(vbuf, buf, ibcnt, VIS_WHITE | VIS_CSTYLE); printf("%s\\n", vbuf); return (0); Modified: head/share/man/man9/ieee80211_node.9 ============================================================================== --- head/share/man/man9/ieee80211_node.9 Tue Jul 17 02:02:40 2012 (r238541) +++ head/share/man/man9/ieee80211_node.9 Tue Jul 17 02:05:39 2012 (r238542) @@ -185,7 +185,7 @@ iwi_node_alloc(struct ieee80211vap *vap, { struct iwi_node *in; - in = malloc(sizeof (struct iwi_node), M_80211_NODE, + in = malloc(sizeof(struct iwi_node), M_80211_NODE, M_NOWAIT | M_ZERO); if (in == NULL) return NULL; Modified: head/share/man/man9/kernel_mount.9 ============================================================================== --- head/share/man/man9/kernel_mount.9 Tue Jul 17 02:02:40 2012 (r238541) +++ head/share/man/man9/kernel_mount.9 Tue Jul 17 02:05:39 2012 (r238542) @@ -153,12 +153,12 @@ msdosfs_cmount(struct mntarg *ma, void * if (data == NULL) return (EINVAL); - error = copyin(data, &args, sizeof args); + error = copyin(data, &args, sizeof(args)); if (error) return (error); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &args.export, sizeof(args.export)); ma = mount_argf(ma, "uid", "%d", args.uid); ma = mount_argf(ma, "gid", "%d", args.gid); ma = mount_argf(ma, "mask", "%d", args.mask); Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Tue Jul 17 02:02:40 2012 (r238541) +++ head/share/man/man9/malloc.9 Tue Jul 17 02:05:39 2012 (r238542) @@ -197,7 +197,7 @@ MALLOC_DEFINE(M_FOOBUF, "foobuffers", "B /* sys/something/foo_subr.c */ \&... -buf = malloc(sizeof *buf, M_FOOBUF, M_NOWAIT); +buf = malloc(sizeof(*buf), M_FOOBUF, M_NOWAIT); .Ed .Pp From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 02:37:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CAFF106566C; Tue, 17 Jul 2012 02:37:00 +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 5762A8FC12; Tue, 17 Jul 2012 02:37:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6H2b0Ok007584; Tue, 17 Jul 2012 02:37:00 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6H2b0Bu007582; Tue, 17 Jul 2012 02:37:00 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207170237.q6H2b0Bu007582@svn.freebsd.org> From: Alan Cox Date: Tue, 17 Jul 2012 02:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238543 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 02:37:00 -0000 Author: alc Date: Tue Jul 17 02:36:59 2012 New Revision: 238543 URL: http://svn.freebsd.org/changeset/base/238543 Log: Correct vm_page_alloc_contig()'s implementation of VM_ALLOC_NODUMP. Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Jul 17 02:05:39 2012 (r238542) +++ head/sys/vm/vm_page.c Tue Jul 17 02:36:59 2012 (r238543) @@ -1684,7 +1684,7 @@ retry: } for (m = m_ret; m < &m_ret[npages]; m++) { m->aflags = 0; - m->flags &= flags; + m->flags = (m->flags | PG_NODUMP) & flags; if ((req & VM_ALLOC_WIRED) != 0) m->wire_count = 1; /* Unmanaged pages don't use "act_count". */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 03:18:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C31E106564A; Tue, 17 Jul 2012 03:18:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9E9B8FC12; Tue, 17 Jul 2012 03:18:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6H3IDLA010828; Tue, 17 Jul 2012 03:18:13 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6H3IDx7010821; Tue, 17 Jul 2012 03:18:13 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201207170318.q6H3IDx7010821@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 17 Jul 2012 03:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238545 - in head/sys/arm: arm at91 econa s3c2xx0 xscale/i8134x xscale/pxa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 03:18:14 -0000 Author: gonzo Date: Tue Jul 17 03:18:12 2012 New Revision: 238545 URL: http://svn.freebsd.org/changeset/base/238545 Log: Move unmask IRQ function call up to nexus device level. FDT-enabled targets were broken after r238043 that relies on device up the hierarchy to properly setup interrupt. nexus device for ARM platforms did job only partially: setting handler but not unmasking interrupt. Unmasking was performed by platform code. Reviewed by: andrew@ Modified: head/sys/arm/arm/nexus.c head/sys/arm/at91/at91.c head/sys/arm/econa/econa.c head/sys/arm/s3c2xx0/s3c24x0.c head/sys/arm/xscale/i8134x/i81342.c head/sys/arm/xscale/pxa/pxa_obio.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Tue Jul 17 03:02:11 2012 (r238544) +++ head/sys/arm/arm/nexus.c Tue Jul 17 03:18:12 2012 (r238545) @@ -117,12 +117,16 @@ static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { + int irq; if ((rman_get_flags(res) & RF_SHAREABLE) == 0) flags |= INTR_EXCL; - arm_setup_irqhandler(device_get_nameunit(child), - filt, intr, arg, rman_get_start(res), flags, cookiep); + for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) { + arm_setup_irqhandler(device_get_nameunit(child), + filt, intr, arg, irq, flags, cookiep); + arm_unmask_irq(irq); + } return (0); } Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Tue Jul 17 03:02:11 2012 (r238544) +++ head/sys/arm/at91/at91.c Tue Jul 17 03:18:12 2012 (r238545) @@ -397,7 +397,6 @@ at91_setup_intr(device_t dev, device_t c struct resource *ires, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { - struct at91_softc *sc = device_get_softc(dev); int error; if (rman_get_start(ires) == AT91_IRQ_SYSTEM && filt == NULL) @@ -407,8 +406,6 @@ at91_setup_intr(device_t dev, device_t c if (error) return (error); - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IECR, - 1 << rman_get_start(ires)); return (0); } Modified: head/sys/arm/econa/econa.c ============================================================================== --- head/sys/arm/econa/econa.c Tue Jul 17 03:02:11 2012 (r238544) +++ head/sys/arm/econa/econa.c Tue Jul 17 03:18:12 2012 (r238545) @@ -602,8 +602,6 @@ econa_setup_intr(device_t dev, device_t if (error) return (error); - arm_unmask_irq(rman_get_start(ires)); - return (0); } Modified: head/sys/arm/s3c2xx0/s3c24x0.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0.c Tue Jul 17 03:02:11 2012 (r238544) +++ head/sys/arm/s3c2xx0/s3c24x0.c Tue Jul 17 03:18:12 2012 (r238545) @@ -220,7 +220,6 @@ s3c24x0_setup_intr(device_t dev, device_ /* Enable the external interrupt pin */ s3c24x0_enable_ext_intr(irq - S3C24X0_EXTIRQ_MIN); } - arm_unmask_irq(irq); } return (0); } Modified: head/sys/arm/xscale/i8134x/i81342.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342.c Tue Jul 17 03:02:11 2012 (r238544) +++ head/sys/arm/xscale/i8134x/i81342.c Tue Jul 17 03:18:12 2012 (r238545) @@ -435,7 +435,6 @@ i81342_setup_intr(device_t dev, device_t filt, intr, arg, cookiep); if (error) return (error); - arm_unmask_irq(rman_get_start(ires)); return (0); } Modified: head/sys/arm/xscale/pxa/pxa_obio.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_obio.c Tue Jul 17 03:02:11 2012 (r238544) +++ head/sys/arm/xscale/pxa/pxa_obio.c Tue Jul 17 03:18:12 2012 (r238545) @@ -181,7 +181,6 @@ pxa_setup_intr(device_t dev, device_t ch filter, ithread, arg, cookiep); if (error) return (error); - arm_unmask_irq(rman_get_start(irq)); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 09:31:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E9FA106566B; Tue, 17 Jul 2012 09:31:06 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 093A58FC12; Tue, 17 Jul 2012 09:31:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6H9V5Dp037298; Tue, 17 Jul 2012 09:31:05 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6H9V5SR037296; Tue, 17 Jul 2012 09:31:05 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201207170931.q6H9V5SR037296@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 17 Jul 2012 09:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238546 - head/usr.sbin/lpr/common_source X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 09:31:06 -0000 Author: jh Date: Tue Jul 17 09:31:05 2012 New Revision: 238546 URL: http://svn.freebsd.org/changeset/base/238546 Log: Remove trailing whitespace. MFC after: 2 weeks Modified: head/usr.sbin/lpr/common_source/common.c Modified: head/usr.sbin/lpr/common_source/common.c ============================================================================== --- head/usr.sbin/lpr/common_source/common.c Tue Jul 17 03:18:12 2012 (r238545) +++ head/usr.sbin/lpr/common_source/common.c Tue Jul 17 09:31:05 2012 (r238546) @@ -136,7 +136,7 @@ getq(const struct printer *pp, struct jo /* * Estimate the array size by taking the size of the directory file - * and dividing it by a multiple of the minimum size entry. + * and dividing it by a multiple of the minimum size entry. */ arraysz = (stbuf.st_size / 24); queue = (struct jobqueue **)malloc(arraysz * sizeof(struct jobqueue *)); @@ -641,7 +641,7 @@ trstat_write(struct printer *pp, tr_send * secs= - seconds it took to transfer the file * bytes= - number of bytes transfered (ie, "bytecount") * bps=e - Bytes/sec (if the transfer was "big enough" - * for this to be useful) + * for this to be useful) * ! top= - type of printer (if the type is defined in * printcap, and if this statline is for sending * a file to that ptr) @@ -719,7 +719,7 @@ trstat_write(struct printer *pp, tr_send if (remspace > 1) { strcpy(eostat, "\n"); } else { - /* probably should back up to just before the final " x=".. */ + /* probably should back up to just before the final " x=".. */ strcpy(statline+STATLINE_SIZE-2, "\n"); } statfile = open(statfname, O_WRONLY|O_APPEND, 0664); @@ -732,7 +732,7 @@ trstat_write(struct printer *pp, tr_send close(statfile); return; -#undef UPD_EOSTAT +#undef UPD_EOSTAT } #include From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 09:34:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED9E1106564A; Tue, 17 Jul 2012 09:34:52 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D86128FC0C; Tue, 17 Jul 2012 09:34:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6H9Yqde037622; Tue, 17 Jul 2012 09:34:52 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6H9YqWx037620; Tue, 17 Jul 2012 09:34:52 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201207170934.q6H9YqWx037620@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 17 Jul 2012 09:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238547 - head/usr.sbin/lpr/common_source X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 09:34:53 -0000 Author: jh Date: Tue Jul 17 09:34:52 2012 New Revision: 238547 URL: http://svn.freebsd.org/changeset/base/238547 Log: Make sure that arraysz is initialized to a value larger than zero. arraysz could get initialized to zero on ZFS because ZFS reports directory sizes differently compared to UFS. PR: bin/169493 Tested by: swills MFC after: 2 weeks Modified: head/usr.sbin/lpr/common_source/common.c Modified: head/usr.sbin/lpr/common_source/common.c ============================================================================== --- head/usr.sbin/lpr/common_source/common.c Tue Jul 17 09:31:05 2012 (r238546) +++ head/usr.sbin/lpr/common_source/common.c Tue Jul 17 09:34:52 2012 (r238547) @@ -139,6 +139,8 @@ getq(const struct printer *pp, struct jo * and dividing it by a multiple of the minimum size entry. */ arraysz = (stbuf.st_size / 24); + if (arraysz < 16) + arraysz = 16; queue = (struct jobqueue **)malloc(arraysz * sizeof(struct jobqueue *)); if (queue == NULL) goto errdone; From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 11:18:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 018C61065670; Tue, 17 Jul 2012 11:18:40 +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 E02D28FC17; Tue, 17 Jul 2012 11:18:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HBIdFL047483; Tue, 17 Jul 2012 11:18:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HBIdXH047481; Tue, 17 Jul 2012 11:18:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207171118.q6HBIdXH047481@svn.freebsd.org> From: Michael Tuexen Date: Tue, 17 Jul 2012 11:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238548 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 11:18:40 -0000 Author: tuexen Date: Tue Jul 17 11:18:39 2012 New Revision: 238548 URL: http://svn.freebsd.org/changeset/base/238548 Log: MFC r238454: Bugfix: Send up a COMM UP notification for active 1-to-1 style sockets also in the case where the assoc comes up due to a remotely started handshake (collision case). Approved by: re@ Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Tue Jul 17 09:34:52 2012 (r238547) +++ stable/9/sys/netinet/sctp_input.c Tue Jul 17 11:18:39 2012 (r238548) @@ -2912,14 +2912,12 @@ sctp_handle_cookie_echo(struct mbuf *m, return (m); } } - if ((*inp_p)->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { - if (notification) { - sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - } - if (send_int_conf) { - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, - (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); - } + if (notification) { + sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + } + if (send_int_conf) { + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, + (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); } return (m); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 11:33:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6590106564A; Tue, 17 Jul 2012 11:33:24 +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 D07478FC0A; Tue, 17 Jul 2012 11:33:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HBXOLM048597; Tue, 17 Jul 2012 11:33:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HBXOo8048595; Tue, 17 Jul 2012 11:33:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207171133.q6HBXOo8048595@svn.freebsd.org> From: Michael Tuexen Date: Tue, 17 Jul 2012 11:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238549 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 11:33:25 -0000 Author: tuexen Date: Tue Jul 17 11:33:24 2012 New Revision: 238549 URL: http://svn.freebsd.org/changeset/base/238549 Log: MFC r238458: Provide the correct notification type (SCTP_SEND_FAILED_EVENT) for unsent messages. Approved by: re@ Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Tue Jul 17 11:18:39 2012 (r238548) +++ stable/9/sys/netinet/sctputil.c Tue Jul 17 11:33:24 2012 (r238549) @@ -2951,7 +2951,7 @@ sctp_notify_send_failed2(struct sctp_tcb SCTP_BUF_LEN(m_notify) = 0; if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { ssfe = mtod(m_notify, struct sctp_send_failed_event *); - ssfe->ssfe_type = SCTP_SEND_FAILED; + ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT; ssfe->ssfe_flags = SCTP_DATA_UNSENT; ssfe->ssfe_length = length; ssfe->ssfe_error = error; From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 13:03:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48D261065674; Tue, 17 Jul 2012 13:03:48 +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 1BE628FC0C; Tue, 17 Jul 2012 13:03:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HD3lOs055693; Tue, 17 Jul 2012 13:03:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HD3lZY055690; Tue, 17 Jul 2012 13:03:47 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207171303.q6HD3lZY055690@svn.freebsd.org> From: Michael Tuexen Date: Tue, 17 Jul 2012 13:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238550 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 13:03:48 -0000 Author: tuexen Date: Tue Jul 17 13:03:47 2012 New Revision: 238550 URL: http://svn.freebsd.org/changeset/base/238550 Log: Fix a refcount bug when freeing an association. While there: Change code to be consistent. Discussed with rrs@. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Jul 17 11:33:24 2012 (r238549) +++ head/sys/netinet/sctp_pcb.c Tue Jul 17 13:03:47 2012 (r238550) @@ -4875,6 +4875,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, /* now clean up any chunks here */ TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { TAILQ_REMOVE(&outs->outqueue, sp, next); + sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { if (so) { /* Still an open socket - report */ @@ -4885,19 +4886,14 @@ sctp_free_assoc(struct sctp_inpcb *inp, sctp_m_freem(sp->data); sp->data = NULL; sp->tail_mbuf = NULL; + sp->length = 0; } } if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; } - sctp_free_spbufspace(stcb, asoc, sp); - if (sp->holds_key_ref) - sctp_auth_key_release(stcb, sp->auth_keyid, SCTP_SO_LOCKED); - /* Free the zone stuff */ - SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_strmoq), sp); - SCTP_DECR_STRMOQ_COUNT(); - /* sa_ignore FREED_MEMORY */ + sctp_free_a_strmoq(stcb, sp, SCTP_SO_LOCKED); } } /* sa_ignore FREED_MEMORY */ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Jul 17 11:33:24 2012 (r238549) +++ head/sys/netinet/sctputil.c Tue Jul 17 13:03:47 2012 (r238550) @@ -3774,6 +3774,8 @@ sctp_report_all_outbound(struct sctp_tcb if (sp->data) { sctp_m_freem(sp->data); sp->data = NULL; + sp->tail_mbuf = NULL; + sp->length = 0; } } if (sp->net) { @@ -4833,7 +4835,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t /* * Pull any data to free up the SB * and allow sender to "add more" - * whilc we will throw away :-) + * while we will throw away :-) */ sctp_free_spbufspace(stcb, &stcb->asoc, sp); @@ -4841,9 +4843,9 @@ sctp_release_pr_sctp_chunk(struct sctp_t do_wakeup_routine = 1; sp->some_taken = 1; sctp_m_freem(sp->data); - sp->length = 0; sp->data = NULL; sp->tail_mbuf = NULL; + sp->length = 0; } break; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 14:03:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 725BD106566B; Tue, 17 Jul 2012 14:03:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43FF18FC17; Tue, 17 Jul 2012 14:03:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HE35ur060319; Tue, 17 Jul 2012 14:03:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HE35gi060316; Tue, 17 Jul 2012 14:03:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207171403.q6HE35gi060316@svn.freebsd.org> From: Alexander Motin Date: Tue, 17 Jul 2012 14:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238551 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 14:03:05 -0000 Author: mav Date: Tue Jul 17 14:03:04 2012 New Revision: 238551 URL: http://svn.freebsd.org/changeset/base/238551 Log: For Intel Panther/Lynx Point USB 3.0 xHCI controllers enable SuperSpeed USB capability and reroute USB 2.0 ports to the xHCI controller. Reviewed by: hselasky Modified: head/sys/dev/usb/controller/xhci_pci.c head/sys/dev/usb/controller/xhcireg.h Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Tue Jul 17 13:03:47 2012 (r238550) +++ head/sys/dev/usb/controller/xhci_pci.c Tue Jul 17 14:03:04 2012 (r238551) @@ -101,6 +101,8 @@ xhci_pci_match(device_t self) case 0x1e318086: return ("Intel Panther Point USB 3.0 controller"); + case 0x8c318086: + return ("Intel Lynx Point USB 3.0 controller"); default: break; @@ -245,6 +247,7 @@ static int xhci_pci_take_controller(device_t self) { struct xhci_softc *sc = device_get_softc(self); + uint32_t device_id = pci_get_devid(self); uint32_t cparams; uint32_t eecp; uint32_t eec; @@ -285,5 +288,13 @@ xhci_pci_take_controller(device_t self) usb_pause_mtx(NULL, hz / 100); /* wait 10ms */ } } + + /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ + if (device_id == 0x1e318086 /* Panther Point */ || + device_id == 0x8c318086 /* Lynx Point */) { + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, 0xffffffff, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, 0xffffffff, 4); + } + return (0); } Modified: head/sys/dev/usb/controller/xhcireg.h ============================================================================== --- head/sys/dev/usb/controller/xhcireg.h Tue Jul 17 13:03:47 2012 (r238550) +++ head/sys/dev/usb/controller/xhcireg.h Tue Jul 17 14:03:04 2012 (r238551) @@ -34,6 +34,9 @@ #define PCI_USB_REV_3_0 0x30 /* USB 3.0 */ #define PCI_XHCI_FLADJ 0x61 /* RW frame length adjust */ +#define PCI_XHCI_INTEL_XUSB2PR 0xD0 /* Intel USB2 Port Routing */ +#define PCI_XHCI_INTEL_USB3_PSSEN 0xD8 /* Intel USB3 Port SuperSpeed Enable */ + /* XHCI capability registers */ #define XHCI_CAPLENGTH 0x00 /* RO capability */ #define XHCI_RESERVED 0x01 /* Reserved */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 14:36:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 752841065678; Tue, 17 Jul 2012 14:36:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F4B68FC17; Tue, 17 Jul 2012 14:36:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HEafvM062837; Tue, 17 Jul 2012 14:36:41 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HEafrp062834; Tue, 17 Jul 2012 14:36:41 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201207171436.q6HEafrp062834@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 17 Jul 2012 14:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238552 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 14:36:41 -0000 Author: gnn Date: Tue Jul 17 14:36:40 2012 New Revision: 238552 URL: http://svn.freebsd.org/changeset/base/238552 Log: Change UL to ULL since time is 32 bits. Pointed out by: avg@ MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Tue Jul 17 14:03:04 2012 (r238551) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Tue Jul 17 14:36:40 2012 (r238552) @@ -467,7 +467,7 @@ dtrace_gethrestime(void) dtrace_getnanotime(¤t_time); - return (current_time.tv_sec * 1000000000UL + current_time.tv_nsec); + return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec); } /* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue Jul 17 14:03:04 2012 (r238551) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue Jul 17 14:36:40 2012 (r238552) @@ -468,7 +468,7 @@ dtrace_gethrestime(void) dtrace_getnanotime(¤t_time); - return (current_time.tv_sec * 1000000000UL + current_time.tv_nsec); + return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec); } /* Function to handle DTrace traps during probes. See i386/i386/trap.c */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 17:34:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71F7D106566C; Tue, 17 Jul 2012 17:34:49 +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 59A468FC0A; Tue, 17 Jul 2012 17:34:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HHYnZ3076481; Tue, 17 Jul 2012 17:34:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HHYnob076477; Tue, 17 Jul 2012 17:34:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201207171734.q6HHYnob076477@svn.freebsd.org> From: Xin LI Date: Tue, 17 Jul 2012 17:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238553 - stable/8/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 17:34:49 -0000 Author: delphij Date: Tue Jul 17 17:34:48 2012 New Revision: 238553 URL: http://svn.freebsd.org/changeset/base/238553 Log: MFC the following revisions per request from gleb@: r197953: Add locking around access to parent node, and bail out when the parent node is already freed rather than panicking the system. r227822: Avoid panics from recursive rename operations. Not a perfect patch but good enough for now. r232959: Don't enforce LK_RETRY to get existing vnode in tmpfs_alloc_vp(). Doomed vnode is hardly of any use here, besides all callers handle error case. vfs_hash_get() does the same. Don't mess with vnode holdcount, vget() takes care of it already. r232960: Prevent tmpfs_rename() deadlock in a way similar to UFS Unlock vnodes and try to lock them one by one. Relookup fvp and tvp. Modified: stable/8/sys/fs/tmpfs/tmpfs.h stable/8/sys/fs/tmpfs/tmpfs_subr.c stable/8/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs.h Tue Jul 17 14:36:40 2012 (r238552) +++ stable/8/sys/fs/tmpfs/tmpfs.h Tue Jul 17 17:34:48 2012 (r238553) @@ -304,10 +304,30 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define TMPFS_NODE_LOCK(node) mtx_lock(&(node)->tn_interlock) #define TMPFS_NODE_UNLOCK(node) mtx_unlock(&(node)->tn_interlock) -#define TMPFS_NODE_MTX(node) (&(node)->tn_interlock) +#define TMPFS_NODE_MTX(node) (&(node)->tn_interlock) + +#ifdef INVARIANTS +#define TMPFS_ASSERT_LOCKED(node) do { \ + MPASS(node != NULL); \ + MPASS(node->tn_vnode != NULL); \ + if (!VOP_ISLOCKED(node->tn_vnode) && \ + !mtx_owned(TMPFS_NODE_MTX(node))) \ + panic("tmpfs: node is not locked: %p", node); \ + } while (0) +#define TMPFS_ASSERT_ELOCKED(node) do { \ + MPASS((node) != NULL); \ + MPASS((node)->tn_vnode != NULL); \ + mtx_assert(TMPFS_NODE_MTX(node), MA_OWNED); \ + ASSERT_VOP_LOCKED((node)->tn_vnode, "tmpfs"); \ + } while (0) +#else +#define TMPFS_ASSERT_LOCKED(node) (void)0 +#define TMPFS_ASSERT_ELOCKED(node) (void)0 +#endif #define TMPFS_VNODE_ALLOCATING 1 #define TMPFS_VNODE_WANT 2 +#define TMPFS_VNODE_DOOMED 4 /* --------------------------------------------------------------------- */ /* Modified: stable/8/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_subr.c Tue Jul 17 14:36:40 2012 (r238552) +++ stable/8/sys/fs/tmpfs/tmpfs_subr.c Tue Jul 17 17:34:48 2012 (r238553) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -55,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include +SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW, 0, "tmpfs file system"); + /* --------------------------------------------------------------------- */ /* @@ -124,7 +127,9 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp nnode->tn_dir.tn_readdir_lastn = 0; nnode->tn_dir.tn_readdir_lastp = NULL; nnode->tn_links++; + TMPFS_NODE_LOCK(nnode->tn_dir.tn_parent); nnode->tn_dir.tn_parent->tn_links++; + TMPFS_NODE_UNLOCK(nnode->tn_dir.tn_parent); break; case VFIFO: @@ -187,6 +192,7 @@ tmpfs_free_node(struct tmpfs_mount *tmp, #ifdef INVARIANTS TMPFS_NODE_LOCK(node); MPASS(node->tn_vnode == NULL); + MPASS((node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0); TMPFS_NODE_UNLOCK(node); #endif @@ -314,11 +320,14 @@ tmpfs_alloc_vp(struct mount *mp, struct loop: TMPFS_NODE_LOCK(node); if ((vp = node->tn_vnode) != NULL) { + MPASS((node->tn_vpstate & TMPFS_VNODE_DOOMED) == 0); VI_LOCK(vp); TMPFS_NODE_UNLOCK(node); - vholdl(vp); - (void) vget(vp, lkflag | LK_INTERLOCK | LK_RETRY, curthread); - vdrop(vp); + error = vget(vp, lkflag | LK_INTERLOCK, curthread); + if (error != 0) { + vp = NULL; + goto out; + } /* * Make sure the vnode is still there after @@ -332,6 +341,14 @@ loop: goto out; } + if ((node->tn_vpstate & TMPFS_VNODE_DOOMED) || + (node->tn_type == VDIR && node->tn_dir.tn_parent == NULL)) { + TMPFS_NODE_UNLOCK(node); + error = ENOENT; + vp = NULL; + goto out; + } + /* * otherwise lock the vp list while we call getnewvnode * since that can block. @@ -377,6 +394,7 @@ loop: vp->v_op = &tmpfs_fifoop_entries; break; case VDIR: + MPASS(node->tn_dir.tn_parent != NULL); if (node->tn_dir.tn_parent == node) vp->v_vflag |= VV_ROOT; break; @@ -407,11 +425,13 @@ unlock: out: *vpp = vp; - MPASS(IFF(error == 0, *vpp != NULL && VOP_ISLOCKED(*vpp))); #ifdef INVARIANTS - TMPFS_NODE_LOCK(node); - MPASS(*vpp == node->tn_vnode); - TMPFS_NODE_UNLOCK(node); + if (error == 0) { + MPASS(*vpp != NULL && VOP_ISLOCKED(*vpp)); + TMPFS_NODE_LOCK(node); + MPASS(*vpp == node->tn_vnode); + TMPFS_NODE_UNLOCK(node); + } #endif return error; @@ -430,10 +450,9 @@ tmpfs_free_vp(struct vnode *vp) node = VP_TO_TMPFS_NODE(vp); - TMPFS_NODE_LOCK(node); + mtx_assert(TMPFS_NODE_MTX(node), MA_OWNED); node->tn_vnode = NULL; vp->v_data = NULL; - TMPFS_NODE_UNLOCK(node); } /* --------------------------------------------------------------------- */ @@ -657,7 +676,18 @@ tmpfs_dir_getdotdotdent(struct tmpfs_nod TMPFS_VALIDATE_DIR(node); MPASS(uio->uio_offset == TMPFS_DIRCOOKIE_DOTDOT); + /* + * Return ENOENT if the current node is already removed. + */ + TMPFS_ASSERT_LOCKED(node); + if (node->tn_dir.tn_parent == NULL) { + return (ENOENT); + } + + TMPFS_NODE_LOCK(node->tn_dir.tn_parent); dent.d_fileno = node->tn_dir.tn_parent->tn_id; + TMPFS_NODE_UNLOCK(node->tn_dir.tn_parent); + dent.d_type = DT_DIR; dent.d_namlen = 2; dent.d_name[0] = '.'; Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vnops.c Tue Jul 17 14:36:40 2012 (r238552) +++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c Tue Jul 17 17:34:48 2012 (r238553) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -60,6 +61,13 @@ __FBSDID("$FreeBSD$"); #include #include +SYSCTL_DECL(_vfs_tmpfs); + +static volatile int tmpfs_rename_restarts; +SYSCTL_INT(_vfs_tmpfs, OID_AUTO, rename_restarts, CTLFLAG_RD, + __DEVOLATILE(int *, &tmpfs_rename_restarts), 0, + "Times rename had to restart due to lock contention"); + /* --------------------------------------------------------------------- */ static int @@ -86,6 +94,11 @@ tmpfs_lookup(struct vop_cachedlookup_arg dnode->tn_dir.tn_parent == dnode, !(cnp->cn_flags & ISDOTDOT))); + TMPFS_ASSERT_LOCKED(dnode); + if (dnode->tn_dir.tn_parent == NULL) { + error = ENOENT; + goto out; + } if (cnp->cn_flags & ISDOTDOT) { int ltype = 0; @@ -893,6 +906,139 @@ out: /* --------------------------------------------------------------------- */ +/* + * We acquire all but fdvp locks using non-blocking acquisitions. If we + * fail to acquire any lock in the path we will drop all held locks, + * acquire the new lock in a blocking fashion, and then release it and + * restart the rename. This acquire/release step ensures that we do not + * spin on a lock waiting for release. On error release all vnode locks + * and decrement references the way tmpfs_rename() would do. + */ +static int +tmpfs_rename_relock(struct vnode *fdvp, struct vnode **fvpp, + struct vnode *tdvp, struct vnode **tvpp, + struct componentname *fcnp, struct componentname *tcnp) +{ + struct vnode *nvp; + struct mount *mp; + struct tmpfs_dirent *de; + int error, restarts = 0; + + VOP_UNLOCK(tdvp, 0); + if (*tvpp != NULL && *tvpp != tdvp) + VOP_UNLOCK(*tvpp, 0); + mp = fdvp->v_mount; + +relock: + restarts += 1; + error = vn_lock(fdvp, LK_EXCLUSIVE); + if (error) + goto releout; + if (vn_lock(tdvp, LK_EXCLUSIVE | LK_NOWAIT) != 0) { + VOP_UNLOCK(fdvp, 0); + error = vn_lock(tdvp, LK_EXCLUSIVE); + if (error) + goto releout; + VOP_UNLOCK(tdvp, 0); + goto relock; + } + /* + * Re-resolve fvp to be certain it still exists and fetch the + * correct vnode. + */ + de = tmpfs_dir_lookup(VP_TO_TMPFS_DIR(fdvp), NULL, fcnp); + if (de == NULL) { + VOP_UNLOCK(fdvp, 0); + VOP_UNLOCK(tdvp, 0); + if ((fcnp->cn_flags & ISDOTDOT) != 0 || + (fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.')) + error = EINVAL; + else + error = ENOENT; + goto releout; + } + error = tmpfs_alloc_vp(mp, de->td_node, LK_EXCLUSIVE | LK_NOWAIT, &nvp); + if (error != 0) { + VOP_UNLOCK(fdvp, 0); + VOP_UNLOCK(tdvp, 0); + if (error != EBUSY) + goto releout; + error = tmpfs_alloc_vp(mp, de->td_node, LK_EXCLUSIVE, &nvp); + if (error != 0) + goto releout; + VOP_UNLOCK(nvp, 0); + /* + * Concurrent rename race. + */ + if (nvp == tdvp) { + vrele(nvp); + error = EINVAL; + goto releout; + } + vrele(*fvpp); + *fvpp = nvp; + goto relock; + } + vrele(*fvpp); + *fvpp = nvp; + VOP_UNLOCK(*fvpp, 0); + /* + * Re-resolve tvp and acquire the vnode lock if present. + */ + de = tmpfs_dir_lookup(VP_TO_TMPFS_DIR(tdvp), NULL, tcnp); + /* + * If tvp disappeared we just carry on. + */ + if (de == NULL && *tvpp != NULL) { + vrele(*tvpp); + *tvpp = NULL; + } + /* + * Get the tvp ino if the lookup succeeded. We may have to restart + * if the non-blocking acquire fails. + */ + if (de != NULL) { + nvp = NULL; + error = tmpfs_alloc_vp(mp, de->td_node, + LK_EXCLUSIVE | LK_NOWAIT, &nvp); + if (*tvpp != NULL) + vrele(*tvpp); + *tvpp = nvp; + if (error != 0) { + VOP_UNLOCK(fdvp, 0); + VOP_UNLOCK(tdvp, 0); + if (error != EBUSY) + goto releout; + error = tmpfs_alloc_vp(mp, de->td_node, LK_EXCLUSIVE, + &nvp); + if (error != 0) + goto releout; + VOP_UNLOCK(nvp, 0); + /* + * fdvp contains fvp, thus tvp (=fdvp) is not empty. + */ + if (nvp == fdvp) { + error = ENOTEMPTY; + goto releout; + } + goto relock; + } + } + tmpfs_rename_restarts += restarts; + + return (0); + +releout: + vrele(fdvp); + vrele(*fvpp); + vrele(tdvp); + if (*tvpp != NULL) + vrele(*tvpp); + tmpfs_rename_restarts += restarts; + + return (error); +} + static int tmpfs_rename(struct vop_rename_args *v) { @@ -902,10 +1048,12 @@ tmpfs_rename(struct vop_rename_args *v) struct vnode *tdvp = v->a_tdvp; struct vnode *tvp = v->a_tvp; struct componentname *tcnp = v->a_tcnp; + struct mount *mp = NULL; char *newname; int error; struct tmpfs_dirent *de; + struct tmpfs_mount *tmp; struct tmpfs_node *fdnode; struct tmpfs_node *fnode; struct tmpfs_node *tnode; @@ -916,8 +1064,6 @@ tmpfs_rename(struct vop_rename_args *v) MPASS(fcnp->cn_flags & HASBUF); MPASS(tcnp->cn_flags & HASBUF); - tnode = (tvp == NULL) ? NULL : VP_TO_TMPFS_NODE(tvp); - /* Disallow cross-device renames. * XXX Why isn't this done by the caller? */ if (fvp->v_mount != tdvp->v_mount || @@ -926,8 +1072,6 @@ tmpfs_rename(struct vop_rename_args *v) goto out; } - tdnode = VP_TO_TMPFS_DIR(tdvp); - /* If source and target are the same file, there is nothing to do. */ if (fvp == tvp) { error = 0; @@ -936,11 +1080,37 @@ tmpfs_rename(struct vop_rename_args *v) /* If we need to move the directory between entries, lock the * source so that we can safely operate on it. */ - if (tdvp != fdvp) { - error = vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY); - if (error != 0) - goto out; + if (fdvp != tdvp && fdvp != tvp) { + if (vn_lock(fdvp, LK_EXCLUSIVE | LK_NOWAIT) != 0) { + mp = tdvp->v_mount; + error = vfs_busy(mp, 0); + if (error != 0) { + mp = NULL; + goto out; + } + error = tmpfs_rename_relock(fdvp, &fvp, tdvp, &tvp, + fcnp, tcnp); + if (error != 0) { + vfs_unbusy(mp); + return (error); + } + ASSERT_VOP_ELOCKED(fdvp, + "tmpfs_rename: fdvp not locked"); + ASSERT_VOP_ELOCKED(tdvp, + "tmpfs_rename: tdvp not locked"); + if (tvp != NULL) + ASSERT_VOP_ELOCKED(tvp, + "tmpfs_rename: tvp not locked"); + if (fvp == tvp) { + error = 0; + goto out_locked; + } + } } + + tmp = VFS_TO_TMPFS(tdvp->v_mount); + tdnode = VP_TO_TMPFS_DIR(tdvp); + tnode = (tvp == NULL) ? NULL : VP_TO_TMPFS_NODE(tvp); fdnode = VP_TO_TMPFS_DIR(fdvp); fnode = VP_TO_TMPFS_NODE(fvp); de = tmpfs_dir_lookup(fdnode, fnode, fcnp); @@ -1014,25 +1184,63 @@ tmpfs_rename(struct vop_rename_args *v) * directory being moved. Otherwise, we'd end up * with stale nodes. */ n = tdnode; + /* TMPFS_LOCK garanties that no nodes are freed while + * traversing the list. Nodes can only be marked as + * removed: tn_parent == NULL. */ + TMPFS_LOCK(tmp); + TMPFS_NODE_LOCK(n); while (n != n->tn_dir.tn_parent) { + struct tmpfs_node *parent; + if (n == fnode) { + TMPFS_NODE_UNLOCK(n); + TMPFS_UNLOCK(tmp); error = EINVAL; if (newname != NULL) free(newname, M_TMPFSNAME); goto out_locked; } - n = n->tn_dir.tn_parent; + parent = n->tn_dir.tn_parent; + TMPFS_NODE_UNLOCK(n); + if (parent == NULL) { + n = NULL; + break; + } + TMPFS_NODE_LOCK(parent); + if (parent->tn_dir.tn_parent == NULL) { + TMPFS_NODE_UNLOCK(parent); + n = NULL; + break; + } + n = parent; } + TMPFS_UNLOCK(tmp); + if (n == NULL) { + error = EINVAL; + if (newname != NULL) + free(newname, M_TMPFSNAME); + goto out_locked; + } + TMPFS_NODE_UNLOCK(n); /* Adjust the parent pointer. */ TMPFS_VALIDATE_DIR(fnode); + TMPFS_NODE_LOCK(de->td_node); de->td_node->tn_dir.tn_parent = tdnode; + TMPFS_NODE_UNLOCK(de->td_node); /* As a result of changing the target of the '..' * entry, the link count of the source and target * directories has to be adjusted. */ - fdnode->tn_links--; + TMPFS_NODE_LOCK(tdnode); + TMPFS_ASSERT_LOCKED(tdnode); tdnode->tn_links++; + TMPFS_NODE_UNLOCK(tdnode); + + TMPFS_NODE_LOCK(fdnode); + TMPFS_ASSERT_LOCKED(fdnode); + fdnode->tn_links--; + TMPFS_NODE_UNLOCK(fdnode); } /* Do the move: just remove the entry from the source directory @@ -1078,7 +1286,7 @@ tmpfs_rename(struct vop_rename_args *v) error = 0; out_locked: - if (fdnode != tdnode) + if (fdvp != tdvp && fdvp != tvp) VOP_UNLOCK(fdvp, 0); out: @@ -1096,6 +1304,9 @@ out: vrele(fdvp); vrele(fvp); + if (mp != NULL) + vfs_unbusy(mp); + return error; } @@ -1166,17 +1377,28 @@ tmpfs_rmdir(struct vop_rmdir_args *v) goto out; } + /* Detach the directory entry from the directory (dnode). */ tmpfs_dir_detach(dvp, de); if (v->a_cnp->cn_flags & DOWHITEOUT) tmpfs_dir_whiteout_add(dvp, v->a_cnp); + /* No vnode should be allocated for this entry from this point */ + TMPFS_NODE_LOCK(node); + TMPFS_ASSERT_ELOCKED(node); node->tn_links--; + node->tn_dir.tn_parent = NULL; node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \ TMPFS_NODE_MODIFIED; - node->tn_dir.tn_parent->tn_links--; - node->tn_dir.tn_parent->tn_status |= TMPFS_NODE_ACCESSED | \ + + TMPFS_NODE_UNLOCK(node); + + TMPFS_NODE_LOCK(dnode); + TMPFS_ASSERT_ELOCKED(dnode); + dnode->tn_links--; + dnode->tn_status |= TMPFS_NODE_ACCESSED | \ TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; + TMPFS_NODE_UNLOCK(dnode); cache_purge(dvp); cache_purge(vp); @@ -1364,13 +1586,21 @@ tmpfs_reclaim(struct vop_reclaim_args *v vnode_destroy_vobject(vp); cache_purge(vp); + + TMPFS_NODE_LOCK(node); + TMPFS_ASSERT_ELOCKED(node); tmpfs_free_vp(vp); /* If the node referenced by this vnode was deleted by the user, * we must free its associated data structures (now that the vnode * is being reclaimed). */ - if (node->tn_links == 0) + if (node->tn_links == 0 && + (node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0) { + node->tn_vpstate = TMPFS_VNODE_DOOMED; + TMPFS_NODE_UNLOCK(node); tmpfs_free_node(tmp, node); + } else + TMPFS_NODE_UNLOCK(node); MPASS(vp->v_data == NULL); return 0; From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 18:04:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 723C91065673; Tue, 17 Jul 2012 18:04:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 428588FC0A; Tue, 17 Jul 2012 18:04:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HI4Zer078755; Tue, 17 Jul 2012 18:04:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HI4YwF078753; Tue, 17 Jul 2012 18:04:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201207171804.q6HI4YwF078753@svn.freebsd.org> From: Dimitry Andric Date: Tue, 17 Jul 2012 18:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238554 - stable/9/contrib/llvm/tools/clang/lib/Sema X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 18:04:35 -0000 Author: dim Date: Tue Jul 17 18:04:34 2012 New Revision: 238554 URL: http://svn.freebsd.org/changeset/base/238554 Log: MFC r238429: Pull in r159895 from upstream clang trunk: When marking virtual functions as used for a class' vtable, mark all functions which will appear in the vtable as used, not just those ones which were declared within the class itself. Fixes an issue reported as comment#3 in PR12763 -- we sometimes assert in codegen if we try to emit a reference to a function declaration which we've not marked as referenced. This also matches gcc's observed behavior. This should fix clang assertions when building certain components of the LibreOffice port. Approved by: re (kib) Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp Tue Jul 17 17:34:48 2012 (r238553) +++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp Tue Jul 17 18:04:34 2012 (r238554) @@ -10937,14 +10937,23 @@ bool Sema::DefineUsedVTables() { void Sema::MarkVirtualMembersReferenced(SourceLocation Loc, const CXXRecordDecl *RD) { - for (CXXRecordDecl::method_iterator i = RD->method_begin(), - e = RD->method_end(); i != e; ++i) { - CXXMethodDecl *MD = *i; - - // C++ [basic.def.odr]p2: - // [...] A virtual member function is used if it is not pure. [...] - if (MD->isVirtual() && !MD->isPure()) - MarkFunctionReferenced(Loc, MD); + // Mark all functions which will appear in RD's vtable as used. + CXXFinalOverriderMap FinalOverriders; + RD->getFinalOverriders(FinalOverriders); + for (CXXFinalOverriderMap::const_iterator I = FinalOverriders.begin(), + E = FinalOverriders.end(); + I != E; ++I) { + for (OverridingMethods::const_iterator OI = I->second.begin(), + OE = I->second.end(); + OI != OE; ++OI) { + assert(OI->second.size() > 0 && "no final overrider"); + CXXMethodDecl *Overrider = OI->second.front().Method; + + // C++ [basic.def.odr]p2: + // [...] A virtual member function is used if it is not pure. [...] + if (!Overrider->isPure()) + MarkFunctionReferenced(Loc, Overrider); + } } // Only classes that have virtual bases need a VTT. From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 19:00:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 502E11065670; Tue, 17 Jul 2012 19:00:47 +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 3B2988FC17; Tue, 17 Jul 2012 19:00:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HJ0ldW083905; Tue, 17 Jul 2012 19:00:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HJ0lui083903; Tue, 17 Jul 2012 19:00:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207171900.q6HJ0lui083903@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Jul 2012 19:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238555 - stable/9/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 19:00:47 -0000 Author: kib Date: Tue Jul 17 19:00:46 2012 New Revision: 238555 URL: http://svn.freebsd.org/changeset/base/238555 Log: MFC r237203,r237223 (by phk): Fix writes to the video memory of the VGA to always use half-word sized writes. Approved by: re (hrs), phk Modified: stable/9/sys/dev/fb/fbreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/fb/fbreg.h ============================================================================== --- stable/9/sys/dev/fb/fbreg.h Tue Jul 17 18:04:34 2012 (r238554) +++ stable/9/sys/dev/fb/fbreg.h Tue Jul 17 19:00:46 2012 (r238555) @@ -35,9 +35,17 @@ /* some macros */ #if defined(__amd64__) || defined(__i386__) -#define bcopy_io(s, d, c) bcopy((void *)(s), (void *)(d), (c)) -#define bcopy_toio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) -#define bcopy_fromio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) + +static __inline void +copyw(uint16_t *src, uint16_t *dst, size_t size) +{ + size >>= 1; + while (size--) + *dst++ = *src++; +} +#define bcopy_io(s, d, c) copyw((void*)(s), (void*)(d), (c)) +#define bcopy_toio(s, d, c) copyw((void*)(s), (void*)(d), (c)) +#define bcopy_fromio(s, d, c) copyw((void*)(s), (void*)(d), (c)) #define bzero_io(d, c) bzero((void *)(d), (c)) #define fill_io(p, d, c) fill((p), (void *)(d), (c)) #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 19:14:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E6DA1065673; Tue, 17 Jul 2012 19:14:13 +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 289C78FC19; Tue, 17 Jul 2012 19:14:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HJEDw4084990; Tue, 17 Jul 2012 19:14:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HJEC0G084988; Tue, 17 Jul 2012 19:14:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207171914.q6HJEC0G084988@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Jul 2012 19:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238556 - stable/8/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 19:14:13 -0000 Author: kib Date: Tue Jul 17 19:14:12 2012 New Revision: 238556 URL: http://svn.freebsd.org/changeset/base/238556 Log: MFC r237203,r237223 (by phk): Fix writes to the video memory of the VGA to always use half-word sized writes. Approved by: phk Modified: stable/8/sys/dev/fb/fbreg.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/fb/fbreg.h ============================================================================== --- stable/8/sys/dev/fb/fbreg.h Tue Jul 17 19:00:46 2012 (r238555) +++ stable/8/sys/dev/fb/fbreg.h Tue Jul 17 19:14:12 2012 (r238556) @@ -35,9 +35,17 @@ /* some macros */ #if defined(__amd64__) || defined(__i386__) -#define bcopy_io(s, d, c) bcopy((void *)(s), (void *)(d), (c)) -#define bcopy_toio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) -#define bcopy_fromio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) + +static __inline void +copyw(uint16_t *src, uint16_t *dst, size_t size) +{ + size >>= 1; + while (size--) + *dst++ = *src++; +} +#define bcopy_io(s, d, c) copyw((void*)(s), (void*)(d), (c)) +#define bcopy_toio(s, d, c) copyw((void*)(s), (void*)(d), (c)) +#define bcopy_fromio(s, d, c) copyw((void*)(s), (void*)(d), (c)) #define bzero_io(d, c) bzero((void *)(d), (c)) #define fill_io(p, d, c) fill((p), (void *)(d), (c)) #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 19:29:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2737E106566C; Tue, 17 Jul 2012 19:29:33 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10E498FC0C; Tue, 17 Jul 2012 19:29:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HJTWoI086027; Tue, 17 Jul 2012 19:29:32 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HJTW4W086025; Tue, 17 Jul 2012 19:29:32 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201207171929.q6HJTW4W086025@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 17 Jul 2012 19:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238557 - stable/9/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 19:29:33 -0000 Author: melifaro Date: Tue Jul 17 19:29:32 2012 New Revision: 238557 URL: http://svn.freebsd.org/changeset/base/238557 Log: MFC r237479, r238265 Finally fix lookup (account remaining '\0') and deletion (provide valid key length for radix lookup). Submitted by: Ihor Kaharlichenko (prev version) Approved by: re(hrs), kib(mentor) Sponsored by: Shtorm ISP Modified: stable/9/sys/netinet/ipfw/ip_fw_table.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_table.c Tue Jul 17 19:14:12 2012 (r238556) +++ stable/9/sys/netinet/ipfw/ip_fw_table.c Tue Jul 17 19:29:32 2012 (r238557) @@ -344,9 +344,12 @@ ipfw_del_table_entry(struct ip_fw_chain struct xaddr_iface ifname, ifmask; memset(&ifname, 0, sizeof(ifname)); + /* Include last \0 into comparison */ + mlen++; + /* Set 'total' structure length */ - KEY_LEN(ifname) = mlen; - KEY_LEN(ifmask) = mlen; + KEY_LEN(ifname) = KEY_LEN_IFACE + mlen; + KEY_LEN(ifmask) = KEY_LEN_IFACE + mlen; /* Assume direct match */ /* FIXME: Add interface pattern matching */ #if 0 @@ -568,7 +571,8 @@ ipfw_lookup_table_extended(struct ip_fw_ break; case IPFW_TABLE_INTERFACE: - KEY_LEN(iface) = strlcpy(iface.ifname, (char *)paddr, IF_NAMESIZE); + KEY_LEN(iface) = KEY_LEN_IFACE + + strlcpy(iface.ifname, (char *)paddr, IF_NAMESIZE) + 1; /* Assume direct match */ /* FIXME: Add interface pattern matching */ xent = (struct table_xentry *)(rnh->rnh_lookup(&iface, NULL, rnh)); From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 19:57:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AFC2106566B; Tue, 17 Jul 2012 19:57:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1EA8FC18; Tue, 17 Jul 2012 19:57:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HJvZJT088244; Tue, 17 Jul 2012 19:57:35 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HJvZef088241; Tue, 17 Jul 2012 19:57:35 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207171957.q6HJvZef088241@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 17 Jul 2012 19:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238558 - in head/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/include cmd/dtrace/test/tst/common/pragma lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 19:57:35 -0000 Author: pfg Date: Tue Jul 17 19:57:34 2012 New Revision: 238558 URL: http://svn.freebsd.org/changeset/base/238558 Log: Dtrace: improve handling of library paths. Merge changes from illumos 906 dtrace depends_on pragma should search all library paths, not just the current one 949 dtrace should only include the first instance of a library found on its library path Illumos Revisions: 13353:936a1e45726c 13354:2b2c36a81512 Reference: https://www.illumos.org/issues/906 https://www.illumos.org/issues/949 Tested by: Fabian Keil Obtained from: Illumos MFC after: 3 weeks Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/ - copied from r238552, vendor/illumos/dist/cmd/dtrace/test/tst/common/include/ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh - copied unchanged from r238552, vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh (from r238552, vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh Tue Jul 17 19:57:34 2012 (r238558, copy of r238552, vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh) @@ -0,0 +1,76 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2011, Joyent Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Test to catch that we properly look for libraries dependencies in +# our full library parth +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +libdira=${TMPDIR:-/tmp}/libdepa.$$ +libdirb=${TMPDIR:-/tmp}/libdepb.$$ +libdirc=${TMPDIR:-/tmp}/libdepc.$$ +dtrace=$1 + +setup_libs() +{ + mkdir $libdira + mkdir $libdirb + mkdir $libdirc + cat > $libdira/liba.$$.d < $libdirb/libb.$$.d < $libdirb/libc.$$.d < $libdirb/libd.$$.d < $libdirc/libe.$$.d < $libdirc/libf.$$.d <dt_lib_dep); dld != NULL; + dld = dt_list_next(dld)) { + end = strrchr(dld->dtld_library, '/'); + /* dt_lib_depend_add ensures this */ + assert(end != NULL); + if (strcmp(end + 1, dp->d_name) == 0) + break; + } + + if (dld != NULL) { + dt_dprintf("skipping library %s, already processed " + "library with the same name: %s", dp->d_name, + dld->dtld_library); + continue; + } + dtp->dt_filetag = fname; if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) - goto err; + return (-1); /* preserve dt_errno */ rv = dt_compile(dtp, DT_CTX_DPROG, DTRACE_PROBESPEC_NAME, NULL, @@ -2203,7 +2221,7 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons if (rv != NULL && dtp->dt_errno && (dtp->dt_errno != EDT_COMPILER || dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) - goto err; + return (-1); /* preserve dt_errno */ if (dtp->dt_errno) dt_dprintf("error parsing library %s: %s\n", @@ -2214,6 +2232,27 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons } (void) closedir(dirp); + + return (0); +} + +/* + * Perform a topological sorting of all the libraries found across the entire + * dt_lib_path. Once sorted, compile each one in topological order to cache its + * inlines and translators, etc. We silently ignore any missing directories and + * other files found therein. We only fail (and thereby fail dt_load_libs()) if + * we fail to compile a library and the error is something other than #pragma D + * depends_on. Dependency errors are silently ignored to permit a library + * directory to contain libraries which may not be accessible depending on our + * privileges. + */ +static int +dt_load_libs_sort(dtrace_hdl_t *dtp) +{ + dtrace_prog_t *pgp; + FILE *fp; + dt_lib_depend_t *dld; + /* * Finish building the graph containing the library dependencies * and perform a topological sort to generate an ordered list @@ -2274,7 +2313,14 @@ dt_load_libs(dtrace_hdl_t *dtp) dtp->dt_cflags |= DTRACE_C_NOLIBS; - for (dirp = dt_list_next(&dtp->dt_lib_path); + /* + * /usr/lib/dtrace is always at the head of the list. The rest of the + * list is specified in the precedence order the user requested. Process + * everything other than the head first. DTRACE_C_NOLIBS has already + * been spcified so dt_vopen will ensure that there is always one entry + * in dt_lib_path. + */ + for (dirp = dt_list_next(dt_list_next(&dtp->dt_lib_path)); dirp != NULL; dirp = dt_list_next(dirp)) { if (dt_load_libs_dir(dtp, dirp->dir_path) != 0) { dtp->dt_cflags &= ~DTRACE_C_NOLIBS; @@ -2282,6 +2328,16 @@ dt_load_libs(dtrace_hdl_t *dtp) } } + /* Handle /usr/lib/dtrace */ + dirp = dt_list_next(&dtp->dt_lib_path); + if (dt_load_libs_dir(dtp, dirp->dir_path) != 0) { + dtp->dt_cflags &= ~DTRACE_C_NOLIBS; + return (-1); /* errno is set for us */ + } + + if (dt_load_libs_sort(dtp) < 0) + return (-1); /* errno is set for us */ + return (0); } Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Tue Jul 17 19:29:32 2012 (r238557) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Tue Jul 17 19:57:34 2012 (r238558) @@ -21,7 +21,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2011, Joyent Inc. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -31,9 +31,13 @@ #if defined(sun) #include #endif +#include #include #include +#include +#include + #include #include #include @@ -201,6 +205,29 @@ dt_pragma_binding(const char *prname, dt dtp->dt_globals->dh_defer = &dt_pragma_apply; } +static void +dt_pragma_depends_finddep(dtrace_hdl_t *dtp, const char *lname, char *lib, + size_t len) +{ + dt_dirpath_t *dirp; + struct stat sbuf; + int found = 0; + + for (dirp = dt_list_next(&dtp->dt_lib_path); dirp != NULL; + dirp = dt_list_next(dirp)) { + (void) snprintf(lib, len, "%s/%s", dirp->dir_path, lname); + + if (stat(lib, &sbuf) == 0) { + found = 1; + break; + } + } + + if (!found) + xyerror(D_PRAGMA_DEPEND, + "failed to find dependency in libpath: %s", lname); +} + /* * The #pragma depends_on directive can be used to express a dependency on a * module, provider or library which if not present will cause processing to @@ -230,16 +257,13 @@ dt_pragma_depends(const char *prname, dt if (yypcb->pcb_cflags & DTRACE_C_CTL) { assert(dtp->dt_filetag != NULL); - /* - * We have the file we are working on in dtp->dt_filetag - * so find that node and add the dependency in. - */ + dt_pragma_depends_finddep(dtp, nnp->dn_string, lib, + sizeof (lib)); + dld = dt_lib_depend_lookup(&dtp->dt_lib_dep, dtp->dt_filetag); assert(dld != NULL); - (void) snprintf(lib, sizeof (lib), "%s%s", - dld->dtld_libpath, nnp->dn_string); if ((dt_lib_depend_add(dtp, &dld->dtld_dependencies, lib)) != 0) { xyerror(D_PRAGMA_DEPEND, @@ -261,8 +285,8 @@ dt_pragma_depends(const char *prname, dt dtp->dt_filetag); assert(dld != NULL); - (void) snprintf(lib, sizeof (lib), "%s%s", - dld->dtld_libpath, nnp->dn_string); + dt_pragma_depends_finddep(dtp, nnp->dn_string, lib, + sizeof (lib)); dld = dt_lib_depend_lookup(&dtp->dt_lib_dep_sorted, lib); assert(dld != NULL); From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 22:16:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A5C51065672; Tue, 17 Jul 2012 22:16:11 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75DD48FC12; Tue, 17 Jul 2012 22:16:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HMGBog001125; Tue, 17 Jul 2012 22:16:11 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HMGBPb001123; Tue, 17 Jul 2012 22:16:11 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201207172216.q6HMGBPb001123@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 17 Jul 2012 22:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238559 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 22:16:11 -0000 Author: ken Date: Tue Jul 17 22:16:10 2012 New Revision: 238559 URL: http://svn.freebsd.org/changeset/base/238559 Log: Add back spare fields consumed in r237545. It seems that these should only be consumed to maintain backward compatibility in stable, but should not be consumed in head. Submitted by: trasz, attilio (indirectly) Modified: head/sys/geom/geom.h Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Tue Jul 17 19:57:34 2012 (r238558) +++ head/sys/geom/geom.h Tue Jul 17 22:16:10 2012 (r238559) @@ -110,6 +110,7 @@ struct g_class { g_ioctl_t *ioctl; g_provgone_t *providergone; g_resize_t *resize; + void *spare1; void *spare2; /* * The remaining elements are private @@ -142,6 +143,7 @@ struct g_geom { g_ioctl_t *ioctl; g_provgone_t *providergone; g_resize_t *resize; + void *spare0; void *spare1; void *softc; unsigned flags; From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 04:52:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CACB1065675; Wed, 18 Jul 2012 04:52:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56BDF8FC14; Wed, 18 Jul 2012 04:52:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I4qc0n029229; Wed, 18 Jul 2012 04:52:38 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I4qcwJ029225; Wed, 18 Jul 2012 04:52:38 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201207180452.q6I4qcwJ029225@svn.freebsd.org> From: Mateusz Guzik Date: Wed, 18 Jul 2012 04:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238560 - in stable/9/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 04:52:38 -0000 Author: mjg Date: Wed Jul 18 04:52:37 2012 New Revision: 238560 URL: http://svn.freebsd.org/changeset/base/238560 Log: MFC r238220, r238272: Unbreak handling of descriptors opened with O_EXEC by fexecve(2). While here return EBADF for descriptors opened for writing (previously it was ETXTBSY). Add fgetvp_exec function which performs appropriate checks. == Follow-up commit to r238220: Pass only FEXEC (instead of FREAD|FEXEC) in fgetvp_exec. _fget has to check for !FWRITE anyway and may as well know about FREAD. Make _fget code a bit more readable by converting permission checking from if() to switch(). Assert that correct permission flags are passed. PR: kern/169651 In collaboration with: kib Approved by: re (hrs), trasz (mentor) Modified: stable/9/sys/kern/kern_descrip.c stable/9/sys/kern/kern_exec.c stable/9/sys/sys/file.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Tue Jul 17 22:16:10 2012 (r238559) +++ stable/9/sys/kern/kern_descrip.c Wed Jul 18 04:52:37 2012 (r238560) @@ -2329,8 +2329,8 @@ _fget(struct thread *td, int fd, struct struct file *fp; #ifdef CAPABILITIES struct file *fp_fromcap; - int error; #endif + int error; *fpp = NULL; if (td == NULL || (fdp = td->td_proc->p_fd) == NULL) @@ -2369,7 +2369,7 @@ _fget(struct thread *td, int fd, struct else error = cap_funwrap_mmap(fp, needrights, maxprotp, &fp_fromcap); - if (error) { + if (error != 0) { fdrop(fp, td); return (error); } @@ -2394,14 +2394,30 @@ _fget(struct thread *td, int fd, struct /* * FREAD and FWRITE failure return EBADF as per POSIX. - * - * Only one flag, or 0, may be specified. */ - if ((flags == FREAD && (fp->f_flag & FREAD) == 0) || - (flags == FWRITE && (fp->f_flag & FWRITE) == 0)) { + error = 0; + switch (flags) { + case FREAD: + case FWRITE: + if ((fp->f_flag & flags) == 0) + error = EBADF; + break; + case FEXEC: + if ((fp->f_flag & (FREAD | FEXEC)) == 0 || + ((fp->f_flag & FWRITE) != 0)) + error = EBADF; + break; + case 0: + break; + default: + KASSERT(0, ("wrong flags")); + } + + if (error != 0) { fdrop(fp, td); - return (EBADF); + return (error); } + *fpp = fp; return (0); } @@ -2498,6 +2514,13 @@ fgetvp_read(struct thread *td, int fd, c return (_fgetvp(td, fd, FREAD, rights, NULL, vpp)); } +int +fgetvp_exec(struct thread *td, int fd, cap_rights_t rights, struct vnode **vpp) +{ + + return (_fgetvp(td, fd, FEXEC, rights, NULL, vpp)); +} + #ifdef notyet int fgetvp_write(struct thread *td, int fd, cap_rights_t rights, Modified: stable/9/sys/kern/kern_exec.c ============================================================================== --- stable/9/sys/kern/kern_exec.c Tue Jul 17 22:16:10 2012 (r238559) +++ stable/9/sys/kern/kern_exec.c Wed Jul 18 04:52:37 2012 (r238560) @@ -443,8 +443,10 @@ interpret: /* * Some might argue that CAP_READ and/or CAP_MMAP should also * be required here; such arguments will be entertained. + * + * Descriptors opened only with O_EXEC or O_RDONLY are allowed. */ - error = fgetvp_read(td, args->fd, CAP_FEXECVE, &binvp); + error = fgetvp_exec(td, args->fd, CAP_FEXECVE, &binvp); if (error) goto exec_fail; vfslocked = VFS_LOCK_GIANT(binvp->v_mount); Modified: stable/9/sys/sys/file.h ============================================================================== --- stable/9/sys/sys/file.h Tue Jul 17 22:16:10 2012 (r238559) +++ stable/9/sys/sys/file.h Wed Jul 18 04:52:37 2012 (r238560) @@ -225,6 +225,8 @@ fo_chown_t invfo_chown; void finit(struct file *, u_int, short, void *, struct fileops *); int fgetvp(struct thread *td, int fd, cap_rights_t rights, struct vnode **vpp); +int fgetvp_exec(struct thread *td, int fd, cap_rights_t rights, + struct vnode **vpp); int fgetvp_rights(struct thread *td, int fd, cap_rights_t need, cap_rights_t *have, struct vnode **vpp); int fgetvp_read(struct thread *td, int fd, cap_rights_t rights, From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 05:21:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2E9A1065673; Wed, 18 Jul 2012 05:21:35 +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 8CBE08FC14; Wed, 18 Jul 2012 05:21:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I5LZw3031329; Wed, 18 Jul 2012 05:21:35 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I5LZQY031323; Wed, 18 Jul 2012 05:21:35 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207180521.q6I5LZQY031323@svn.freebsd.org> From: Alan Cox Date: Wed, 18 Jul 2012 05:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238561 - in head/sys: conf mips/mips vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 05:21:35 -0000 Author: alc Date: Wed Jul 18 05:21:34 2012 New Revision: 238561 URL: http://svn.freebsd.org/changeset/base/238561 Log: Move what remains of vm/vm_contig.c into vm/vm_pageout.c, where similar code resides. Rename vm_contig_grow_cache() to vm_pageout_grow_cache(). Reviewed by: kib Deleted: head/sys/vm/vm_contig.c Modified: head/sys/conf/files head/sys/mips/mips/pmap.c head/sys/vm/vm_kern.c head/sys/vm/vm_pageout.c head/sys/vm/vm_pageout.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jul 18 04:52:37 2012 (r238560) +++ head/sys/conf/files Wed Jul 18 05:21:34 2012 (r238561) @@ -3551,7 +3551,6 @@ vm/sg_pager.c standard vm/swap_pager.c standard vm/uma_core.c standard vm/uma_dbg.c standard -vm/vm_contig.c standard vm/memguard.c optional DEBUG_MEMGUARD vm/vm_fault.c standard vm/vm_glue.c standard Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed Jul 18 04:52:37 2012 (r238560) +++ head/sys/mips/mips/pmap.c Wed Jul 18 05:21:34 2012 (r238561) @@ -1034,9 +1034,9 @@ pmap_grow_direct_page_cache() { #ifdef __mips_n64 - vm_contig_grow_cache(3, 0, MIPS_XKPHYS_LARGEST_PHYS); + vm_pageout_grow_cache(3, 0, MIPS_XKPHYS_LARGEST_PHYS); #else - vm_contig_grow_cache(3, 0, MIPS_KSEG0_LARGEST_PHYS); + vm_pageout_grow_cache(3, 0, MIPS_KSEG0_LARGEST_PHYS); #endif } Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Wed Jul 18 04:52:37 2012 (r238560) +++ head/sys/vm/vm_kern.c Wed Jul 18 05:21:34 2012 (r238561) @@ -239,7 +239,7 @@ retry: VM_OBJECT_UNLOCK(object); if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { vm_map_unlock(map); - vm_contig_grow_cache(tries, low, high); + vm_pageout_grow_cache(tries, low, high); vm_map_lock(map); VM_OBJECT_LOCK(object); tries++; @@ -313,7 +313,7 @@ retry: VM_OBJECT_UNLOCK(object); if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { vm_map_unlock(map); - vm_contig_grow_cache(tries, low, high); + vm_pageout_grow_cache(tries, low, high); vm_map_lock(map); VM_OBJECT_LOCK(object); tries++; Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Jul 18 04:52:37 2012 (r238560) +++ head/sys/vm/vm_pageout.c Wed Jul 18 05:21:34 2012 (r238561) @@ -209,11 +209,14 @@ int vm_page_max_wired; /* XXX max # of SYSCTL_INT(_vm, OID_AUTO, max_wired, CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired page count"); +static boolean_t vm_pageout_fallback_object_lock(vm_page_t, vm_page_t *); +static boolean_t vm_pageout_launder(int, int, vm_paddr_t, vm_paddr_t); #if !defined(NO_SWAPPING) static void vm_pageout_map_deactivate_pages(vm_map_t, long); static void vm_pageout_object_deactivate_pages(pmap_t, vm_object_t, long); static void vm_req_vmdaemon(int req); #endif +static boolean_t vm_pageout_page_lock(vm_page_t, vm_page_t *); static void vm_pageout_page_stats(void); /* @@ -247,7 +250,7 @@ vm_pageout_init_marker(vm_page_t marker, * This function depends on both the lock portion of struct vm_object * and normal struct vm_page being type stable. */ -boolean_t +static boolean_t vm_pageout_fallback_object_lock(vm_page_t m, vm_page_t *next) { struct vm_page marker; @@ -286,7 +289,7 @@ vm_pageout_fallback_object_lock(vm_page_ * * This function depends on normal struct vm_page being type stable. */ -boolean_t +static boolean_t vm_pageout_page_lock(vm_page_t m, vm_page_t *next) { struct vm_page marker; @@ -558,6 +561,138 @@ vm_pageout_flush(vm_page_t *mc, int coun return (numpagedout); } +static boolean_t +vm_pageout_launder(int queue, int tries, vm_paddr_t low, vm_paddr_t high) +{ + struct mount *mp; + struct vnode *vp; + vm_object_t object; + vm_paddr_t pa; + vm_page_t m, m_tmp, next; + int vfslocked; + + vm_page_lock_queues(); + TAILQ_FOREACH_SAFE(m, &vm_page_queues[queue].pl, pageq, next) { + KASSERT(m->queue == queue, + ("vm_pageout_launder: page %p's queue is not %d", m, + queue)); + if ((m->flags & PG_MARKER) != 0) + continue; + pa = VM_PAGE_TO_PHYS(m); + if (pa < low || pa + PAGE_SIZE > high) + continue; + if (!vm_pageout_page_lock(m, &next) || m->hold_count != 0) { + vm_page_unlock(m); + continue; + } + object = m->object; + if (!VM_OBJECT_TRYLOCK(object) && + (!vm_pageout_fallback_object_lock(m, &next) || + m->hold_count != 0)) { + vm_page_unlock(m); + VM_OBJECT_UNLOCK(object); + continue; + } + if ((m->oflags & VPO_BUSY) != 0 || m->busy != 0) { + if (tries == 0) { + vm_page_unlock(m); + VM_OBJECT_UNLOCK(object); + continue; + } + vm_page_sleep(m, "vpctw0"); + VM_OBJECT_UNLOCK(object); + return (FALSE); + } + vm_page_test_dirty(m); + if (m->dirty == 0) + pmap_remove_all(m); + if (m->dirty != 0) { + vm_page_unlock(m); + if (tries == 0 || (object->flags & OBJ_DEAD) != 0) { + VM_OBJECT_UNLOCK(object); + continue; + } + if (object->type == OBJT_VNODE) { + vm_page_unlock_queues(); + vp = object->handle; + vm_object_reference_locked(object); + VM_OBJECT_UNLOCK(object); + (void)vn_start_write(vp, &mp, V_WAIT); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + VM_OBJECT_LOCK(object); + vm_object_page_clean(object, 0, 0, OBJPC_SYNC); + VM_OBJECT_UNLOCK(object); + VOP_UNLOCK(vp, 0); + VFS_UNLOCK_GIANT(vfslocked); + vm_object_deallocate(object); + vn_finished_write(mp); + return (TRUE); + } else if (object->type == OBJT_SWAP || + object->type == OBJT_DEFAULT) { + vm_page_unlock_queues(); + m_tmp = m; + vm_pageout_flush(&m_tmp, 1, VM_PAGER_PUT_SYNC, + 0, NULL, NULL); + VM_OBJECT_UNLOCK(object); + return (TRUE); + } + } else { + vm_page_cache(m); + vm_page_unlock(m); + } + VM_OBJECT_UNLOCK(object); + } + vm_page_unlock_queues(); + return (FALSE); +} + +/* + * Increase the number of cached pages. The specified value, "tries", + * determines which categories of pages are cached: + * + * 0: All clean, inactive pages within the specified physical address range + * are cached. Will not sleep. + * 1: The vm_lowmem handlers are called. All inactive pages within + * the specified physical address range are cached. May sleep. + * 2: The vm_lowmem handlers are called. All inactive and active pages + * within the specified physical address range are cached. May sleep. + */ +void +vm_pageout_grow_cache(int tries, vm_paddr_t low, vm_paddr_t high) +{ + int actl, actmax, inactl, inactmax; + + if (tries > 0) { + /* + * Decrease registered cache sizes. The vm_lowmem handlers + * may acquire locks and/or sleep, so they can only be invoked + * when "tries" is greater than zero. + */ + EVENTHANDLER_INVOKE(vm_lowmem, 0); + + /* + * We do this explicitly after the caches have been drained + * above. + */ + uma_reclaim(); + } + inactl = 0; + inactmax = cnt.v_inactive_count; + actl = 0; + actmax = tries < 2 ? 0 : cnt.v_active_count; +again: + if (inactl < inactmax && vm_pageout_launder(PQ_INACTIVE, tries, low, + high)) { + inactl++; + goto again; + } + if (actl < actmax && vm_pageout_launder(PQ_ACTIVE, tries, low, high)) { + actl++; + goto again; + } +} + #if !defined(NO_SWAPPING) /* * vm_pageout_object_deactivate_pages Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Wed Jul 18 04:52:37 2012 (r238560) +++ head/sys/vm/vm_pageout.h Wed Jul 18 05:21:34 2012 (r238561) @@ -101,10 +101,8 @@ extern void vm_wait(void); extern void vm_waitpfault(void); #ifdef _KERNEL -boolean_t vm_pageout_fallback_object_lock(vm_page_t, vm_page_t *); int vm_pageout_flush(vm_page_t *, int, int, int, int *, boolean_t *); +void vm_pageout_grow_cache(int, vm_paddr_t, vm_paddr_t); void vm_pageout_oom(int shortage); -boolean_t vm_pageout_page_lock(vm_page_t, vm_page_t *); -void vm_contig_grow_cache(int, vm_paddr_t, vm_paddr_t); #endif #endif /* _VM_VM_PAGEOUT_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 05:50:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B82E7106566C; Wed, 18 Jul 2012 05:50:40 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A303A8FC19; Wed, 18 Jul 2012 05:50:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I5oe6f033508; Wed, 18 Jul 2012 05:50:40 GMT (envelope-from avatar@svn.freebsd.org) Received: (from avatar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I5oe3l033506; Wed, 18 Jul 2012 05:50:40 GMT (envelope-from avatar@svn.freebsd.org) Message-Id: <201207180550.q6I5oe3l033506@svn.freebsd.org> From: Tai-hwa Liang Date: Wed, 18 Jul 2012 05:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238562 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 05:50:40 -0000 Author: avatar Date: Wed Jul 18 05:50:40 2012 New Revision: 238562 URL: http://svn.freebsd.org/changeset/base/238562 Log: Removing bsd{ar,ranlib} found on my ancient installation. MFC after: 3 weeks Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jul 18 05:21:34 2012 (r238561) +++ head/ObsoleteFiles.inc Wed Jul 18 05:50:40 2012 (r238562) @@ -1358,6 +1358,11 @@ OLD_FILES+=usr/share/man/man2/kse_thr_in OLD_FILES+=usr/share/man/man2/kse_wakeup.2.gz OLD_FILES+=usr/lib32/libkse.so OLD_LIBS+=usr/lib32/libkse.so.3 +# 20080225: bsdar/bsdranlib rename to ar/ranlib +OLD_FILES+=usr/bin/bsdar +OLD_FILES+=usr/bin/bsdranlib +OLD_FILES+=usr/share/man/man1/bsdar.1.gz +OLD_FILES+=usr/share/man/man1/bsdranlib.1.gz # 20080220: geom_lvm rename to geom_linux_lvm OLD_FILES+=usr/share/man/man4/geom_lvm.4.gz # 20080126: oldcard.4 removal From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 05:57:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAAA4106566C; Wed, 18 Jul 2012 05:57:43 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5E688FC0A; Wed, 18 Jul 2012 05:57:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I5vhFA034020; Wed, 18 Jul 2012 05:57:43 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I5vheM034018; Wed, 18 Jul 2012 05:57:43 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201207180557.q6I5vheM034018@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 18 Jul 2012 05:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 05:57:44 -0000 Author: obrien Date: Wed Jul 18 05:57:42 2012 New Revision: 238563 URL: http://svn.freebsd.org/changeset/base/238563 Log: a ";" tells make we want the shell to be used Submitted by: Simon Gerraty Modified: head/gnu/usr.bin/groff/tmac/Makefile Modified: head/gnu/usr.bin/groff/tmac/Makefile ============================================================================== --- head/gnu/usr.bin/groff/tmac/Makefile Wed Jul 18 05:50:40 2012 (r238562) +++ head/gnu/usr.bin/groff/tmac/Makefile Wed Jul 18 05:57:42 2012 (r238563) @@ -68,7 +68,7 @@ beforeinstall: cd ${.CURDIR}; \ ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR} - cd ${.OBJDIR} + cd ${.OBJDIR}; .for f in ${STRIPFILES} ${SPECIALFILES} ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ $f-s ${DESTDIR}${TMACDIR}/$f From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 07:07:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBA96106564A; Wed, 18 Jul 2012 07:07:54 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B626E8FC15; Wed, 18 Jul 2012 07:07:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I77sG5039468; Wed, 18 Jul 2012 07:07:54 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I77sdO039466; Wed, 18 Jul 2012 07:07:54 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201207180707.q6I77sdO039466@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 18 Jul 2012 07:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238564 - head/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 07:07:54 -0000 Author: obrien Date: Wed Jul 18 07:07:54 2012 New Revision: 238564 URL: http://svn.freebsd.org/changeset/base/238564 Log: Sort per the comment. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Wed Jul 18 05:57:42 2012 (r238563) +++ head/usr.bin/Makefile Wed Jul 18 07:07:54 2012 (r238564) @@ -208,10 +208,6 @@ SUBDIR+= at SUBDIR+= atm .endif -.if ${MK_MAN_UTILS} != "no" -SUBDIR+= catman -.endif - .if ${MK_BIND_UTILS} != "no" SUBDIR+= dig SUBDIR+= host @@ -235,6 +231,10 @@ SUBDIR+= calendar _clang= clang .endif +.if ${MK_GROFF} != "no" +SUBDIR+= vgrind +.endif + .if ${MK_HESIOD} != "no" SUBDIR+= hesinfo .endif @@ -245,15 +245,8 @@ _mkcsmapper= mkcsmapper _mkesdb= mkesdb .endif -.if ${MK_GROFF} != "no" -SUBDIR+= vgrind -.endif - -.if ${MK_OPENSSL} != "no" -SUBDIR+= bc -SUBDIR+= chkey -SUBDIR+= dc -SUBDIR+= newkey +.if ${MK_KERBEROS_SUPPORT} != "no" +SUBDIR+= compile_et .endif .if ${MK_LIBTHR} != "no" @@ -264,10 +257,6 @@ SUBDIR+= csup SUBDIR+= locate .endif -.if ${MK_KERBEROS_SUPPORT} != "no" -SUBDIR+= compile_et -.endif - # XXX msgs? .if ${MK_MAIL} != "no" SUBDIR+= biff @@ -281,6 +270,7 @@ SUBDIR+= make .endif .if ${MK_MAN_UTILS} != "no" +SUBDIR+= catman _makewhatis= makewhatis _man= man .endif @@ -295,6 +285,13 @@ SUBDIR+= ypmatch SUBDIR+= ypwhich .endif +.if ${MK_OPENSSL} != "no" +SUBDIR+= bc +SUBDIR+= chkey +SUBDIR+= dc +SUBDIR+= newkey +.endif + .if ${MK_QUOTAS} != "no" SUBDIR+= quota .endif From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 07:26:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B850A106566C; Wed, 18 Jul 2012 07:26:21 +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 8A1BB8FC08; Wed, 18 Jul 2012 07:26:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I7QL4O040850; Wed, 18 Jul 2012 07:26:21 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I7QLmM040848; Wed, 18 Jul 2012 07:26:21 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207180726.q6I7QLmM040848@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 18 Jul 2012 07:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238565 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 07:26:21 -0000 Author: trasz Date: Wed Jul 18 07:26:20 2012 New Revision: 238565 URL: http://svn.freebsd.org/changeset/base/238565 Log: Add missing free. Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Wed Jul 18 07:07:54 2012 (r238564) +++ head/sys/geom/geom_subr.c Wed Jul 18 07:26:20 2012 (r238565) @@ -621,6 +621,7 @@ g_resize_provider_event(void *arg, int f hh = arg; pp = hh->pp; size = hh->size; + g_free(hh); G_VALID_PROVIDER(pp); g_trace(G_T_TOPOLOGY, "g_resize_provider_event(%p)", pp); From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 07:48:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43F0D1065673; Wed, 18 Jul 2012 07:48:05 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA5B8FC0C; Wed, 18 Jul 2012 07:48:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I7m5ew042531; Wed, 18 Jul 2012 07:48:05 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I7m43S042525; Wed, 18 Jul 2012 07:48:04 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180748.q6I7m43S042525@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 07:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238566 - in vendor/opensolaris/dist: . cmd/pyzfs cmd/sgs/include cmd/sgs/messages cmd/sgs/tools/common cmd/stat cmd/stat/common cmd/zdb cmd/zfs cmd/zinject cmd/zlook cmd/zpool cmd/zstr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 07:48:05 -0000 Author: mm Date: Wed Jul 18 07:48:04 2012 New Revision: 238566 URL: http://svn.freebsd.org/changeset/base/238566 Log: Update vendor/opensolaris to last OpenSolaris state (13149:b23a4dab3d50) Add ZFS bits to vendor/opensolaris Obtained from: https://hg.openindiana.org/upstream/oracle/onnv-gate Added: vendor/opensolaris/dist/OPENSOLARIS.LICENSE vendor/opensolaris/dist/cmd/pyzfs/ vendor/opensolaris/dist/cmd/pyzfs/pyzfs.py vendor/opensolaris/dist/cmd/stat/ vendor/opensolaris/dist/cmd/stat/common/ vendor/opensolaris/dist/cmd/stat/common/statcommon.h vendor/opensolaris/dist/cmd/stat/common/timestamp.c vendor/opensolaris/dist/cmd/zdb/ vendor/opensolaris/dist/cmd/zdb/zdb.c vendor/opensolaris/dist/cmd/zdb/zdb_il.c vendor/opensolaris/dist/cmd/zfs/ vendor/opensolaris/dist/cmd/zfs/zfs_iter.c vendor/opensolaris/dist/cmd/zfs/zfs_iter.h vendor/opensolaris/dist/cmd/zfs/zfs_main.c vendor/opensolaris/dist/cmd/zfs/zfs_util.h vendor/opensolaris/dist/cmd/zinject/ vendor/opensolaris/dist/cmd/zinject/translate.c vendor/opensolaris/dist/cmd/zinject/zinject.c vendor/opensolaris/dist/cmd/zinject/zinject.h vendor/opensolaris/dist/cmd/zlook/ vendor/opensolaris/dist/cmd/zlook/zlook.c vendor/opensolaris/dist/cmd/zpool/ vendor/opensolaris/dist/cmd/zpool/zpool_iter.c vendor/opensolaris/dist/cmd/zpool/zpool_main.c vendor/opensolaris/dist/cmd/zpool/zpool_util.c vendor/opensolaris/dist/cmd/zpool/zpool_util.h vendor/opensolaris/dist/cmd/zpool/zpool_vdev.c vendor/opensolaris/dist/cmd/zstreamdump/ vendor/opensolaris/dist/cmd/zstreamdump/zstreamdump.c vendor/opensolaris/dist/cmd/ztest/ vendor/opensolaris/dist/cmd/ztest/ztest.c vendor/opensolaris/dist/head/atomic.h vendor/opensolaris/dist/head/libintl.h vendor/opensolaris/dist/head/stdio_ext.h vendor/opensolaris/dist/head/synch.h vendor/opensolaris/dist/head/thread.h vendor/opensolaris/dist/lib/libnvpair/ vendor/opensolaris/dist/lib/libnvpair/libnvpair.c vendor/opensolaris/dist/lib/libnvpair/libnvpair.h vendor/opensolaris/dist/lib/libnvpair/nvpair_alloc_system.c vendor/opensolaris/dist/lib/libuutil/ vendor/opensolaris/dist/lib/libuutil/common/ vendor/opensolaris/dist/lib/libuutil/common/libuutil.h vendor/opensolaris/dist/lib/libuutil/common/libuutil_common.h vendor/opensolaris/dist/lib/libuutil/common/libuutil_impl.h vendor/opensolaris/dist/lib/libuutil/common/uu_alloc.c vendor/opensolaris/dist/lib/libuutil/common/uu_avl.c vendor/opensolaris/dist/lib/libuutil/common/uu_dprintf.c vendor/opensolaris/dist/lib/libuutil/common/uu_ident.c vendor/opensolaris/dist/lib/libuutil/common/uu_list.c vendor/opensolaris/dist/lib/libuutil/common/uu_misc.c vendor/opensolaris/dist/lib/libuutil/common/uu_open.c vendor/opensolaris/dist/lib/libuutil/common/uu_pname.c vendor/opensolaris/dist/lib/libuutil/common/uu_string.c vendor/opensolaris/dist/lib/libuutil/common/uu_strtoint.c vendor/opensolaris/dist/lib/libzfs/ vendor/opensolaris/dist/lib/libzfs/common/ vendor/opensolaris/dist/lib/libzfs/common/libzfs.h vendor/opensolaris/dist/lib/libzfs/common/libzfs_changelist.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_config.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_dataset.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_diff.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_fru.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_graph.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_impl.h vendor/opensolaris/dist/lib/libzfs/common/libzfs_import.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_mount.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_pool.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_status.c vendor/opensolaris/dist/lib/libzfs/common/libzfs_util.c vendor/opensolaris/dist/lib/libzpool/ vendor/opensolaris/dist/lib/libzpool/common/ vendor/opensolaris/dist/lib/libzpool/common/kernel.c vendor/opensolaris/dist/lib/libzpool/common/sys/ vendor/opensolaris/dist/lib/libzpool/common/sys/zfs_context.h vendor/opensolaris/dist/lib/libzpool/common/taskq.c vendor/opensolaris/dist/lib/libzpool/common/util.c vendor/opensolaris/dist/lib/pyzfs/ vendor/opensolaris/dist/lib/pyzfs/common/ vendor/opensolaris/dist/lib/pyzfs/common/__init__.py vendor/opensolaris/dist/lib/pyzfs/common/allow.py vendor/opensolaris/dist/lib/pyzfs/common/dataset.py vendor/opensolaris/dist/lib/pyzfs/common/groupspace.py vendor/opensolaris/dist/lib/pyzfs/common/holds.py vendor/opensolaris/dist/lib/pyzfs/common/ioctl.c vendor/opensolaris/dist/lib/pyzfs/common/table.py vendor/opensolaris/dist/lib/pyzfs/common/unallow.py vendor/opensolaris/dist/lib/pyzfs/common/userspace.py vendor/opensolaris/dist/lib/pyzfs/common/util.py Modified: vendor/opensolaris/dist/cmd/sgs/include/alist.h vendor/opensolaris/dist/cmd/sgs/include/debug.h vendor/opensolaris/dist/cmd/sgs/include/sgs.h vendor/opensolaris/dist/cmd/sgs/messages/sgs.ident vendor/opensolaris/dist/cmd/sgs/tools/common/sgsmsg.c vendor/opensolaris/dist/cmd/sgs/tools/common/string_table.c vendor/opensolaris/dist/lib/libdtrace/common/dt_decl.c vendor/opensolaris/dist/lib/libdtrace/common/dt_ident.c vendor/opensolaris/dist/lib/libdtrace/common/dt_parser.c vendor/opensolaris/dist/lib/libdtrace/common/dt_pragma.c vendor/opensolaris/dist/lib/libdtrace/common/dt_string.c vendor/opensolaris/dist/lib/libdtrace/common/dt_string.h vendor/opensolaris/dist/lib/libdtrace/common/dt_subr.c Added: vendor/opensolaris/dist/OPENSOLARIS.LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opensolaris/dist/OPENSOLARIS.LICENSE Wed Jul 18 07:48:04 2012 (r238566) @@ -0,0 +1,384 @@ +Unless otherwise noted, all files in this distribution are released +under the Common Development and Distribution License (CDDL). +Exceptions are noted within the associated source files. + +-------------------------------------------------------------------- + + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0 + +1. Definitions. + + 1.1. "Contributor" means each individual or entity that creates + or contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Software, prior Modifications used by a Contributor (if any), + and the Modifications made by that particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or (b) + Modifications, or (c) the combination of files containing + Original Software with files containing Modifications, in + each case including portions thereof. + + 1.4. "Executable" means the Covered Software in any form other + than Source Code. + + 1.5. "Initial Developer" means the individual or entity that first + makes Original Software available under this License. + + 1.6. "Larger Work" means a work which combines Covered Software or + portions thereof with code not governed by the terms of this + License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed + herein. + + 1.9. "Modifications" means the Source Code and Executable form of + any of the following: + + A. Any file that results from an addition to, deletion from or + modification of the contents of a file containing Original + Software or previous Modifications; + + B. Any new file that contains any part of the Original + Software or previous Modifications; or + + C. Any new file that is contributed or otherwise made + available under the terms of this License. + + 1.10. "Original Software" means the Source Code and Executable + form of computer software code that is originally released + under this License. + + 1.11. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, + process, and apparatus claims, in any patent Licensable by + grantor. + + 1.12. "Source Code" means (a) the common form of computer software + code in which modifications are made and (b) associated + documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms + of, this License. For legal entities, "You" includes any + entity which controls, is controlled by, or is under common + control with You. For purposes of this definition, + "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by + contract or otherwise, or (b) ownership of more than fifty + percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, the Initial + Developer hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer, to use, + reproduce, modify, display, perform, sublicense and + distribute the Original Software (or portions thereof), + with or without Modifications, and/or as part of a Larger + Work; and + + (b) under Patent Claims infringed by the making, using or + selling of Original Software, to make, have made, use, + practice, sell, and offer for sale, and/or otherwise + dispose of the Original Software (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are + effective on the date Initial Developer first distributes + or otherwise makes the Original Software available to a + third party under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: (1) for code that You delete from the Original + Software, or (2) for infringements caused by: (i) the + modification of the Original Software, or (ii) the + combination of the Original Software with other software + or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, each + Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor to use, reproduce, + modify, display, perform, sublicense and distribute the + Modifications created by such Contributor (or portions + thereof), either on an unmodified basis, with other + Modifications, as Covered Software and/or as part of a + Larger Work; and + + (b) under Patent Claims infringed by the making, using, or + selling of Modifications made by that Contributor either + alone and/or in combination with its Contributor Version + (or portions of such combination), to make, use, sell, + offer for sale, have made, and/or otherwise dispose of: + (1) Modifications made by that Contributor (or portions + thereof); and (2) the combination of Modifications made by + that Contributor with its Contributor Version (or portions + of such combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are + effective on the date Contributor first distributes or + otherwise makes the Modifications available to a third + party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: (1) for any code that Contributor has deleted + from the Contributor Version; (2) for infringements caused + by: (i) third party modifications of Contributor Version, + or (ii) the combination of Modifications made by that + Contributor with other software (except as part of the + Contributor Version) or other devices; or (3) under Patent + Claims infringed by Covered Software in the absence of + Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make + available in Executable form must also be made available in Source + Code form and that Source Code form must be distributed only under + the terms of this License. You must include a copy of this + License with every copy of the Source Code form of the Covered + Software You distribute or otherwise make available. You must + inform recipients of any such Covered Software in Executable form + as to how they can obtain such Covered Software in Source Code + form in a reasonable manner on or through a medium customarily + used for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You contribute are + governed by the terms of this License. You represent that You + believe Your Modifications are Your original creation(s) and/or + You have sufficient rights to grant the rights conveyed by this + License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications that + identifies You as the Contributor of the Modification. You may + not remove or alter any copyright, patent or trademark notices + contained within the Covered Software, or any notices of licensing + or any descriptive text giving attribution to any Contributor or + the Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered Software in + Source Code form that alters or restricts the applicable version + of this License or the recipients' rights hereunder. You may + choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of + Covered Software. However, you may do so only on Your own behalf, + and not on behalf of the Initial Developer or any Contributor. + You must make it absolutely clear that any such warranty, support, + indemnity or liability obligation is offered by You alone, and You + hereby agree to indemnify the Initial Developer and every + Contributor for any liability incurred by the Initial Developer or + such Contributor as a result of warranty, support, indemnity or + liability terms You offer. + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered Software + under the terms of this License or under the terms of a license of + Your choice, which may contain terms different from this License, + provided that You are in compliance with the terms of this License + and that the license for the Executable form does not attempt to + limit or alter the recipient's rights in the Source Code form from + the rights set forth in this License. If You distribute the + Covered Software in Executable form under a different license, You + must make it absolutely clear that any terms which differ from + this License are offered by You alone, not by the Initial + Developer or Contributor. You hereby agree to indemnify the + Initial Developer and every Contributor for any liability incurred + by the Initial Developer or such Contributor as a result of any + such terms You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software with + other code not governed by the terms of this License and + distribute the Larger Work as a single product. In such a case, + You must make sure the requirements of this License are fulfilled + for the Covered Software. + +4. Versions of the License. + + 4.1. New Versions. + + Sun Microsystems, Inc. is the initial license steward and may + publish revised and/or new versions of this License from time to + time. Each version will be given a distinguishing version number. + Except as provided in Section 4.3, no one other than the license + steward has the right to modify this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise make the + Covered Software available under the terms of the version of the + License under which You originally received the Covered Software. + If the Initial Developer includes a notice in the Original + Software prohibiting it from being distributed or otherwise made + available under any subsequent version of the License, You must + distribute and make the Covered Software available under the terms + of the version of the License under which You originally received + the Covered Software. Otherwise, You may also choose to use, + distribute or otherwise make the Covered Software available under + the terms of any subsequent version of the License published by + the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a new + license for Your Original Software, You may create and use a + modified version of this License if You: (a) rename the license + and remove any references to the name of the license steward + (except to note that the license differs from this License); and + (b) otherwise make it clear that the license contains terms which + differ from this License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" + BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED + SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR + PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY + COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE + INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY + NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF + WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS + DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to + cure such breach within 30 days of becoming aware of the breach. + Provisions which, by their nature, must remain in effect beyond + the termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding + declaratory judgment actions) against Initial Developer or a + Contributor (the Initial Developer or Contributor against whom You + assert such claim is referred to as "Participant") alleging that + the Participant Software (meaning the Contributor Version where + the Participant is a Contributor or the Original Software where + the Participant is the Initial Developer) directly or indirectly + infringes any patent, then any and all rights granted directly or + indirectly to You by such Participant, the Initial Developer (if + the Initial Developer is not the Participant) and all Contributors + under Sections 2.1 and/or 2.2 of this License shall, upon 60 days + notice from Participant terminate prospectively and automatically + at the expiration of such 60 day notice period, unless if within + such 60 day period You withdraw Your claim with respect to the + Participant Software against such Participant either unilaterally + or pursuant to a written agreement with Participant. + + 6.3. In the event of termination under Sections 6.1 or 6.2 above, + all end user licenses that have been validly granted by You or any + distributor hereunder prior to termination (excluding licenses + granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE + INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF + COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE + LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK + STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL + INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT + APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO + NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR + CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT + APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is + defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial + computer software" (as that term is defined at 48 + C.F.R. 252.227-7014(a)(1)) and "commercial computer software + documentation" as such terms are used in 48 C.F.R. 12.212 + (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 + C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all + U.S. Government End Users acquire Covered Software with only those + rights set forth herein. This U.S. Government Rights clause is in + lieu of, and supersedes, any other FAR, DFAR, or other clause or + provision that addresses Government rights in computer software + under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed + by the law of the jurisdiction specified in a notice contained + within the Original Software (except to the extent applicable law, + if any, provides otherwise), excluding such jurisdiction's + conflict-of-law provisions. Any litigation relating to this + License shall be subject to the jurisdiction of the courts located + in the jurisdiction and venue specified in a notice contained + within the Original Software, with the losing party responsible + for costs, including, without limitation, court costs and + reasonable attorneys' fees and expenses. The application of the + United Nations Convention on Contracts for the International Sale + of Goods is expressly excluded. Any law or regulation which + provides that the language of a contract shall be construed + against the drafter shall not apply to this License. You agree + that You alone are responsible for compliance with the United + States export administration regulations (and the export control + laws and regulation of any other countries) when You use, + distribute or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or + indirectly, out of its utilization of rights under this License + and You agree to work with Initial Developer and Contributors to + distribute such responsibility on an equitable basis. Nothing + herein is intended or shall be deemed to constitute any admission + of liability. + +-------------------------------------------------------------------- + +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND +DISTRIBUTION LICENSE (CDDL) + +For Covered Software in this distribution, this License shall +be governed by the laws of the State of California (excluding +conflict-of-law provisions). + +Any litigation relating to this License shall be subject to the +jurisdiction of the Federal Courts of the Northern District of +California and the state courts of the State of California, with +venue lying in Santa Clara County, California. Added: vendor/opensolaris/dist/cmd/pyzfs/pyzfs.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opensolaris/dist/cmd/pyzfs/pyzfs.py Wed Jul 18 07:48:04 2012 (r238566) @@ -0,0 +1,82 @@ +#! /usr/bin/python2.6 -S +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +# + +# Note, we want SIGINT (control-c) to exit the process quietly, to mimic +# the standard behavior of C programs. The best we can do with pure +# Python is to run with -S (to disable "import site"), and start our +# program with a "try" statement. Hopefully nobody hits ^C before our +# try statement is executed. + +try: + import site + import gettext + import zfs.util + import zfs.ioctl + import sys + import errno + import solaris.misc + + """This is the main script for doing zfs subcommands. It doesn't know + what subcommands there are, it just looks for a module zfs. + that implements that subcommand.""" + + try: + _ = gettext.translation("SUNW_OST_OSCMD", "/usr/lib/locale", + fallback=True).gettext + except: + _ = solaris.misc.gettext + + if len(sys.argv) < 2: + sys.exit(_("missing subcommand argument")) + + zfs.ioctl.set_cmdstr(" ".join(["zfs"] + sys.argv[1:])) + + try: + # import zfs. + # subfunc = zfs..do_ + + subcmd = sys.argv[1] + __import__("zfs." + subcmd) + submod = getattr(zfs, subcmd) + subfunc = getattr(submod, "do_" + subcmd) + except (ImportError, AttributeError): + sys.exit(_("invalid subcommand")) + + try: + subfunc() + except zfs.util.ZFSError, e: + print(e) + sys.exit(1) + +except IOError, e: + import errno + import sys + + if e.errno == errno.EPIPE: + sys.exit(1) + raise +except KeyboardInterrupt: + import sys + + sys.exit(1) Modified: vendor/opensolaris/dist/cmd/sgs/include/alist.h ============================================================================== --- vendor/opensolaris/dist/cmd/sgs/include/alist.h Wed Jul 18 07:26:20 2012 (r238565) +++ vendor/opensolaris/dist/cmd/sgs/include/alist.h Wed Jul 18 07:48:04 2012 (r238566) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * * Define an Alist, a list maintained as a reallocable array, and a for() loop @@ -32,8 +32,6 @@ #ifndef _ALIST_H #define _ALIST_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -138,6 +136,13 @@ typedef struct { void *apl_data[1]; /* data area: (arrcnt * size) bytes */ } APlist; +#ifdef _SYSCALL32 /* required by librtld_db */ +typedef struct { + Elf32_Word apl_arritems; + Elf32_Word apl_nitems; + Elf32_Addr apl_data[1]; +} APlist32; +#endif /* _SYSCALL32 */ /* * The ALIST_OFF_DATA and APLIST_OFF_DATA macros give the byte offset @@ -224,7 +229,7 @@ typedef struct { * Possible values returned by aplist_test() */ typedef enum { - ALE_ALLOCFAIL = 0, /* Memory allocation error */ + ALE_ALLOCFAIL = 0, /* memory allocation error */ ALE_EXISTS = 1, /* alist entry already exists */ ALE_NOTFND = 2, /* item not found and insert not required */ ALE_CREATE = 3 /* alist entry created */ @@ -244,11 +249,14 @@ typedef enum { ((void *)((_off) + (char *)(_lp))) /* - * # of items currently found in a list. These macros handle the case - * where the list has not been allocated yet. - */ -#define alist_nitems(_lp) (((_lp) == NULL) ? 0 : (_lp)->al_nitems) -#define aplist_nitems(_lp) (((_lp) == NULL) ? 0 : (_lp)->apl_nitems) + * The number of items currently found in a list (nitems), and the total number + * of slots in the current data allocation (arritems). These macros handle the + * case where the list has not been allocated yet. + */ +#define alist_nitems(_lp) (((_lp) == NULL) ? 0 : (_lp)->al_nitems) +#define aplist_nitems(_lp) (((_lp) == NULL) ? 0 : (_lp)->apl_nitems) +#define alist_arritems(_lp) (((_lp) == NULL) ? 0 : (_lp)->al_arritems) +#define aplist_arritems(_lp) (((_lp) == NULL) ? 0 : (_lp)->apl_arritems) extern void *alist_append(Alist **, const void *, size_t, Aliste); Modified: vendor/opensolaris/dist/cmd/sgs/include/debug.h ============================================================================== --- vendor/opensolaris/dist/cmd/sgs/include/debug.h Wed Jul 18 07:26:20 2012 (r238565) +++ vendor/opensolaris/dist/cmd/sgs/include/debug.h Wed Jul 18 07:48:04 2012 (r238566) @@ -20,15 +20,12 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _DEBUG_H #define _DEBUG_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Global include file for lddbg debugging. * @@ -45,6 +42,7 @@ * start with the `Elf_' prefix. These latter routines are the only * routines used by the elfdump(1) utility. */ +#include #include #include #include @@ -55,13 +53,12 @@ extern "C" { #endif /* - * Define Dbg_*() interface flags. These flags direct the debugging routine to - * generate different diagnostics, thus the strings themselves are maintained + * Define Dbg_*() interface values. These values direct the debugging routine + * to generate different diagnostics, thus the strings themselves are maintained * in the debugging library. */ #define DBG_SUP_ENVIRON 1 #define DBG_SUP_CMDLINE 2 -#define DBG_SUP_DEFAULT 3 #define DBG_CONF_IGNORE 1 /* configuration processing errors */ #define DBG_CONF_VERSION 2 @@ -87,18 +84,22 @@ extern "C" { #define DBG_DLSYM_SELF 3 #define DBG_DLSYM_PROBE 4 #define DBG_DLSYM_SINGLETON 5 +#define DBG_DLSYM_NUM DBG_DLSYM_SINGLETON + 1 #define DBG_DLCLOSE_NULL 0 #define DBG_DLCLOSE_IGNORE 1 #define DBG_DLCLOSE_RESCAN 2 -#define DBG_WAIT_INIT 1 -#define DBG_WAIT_FINI 2 -#define DBG_WAIT_SYMBOL 3 - #define DBG_SYM_REDUCE_GLOBAL 1 /* reporting global symbols to local */ #define DBG_SYM_REDUCE_RETAIN 2 /* reporting non reduced local syms */ +#define DBG_AUD_CALL 1 /* original call to auditor */ +#define DBG_AUD_RET 2 /* return from auditor diagnostic */ + +#define DBG_AUD_LOCAL 0 /* auditor is local */ +#define DBG_AUD_GLOBAL 1 /* auditor is global */ +#define DBG_AUD_PRELOAD 2 /* auditor is preloaded */ + /* * Group handle operations - passed to Dbg_file_hdl_title(). Indicate why * handle dependencies are being manipulated. @@ -139,12 +140,18 @@ extern "C" { #define DBG_BINFO_REF_PARENT 0x2000 /* reference to PARENT */ #define DBG_BINFO_REF_MSK 0xf000 - -#define DBG_CAP_INITIAL 0 -#define DBG_CAP_IGNORE 1 -#define DBG_CAP_OLD 2 -#define DBG_CAP_NEW 3 -#define DBG_CAP_RESOLVED 4 +/* + * ld.so.1(1) symbol capabilities processing. + */ +#define DBG_CAP_DEFAULT 0 +#define DBG_CAP_USED 1 +#define DBG_CAP_CANDIDATE 2 +#define DBG_CAP_REJECTED 3 +#define DBG_CAP_HW_1 4 +#define DBG_CAP_SF_1 5 +#define DBG_CAP_HW_2 6 +#define DBG_CAP_PLAT 7 +#define DBG_CAP_MACH 8 #define DBG_REL_START 1 #define DBG_REL_FINISH 2 @@ -153,23 +160,53 @@ extern "C" { #define DBG_NL_STD 0 /* newline controllers - standard and */ #define DBG_NL_FRC 2 /* forced. */ -#define DBG_BNDREJ_NODIR 0 /* bind rejected, direct to nodirect */ -#define DBG_BNDREJ_SINGLE 1 /* bind rejected, singleton without */ +#define DBG_BNDREJ_DIRECT 0 /* bind rejected, direct to nodirect */ +#define DBG_BNDREJ_GROUP 1 /* bind rejected, group to nodirect */ +#define DBG_BNDREJ_SINGLE 2 /* bind rejected, singleton without */ /* default search model */ #define DBG_BNDREJ_NUM DBG_BNDREJ_SINGLE /* + * Dbg_state_str() is used to obtain commonly used "state transition" + * strings used in various debugging output. + */ +#define DBG_STATE_ADD 0 /* add */ +#define DBG_STATE_CURRENT 1 /* current */ +#define DBG_STATE_EXCLUDE 2 /* exclude */ +#define DBG_STATE_IGNORED 3 /* ignored */ +#define DBG_STATE_MOD_BEFORE 4 /* modify (before) */ +#define DBG_STATE_MOD_AFTER 5 /* modify (after) */ +#define DBG_STATE_NEW 6 /* new */ +#define DBG_STATE_NEW_IMPLICIT 7 /* new (implicit) */ +#define DBG_STATE_RESET 8 /* reset */ +#define DBG_STATE_ORIGINAL 9 /* original */ +#define DBG_STATE_RESOLVED 10 /* resolved */ + +#define DBG_STATE_NUM 11 +typedef uint_t dbg_state_t; +extern const char *Dbg_state_str(dbg_state_t); + +/* * Define a debug descriptor, and a user macro that inspects the descriptor as * a means of triggering a class of diagnostic output. */ typedef struct { uint_t d_class; /* debugging classes */ - uint_t d_extra; /* extra information for classes */ - APlist *d_list; /* associated strings */ + uint_t d_extra; /* extra public information */ + APlist *d_list; /* accepted link-map list names */ + struct timeval d_totaltime; /* total time since entry - */ + /* gettimeofday(3c) */ + struct timeval d_deltatime; /* delta time since last diagnostic - */ + /* gettimeofday(3c) */ } Dbg_desc; extern Dbg_desc *dbg_desc; +/* + * Macros used to avoid calls to liblddbg unless debugging is enabled. + * liblddbg is lazy loaded --- this prevents it from happening unless + * it will actually be used. + */ #define DBG_ENABLED (dbg_desc->d_class) #define DBG_CALL(func) if (DBG_ENABLED) func @@ -180,26 +217,51 @@ extern Dbg_desc *dbg_desc; * may be interpreted by the debugging library itself or from the callers * dbg_print() routine. */ -#define DBG_E_DETAIL 0x0001 /* add detail to a class */ -#define DBG_E_LONG 0x0002 /* use long names (ie. no truncation) */ - -#define DBG_E_STDNL 0x0010 /* standard newline indicator */ +#define DBG_E_DETAIL 0x00000001 /* add detail to a class */ +#define DBG_E_LONG 0x00000002 /* use long names (ie. no truncation) */ +#define DBG_E_DEMANGLE 0x00000004 /* demangle symbol names */ +#define DBG_E_STDNL 0x00000008 /* standard newline indicator */ +#define DBG_E_HELP 0x00000010 /* help requested */ +#define DBG_E_HELP_EXIT 0x00000020 /* hint: user should exit after help */ +#define DBG_E_TTIME 0x00000040 /* prepend total time */ +#define DBG_E_DTIME 0x00000080 /* prepend delta time */ +#define DBG_E_RESET 0x00000100 /* reset times */ + +/* ld only */ +#define DBG_E_SNAME 0x00001000 /* prepend simple name */ +#define DBG_E_FNAME 0x00002000 /* prepend full name */ +#define DBG_E_CLASS 0x00004000 /* prepend ELF class */ + +/* ld.so.1 only */ +#define DBG_E_LMID 0x00100000 /* prepend link-map id */ +#define DBG_E_LMID_LDSO 0x00200000 /* show ldso link-map list */ +#define DBG_E_LMID_ALL 0x00400000 /* show all non-ldso link-map lists */ +#define DBG_E_LMID_ALT 0x00800000 /* show all ALT link-map lists */ +#define DBG_E_LMID_BASE 0x01000000 /* show BASE link-map list */ -#define DBG_E_SNAME 0x0100 /* prepend simple name (ld only) */ -#define DBG_E_FNAME 0x0200 /* prepend full name (ld only) */ -#define DBG_E_CLASS 0x0400 /* prepend ELF class (ld only) */ -#define DBG_E_LMID 0x0800 /* prepend link-map id (ld.so.1 only) */ -#define DBG_E_DEMANGLE 0x1000 /* demangle symbol names */ #define DBG_NOTDETAIL() !(dbg_desc->d_extra & DBG_E_DETAIL) #define DBG_NOTLONG() !(dbg_desc->d_extra & DBG_E_LONG) +#define DBG_ISDEMANGLE() \ + (dbg_desc->d_extra & DBG_E_DEMANGLE) + +#define DBG_TOTALTIME (dbg_desc->d_totaltime) +#define DBG_DELTATIME (dbg_desc->d_deltatime) + +#define DBG_ISTTIME() (dbg_desc->d_extra & DBG_E_TTIME) +#define DBG_ISDTIME() (dbg_desc->d_extra & DBG_E_DTIME) +#define DBG_ISTIME() (dbg_desc->d_extra & (DBG_E_TTIME | DBG_E_DTIME)) +#define DBG_NOTTIME() !(dbg_desc->d_extra & (DBG_E_TTIME | DBG_E_DTIME)) + +#define DBG_ISRESET() (dbg_desc->d_extra & DBG_E_RESET) +#define DBG_ONRESET() (dbg_desc->d_extra |= DBG_E_RESET) +#define DBG_OFFRESET() (dbg_desc->d_extra &= ~DBG_E_RESET) + #define DBG_ISSNAME() (dbg_desc->d_extra & DBG_E_SNAME) #define DBG_ISFNAME() (dbg_desc->d_extra & DBG_E_FNAME) #define DBG_ISCLASS() (dbg_desc->d_extra & DBG_E_CLASS) #define DBG_ISLMID() (dbg_desc->d_extra & DBG_E_LMID) -#define DBG_ISDEMANGLE() \ - (dbg_desc->d_extra & DBG_E_DEMANGLE) /* * Print routine, this must be supplied by the application. The initial @@ -209,7 +271,19 @@ extern Dbg_desc *dbg_desc; /* PRINTFLIKE2 */ extern void dbg_print(Lm_list *, const char *, ...); -extern uintptr_t Dbg_setup(const char *, Dbg_desc *); +/* + * Initialization routine, called before any other Dbg routines to + * establish the necessary state. + */ +typedef enum { DBG_CALLER_LD, DBG_CALLER_RTLD } dbg_setup_caller_t; +extern int Dbg_setup(dbg_setup_caller_t, const char *, + Dbg_desc *, const char **); + +/* Call dbg_print() to produce linker version output */ +extern void Dbg_version(void); + +/* Call dbg_print() to produce help output */ +extern void Dbg_help(void); /* * Establish ELF32 and ELF64 class Dbg_*() interfaces. @@ -225,12 +299,28 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_bind_reject Dbg64_bind_reject #define Dbg_bind_weak Dbg64_bind_weak -#define Dbg_cap_val_hw1 Dbg64_cap_val_hw1 -#define Dbg_cap_hw_candidate Dbg64_cap_hw_candidate -#define Dbg_cap_hw_filter Dbg64_cap_hw_filter -#define Dbg_cap_mapfile Dbg64_cap_mapfile -#define Dbg_cap_sec_entry Dbg64_cap_sec_entry +#define Dbg_cap_candidate Dbg64_cap_candidate +#define Dbg_cap_filter Dbg64_cap_filter +#define Dbg_cap_id Dbg64_cap_id +#define Dbg_cap_identical Dbg64_cap_identical +#define Dbg_cap_mapfile_title Dbg64_cap_mapfile_title +#define Dbg_cap_post_title Dbg64_cap_post_title #define Dbg_cap_sec_title Dbg64_cap_sec_title +#define Dbg_cap_val Dbg64_cap_val +#define Dbg_cap_ptr_entry Dbg64_cap_ptr_entry +#define Dbg_cap_val_entry Dbg64_cap_val_entry + +#define Dbg_dl_dladdr Dbg64_dl_dladdr +#define Dbg_dl_dlclose Dbg64_dl_dlclose +#define Dbg_dl_dldump Dbg64_dl_dldump +#define Dbg_dl_dlerror Dbg64_dl_dlerror +#define Dbg_dl_dlinfo Dbg64_dl_dlinfo +#define Dbg_dl_dlopen Dbg64_dl_dlopen +#define Dbg_dl_dlsym Dbg64_dl_dlsym +#define Dbg_dl_iphdr_enter Dbg64_dl_iphdr_enter +#define Dbg_dl_iphdr_callback Dbg64_dl_iphdr_callback +#define Dbg_dl_iphdr_mapchange Dbg64_dl_iphdr_mapchange +#define Dbg_dl_iphdr_unmap_ret Dbg64_dl_iphdr_unmap_ret #define Dbg_ent_entry Dbg64_ent_entry #define Dbg_ent_print Dbg64_ent_print @@ -241,15 +331,14 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_file_ar_rescan Dbg64_file_ar_rescan #define Dbg_file_bind_entry Dbg64_file_bind_entry #define Dbg_file_bindings Dbg64_file_bindings +#define Dbg_file_bindings_done Dbg64_file_bindings_done #define Dbg_file_cleanup Dbg64_file_cleanup #define Dbg_file_cntl Dbg64_file_cntl #define Dbg_file_config_dis Dbg64_file_config_dis #define Dbg_file_config_obj Dbg64_file_config_obj #define Dbg_file_del_rescan Dbg64_file_del_rescan #define Dbg_file_delete Dbg64_file_delete -#define Dbg_file_dlclose Dbg64_file_dlclose -#define Dbg_file_dldump Dbg64_file_dldump -#define Dbg_file_dlopen Dbg64_file_dlopen +#define Dbg_file_deferred Dbg64_file_deferred #define Dbg_file_elf Dbg64_file_elf #define Dbg_file_filtee Dbg64_file_filtee #define Dbg_file_filter Dbg64_file_filter @@ -260,6 +349,7 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_file_hdl_title Dbg64_file_hdl_title #define Dbg_file_lazyload Dbg64_file_lazyload #define Dbg_file_ldso Dbg64_file_ldso +#define Dbg_file_mmapobj Dbg64_file_mmapobj #define Dbg_file_mode_promote Dbg64_file_mode_promote #define Dbg_file_modified Dbg64_file_modified #define Dbg_file_needed Dbg64_file_needed @@ -275,7 +365,7 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_libs_audit Dbg64_libs_audit #define Dbg_libs_find Dbg64_libs_find #define Dbg_libs_found Dbg64_libs_found -#define Dbg_libs_ignore Dbg64_libs_ignore +#define Dbg_libs_insecure Dbg64_libs_insecure #define Dbg_libs_init Dbg64_libs_init #define Dbg_libs_l Dbg64_libs_l #define Dbg_libs_path Dbg64_libs_path @@ -284,22 +374,28 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_libs_yp Dbg64_libs_yp #define Dbg_libs_ylu Dbg64_libs_ylu -#define Dbg_map_dash Dbg64_map_dash +#define Dbg_map_cexp_id Dbg64_map_cexp_id +#define Dbg_map_dv Dbg64_map_dv +#define Dbg_map_dv_entry Dbg64_map_dv_entry #define Dbg_map_ent Dbg64_map_ent +#define Dbg_map_ent_ord_title Dbg64_map_ent_ord_title +#define Dbg_map_hdr_noalloc Dbg64_map_hdr_noalloc #define Dbg_map_parse Dbg64_map_parse -#define Dbg_map_pipe Dbg64_map_pipe +#define Dbg_map_pass Dbg64_map_pass +#define Dbg_map_post_title Dbg64_map_post_title #define Dbg_map_seg Dbg64_map_seg -#define Dbg_map_set_atsign Dbg64_map_set_atsign -#define Dbg_map_set_equal Dbg64_map_set_equal +#define Dbg_map_seg_order Dbg64_map_seg_order +#define Dbg_map_seg_os_order Dbg64_map_seg_os_order #define Dbg_map_size_new Dbg64_map_size_new #define Dbg_map_size_old Dbg64_map_size_old -#define Dbg_map_sort_fini Dbg64_map_sort_fini -#define Dbg_map_sort_orig Dbg64_map_sort_orig +#define Dbg_map_sort_seg Dbg64_map_sort_seg +#define Dbg_map_sort_title Dbg64_map_sort_title #define Dbg_map_symbol Dbg64_map_symbol #define Dbg_map_version Dbg64_map_version #define Dbg_move_adjexpandreloc Dbg64_move_adjexpandreloc #define Dbg_move_adjmovereloc Dbg64_move_adjmovereloc +#define Dbg_move_bad Dbg64_move_bad #define Dbg_move_data Dbg64_move_data #define Dbg_move_entry1 Dbg64_move_entry1 #define Dbg_move_entry2 Dbg64_move_entry2 @@ -329,13 +425,16 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_reloc_sloppycomdat Dbg64_reloc_sloppycomdat #define Dbg_sec_added Dbg64_sec_added +#define Dbg_sec_backing Dbg64_sec_backing #define Dbg_sec_created Dbg64_sec_created #define Dbg_sec_discarded Dbg64_sec_discarded #define Dbg_sec_genstr_compress Dbg64_sec_genstr_compress #define Dbg_sec_group Dbg64_sec_group +#define Dbg_sec_gnu_comdat Dbg64_sec_gnu_comdat #define Dbg_sec_in Dbg64_sec_in #define Dbg_sec_order_error Dbg64_sec_order_error #define Dbg_sec_order_list Dbg64_sec_order_list +#define Dbg_sec_redirected Dbg64_sec_redirected #define Dbg_sec_strtab Dbg64_sec_strtab #define Dbg_sec_unsup_strmerge Dbg64_sec_unsup_strmerge @@ -353,17 +452,24 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_support_action Dbg64_support_action #define Dbg_support_load Dbg64_support_load #define Dbg_support_req Dbg64_support_req +#define Dbg_support_vnone Dbg64_support_vnone #define Dbg_syminfo_entry Dbg64_syminfo_entry #define Dbg_syminfo_title Dbg64_syminfo_title #define Dbg_syms_ar_checking Dbg64_syms_ar_checking -#define Dbg_syms_ar_entry Dbg64_syms_ar_entry +#define Dbg_syms_ar_force Dbg64_syms_ar_force #define Dbg_syms_ar_resolve Dbg64_syms_ar_resolve +#define Dbg_syms_ar_skip Dbg64_syms_ar_skip #define Dbg_syms_ar_title Dbg64_syms_ar_title +#define Dbg_syms_cap_convert Dbg64_syms_cap_convert +#define Dbg_syms_cap_local Dbg64_syms_cap_local +#define Dbg_syms_cap_lookup Dbg64_syms_cap_lookup +#define Dbg_syms_cap_title Dbg64_syms_cap_title +#define Dbg_syms_copy_reloc Dbg64_syms_copy_reloc #define Dbg_syms_created Dbg64_syms_created #define Dbg_syms_discarded Dbg64_syms_discarded -#define Dbg_syms_dlsym Dbg64_syms_dlsym +#define Dbg_syms_dup_discarded Dbg64_syms_dup_discarded #define Dbg_syms_dup_sort_addr Dbg64_syms_dup_sort_addr #define Dbg_syms_entered Dbg64_syms_entered #define Dbg_syms_entry Dbg64_syms_entry @@ -376,7 +482,6 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_syms_old Dbg64_syms_old #define Dbg_syms_process Dbg64_syms_process #define Dbg_syms_reduce Dbg64_syms_reduce -#define Dbg_syms_reloc Dbg64_syms_reloc #define Dbg_syms_resolved Dbg64_syms_resolved #define Dbg_syms_resolving Dbg64_syms_resolving #define Dbg_syms_sec_entry Dbg64_syms_sec_entry @@ -384,8 +489,8 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_syms_spec_title Dbg64_syms_spec_title #define Dbg_syms_updated Dbg64_syms_updated #define Dbg_syms_up_title Dbg64_syms_up_title +#define Dbg_syms_wrap Dbg64_syms_wrap -#define Dbg_util_broadcast Dbg64_util_broadcast #define Dbg_util_call_array Dbg64_util_call_array #define Dbg_util_call_fini Dbg64_util_call_fini #define Dbg_util_call_init Dbg64_util_call_init @@ -401,7 +506,6 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_util_scc_entry Dbg64_util_scc_entry #define Dbg_util_scc_title Dbg64_util_scc_title #define Dbg_util_str Dbg64_util_str -#define Dbg_util_wait Dbg64_util_wait #define Dbg_unused_file Dbg64_unused_file #define Dbg_unused_lcinterface Dbg64_unused_lcinterface @@ -413,6 +517,7 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_ver_avail_title Dbg64_ver_avail_title #define Dbg_ver_def_title Dbg64_ver_def_title #define Dbg_ver_desc_entry Dbg64_ver_desc_entry +#define Dbg_ver_need_done Dbg64_ver_need_done #define Dbg_ver_need_entry Dbg64_ver_need_entry #define Dbg_ver_need_title Dbg64_ver_need_title #define Dbg_ver_nointerface Dbg64_ver_nointerface @@ -427,12 +532,28 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_bind_reject Dbg32_bind_reject #define Dbg_bind_weak Dbg32_bind_weak -#define Dbg_cap_val_hw1 Dbg32_cap_val_hw1 -#define Dbg_cap_hw_candidate Dbg32_cap_hw_candidate -#define Dbg_cap_hw_filter Dbg32_cap_hw_filter -#define Dbg_cap_mapfile Dbg32_cap_mapfile -#define Dbg_cap_sec_entry Dbg32_cap_sec_entry +#define Dbg_cap_candidate Dbg32_cap_candidate +#define Dbg_cap_filter Dbg32_cap_filter +#define Dbg_cap_id Dbg32_cap_id +#define Dbg_cap_identical Dbg32_cap_identical +#define Dbg_cap_mapfile_title Dbg32_cap_mapfile_title +#define Dbg_cap_post_title Dbg32_cap_post_title #define Dbg_cap_sec_title Dbg32_cap_sec_title +#define Dbg_cap_val Dbg32_cap_val +#define Dbg_cap_ptr_entry Dbg32_cap_ptr_entry +#define Dbg_cap_val_entry Dbg32_cap_val_entry + +#define Dbg_dl_dladdr Dbg32_dl_dladdr +#define Dbg_dl_dlclose Dbg32_dl_dlclose +#define Dbg_dl_dldump Dbg32_dl_dldump +#define Dbg_dl_dlerror Dbg32_dl_dlerror +#define Dbg_dl_dlinfo Dbg32_dl_dlinfo +#define Dbg_dl_dlopen Dbg32_dl_dlopen +#define Dbg_dl_dlsym Dbg32_dl_dlsym +#define Dbg_dl_iphdr_enter Dbg32_dl_iphdr_enter +#define Dbg_dl_iphdr_callback Dbg32_dl_iphdr_callback +#define Dbg_dl_iphdr_mapchange Dbg32_dl_iphdr_mapchange +#define Dbg_dl_iphdr_unmap_ret Dbg32_dl_iphdr_unmap_ret #define Dbg_ent_entry Dbg32_ent_entry #define Dbg_ent_print Dbg32_ent_print @@ -443,15 +564,14 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_file_ar_rescan Dbg32_file_ar_rescan #define Dbg_file_bind_entry Dbg32_file_bind_entry #define Dbg_file_bindings Dbg32_file_bindings +#define Dbg_file_bindings_done Dbg32_file_bindings_done #define Dbg_file_cleanup Dbg32_file_cleanup #define Dbg_file_cntl Dbg32_file_cntl #define Dbg_file_config_dis Dbg32_file_config_dis #define Dbg_file_config_obj Dbg32_file_config_obj #define Dbg_file_del_rescan Dbg32_file_del_rescan #define Dbg_file_delete Dbg32_file_delete -#define Dbg_file_dlclose Dbg32_file_dlclose *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 08:12:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A2581065670; Wed, 18 Jul 2012 08:12:05 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 501CF8FC0A; Wed, 18 Jul 2012 08:12:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I8C5pG044228; Wed, 18 Jul 2012 08:12:05 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I8C5vK044224; Wed, 18 Jul 2012 08:12:05 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180812.q6I8C5vK044224@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 08:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238567 - in vendor-sys/opensolaris/dist: . common common/acl common/atomic common/atomic/amd64 common/atomic/i386 common/atomic/sparc common/avl common/list common/nvpair common/unicod... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 08:12:05 -0000 Author: mm Date: Wed Jul 18 08:12:04 2012 New Revision: 238567 URL: http://svn.freebsd.org/changeset/base/238567 Log: Update vendor-sys/opensolaris to last OpenSolaris state (13149:b23a4dab3d50) Add ZFS bits to vendor-sys/opensolaris Obtained from: https://hg.openindiana.org/upstream/oracle/onnv-gate Added: vendor-sys/opensolaris/dist/OPENSOLARIS.LICENSE vendor-sys/opensolaris/dist/common/ vendor-sys/opensolaris/dist/common/acl/ vendor-sys/opensolaris/dist/common/acl/acl_common.c vendor-sys/opensolaris/dist/common/acl/acl_common.h vendor-sys/opensolaris/dist/common/atomic/ vendor-sys/opensolaris/dist/common/atomic/amd64/ vendor-sys/opensolaris/dist/common/atomic/amd64/atomic.s vendor-sys/opensolaris/dist/common/atomic/i386/ vendor-sys/opensolaris/dist/common/atomic/i386/atomic.s vendor-sys/opensolaris/dist/common/atomic/sparc/ vendor-sys/opensolaris/dist/common/atomic/sparc/atomic.s vendor-sys/opensolaris/dist/common/avl/ vendor-sys/opensolaris/dist/common/avl/avl.c vendor-sys/opensolaris/dist/common/list/ vendor-sys/opensolaris/dist/common/list/list.c vendor-sys/opensolaris/dist/common/nvpair/ vendor-sys/opensolaris/dist/common/nvpair/nvpair.c vendor-sys/opensolaris/dist/common/nvpair/nvpair_alloc_fixed.c vendor-sys/opensolaris/dist/common/unicode/ vendor-sys/opensolaris/dist/common/unicode/u8_textprep.c vendor-sys/opensolaris/dist/common/zfs/ vendor-sys/opensolaris/dist/common/zfs/zfs_comutil.c vendor-sys/opensolaris/dist/common/zfs/zfs_comutil.h vendor-sys/opensolaris/dist/common/zfs/zfs_deleg.c vendor-sys/opensolaris/dist/common/zfs/zfs_deleg.h vendor-sys/opensolaris/dist/common/zfs/zfs_fletcher.c vendor-sys/opensolaris/dist/common/zfs/zfs_fletcher.h vendor-sys/opensolaris/dist/common/zfs/zfs_namecheck.c vendor-sys/opensolaris/dist/common/zfs/zfs_namecheck.h vendor-sys/opensolaris/dist/common/zfs/zfs_prop.c vendor-sys/opensolaris/dist/common/zfs/zfs_prop.h vendor-sys/opensolaris/dist/common/zfs/zpool_prop.c vendor-sys/opensolaris/dist/common/zfs/zprop_common.c vendor-sys/opensolaris/dist/uts/common/Makefile.files vendor-sys/opensolaris/dist/uts/common/fs/ vendor-sys/opensolaris/dist/uts/common/fs/gfs.c vendor-sys/opensolaris/dist/uts/common/fs/vnode.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/ vendor-sys/opensolaris/dist/uts/common/fs/zfs/arc.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/bplist.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/bpobj.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dbuf.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/ddt.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/ddt_zap.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dmu.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dmu_object.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dmu_zfetch.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dnode.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dsl_deadlist.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dsl_deleg.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dsl_prop.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/dsl_synctask.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/gzip.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/lzjb.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/metaslab.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/refcount.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/rrwlock.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/sa.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/sha256.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/spa.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/spa_config.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/spa_errlog.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/spa_history.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/space_map.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/ vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/arc.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/bplist.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/bpobj.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dbuf.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/ddt.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dmu_impl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dmu_objset.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dmu_traverse.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dmu_tx.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dmu_zfetch.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dnode.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dsl_deadlist.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dsl_deleg.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dsl_dir.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dsl_pool.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dsl_prop.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dsl_scan.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/dsl_synctask.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/metaslab.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/metaslab_impl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/refcount.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/rrwlock.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/sa.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/sa_impl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/spa_boot.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/space_map.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/txg.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/txg_impl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/uberblock.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/uberblock_impl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/unique.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/vdev.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/vdev_disk.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/vdev_file.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zap.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zap_impl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zap_leaf.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_acl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_context.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_ctldir.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_debug.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_dir.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_fuid.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_ioctl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_onexit.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_rlock.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_sa.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_stat.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_vfsops.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zfs_znode.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zil.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zil_impl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zio_checksum.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zio_compress.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zio_impl.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zrlock.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/sys/zvol.h vendor-sys/opensolaris/dist/uts/common/fs/zfs/txg.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/uberblock.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/unique.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/vdev.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/vdev_cache.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/vdev_file.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/vdev_label.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/vdev_mirror.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/vdev_missing.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/vdev_queue.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/vdev_raidz.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/vdev_root.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zap.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zap_leaf.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zap_micro.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs.conf vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_acl.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_byteswap.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_ctldir.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_debug.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_dir.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_fm.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_fuid.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_ioctl.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_log.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_onexit.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_replay.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_rlock.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_sa.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_vfsops.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zfs_znode.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zil.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zio.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zio_checksum.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zio_compress.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zio_inject.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zle.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zrlock.c vendor-sys/opensolaris/dist/uts/common/fs/zfs/zvol.c vendor-sys/opensolaris/dist/uts/common/os/ vendor-sys/opensolaris/dist/uts/common/os/callb.c vendor-sys/opensolaris/dist/uts/common/os/fm.c vendor-sys/opensolaris/dist/uts/common/os/nvpair_alloc_system.c vendor-sys/opensolaris/dist/uts/common/sys/acl.h vendor-sys/opensolaris/dist/uts/common/sys/acl_impl.h vendor-sys/opensolaris/dist/uts/common/sys/avl.h vendor-sys/opensolaris/dist/uts/common/sys/avl_impl.h vendor-sys/opensolaris/dist/uts/common/sys/bitmap.h vendor-sys/opensolaris/dist/uts/common/sys/callb.h vendor-sys/opensolaris/dist/uts/common/sys/ccompile.h vendor-sys/opensolaris/dist/uts/common/sys/compress.h vendor-sys/opensolaris/dist/uts/common/sys/cred.h vendor-sys/opensolaris/dist/uts/common/sys/debug.h vendor-sys/opensolaris/dist/uts/common/sys/errorq.h vendor-sys/opensolaris/dist/uts/common/sys/extdirent.h vendor-sys/opensolaris/dist/uts/common/sys/feature_tests.h vendor-sys/opensolaris/dist/uts/common/sys/fm/ vendor-sys/opensolaris/dist/uts/common/sys/fm/fs/ vendor-sys/opensolaris/dist/uts/common/sys/fm/fs/zfs.h vendor-sys/opensolaris/dist/uts/common/sys/fm/protocol.h vendor-sys/opensolaris/dist/uts/common/sys/fm/util.h vendor-sys/opensolaris/dist/uts/common/sys/fs/ vendor-sys/opensolaris/dist/uts/common/sys/fs/zfs.h vendor-sys/opensolaris/dist/uts/common/sys/fs/zut.h vendor-sys/opensolaris/dist/uts/common/sys/gfs.h vendor-sys/opensolaris/dist/uts/common/sys/idmap.h vendor-sys/opensolaris/dist/uts/common/sys/isa_defs.h vendor-sys/opensolaris/dist/uts/common/sys/list.h vendor-sys/opensolaris/dist/uts/common/sys/list_impl.h vendor-sys/opensolaris/dist/uts/common/sys/note.h vendor-sys/opensolaris/dist/uts/common/sys/nvpair.h vendor-sys/opensolaris/dist/uts/common/sys/nvpair_impl.h vendor-sys/opensolaris/dist/uts/common/sys/processor.h vendor-sys/opensolaris/dist/uts/common/sys/procset.h vendor-sys/opensolaris/dist/uts/common/sys/synch.h vendor-sys/opensolaris/dist/uts/common/sys/sysevent/ vendor-sys/opensolaris/dist/uts/common/sys/sysevent.h vendor-sys/opensolaris/dist/uts/common/sys/sysevent/dev.h vendor-sys/opensolaris/dist/uts/common/sys/sysevent/eventdefs.h vendor-sys/opensolaris/dist/uts/common/sys/sysmacros.h vendor-sys/opensolaris/dist/uts/common/sys/taskq.h vendor-sys/opensolaris/dist/uts/common/sys/u8_textprep.h vendor-sys/opensolaris/dist/uts/common/sys/u8_textprep_data.h vendor-sys/opensolaris/dist/uts/common/sys/vnode.h vendor-sys/opensolaris/dist/uts/common/sys/zmod.h vendor-sys/opensolaris/dist/uts/common/zmod/ vendor-sys/opensolaris/dist/uts/common/zmod/adler32.c vendor-sys/opensolaris/dist/uts/common/zmod/crc32.c vendor-sys/opensolaris/dist/uts/common/zmod/crc32.h vendor-sys/opensolaris/dist/uts/common/zmod/deflate.c vendor-sys/opensolaris/dist/uts/common/zmod/deflate.h vendor-sys/opensolaris/dist/uts/common/zmod/inffast.c vendor-sys/opensolaris/dist/uts/common/zmod/inffast.h vendor-sys/opensolaris/dist/uts/common/zmod/inffixed.h vendor-sys/opensolaris/dist/uts/common/zmod/inflate.c vendor-sys/opensolaris/dist/uts/common/zmod/inflate.h vendor-sys/opensolaris/dist/uts/common/zmod/inftrees.c vendor-sys/opensolaris/dist/uts/common/zmod/inftrees.h vendor-sys/opensolaris/dist/uts/common/zmod/trees.c vendor-sys/opensolaris/dist/uts/common/zmod/zconf.h vendor-sys/opensolaris/dist/uts/common/zmod/zlib.h vendor-sys/opensolaris/dist/uts/common/zmod/zmod.c vendor-sys/opensolaris/dist/uts/common/zmod/zmod_subr.c vendor-sys/opensolaris/dist/uts/common/zmod/zutil.c vendor-sys/opensolaris/dist/uts/common/zmod/zutil.h Modified: vendor-sys/opensolaris/dist/uts/common/dtrace/dtrace.c vendor-sys/opensolaris/dist/uts/common/dtrace/fasttrap.c vendor-sys/opensolaris/dist/uts/common/dtrace/lockstat.c vendor-sys/opensolaris/dist/uts/common/dtrace/profile.c vendor-sys/opensolaris/dist/uts/common/dtrace/sdt_subr.c vendor-sys/opensolaris/dist/uts/common/dtrace/systrace.c vendor-sys/opensolaris/dist/uts/common/sys/cpupart.h vendor-sys/opensolaris/dist/uts/common/sys/cpuvar.h vendor-sys/opensolaris/dist/uts/common/sys/dtrace.h Added: vendor-sys/opensolaris/dist/OPENSOLARIS.LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/opensolaris/dist/OPENSOLARIS.LICENSE Wed Jul 18 08:12:04 2012 (r238567) @@ -0,0 +1,384 @@ +Unless otherwise noted, all files in this distribution are released +under the Common Development and Distribution License (CDDL). +Exceptions are noted within the associated source files. + +-------------------------------------------------------------------- + + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0 + +1. Definitions. + + 1.1. "Contributor" means each individual or entity that creates + or contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Software, prior Modifications used by a Contributor (if any), + and the Modifications made by that particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or (b) + Modifications, or (c) the combination of files containing + Original Software with files containing Modifications, in + each case including portions thereof. + + 1.4. "Executable" means the Covered Software in any form other + than Source Code. + + 1.5. "Initial Developer" means the individual or entity that first + makes Original Software available under this License. + + 1.6. "Larger Work" means a work which combines Covered Software or + portions thereof with code not governed by the terms of this + License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed + herein. + + 1.9. "Modifications" means the Source Code and Executable form of + any of the following: + + A. Any file that results from an addition to, deletion from or + modification of the contents of a file containing Original + Software or previous Modifications; + + B. Any new file that contains any part of the Original + Software or previous Modifications; or + + C. Any new file that is contributed or otherwise made + available under the terms of this License. + + 1.10. "Original Software" means the Source Code and Executable + form of computer software code that is originally released + under this License. + + 1.11. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, + process, and apparatus claims, in any patent Licensable by + grantor. + + 1.12. "Source Code" means (a) the common form of computer software + code in which modifications are made and (b) associated + documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms + of, this License. For legal entities, "You" includes any + entity which controls, is controlled by, or is under common + control with You. For purposes of this definition, + "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by + contract or otherwise, or (b) ownership of more than fifty + percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, the Initial + Developer hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer, to use, + reproduce, modify, display, perform, sublicense and + distribute the Original Software (or portions thereof), + with or without Modifications, and/or as part of a Larger + Work; and + + (b) under Patent Claims infringed by the making, using or + selling of Original Software, to make, have made, use, + practice, sell, and offer for sale, and/or otherwise + dispose of the Original Software (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are + effective on the date Initial Developer first distributes + or otherwise makes the Original Software available to a + third party under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: (1) for code that You delete from the Original + Software, or (2) for infringements caused by: (i) the + modification of the Original Software, or (ii) the + combination of the Original Software with other software + or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, each + Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor to use, reproduce, + modify, display, perform, sublicense and distribute the + Modifications created by such Contributor (or portions + thereof), either on an unmodified basis, with other + Modifications, as Covered Software and/or as part of a + Larger Work; and + + (b) under Patent Claims infringed by the making, using, or + selling of Modifications made by that Contributor either + alone and/or in combination with its Contributor Version + (or portions of such combination), to make, use, sell, + offer for sale, have made, and/or otherwise dispose of: + (1) Modifications made by that Contributor (or portions + thereof); and (2) the combination of Modifications made by + that Contributor with its Contributor Version (or portions + of such combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are + effective on the date Contributor first distributes or + otherwise makes the Modifications available to a third + party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: (1) for any code that Contributor has deleted + from the Contributor Version; (2) for infringements caused + by: (i) third party modifications of Contributor Version, + or (ii) the combination of Modifications made by that + Contributor with other software (except as part of the + Contributor Version) or other devices; or (3) under Patent + Claims infringed by Covered Software in the absence of + Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make + available in Executable form must also be made available in Source + Code form and that Source Code form must be distributed only under + the terms of this License. You must include a copy of this + License with every copy of the Source Code form of the Covered + Software You distribute or otherwise make available. You must + inform recipients of any such Covered Software in Executable form + as to how they can obtain such Covered Software in Source Code + form in a reasonable manner on or through a medium customarily + used for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You contribute are + governed by the terms of this License. You represent that You + believe Your Modifications are Your original creation(s) and/or + You have sufficient rights to grant the rights conveyed by this + License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications that + identifies You as the Contributor of the Modification. You may + not remove or alter any copyright, patent or trademark notices + contained within the Covered Software, or any notices of licensing + or any descriptive text giving attribution to any Contributor or + the Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered Software in + Source Code form that alters or restricts the applicable version + of this License or the recipients' rights hereunder. You may + choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of + Covered Software. However, you may do so only on Your own behalf, + and not on behalf of the Initial Developer or any Contributor. + You must make it absolutely clear that any such warranty, support, + indemnity or liability obligation is offered by You alone, and You + hereby agree to indemnify the Initial Developer and every + Contributor for any liability incurred by the Initial Developer or + such Contributor as a result of warranty, support, indemnity or + liability terms You offer. + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered Software + under the terms of this License or under the terms of a license of + Your choice, which may contain terms different from this License, + provided that You are in compliance with the terms of this License + and that the license for the Executable form does not attempt to + limit or alter the recipient's rights in the Source Code form from + the rights set forth in this License. If You distribute the + Covered Software in Executable form under a different license, You + must make it absolutely clear that any terms which differ from + this License are offered by You alone, not by the Initial + Developer or Contributor. You hereby agree to indemnify the + Initial Developer and every Contributor for any liability incurred + by the Initial Developer or such Contributor as a result of any + such terms You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software with + other code not governed by the terms of this License and + distribute the Larger Work as a single product. In such a case, + You must make sure the requirements of this License are fulfilled + for the Covered Software. + +4. Versions of the License. + + 4.1. New Versions. + + Sun Microsystems, Inc. is the initial license steward and may + publish revised and/or new versions of this License from time to + time. Each version will be given a distinguishing version number. + Except as provided in Section 4.3, no one other than the license + steward has the right to modify this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise make the + Covered Software available under the terms of the version of the + License under which You originally received the Covered Software. + If the Initial Developer includes a notice in the Original + Software prohibiting it from being distributed or otherwise made + available under any subsequent version of the License, You must + distribute and make the Covered Software available under the terms + of the version of the License under which You originally received + the Covered Software. Otherwise, You may also choose to use, + distribute or otherwise make the Covered Software available under + the terms of any subsequent version of the License published by + the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a new + license for Your Original Software, You may create and use a + modified version of this License if You: (a) rename the license + and remove any references to the name of the license steward + (except to note that the license differs from this License); and + (b) otherwise make it clear that the license contains terms which + differ from this License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" + BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED + SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR + PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY + COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE + INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY + NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF + WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS + DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to + cure such breach within 30 days of becoming aware of the breach. + Provisions which, by their nature, must remain in effect beyond + the termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding + declaratory judgment actions) against Initial Developer or a + Contributor (the Initial Developer or Contributor against whom You + assert such claim is referred to as "Participant") alleging that + the Participant Software (meaning the Contributor Version where + the Participant is a Contributor or the Original Software where + the Participant is the Initial Developer) directly or indirectly + infringes any patent, then any and all rights granted directly or + indirectly to You by such Participant, the Initial Developer (if + the Initial Developer is not the Participant) and all Contributors + under Sections 2.1 and/or 2.2 of this License shall, upon 60 days + notice from Participant terminate prospectively and automatically + at the expiration of such 60 day notice period, unless if within + such 60 day period You withdraw Your claim with respect to the + Participant Software against such Participant either unilaterally + or pursuant to a written agreement with Participant. + + 6.3. In the event of termination under Sections 6.1 or 6.2 above, + all end user licenses that have been validly granted by You or any + distributor hereunder prior to termination (excluding licenses + granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE + INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF + COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE + LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK + STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL + INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT + APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO + NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR + CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT + APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is + defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial + computer software" (as that term is defined at 48 + C.F.R. 252.227-7014(a)(1)) and "commercial computer software + documentation" as such terms are used in 48 C.F.R. 12.212 + (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 + C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all + U.S. Government End Users acquire Covered Software with only those + rights set forth herein. This U.S. Government Rights clause is in + lieu of, and supersedes, any other FAR, DFAR, or other clause or + provision that addresses Government rights in computer software + under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed + by the law of the jurisdiction specified in a notice contained + within the Original Software (except to the extent applicable law, + if any, provides otherwise), excluding such jurisdiction's + conflict-of-law provisions. Any litigation relating to this + License shall be subject to the jurisdiction of the courts located + in the jurisdiction and venue specified in a notice contained + within the Original Software, with the losing party responsible + for costs, including, without limitation, court costs and + reasonable attorneys' fees and expenses. The application of the + United Nations Convention on Contracts for the International Sale + of Goods is expressly excluded. Any law or regulation which + provides that the language of a contract shall be construed + against the drafter shall not apply to this License. You agree + that You alone are responsible for compliance with the United + States export administration regulations (and the export control + laws and regulation of any other countries) when You use, + distribute or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or + indirectly, out of its utilization of rights under this License + and You agree to work with Initial Developer and Contributors to + distribute such responsibility on an equitable basis. Nothing + herein is intended or shall be deemed to constitute any admission + of liability. + +-------------------------------------------------------------------- + +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND +DISTRIBUTION LICENSE (CDDL) + +For Covered Software in this distribution, this License shall +be governed by the laws of the State of California (excluding +conflict-of-law provisions). + +Any litigation relating to this License shall be subject to the +jurisdiction of the Federal Courts of the Northern District of +California and the state courts of the State of California, with +venue lying in Santa Clara County, California. Added: vendor-sys/opensolaris/dist/common/acl/acl_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/opensolaris/dist/common/acl/acl_common.c Wed Jul 18 08:12:04 2012 (r238567) @@ -0,0 +1,1755 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + */ + +#include +#include +#include +#if defined(_KERNEL) +#include +#include +#include +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define ASSERT assert +#endif + +#define ACE_POSIX_SUPPORTED_BITS (ACE_READ_DATA | \ + ACE_WRITE_DATA | ACE_APPEND_DATA | ACE_EXECUTE | \ + ACE_READ_ATTRIBUTES | ACE_READ_ACL | ACE_WRITE_ACL) + + +#define ACL_SYNCHRONIZE_SET_DENY 0x0000001 +#define ACL_SYNCHRONIZE_SET_ALLOW 0x0000002 +#define ACL_SYNCHRONIZE_ERR_DENY 0x0000004 +#define ACL_SYNCHRONIZE_ERR_ALLOW 0x0000008 + +#define ACL_WRITE_OWNER_SET_DENY 0x0000010 +#define ACL_WRITE_OWNER_SET_ALLOW 0x0000020 +#define ACL_WRITE_OWNER_ERR_DENY 0x0000040 +#define ACL_WRITE_OWNER_ERR_ALLOW 0x0000080 + +#define ACL_DELETE_SET_DENY 0x0000100 +#define ACL_DELETE_SET_ALLOW 0x0000200 +#define ACL_DELETE_ERR_DENY 0x0000400 +#define ACL_DELETE_ERR_ALLOW 0x0000800 + +#define ACL_WRITE_ATTRS_OWNER_SET_DENY 0x0001000 +#define ACL_WRITE_ATTRS_OWNER_SET_ALLOW 0x0002000 +#define ACL_WRITE_ATTRS_OWNER_ERR_DENY 0x0004000 +#define ACL_WRITE_ATTRS_OWNER_ERR_ALLOW 0x0008000 + +#define ACL_WRITE_ATTRS_WRITER_SET_DENY 0x0010000 +#define ACL_WRITE_ATTRS_WRITER_SET_ALLOW 0x0020000 +#define ACL_WRITE_ATTRS_WRITER_ERR_DENY 0x0040000 +#define ACL_WRITE_ATTRS_WRITER_ERR_ALLOW 0x0080000 + +#define ACL_WRITE_NAMED_WRITER_SET_DENY 0x0100000 +#define ACL_WRITE_NAMED_WRITER_SET_ALLOW 0x0200000 +#define ACL_WRITE_NAMED_WRITER_ERR_DENY 0x0400000 +#define ACL_WRITE_NAMED_WRITER_ERR_ALLOW 0x0800000 + +#define ACL_READ_NAMED_READER_SET_DENY 0x1000000 +#define ACL_READ_NAMED_READER_SET_ALLOW 0x2000000 +#define ACL_READ_NAMED_READER_ERR_DENY 0x4000000 +#define ACL_READ_NAMED_READER_ERR_ALLOW 0x8000000 + + +#define ACE_VALID_MASK_BITS (\ + ACE_READ_DATA | \ + ACE_LIST_DIRECTORY | \ + ACE_WRITE_DATA | \ + ACE_ADD_FILE | \ + ACE_APPEND_DATA | \ + ACE_ADD_SUBDIRECTORY | \ + ACE_READ_NAMED_ATTRS | \ + ACE_WRITE_NAMED_ATTRS | \ + ACE_EXECUTE | \ + ACE_DELETE_CHILD | \ + ACE_READ_ATTRIBUTES | \ + ACE_WRITE_ATTRIBUTES | \ + ACE_DELETE | \ + ACE_READ_ACL | \ + ACE_WRITE_ACL | \ + ACE_WRITE_OWNER | \ + ACE_SYNCHRONIZE) + +#define ACE_MASK_UNDEFINED 0x80000000 + +#define ACE_VALID_FLAG_BITS (ACE_FILE_INHERIT_ACE | \ + ACE_DIRECTORY_INHERIT_ACE | \ + ACE_NO_PROPAGATE_INHERIT_ACE | ACE_INHERIT_ONLY_ACE | \ + ACE_SUCCESSFUL_ACCESS_ACE_FLAG | ACE_FAILED_ACCESS_ACE_FLAG | \ + ACE_IDENTIFIER_GROUP | ACE_OWNER | ACE_GROUP | ACE_EVERYONE) + +/* + * ACL conversion helpers + */ + +typedef enum { + ace_unused, + ace_user_obj, + ace_user, + ace_group, /* includes GROUP and GROUP_OBJ */ + ace_other_obj +} ace_to_aent_state_t; + +typedef struct acevals { + uid_t key; + avl_node_t avl; + uint32_t mask; + uint32_t allowed; + uint32_t denied; + int aent_type; +} acevals_t; + +typedef struct ace_list { + acevals_t user_obj; + avl_tree_t user; + int numusers; + acevals_t group_obj; + avl_tree_t group; + int numgroups; + acevals_t other_obj; + uint32_t acl_mask; + int hasmask; + int dfacl_flag; + ace_to_aent_state_t state; + int seen; /* bitmask of all aclent_t a_type values seen */ +} ace_list_t; + +/* + * Generic shellsort, from K&R (1st ed, p 58.), somewhat modified. + * v = Ptr to array/vector of objs + * n = # objs in the array + * s = size of each obj (must be multiples of a word size) + * f = ptr to function to compare two objs + * returns (-1 = less than, 0 = equal, 1 = greater than + */ +void +ksort(caddr_t v, int n, int s, int (*f)()) +{ + int g, i, j, ii; + unsigned int *p1, *p2; + unsigned int tmp; + + /* No work to do */ + if (v == NULL || n <= 1) + return; + + /* Sanity check on arguments */ + ASSERT(((uintptr_t)v & 0x3) == 0 && (s & 0x3) == 0); + ASSERT(s > 0); + for (g = n / 2; g > 0; g /= 2) { + for (i = g; i < n; i++) { + for (j = i - g; j >= 0 && + (*f)(v + j * s, v + (j + g) * s) == 1; + j -= g) { + p1 = (void *)(v + j * s); + p2 = (void *)(v + (j + g) * s); + for (ii = 0; ii < s / 4; ii++) { + tmp = *p1; + *p1++ = *p2; + *p2++ = tmp; + } + } + } + } +} + +/* + * Compare two acls, all fields. Returns: + * -1 (less than) + * 0 (equal) + * +1 (greater than) + */ +int +cmp2acls(void *a, void *b) +{ + aclent_t *x = (aclent_t *)a; + aclent_t *y = (aclent_t *)b; + + /* Compare types */ + if (x->a_type < y->a_type) + return (-1); + if (x->a_type > y->a_type) + return (1); + /* Equal types; compare id's */ + if (x->a_id < y->a_id) + return (-1); + if (x->a_id > y->a_id) + return (1); + /* Equal ids; compare perms */ + if (x->a_perm < y->a_perm) + return (-1); + if (x->a_perm > y->a_perm) + return (1); + /* Totally equal */ + return (0); +} + +/*ARGSUSED*/ +static void * +cacl_realloc(void *ptr, size_t size, size_t new_size) +{ +#if defined(_KERNEL) + void *tmp; + + tmp = kmem_alloc(new_size, KM_SLEEP); + (void) memcpy(tmp, ptr, (size < new_size) ? size : new_size); + kmem_free(ptr, size); + return (tmp); +#else + return (realloc(ptr, new_size)); +#endif +} + +static int +cacl_malloc(void **ptr, size_t size) +{ +#if defined(_KERNEL) + *ptr = kmem_zalloc(size, KM_SLEEP); + return (0); +#else + *ptr = calloc(1, size); + if (*ptr == NULL) + return (errno); + + return (0); +#endif +} + +/*ARGSUSED*/ +static void +cacl_free(void *ptr, size_t size) +{ +#if defined(_KERNEL) + kmem_free(ptr, size); +#else + free(ptr); +#endif +} + +acl_t * +acl_alloc(enum acl_type type) +{ + acl_t *aclp; + + if (cacl_malloc((void **)&aclp, sizeof (acl_t)) != 0) + return (NULL); + + aclp->acl_aclp = NULL; + aclp->acl_cnt = 0; + + switch (type) { + case ACE_T: + aclp->acl_type = ACE_T; + aclp->acl_entry_size = sizeof (ace_t); + break; + case ACLENT_T: + aclp->acl_type = ACLENT_T; + aclp->acl_entry_size = sizeof (aclent_t); + break; + default: + acl_free(aclp); + aclp = NULL; + } + return (aclp); +} + +/* + * Free acl_t structure + */ +void +acl_free(acl_t *aclp) +{ + int acl_size; + + if (aclp == NULL) + return; + + if (aclp->acl_aclp) { + acl_size = aclp->acl_cnt * aclp->acl_entry_size; + cacl_free(aclp->acl_aclp, acl_size); + } + + cacl_free(aclp, sizeof (acl_t)); +} + +static uint32_t +access_mask_set(int haswriteperm, int hasreadperm, int isowner, int isallow) +{ + uint32_t access_mask = 0; + int acl_produce; + int synchronize_set = 0, write_owner_set = 0; + int delete_set = 0, write_attrs_set = 0; + int read_named_set = 0, write_named_set = 0; + + acl_produce = (ACL_SYNCHRONIZE_SET_ALLOW | + ACL_WRITE_ATTRS_OWNER_SET_ALLOW | + ACL_WRITE_ATTRS_WRITER_SET_DENY); + + if (isallow) { + synchronize_set = ACL_SYNCHRONIZE_SET_ALLOW; + write_owner_set = ACL_WRITE_OWNER_SET_ALLOW; + delete_set = ACL_DELETE_SET_ALLOW; + if (hasreadperm) + read_named_set = ACL_READ_NAMED_READER_SET_ALLOW; + if (haswriteperm) + write_named_set = ACL_WRITE_NAMED_WRITER_SET_ALLOW; + if (isowner) + write_attrs_set = ACL_WRITE_ATTRS_OWNER_SET_ALLOW; + else if (haswriteperm) + write_attrs_set = ACL_WRITE_ATTRS_WRITER_SET_ALLOW; + } else { + + synchronize_set = ACL_SYNCHRONIZE_SET_DENY; + write_owner_set = ACL_WRITE_OWNER_SET_DENY; + delete_set = ACL_DELETE_SET_DENY; + if (hasreadperm) + read_named_set = ACL_READ_NAMED_READER_SET_DENY; + if (haswriteperm) + write_named_set = ACL_WRITE_NAMED_WRITER_SET_DENY; + if (isowner) + write_attrs_set = ACL_WRITE_ATTRS_OWNER_SET_DENY; + else if (haswriteperm) + write_attrs_set = ACL_WRITE_ATTRS_WRITER_SET_DENY; + else + /* + * If the entity is not the owner and does not + * have write permissions ACE_WRITE_ATTRIBUTES will + * always go in the DENY ACE. + */ + access_mask |= ACE_WRITE_ATTRIBUTES; + } + + if (acl_produce & synchronize_set) + access_mask |= ACE_SYNCHRONIZE; + if (acl_produce & write_owner_set) + access_mask |= ACE_WRITE_OWNER; + if (acl_produce & delete_set) + access_mask |= ACE_DELETE; + if (acl_produce & write_attrs_set) + access_mask |= ACE_WRITE_ATTRIBUTES; + if (acl_produce & read_named_set) + access_mask |= ACE_READ_NAMED_ATTRS; + if (acl_produce & write_named_set) + access_mask |= ACE_WRITE_NAMED_ATTRS; + + return (access_mask); +} + +/* + * Given an mode_t, convert it into an access_mask as used + * by nfsace, assuming aclent_t -> nfsace semantics. + */ +static uint32_t +mode_to_ace_access(mode_t mode, int isdir, int isowner, int isallow) +{ + uint32_t access = 0; + int haswriteperm = 0; + int hasreadperm = 0; + + if (isallow) { + haswriteperm = (mode & S_IWOTH); + hasreadperm = (mode & S_IROTH); + } else { + haswriteperm = !(mode & S_IWOTH); + hasreadperm = !(mode & S_IROTH); + } + + /* + * The following call takes care of correctly setting the following + * mask bits in the access_mask: + * ACE_SYNCHRONIZE, ACE_WRITE_OWNER, ACE_DELETE, + * ACE_WRITE_ATTRIBUTES, ACE_WRITE_NAMED_ATTRS, ACE_READ_NAMED_ATTRS + */ + access = access_mask_set(haswriteperm, hasreadperm, isowner, isallow); + + if (isallow) { + access |= ACE_READ_ACL | ACE_READ_ATTRIBUTES; + if (isowner) + access |= ACE_WRITE_ACL; + } else { + if (! isowner) + access |= ACE_WRITE_ACL; + } + + /* read */ + if (mode & S_IROTH) { + access |= ACE_READ_DATA; + } + /* write */ + if (mode & S_IWOTH) { + access |= ACE_WRITE_DATA | + ACE_APPEND_DATA; + if (isdir) + access |= ACE_DELETE_CHILD; + } + /* exec */ + if (mode & 01) { + access |= ACE_EXECUTE; + } + + return (access); +} + +/* + * Given an nfsace (presumably an ALLOW entry), make a + * corresponding DENY entry at the address given. + */ +static void +ace_make_deny(ace_t *allow, ace_t *deny, int isdir, int isowner) +{ + (void) memcpy(deny, allow, sizeof (ace_t)); + + deny->a_who = allow->a_who; + + deny->a_type = ACE_ACCESS_DENIED_ACE_TYPE; + deny->a_access_mask ^= ACE_POSIX_SUPPORTED_BITS; + if (isdir) + deny->a_access_mask ^= ACE_DELETE_CHILD; + + deny->a_access_mask &= ~(ACE_SYNCHRONIZE | ACE_WRITE_OWNER | + ACE_DELETE | ACE_WRITE_ATTRIBUTES | ACE_READ_NAMED_ATTRS | + ACE_WRITE_NAMED_ATTRS); + deny->a_access_mask |= access_mask_set((allow->a_access_mask & + ACE_WRITE_DATA), (allow->a_access_mask & ACE_READ_DATA), isowner, + B_FALSE); +} +/* + * Make an initial pass over an array of aclent_t's. Gather + * information such as an ACL_MASK (if any), number of users, + * number of groups, and whether the array needs to be sorted. + */ +static int +ln_aent_preprocess(aclent_t *aclent, int n, + int *hasmask, mode_t *mask, + int *numuser, int *numgroup, int *needsort) +{ + int error = 0; + int i; + int curtype = 0; + + *hasmask = 0; + *mask = 07; + *needsort = 0; + *numuser = 0; + *numgroup = 0; + + for (i = 0; i < n; i++) { + if (aclent[i].a_type < curtype) + *needsort = 1; + else if (aclent[i].a_type > curtype) + curtype = aclent[i].a_type; + if (aclent[i].a_type & USER) + (*numuser)++; + if (aclent[i].a_type & (GROUP | GROUP_OBJ)) + (*numgroup)++; + if (aclent[i].a_type & CLASS_OBJ) { + if (*hasmask) { + error = EINVAL; + goto out; + } else { + *hasmask = 1; + *mask = aclent[i].a_perm; + } + } + } + + if ((! *hasmask) && (*numuser + *numgroup > 1)) { + error = EINVAL; + goto out; + } + +out: + return (error); +} + +/* + * Convert an array of aclent_t into an array of nfsace entries, + * following POSIX draft -> nfsv4 conversion semantics as outlined in + * the IETF draft. + */ +static int +ln_aent_to_ace(aclent_t *aclent, int n, ace_t **acepp, int *rescount, int isdir) +{ + int error = 0; + mode_t mask; + int numuser, numgroup, needsort; + int resultsize = 0; + int i, groupi = 0, skip; + ace_t *acep, *result = NULL; + int hasmask; + + error = ln_aent_preprocess(aclent, n, &hasmask, &mask, + &numuser, &numgroup, &needsort); + if (error != 0) + goto out; + + /* allow + deny for each aclent */ + resultsize = n * 2; + if (hasmask) { + /* + * stick extra deny on the group_obj and on each + * user|group for the mask (the group_obj was added + * into the count for numgroup) + */ + resultsize += numuser + numgroup; + /* ... and don't count the mask itself */ + resultsize -= 2; + } + + /* sort the source if necessary */ + if (needsort) + ksort((caddr_t)aclent, n, sizeof (aclent_t), cmp2acls); + + if (cacl_malloc((void **)&result, resultsize * sizeof (ace_t)) != 0) + goto out; + + acep = result; + + for (i = 0; i < n; i++) { + /* + * don't process CLASS_OBJ (mask); mask was grabbed in + * ln_aent_preprocess() + */ + if (aclent[i].a_type & CLASS_OBJ) + continue; + + /* If we need an ACL_MASK emulator, prepend it now */ + if ((hasmask) && + (aclent[i].a_type & (USER | GROUP | GROUP_OBJ))) { + acep->a_type = ACE_ACCESS_DENIED_ACE_TYPE; + acep->a_flags = 0; + if (aclent[i].a_type & GROUP_OBJ) { + acep->a_who = (uid_t)-1; + acep->a_flags |= + (ACE_IDENTIFIER_GROUP|ACE_GROUP); + } else if (aclent[i].a_type & USER) { + acep->a_who = aclent[i].a_id; + } else { + acep->a_who = aclent[i].a_id; + acep->a_flags |= ACE_IDENTIFIER_GROUP; + } + if (aclent[i].a_type & ACL_DEFAULT) { + acep->a_flags |= ACE_INHERIT_ONLY_ACE | + ACE_FILE_INHERIT_ACE | + ACE_DIRECTORY_INHERIT_ACE; + } + /* + * Set the access mask for the prepended deny + * ace. To do this, we invert the mask (found + * in ln_aent_preprocess()) then convert it to an + * DENY ace access_mask. + */ + acep->a_access_mask = mode_to_ace_access((mask ^ 07), + isdir, 0, 0); + acep += 1; + } + + /* handle a_perm -> access_mask */ + acep->a_access_mask = mode_to_ace_access(aclent[i].a_perm, + isdir, aclent[i].a_type & USER_OBJ, 1); + + /* emulate a default aclent */ + if (aclent[i].a_type & ACL_DEFAULT) { + acep->a_flags |= ACE_INHERIT_ONLY_ACE | + ACE_FILE_INHERIT_ACE | + ACE_DIRECTORY_INHERIT_ACE; + } + + /* + * handle a_perm and a_id + * + * this must be done last, since it involves the + * corresponding deny aces, which are handled + * differently for each different a_type. + */ + if (aclent[i].a_type & USER_OBJ) { + acep->a_who = (uid_t)-1; + acep->a_flags |= ACE_OWNER; + ace_make_deny(acep, acep + 1, isdir, B_TRUE); + acep += 2; + } else if (aclent[i].a_type & USER) { + acep->a_who = aclent[i].a_id; + ace_make_deny(acep, acep + 1, isdir, B_FALSE); + acep += 2; + } else if (aclent[i].a_type & (GROUP_OBJ | GROUP)) { + if (aclent[i].a_type & GROUP_OBJ) { + acep->a_who = (uid_t)-1; + acep->a_flags |= ACE_GROUP; + } else { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 08:17:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34E88106566C; Wed, 18 Jul 2012 08:17:40 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 056BB8FC0C; Wed, 18 Jul 2012 08:17:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I8HdC8044731; Wed, 18 Jul 2012 08:17:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I8HdK2044730; Wed, 18 Jul 2012 08:17:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180817.q6I8HdK2044730@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 08:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238568 - vendor-sys/opensolaris/20100818 vendor/opensolaris/20100818 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 08:17:40 -0000 Author: mm Date: Wed Jul 18 08:17:39 2012 New Revision: 238568 URL: http://svn.freebsd.org/changeset/base/238568 Log: Tag vendor/opensolaris and vendor-sys/opensolaris as 20100818 Added: vendor-sys/opensolaris/20100818/ - copied from r238567, vendor-sys/opensolaris/dist/ Changes in other areas also in this revision: Added: vendor/opensolaris/20100818/ - copied from r238566, vendor/opensolaris/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 08:17:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65DB01065670; Wed, 18 Jul 2012 08:17:40 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37B138FC14; Wed, 18 Jul 2012 08:17:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I8Hev5044736; Wed, 18 Jul 2012 08:17:40 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I8Het6044735; Wed, 18 Jul 2012 08:17:40 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180817.q6I8Het6044735@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 08:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238568 - vendor-sys/opensolaris/20100818 vendor/opensolaris/20100818 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 08:17:40 -0000 Author: mm Date: Wed Jul 18 08:17:39 2012 New Revision: 238568 URL: http://svn.freebsd.org/changeset/base/238568 Log: Tag vendor/opensolaris and vendor-sys/opensolaris as 20100818 Added: vendor/opensolaris/20100818/ - copied from r238566, vendor/opensolaris/dist/ Changes in other areas also in this revision: Added: vendor-sys/opensolaris/20100818/ - copied from r238567, vendor-sys/opensolaris/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 08:23:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22585106564A; Wed, 18 Jul 2012 08:23:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E96DF8FC16; Wed, 18 Jul 2012 08:23:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I8Nmoi045181; Wed, 18 Jul 2012 08:23:48 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I8Nmbm045180; Wed, 18 Jul 2012 08:23:48 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180823.q6I8Nmbm045180@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 08:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238569 - vendor-sys/illumos/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 08:23:49 -0000 Author: mm Date: Wed Jul 18 08:23:48 2012 New Revision: 238569 URL: http://svn.freebsd.org/changeset/base/238569 Log: Remove vendor-sys/illumos/dist for repopulation from latest vendor/opensolaris Deleted: vendor-sys/illumos/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 08:25:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 609C2106567E; Wed, 18 Jul 2012 08:25:00 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 313398FC16; Wed, 18 Jul 2012 08:25:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I8P0G9045302; Wed, 18 Jul 2012 08:25:00 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I8P0SZ045300; Wed, 18 Jul 2012 08:25:00 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180825.q6I8P0SZ045300@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 08:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238570 - vendor-sys/illumos/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 08:25:00 -0000 Author: mm Date: Wed Jul 18 08:24:59 2012 New Revision: 238570 URL: http://svn.freebsd.org/changeset/base/238570 Log: Copy vendor-sys/opensolaris/dist to vendor-sys/illumos/dist Added: vendor-sys/illumos/dist/ - copied from r238567, vendor-sys/opensolaris/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 08:37:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50E69106564A; Wed, 18 Jul 2012 08:37:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23E638FC1F; Wed, 18 Jul 2012 08:37:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I8b8ZE046227; Wed, 18 Jul 2012 08:37:08 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I8b8do046226; Wed, 18 Jul 2012 08:37:08 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180837.q6I8b8do046226@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 08:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238571 - vendor-sys/illumos/20100818 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 08:37:09 -0000 Author: mm Date: Wed Jul 18 08:37:08 2012 New Revision: 238571 URL: http://svn.freebsd.org/changeset/base/238571 Log: Tag initial vendor-sys/illumos/dist as 20100818 Added: vendor-sys/illumos/20100818/ - copied from r238570, vendor-sys/illumos/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 08:41:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 31C991065673; Wed, 18 Jul 2012 08:41:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB4A8FC1D; Wed, 18 Jul 2012 08:41:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I8f0gH046739; Wed, 18 Jul 2012 08:41:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I8f0WC046737; Wed, 18 Jul 2012 08:41:00 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207180841.q6I8f0WC046737@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 18 Jul 2012 08:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238572 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 08:41:01 -0000 Author: glebius Date: Wed Jul 18 08:41:00 2012 New Revision: 238572 URL: http://svn.freebsd.org/changeset/base/238572 Log: When traversing global in_ifaddr list in the IFP_TO_IA() macro, we need to obtain IN_IFADDR_RLOCK(). Modified: head/sys/netinet/in_var.h Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Wed Jul 18 08:37:08 2012 (r238571) +++ head/sys/netinet/in_var.h Wed Jul 18 08:41:00 2012 (r238572) @@ -161,14 +161,16 @@ do { \ #define IFP_TO_IA(ifp, ia) \ /* struct ifnet *ifp; */ \ /* struct in_ifaddr *ia; */ \ -{ \ +do { \ + IN_IFADDR_RLOCK(); \ for ((ia) = TAILQ_FIRST(&V_in_ifaddrhead); \ (ia) != NULL && (ia)->ia_ifp != (ifp); \ (ia) = TAILQ_NEXT((ia), ia_link)) \ continue; \ if ((ia) != NULL) \ ifa_ref(&(ia)->ia_ifa); \ -} + IN_IFADDR_RUNLOCK(); \ +} while (0) #endif /* From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 08:58:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F07A106564A; Wed, 18 Jul 2012 08:58:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B1BD8FC0A; Wed, 18 Jul 2012 08:58:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I8wUex048162; Wed, 18 Jul 2012 08:58:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I8wUYB048160; Wed, 18 Jul 2012 08:58:30 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207180858.q6I8wUYB048160@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 18 Jul 2012 08:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238573 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 08:58:31 -0000 Author: glebius Date: Wed Jul 18 08:58:30 2012 New Revision: 238573 URL: http://svn.freebsd.org/changeset/base/238573 Log: Plug a reference leak: before doing 'goto again' we need to unref ia->ia_ifa if there is any. Submitted by: Andrey Zonov Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Jul 18 08:41:00 2012 (r238572) +++ head/sys/netinet/ip_output.c Wed Jul 18 08:58:30 2012 (r238573) @@ -124,7 +124,7 @@ ip_output(struct mbuf *m, struct mbuf *o int n; /* scratchpad */ int error = 0; struct sockaddr_in *dst; - struct in_ifaddr *ia = NULL; + struct in_ifaddr *ia; int isbroadcast, sw_csum; struct route iproute; struct rtentry *rte; /* cache for ro->ro_rt */ @@ -198,6 +198,7 @@ ip_output(struct mbuf *m, struct mbuf *o dst = (struct sockaddr_in *)&ro->ro_dst; again: + ia = NULL; /* * If there is a cached route, * check that it is to the same destination @@ -533,8 +534,11 @@ sendit: #endif error = netisr_queue(NETISR_IP, m); goto done; - } else + } else { + if (ia != NULL) + ifa_free(&ia->ia_ifa); goto again; /* Redo the routing table lookup. */ + } } #ifdef IPFIREWALL_FORWARD @@ -564,6 +568,8 @@ sendit: bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); m->m_flags |= M_SKIP_FIREWALL; m_tag_delete(m, fwd_tag); + if (ia != NULL) + ifa_free(&ia->ia_ifa); goto again; } #endif /* IPFIREWALL_FORWARD */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 09:06:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD72C106564A; Wed, 18 Jul 2012 09:06:07 +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 B85718FC16; Wed, 18 Jul 2012 09:06:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I967Sh048810; Wed, 18 Jul 2012 09:06:07 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I967M3048808; Wed, 18 Jul 2012 09:06:07 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207180906.q6I967M3048808@svn.freebsd.org> From: Christian Brueffer Date: Wed, 18 Jul 2012 09:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238574 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 09:06:07 -0000 Author: brueffer Date: Wed Jul 18 09:06:07 2012 New Revision: 238574 URL: http://svn.freebsd.org/changeset/base/238574 Log: Fix a small memory leak in mpssas_get_sata_identify(). The change has been submitted upstream as well. Reviewed by: ken, scottl Obtained from: DragonFly BSD (change df8658e030226dd015cff9749452666d8fe1e87b) MFC after: 5 days Modified: head/sys/dev/mps/mps_sas_lsi.c Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Wed Jul 18 08:58:30 2012 (r238573) +++ head/sys/dev/mps/mps_sas_lsi.c Wed Jul 18 09:06:07 2012 (r238574) @@ -796,8 +796,10 @@ mpssas_get_sata_identify(struct mps_soft if (!buffer) return ENOMEM; - if ((cm = mps_alloc_command(sc)) == NULL) + if ((cm = mps_alloc_command(sc)) == NULL) { + free(buffer, M_MPT2); return (EBUSY); + } mpi_request = (MPI2_SATA_PASSTHROUGH_REQUEST *)cm->cm_req; bzero(mpi_request,sizeof(MPI2_SATA_PASSTHROUGH_REQUEST)); mpi_request->Function = MPI2_FUNCTION_SATA_PASSTHROUGH; From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 09:10:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB6281065673; Wed, 18 Jul 2012 09:10:54 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A21D18FC20; Wed, 18 Jul 2012 09:10:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I9AspJ049181; Wed, 18 Jul 2012 09:10:54 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I9AsM7049174; Wed, 18 Jul 2012 09:10:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180910.q6I9AsM7049174@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 09:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238575 - in vendor-sys/illumos/dist: common/acl common/nvpair common/zfs uts/common uts/common/dtrace uts/common/fs/zfs uts/common/fs/zfs/sys uts/common/os uts/common/sys uts/common/sy... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 09:10:54 -0000 Author: mm Date: Wed Jul 18 09:10:54 2012 New Revision: 238575 URL: http://svn.freebsd.org/changeset/base/238575 Log: Update vendor-sys/illumos/dist to pre libzfs_core state illumos-gate revision 13742:b6bbdd77139c Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Added: vendor-sys/illumos/dist/common/nvpair/fnvpair.c vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/bptree.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Modified: vendor-sys/illumos/dist/common/acl/acl_common.c vendor-sys/illumos/dist/common/acl/acl_common.h vendor-sys/illumos/dist/common/zfs/zfs_deleg.c vendor-sys/illumos/dist/common/zfs/zfs_deleg.h vendor-sys/illumos/dist/common/zfs/zfs_prop.c vendor-sys/illumos/dist/common/zfs/zpool_prop.c vendor-sys/illumos/dist/uts/common/Makefile.files vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c vendor-sys/illumos/dist/uts/common/dtrace/profile.c vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/ddt.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deleg.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_config.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_traverse.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_deleg.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_scan.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_acl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_context.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_vfsops.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_cache.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_mirror.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_missing.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_root.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_fm.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c vendor-sys/illumos/dist/uts/common/os/fm.c vendor-sys/illumos/dist/uts/common/sys/ccompile.h vendor-sys/illumos/dist/uts/common/sys/cmn_err.h vendor-sys/illumos/dist/uts/common/sys/dtrace.h vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h vendor-sys/illumos/dist/uts/common/sys/nvpair.h vendor-sys/illumos/dist/uts/common/sys/sysevent/eventdefs.h vendor-sys/illumos/dist/uts/common/sys/sysmacros.h Modified: vendor-sys/illumos/dist/common/acl/acl_common.c ============================================================================== --- vendor-sys/illumos/dist/common/acl/acl_common.c Wed Jul 18 09:06:07 2012 (r238574) +++ vendor-sys/illumos/dist/common/acl/acl_common.c Wed Jul 18 09:10:54 2012 (r238575) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ #include @@ -372,7 +373,7 @@ access_mask_set(int haswriteperm, int ha * by nfsace, assuming aclent_t -> nfsace semantics. */ static uint32_t -mode_to_ace_access(mode_t mode, int isdir, int isowner, int isallow) +mode_to_ace_access(mode_t mode, boolean_t isdir, int isowner, int isallow) { uint32_t access = 0; int haswriteperm = 0; @@ -415,7 +416,7 @@ mode_to_ace_access(mode_t mode, int isdi access |= ACE_DELETE_CHILD; } /* exec */ - if (mode & 01) { + if (mode & S_IXOTH) { access |= ACE_EXECUTE; } @@ -666,7 +667,7 @@ out: } static int -convert_aent_to_ace(aclent_t *aclentp, int aclcnt, int isdir, +convert_aent_to_ace(aclent_t *aclentp, int aclcnt, boolean_t isdir, ace_t **retacep, int *retacecnt) { ace_t *acep; @@ -692,7 +693,7 @@ convert_aent_to_ace(aclent_t *aclentp, i dfaclcnt = aclcnt - i; } - if (dfaclcnt && isdir == 0) { + if (dfaclcnt && !isdir) { return (EINVAL); } @@ -730,7 +731,7 @@ convert_aent_to_ace(aclent_t *aclentp, i } static int -ace_mask_to_mode(uint32_t mask, o_mode_t *modep, int isdir) +ace_mask_to_mode(uint32_t mask, o_mode_t *modep, boolean_t isdir) { int error = 0; o_mode_t mode = 0; @@ -1027,7 +1028,7 @@ out: } static int -ace_allow_to_mode(uint32_t mask, o_mode_t *modep, int isdir) +ace_allow_to_mode(uint32_t mask, o_mode_t *modep, boolean_t isdir) { /* ACE_READ_ACL and ACE_READ_ATTRIBUTES must both be set */ if ((mask & (ACE_READ_ACL | ACE_READ_ATTRIBUTES)) != @@ -1040,7 +1041,7 @@ ace_allow_to_mode(uint32_t mask, o_mode_ static int acevals_to_aent(acevals_t *vals, aclent_t *dest, ace_list_t *list, - uid_t owner, gid_t group, int isdir) + uid_t owner, gid_t group, boolean_t isdir) { int error; uint32_t flips = ACE_POSIX_SUPPORTED_BITS; @@ -1080,7 +1081,7 @@ out: static int ace_list_to_aent(ace_list_t *list, aclent_t **aclentp, int *aclcnt, - uid_t owner, gid_t group, int isdir) + uid_t owner, gid_t group, boolean_t isdir) { int error = 0; aclent_t *aent, *result = NULL; @@ -1260,7 +1261,7 @@ acevals_compare(const void *va, const vo static int ln_ace_to_aent(ace_t *ace, int n, uid_t owner, gid_t group, aclent_t **aclentp, int *aclcnt, aclent_t **dfaclentp, int *dfaclcnt, - int isdir) + boolean_t isdir) { int error = 0; ace_t *acep; @@ -1455,7 +1456,7 @@ out: } static int -convert_ace_to_aent(ace_t *acebufp, int acecnt, int isdir, +convert_ace_to_aent(ace_t *acebufp, int acecnt, boolean_t isdir, uid_t owner, gid_t group, aclent_t **retaclentp, int *retaclcnt) { int error = 0; @@ -1497,7 +1498,7 @@ convert_ace_to_aent(ace_t *acebufp, int int -acl_translate(acl_t *aclp, int target_flavor, int isdir, uid_t owner, +acl_translate(acl_t *aclp, int target_flavor, boolean_t isdir, uid_t owner, gid_t group) { int aclcnt; @@ -1568,101 +1569,105 @@ out: } void -acl_trivial_access_masks(mode_t mode, uint32_t *allow0, uint32_t *deny1, - uint32_t *deny2, uint32_t *owner, uint32_t *group, uint32_t *everyone) +acl_trivial_access_masks(mode_t mode, boolean_t isdir, trivial_acl_t *masks) { - *deny1 = *deny2 = *allow0 = *group = 0; + uint32_t read_mask = ACE_READ_DATA; + uint32_t write_mask = ACE_WRITE_DATA|ACE_APPEND_DATA; + uint32_t execute_mask = ACE_EXECUTE; + (void) isdir; /* will need this later */ + + masks->deny1 = 0; if (!(mode & S_IRUSR) && (mode & (S_IRGRP|S_IROTH))) - *deny1 |= ACE_READ_DATA; + masks->deny1 |= read_mask; if (!(mode & S_IWUSR) && (mode & (S_IWGRP|S_IWOTH))) - *deny1 |= ACE_WRITE_DATA; + masks->deny1 |= write_mask; if (!(mode & S_IXUSR) && (mode & (S_IXGRP|S_IXOTH))) - *deny1 |= ACE_EXECUTE; + masks->deny1 |= execute_mask; + masks->deny2 = 0; if (!(mode & S_IRGRP) && (mode & S_IROTH)) - *deny2 = ACE_READ_DATA; + masks->deny2 |= read_mask; if (!(mode & S_IWGRP) && (mode & S_IWOTH)) - *deny2 |= ACE_WRITE_DATA; + masks->deny2 |= write_mask; if (!(mode & S_IXGRP) && (mode & S_IXOTH)) - *deny2 |= ACE_EXECUTE; + masks->deny2 |= execute_mask; + masks->allow0 = 0; if ((mode & S_IRUSR) && (!(mode & S_IRGRP) && (mode & S_IROTH))) - *allow0 |= ACE_READ_DATA; + masks->allow0 |= read_mask; if ((mode & S_IWUSR) && (!(mode & S_IWGRP) && (mode & S_IWOTH))) - *allow0 |= ACE_WRITE_DATA; + masks->allow0 |= write_mask; if ((mode & S_IXUSR) && (!(mode & S_IXGRP) && (mode & S_IXOTH))) - *allow0 |= ACE_EXECUTE; + masks->allow0 |= execute_mask; - *owner = ACE_WRITE_ATTRIBUTES|ACE_WRITE_OWNER|ACE_WRITE_ACL| + masks->owner = ACE_WRITE_ATTRIBUTES|ACE_WRITE_OWNER|ACE_WRITE_ACL| ACE_WRITE_NAMED_ATTRS|ACE_READ_ACL|ACE_READ_ATTRIBUTES| ACE_READ_NAMED_ATTRS|ACE_SYNCHRONIZE; if (mode & S_IRUSR) - *owner |= ACE_READ_DATA; + masks->owner |= read_mask; if (mode & S_IWUSR) - *owner |= ACE_WRITE_DATA|ACE_APPEND_DATA; + masks->owner |= write_mask; if (mode & S_IXUSR) - *owner |= ACE_EXECUTE; + masks->owner |= execute_mask; - *group = ACE_READ_ACL|ACE_READ_ATTRIBUTES| ACE_READ_NAMED_ATTRS| + masks->group = ACE_READ_ACL|ACE_READ_ATTRIBUTES|ACE_READ_NAMED_ATTRS| ACE_SYNCHRONIZE; if (mode & S_IRGRP) - *group |= ACE_READ_DATA; + masks->group |= read_mask; if (mode & S_IWGRP) - *group |= ACE_WRITE_DATA|ACE_APPEND_DATA; + masks->group |= write_mask; if (mode & S_IXGRP) - *group |= ACE_EXECUTE; + masks->group |= execute_mask; - *everyone = ACE_READ_ACL|ACE_READ_ATTRIBUTES| ACE_READ_NAMED_ATTRS| + masks->everyone = ACE_READ_ACL|ACE_READ_ATTRIBUTES|ACE_READ_NAMED_ATTRS| ACE_SYNCHRONIZE; if (mode & S_IROTH) - *everyone |= ACE_READ_DATA; + masks->everyone |= read_mask; if (mode & S_IWOTH) - *everyone |= ACE_WRITE_DATA|ACE_APPEND_DATA; + masks->everyone |= write_mask; if (mode & S_IXOTH) - *everyone |= ACE_EXECUTE; + masks->everyone |= execute_mask; } int -acl_trivial_create(mode_t mode, ace_t **acl, int *count) +acl_trivial_create(mode_t mode, boolean_t isdir, ace_t **acl, int *count) { - uint32_t deny1, deny2; - uint32_t allow0; - uint32_t owner, group, everyone; int index = 0; int error; + trivial_acl_t masks; *count = 3; - acl_trivial_access_masks(mode, &allow0, &deny1, &deny2, &owner, &group, - &everyone); + acl_trivial_access_masks(mode, isdir, &masks); - if (allow0) + if (masks.allow0) (*count)++; - if (deny1) + if (masks.deny1) (*count)++; - if (deny2) + if (masks.deny2) (*count)++; if ((error = cacl_malloc((void **)acl, *count * sizeof (ace_t))) != 0) return (error); - if (allow0) { - SET_ACE(acl, index, -1, allow0, ACE_ACCESS_ALLOWED_ACE_TYPE, - ACE_OWNER); - } - if (deny1) { - SET_ACE(acl, index, -1, deny1, ACE_ACCESS_DENIED_ACE_TYPE, - ACE_OWNER); - } - if (deny2) { - SET_ACE(acl, index, -1, deny2, ACE_ACCESS_DENIED_ACE_TYPE, - ACE_GROUP|ACE_IDENTIFIER_GROUP); - } - - SET_ACE(acl, index, -1, owner, ACE_ACCESS_ALLOWED_ACE_TYPE, ACE_OWNER); - SET_ACE(acl, index, -1, group, ACE_ACCESS_ALLOWED_ACE_TYPE, + if (masks.allow0) { + SET_ACE(acl, index, -1, masks.allow0, + ACE_ACCESS_ALLOWED_ACE_TYPE, ACE_OWNER); + } + if (masks.deny1) { + SET_ACE(acl, index, -1, masks.deny1, + ACE_ACCESS_DENIED_ACE_TYPE, ACE_OWNER); + } + if (masks.deny2) { + SET_ACE(acl, index, -1, masks.deny2, + ACE_ACCESS_DENIED_ACE_TYPE, ACE_GROUP|ACE_IDENTIFIER_GROUP); + } + + SET_ACE(acl, index, -1, masks.owner, ACE_ACCESS_ALLOWED_ACE_TYPE, + ACE_OWNER); + SET_ACE(acl, index, -1, masks.group, ACE_ACCESS_ALLOWED_ACE_TYPE, ACE_IDENTIFIER_GROUP|ACE_GROUP); - SET_ACE(acl, index, -1, everyone, ACE_ACCESS_ALLOWED_ACE_TYPE, + SET_ACE(acl, index, -1, masks.everyone, ACE_ACCESS_ALLOWED_ACE_TYPE, ACE_EVERYONE); return (0); Modified: vendor-sys/illumos/dist/common/acl/acl_common.h ============================================================================== --- vendor-sys/illumos/dist/common/acl/acl_common.h Wed Jul 18 09:06:07 2012 (r238574) +++ vendor-sys/illumos/dist/common/acl/acl_common.h Wed Jul 18 09:10:54 2012 (r238575) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ #ifndef _ACL_COMMON_H @@ -33,7 +34,14 @@ extern "C" { #endif -extern ace_t trivial_acl[6]; +typedef struct trivial_acl { + uint32_t allow0; /* allow mask for bits only in owner */ + uint32_t deny1; /* deny mask for bits not in owner */ + uint32_t deny2; /* deny mask for bits not in group */ + uint32_t owner; /* allow mask matching mode */ + uint32_t group; /* allow mask matching mode */ + uint32_t everyone; /* allow mask matching mode */ +} trivial_acl_t; extern int acltrivial(const char *); extern void adjust_ace_pair(ace_t *pair, mode_t mode); @@ -44,13 +52,13 @@ extern int ace_trivial_common(void *, in uint32_t *mask)); extern acl_t *acl_alloc(acl_type_t); extern void acl_free(acl_t *aclp); -extern int acl_translate(acl_t *aclp, int target_flavor, - int isdir, uid_t owner, gid_t group); +extern int acl_translate(acl_t *aclp, int target_flavor, boolean_t isdir, + uid_t owner, gid_t group); void ksort(caddr_t v, int n, int s, int (*f)()); int cmp2acls(void *a, void *b); -int acl_trivial_create(mode_t mode, ace_t **acl, int *count); -void acl_trivial_access_masks(mode_t mode, uint32_t *allow0, uint32_t *deny1, - uint32_t *deny2, uint32_t *owner, uint32_t *group, uint32_t *everyone); +int acl_trivial_create(mode_t mode, boolean_t isdir, ace_t **acl, int *count); +void acl_trivial_access_masks(mode_t mode, boolean_t isdir, + trivial_acl_t *masks); #ifdef __cplusplus } Added: vendor-sys/illumos/dist/common/nvpair/fnvpair.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/illumos/dist/common/nvpair/fnvpair.c Wed Jul 18 09:10:54 2012 (r238575) @@ -0,0 +1,496 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#include +#include +#include +#ifndef _KERNEL +#include +#endif + +/* + * "Force" nvlist wrapper. + * + * These functions wrap the nvlist_* functions with assertions that assume + * the operation is successful. This allows the caller's code to be much + * more readable, especially for the fnvlist_lookup_* and fnvpair_value_* + * functions, which can return the requested value (rather than filling in + * a pointer). + * + * These functions use NV_UNIQUE_NAME, encoding NV_ENCODE_NATIVE, and allocate + * with KM_SLEEP. + * + * More wrappers should be added as needed -- for example + * nvlist_lookup_*_array and nvpair_value_*_array. + */ + +nvlist_t * +fnvlist_alloc(void) +{ + nvlist_t *nvl; + VERIFY3U(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP), ==, 0); + return (nvl); +} + +void +fnvlist_free(nvlist_t *nvl) +{ + nvlist_free(nvl); +} + +size_t +fnvlist_size(nvlist_t *nvl) +{ + size_t size; + VERIFY3U(nvlist_size(nvl, &size, NV_ENCODE_NATIVE), ==, 0); + return (size); +} + +/* + * Returns allocated buffer of size *sizep. Caller must free the buffer with + * fnvlist_pack_free(). + */ +char * +fnvlist_pack(nvlist_t *nvl, size_t *sizep) +{ + char *packed = 0; + VERIFY3U(nvlist_pack(nvl, &packed, sizep, NV_ENCODE_NATIVE, + KM_SLEEP), ==, 0); + return (packed); +} + +/*ARGSUSED*/ +void +fnvlist_pack_free(char *pack, size_t size) +{ +#ifdef _KERNEL + kmem_free(pack, size); +#else + free(pack); +#endif +} + +nvlist_t * +fnvlist_unpack(char *buf, size_t buflen) +{ + nvlist_t *rv; + VERIFY3U(nvlist_unpack(buf, buflen, &rv, KM_SLEEP), ==, 0); + return (rv); +} + +nvlist_t * +fnvlist_dup(nvlist_t *nvl) +{ + nvlist_t *rv; + VERIFY3U(nvlist_dup(nvl, &rv, KM_SLEEP), ==, 0); + return (rv); +} + +void +fnvlist_merge(nvlist_t *dst, nvlist_t *src) +{ + VERIFY3U(nvlist_merge(dst, src, KM_SLEEP), ==, 0); +} + +void +fnvlist_add_boolean(nvlist_t *nvl, const char *name) +{ + VERIFY3U(nvlist_add_boolean(nvl, name), ==, 0); +} + +void +fnvlist_add_boolean_value(nvlist_t *nvl, const char *name, boolean_t val) +{ + VERIFY3U(nvlist_add_boolean_value(nvl, name, val), ==, 0); +} + +void +fnvlist_add_byte(nvlist_t *nvl, const char *name, uchar_t val) +{ + VERIFY3U(nvlist_add_byte(nvl, name, val), ==, 0); +} + +void +fnvlist_add_int8(nvlist_t *nvl, const char *name, int8_t val) +{ + VERIFY3U(nvlist_add_int8(nvl, name, val), ==, 0); +} + +void +fnvlist_add_uint8(nvlist_t *nvl, const char *name, uint8_t val) +{ + VERIFY3U(nvlist_add_uint8(nvl, name, val), ==, 0); +} + +void +fnvlist_add_int16(nvlist_t *nvl, const char *name, int16_t val) +{ + VERIFY3U(nvlist_add_int16(nvl, name, val), ==, 0); +} + +void +fnvlist_add_uint16(nvlist_t *nvl, const char *name, uint16_t val) +{ + VERIFY3U(nvlist_add_uint16(nvl, name, val), ==, 0); +} + +void +fnvlist_add_int32(nvlist_t *nvl, const char *name, int32_t val) +{ + VERIFY3U(nvlist_add_int32(nvl, name, val), ==, 0); +} + +void +fnvlist_add_uint32(nvlist_t *nvl, const char *name, uint32_t val) +{ + VERIFY3U(nvlist_add_uint32(nvl, name, val), ==, 0); +} + +void +fnvlist_add_int64(nvlist_t *nvl, const char *name, int64_t val) +{ + VERIFY3U(nvlist_add_int64(nvl, name, val), ==, 0); +} + +void +fnvlist_add_uint64(nvlist_t *nvl, const char *name, uint64_t val) +{ + VERIFY3U(nvlist_add_uint64(nvl, name, val), ==, 0); +} + +void +fnvlist_add_string(nvlist_t *nvl, const char *name, const char *val) +{ + VERIFY3U(nvlist_add_string(nvl, name, val), ==, 0); +} + +void +fnvlist_add_nvlist(nvlist_t *nvl, const char *name, nvlist_t *val) +{ + VERIFY3U(nvlist_add_nvlist(nvl, name, val), ==, 0); +} + +void +fnvlist_add_nvpair(nvlist_t *nvl, nvpair_t *pair) +{ + VERIFY3U(nvlist_add_nvpair(nvl, pair), ==, 0); +} + +void +fnvlist_add_boolean_array(nvlist_t *nvl, const char *name, + boolean_t *val, uint_t n) +{ + VERIFY3U(nvlist_add_boolean_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_byte_array(nvlist_t *nvl, const char *name, uchar_t *val, uint_t n) +{ + VERIFY3U(nvlist_add_byte_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_int8_array(nvlist_t *nvl, const char *name, int8_t *val, uint_t n) +{ + VERIFY3U(nvlist_add_int8_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_uint8_array(nvlist_t *nvl, const char *name, uint8_t *val, uint_t n) +{ + VERIFY3U(nvlist_add_uint8_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_int16_array(nvlist_t *nvl, const char *name, int16_t *val, uint_t n) +{ + VERIFY3U(nvlist_add_int16_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_uint16_array(nvlist_t *nvl, const char *name, + uint16_t *val, uint_t n) +{ + VERIFY3U(nvlist_add_uint16_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_int32_array(nvlist_t *nvl, const char *name, int32_t *val, uint_t n) +{ + VERIFY3U(nvlist_add_int32_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_uint32_array(nvlist_t *nvl, const char *name, + uint32_t *val, uint_t n) +{ + VERIFY3U(nvlist_add_uint32_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_int64_array(nvlist_t *nvl, const char *name, int64_t *val, uint_t n) +{ + VERIFY3U(nvlist_add_int64_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_uint64_array(nvlist_t *nvl, const char *name, + uint64_t *val, uint_t n) +{ + VERIFY3U(nvlist_add_uint64_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_string_array(nvlist_t *nvl, const char *name, + char * const *val, uint_t n) +{ + VERIFY3U(nvlist_add_string_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_add_nvlist_array(nvlist_t *nvl, const char *name, + nvlist_t **val, uint_t n) +{ + VERIFY3U(nvlist_add_nvlist_array(nvl, name, val, n), ==, 0); +} + +void +fnvlist_remove(nvlist_t *nvl, const char *name) +{ + VERIFY3U(nvlist_remove_all(nvl, name), ==, 0); +} + +void +fnvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *pair) +{ + VERIFY3U(nvlist_remove_nvpair(nvl, pair), ==, 0); +} + +nvpair_t * +fnvlist_lookup_nvpair(nvlist_t *nvl, const char *name) +{ + nvpair_t *rv; + VERIFY3U(nvlist_lookup_nvpair(nvl, name, &rv), ==, 0); + return (rv); +} + +/* returns B_TRUE if the entry exists */ +boolean_t +fnvlist_lookup_boolean(nvlist_t *nvl, const char *name) +{ + return (nvlist_lookup_boolean(nvl, name) == 0); +} + +boolean_t +fnvlist_lookup_boolean_value(nvlist_t *nvl, const char *name) +{ + boolean_t rv; + VERIFY3U(nvlist_lookup_boolean_value(nvl, name, &rv), ==, 0); + return (rv); +} + +uchar_t +fnvlist_lookup_byte(nvlist_t *nvl, const char *name) +{ + uchar_t rv; + VERIFY3U(nvlist_lookup_byte(nvl, name, &rv), ==, 0); + return (rv); +} + +int8_t +fnvlist_lookup_int8(nvlist_t *nvl, const char *name) +{ + int8_t rv; + VERIFY3U(nvlist_lookup_int8(nvl, name, &rv), ==, 0); + return (rv); +} + +int16_t +fnvlist_lookup_int16(nvlist_t *nvl, const char *name) +{ + int16_t rv; + VERIFY3U(nvlist_lookup_int16(nvl, name, &rv), ==, 0); + return (rv); +} + +int32_t +fnvlist_lookup_int32(nvlist_t *nvl, const char *name) +{ + int32_t rv; + VERIFY3U(nvlist_lookup_int32(nvl, name, &rv), ==, 0); + return (rv); +} + +int64_t +fnvlist_lookup_int64(nvlist_t *nvl, const char *name) +{ + int64_t rv; + VERIFY3U(nvlist_lookup_int64(nvl, name, &rv), ==, 0); + return (rv); +} + +uint8_t +fnvlist_lookup_uint8_t(nvlist_t *nvl, const char *name) +{ + uint8_t rv; + VERIFY3U(nvlist_lookup_uint8(nvl, name, &rv), ==, 0); + return (rv); +} + +uint16_t +fnvlist_lookup_uint16(nvlist_t *nvl, const char *name) +{ + uint16_t rv; + VERIFY3U(nvlist_lookup_uint16(nvl, name, &rv), ==, 0); + return (rv); +} + +uint32_t +fnvlist_lookup_uint32(nvlist_t *nvl, const char *name) +{ + uint32_t rv; + VERIFY3U(nvlist_lookup_uint32(nvl, name, &rv), ==, 0); + return (rv); +} + +uint64_t +fnvlist_lookup_uint64(nvlist_t *nvl, const char *name) +{ + uint64_t rv; + VERIFY3U(nvlist_lookup_uint64(nvl, name, &rv), ==, 0); + return (rv); +} + +char * +fnvlist_lookup_string(nvlist_t *nvl, const char *name) +{ + char *rv; + VERIFY3U(nvlist_lookup_string(nvl, name, &rv), ==, 0); + return (rv); +} + +nvlist_t * +fnvlist_lookup_nvlist(nvlist_t *nvl, const char *name) +{ + nvlist_t *rv; + VERIFY3U(nvlist_lookup_nvlist(nvl, name, &rv), ==, 0); + return (rv); +} + +boolean_t +fnvpair_value_boolean_value(nvpair_t *nvp) +{ + boolean_t rv; + VERIFY3U(nvpair_value_boolean_value(nvp, &rv), ==, 0); + return (rv); +} + +uchar_t +fnvpair_value_byte(nvpair_t *nvp) +{ + uchar_t rv; + VERIFY3U(nvpair_value_byte(nvp, &rv), ==, 0); + return (rv); +} + +int8_t +fnvpair_value_int8(nvpair_t *nvp) +{ + int8_t rv; + VERIFY3U(nvpair_value_int8(nvp, &rv), ==, 0); + return (rv); +} + +int16_t +fnvpair_value_int16(nvpair_t *nvp) +{ + int16_t rv; + VERIFY3U(nvpair_value_int16(nvp, &rv), ==, 0); + return (rv); +} + +int32_t +fnvpair_value_int32(nvpair_t *nvp) +{ + int32_t rv; + VERIFY3U(nvpair_value_int32(nvp, &rv), ==, 0); + return (rv); +} + +int64_t +fnvpair_value_int64(nvpair_t *nvp) +{ + int64_t rv; + VERIFY3U(nvpair_value_int64(nvp, &rv), ==, 0); + return (rv); +} + +uint8_t +fnvpair_value_uint8_t(nvpair_t *nvp) +{ + uint8_t rv; + VERIFY3U(nvpair_value_uint8(nvp, &rv), ==, 0); + return (rv); +} + +uint16_t +fnvpair_value_uint16(nvpair_t *nvp) +{ + uint16_t rv; + VERIFY3U(nvpair_value_uint16(nvp, &rv), ==, 0); + return (rv); +} + +uint32_t +fnvpair_value_uint32(nvpair_t *nvp) +{ + uint32_t rv; + VERIFY3U(nvpair_value_uint32(nvp, &rv), ==, 0); + return (rv); +} + +uint64_t +fnvpair_value_uint64(nvpair_t *nvp) +{ + uint64_t rv; + VERIFY3U(nvpair_value_uint64(nvp, &rv), ==, 0); + return (rv); +} + +char * +fnvpair_value_string(nvpair_t *nvp) +{ + char *rv; + VERIFY3U(nvpair_value_string(nvp, &rv), ==, 0); + return (rv); +} + +nvlist_t * +fnvpair_value_nvlist(nvpair_t *nvp) +{ + nvlist_t *rv; + VERIFY3U(nvpair_value_nvlist(nvp, &rv), ==, 0); + return (rv); +} Added: vendor-sys/illumos/dist/common/zfs/zfeature_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.c Wed Jul 18 09:10:54 2012 (r238575) @@ -0,0 +1,156 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#ifdef _KERNEL +#include +#else +#include +#include +#endif +#include +#include +#include +#include +#include "zfeature_common.h" + +/* + * Set to disable all feature checks while opening pools, allowing pools with + * unsupported features to be opened. Set for testing only. + */ +boolean_t zfeature_checks_disable = B_FALSE; + +zfeature_info_t spa_feature_table[SPA_FEATURES]; + +/* + * Valid characters for feature guids. This list is mainly for aesthetic + * purposes and could be expanded in the future. There are different allowed + * characters in the guids reverse dns portion (before the colon) and its + * short name (after the colon). + */ +static int +valid_char(char c, boolean_t after_colon) +{ + return ((c >= 'a' && c <= 'z') || + (c >= '0' && c <= '9') || + c == (after_colon ? '_' : '.')); +} + +/* + * Every feature guid must contain exactly one colon which separates a reverse + * dns organization name from the feature's "short" name (e.g. + * "com.company:feature_name"). + */ +boolean_t +zfeature_is_valid_guid(const char *name) +{ + int i; + boolean_t has_colon = B_FALSE; + + i = 0; + while (name[i] != '\0') { + char c = name[i++]; + if (c == ':') { + if (has_colon) + return (B_FALSE); + has_colon = B_TRUE; + continue; + } + if (!valid_char(c, has_colon)) + return (B_FALSE); + } + + return (has_colon); +} + +boolean_t +zfeature_is_supported(const char *guid) +{ + if (zfeature_checks_disable) + return (B_TRUE); + + return (0 == zfeature_lookup_guid(guid, NULL)); +} + +int +zfeature_lookup_guid(const char *guid, zfeature_info_t **res) +{ + for (int i = 0; i < SPA_FEATURES; i++) { + zfeature_info_t *feature = &spa_feature_table[i]; + if (strcmp(guid, feature->fi_guid) == 0) { + if (res != NULL) + *res = feature; + return (0); + } + } + + return (ENOENT); +} + +int +zfeature_lookup_name(const char *name, zfeature_info_t **res) +{ + for (int i = 0; i < SPA_FEATURES; i++) { + zfeature_info_t *feature = &spa_feature_table[i]; + if (strcmp(name, feature->fi_uname) == 0) { + if (res != NULL) + *res = feature; + return (0); + } + } + + return (ENOENT); +} + +static void +zfeature_register(int fid, const char *guid, const char *name, const char *desc, + boolean_t readonly, boolean_t mos, zfeature_info_t **deps) +{ + zfeature_info_t *feature = &spa_feature_table[fid]; + static zfeature_info_t *nodeps[] = { NULL }; + + ASSERT(name != NULL); + ASSERT(desc != NULL); + ASSERT(!readonly || !mos); + ASSERT3U(fid, <, SPA_FEATURES); + ASSERT(zfeature_is_valid_guid(guid)); + + if (deps == NULL) + deps = nodeps; + + feature->fi_guid = guid; + feature->fi_uname = name; + feature->fi_desc = desc; + feature->fi_can_readonly = readonly; + feature->fi_mos = mos; + feature->fi_depends = deps; +} + +void +zpool_feature_init(void) +{ + zfeature_register(SPA_FEATURE_ASYNC_DESTROY, + "com.delphix:async_destroy", "async_destroy", + "Destroy filesystems asynchronously.", B_TRUE, B_FALSE, NULL); +} Added: vendor-sys/illumos/dist/common/zfs/zfeature_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.h Wed Jul 18 09:10:54 2012 (r238575) @@ -0,0 +1,71 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#ifndef _ZFEATURE_COMMON_H +#define _ZFEATURE_COMMON_H + +#include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 09:15:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74F8A1065673; Wed, 18 Jul 2012 09:15:59 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 474C08FC0A; Wed, 18 Jul 2012 09:15:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I9FxKS049612; Wed, 18 Jul 2012 09:15:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I9FxeZ049611; Wed, 18 Jul 2012 09:15:59 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180915.q6I9FxeZ049611@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 09:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238576 - vendor/illumos/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 09:15:59 -0000 Author: mm Date: Wed Jul 18 09:15:58 2012 New Revision: 238576 URL: http://svn.freebsd.org/changeset/base/238576 Log: Remove vendor/illumos/dist for repopulation from latest vendor/opensolaris Deleted: vendor/illumos/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 09:16:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DADF1065672; Wed, 18 Jul 2012 09:16:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70B528FC1D; Wed, 18 Jul 2012 09:16:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I9Glla049736; Wed, 18 Jul 2012 09:16:47 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I9GlfO049735; Wed, 18 Jul 2012 09:16:47 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180916.q6I9GlfO049735@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 09:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238577 - vendor/illumos/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 09:16:47 -0000 Author: mm Date: Wed Jul 18 09:16:47 2012 New Revision: 238577 URL: http://svn.freebsd.org/changeset/base/238577 Log: Copy vendor/opensolaris/dist to vendor/illumos/dist Added: vendor/illumos/dist/ - copied from r238566, vendor/opensolaris/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 09:17:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E6A310657A0; Wed, 18 Jul 2012 09:17:00 +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 801BE8FC1B; Wed, 18 Jul 2012 09:17:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I9H0w0049795; Wed, 18 Jul 2012 09:17:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I9H00F049788; Wed, 18 Jul 2012 09:17:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207180917.q6I9H00F049788@svn.freebsd.org> From: Michael Tuexen Date: Wed, 18 Jul 2012 09:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238578 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 09:17:00 -0000 Author: tuexen Date: Wed Jul 18 09:16:59 2012 New Revision: 238578 URL: http://svn.freebsd.org/changeset/base/238578 Log: MFC r238475: #ifdef INET and INET6 consistently. This also fixes a bug, where it was done wrong. Approved by: re@ Modified: stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctputil.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Wed Jul 18 09:16:47 2012 (r238577) +++ stable/9/sys/netinet/sctp_output.c Wed Jul 18 09:16:59 2012 (r238578) @@ -8518,12 +8518,14 @@ again_one_more_time: } /* now lets add any data within the MTU constraints */ switch (((struct sockaddr *)&net->ro._l_addr)->sa_family) { +#ifdef INET case AF_INET: if (net->mtu > (sizeof(struct ip) + sizeof(struct sctphdr))) omtu = net->mtu - (sizeof(struct ip) + sizeof(struct sctphdr)); else omtu = 0; break; +#endif #ifdef INET6 case AF_INET6: if (net->mtu > (sizeof(struct ip6_hdr) + sizeof(struct sctphdr))) @@ -12272,7 +12274,7 @@ sctp_lower_sosend(struct socket *so, union sctp_sockstore *raddr = (union sctp_sockstore *)addr; switch (raddr->sa.sa_family) { -#if defined(INET) +#ifdef INET case AF_INET: if (raddr->sin.sin_len != sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); @@ -12282,7 +12284,7 @@ sctp_lower_sosend(struct socket *so, port = raddr->sin.sin_port; break; #endif -#if defined(INET6) +#ifdef INET6 case AF_INET6: if (raddr->sin6.sin6_len != sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Wed Jul 18 09:16:47 2012 (r238577) +++ stable/9/sys/netinet/sctp_pcb.c Wed Jul 18 09:16:59 2012 (r238578) @@ -3125,6 +3125,7 @@ continue_anyway: memset(&store_sa, 0, sizeof(store_sa)); switch (addr->sa_family) { +#ifdef INET case AF_INET: { struct sockaddr_in *sin; @@ -3134,6 +3135,8 @@ continue_anyway: sin->sin_port = 0; break; } +#endif +#ifdef INET6 case AF_INET6: { struct sockaddr_in6 *sin6; @@ -3143,6 +3146,7 @@ continue_anyway: sin6->sin6_port = 0; break; } +#endif default: break; } @@ -5304,12 +5308,16 @@ sctp_destination_is_reachable(struct sct } /* NOTE: all "scope" checks are done when local addresses are added */ switch (destaddr->sa_family) { +#ifdef INET6 case AF_INET6: answer = inp->ip_inp.inp.inp_vflag & INP_IPV6; break; +#endif +#ifdef INET case AF_INET: answer = inp->ip_inp.inp.inp_vflag & INP_IPV4; break; +#endif default: /* invalid family, so it's unreachable */ answer = 0; @@ -5400,7 +5408,7 @@ sctp_add_local_addr_ep(struct sctp_inpcb inp->ip_inp.inp.inp_vflag |= INP_IPV6; break; #endif -#ifdef INET6 +#ifdef INET case AF_INET: inp->ip_inp.inp.inp_vflag |= INP_IPV4; break; Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Wed Jul 18 09:16:47 2012 (r238577) +++ stable/9/sys/netinet/sctp_usrreq.c Wed Jul 18 09:16:59 2012 (r238578) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET6) +#ifdef INET6 #endif #include #include Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Wed Jul 18 09:16:47 2012 (r238577) +++ stable/9/sys/netinet/sctputil.c Wed Jul 18 09:16:59 2012 (r238578) @@ -5691,7 +5691,7 @@ found_one: memcpy(from, &sin6, sizeof(struct sockaddr_in6)); } #endif -#if defined(INET6) +#ifdef INET6 { struct sockaddr_in6 lsa6, *from6; @@ -6588,7 +6588,7 @@ sctp_bindx_delete_address(struct sctp_in return; } addr_touse = sa; -#if defined(INET6) +#ifdef INET6 if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Wed Jul 18 09:16:47 2012 (r238577) +++ stable/9/sys/netinet6/sctp6_usrreq.c Wed Jul 18 09:16:59 2012 (r238578) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET6) +#ifdef INET6 #include #endif #include @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #ifdef IPSEC #include -#if defined(INET6) +#ifdef INET6 #include #endif /* INET6 */ #endif /* IPSEC */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 09:37:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE4E7106566B; Wed, 18 Jul 2012 09:37:59 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B05A28FC15; Wed, 18 Jul 2012 09:37:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I9bxLU051453; Wed, 18 Jul 2012 09:37:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I9bxfW051451; Wed, 18 Jul 2012 09:37:59 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180937.q6I9bxfW051451@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 09:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238579 - vendor/illumos/20100818 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 09:38:00 -0000 Author: mm Date: Wed Jul 18 09:37:59 2012 New Revision: 238579 URL: http://svn.freebsd.org/changeset/base/238579 Log: Tag initial vendor/illumos/dist as 20100818 Added: vendor/illumos/20100818/ - copied from r238578, vendor/illumos/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 09:47:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CBB5106566B; Wed, 18 Jul 2012 09:47:48 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74E1F8FC0A; Wed, 18 Jul 2012 09:47:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I9lmtJ052201; Wed, 18 Jul 2012 09:47:48 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I9lmU9052199; Wed, 18 Jul 2012 09:47:48 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180947.q6I9lmU9052199@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 09:47:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238580 - in vendor/illumos/dist: cmd/dtrace man man/man1m X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 09:47:48 -0000 Author: mm Date: Wed Jul 18 09:47:48 2012 New Revision: 238580 URL: http://svn.freebsd.org/changeset/base/238580 Log: Move dtrace manual page to new vendor location Added: vendor/illumos/dist/man/ vendor/illumos/dist/man/man1m/ vendor/illumos/dist/man/man1m/dtrace.1m - copied unchanged from r238578, vendor/illumos/dist/cmd/dtrace/dtrace.1 Deleted: vendor/illumos/dist/cmd/dtrace/dtrace.1 Copied: vendor/illumos/dist/man/man1m/dtrace.1m (from r238578, vendor/illumos/dist/cmd/dtrace/dtrace.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/man/man1m/dtrace.1m Wed Jul 18 09:47:48 2012 (r238580, copy of r238578, vendor/illumos/dist/cmd/dtrace/dtrace.1) @@ -0,0 +1,670 @@ +'\" te +.\" CDDL HEADER START +.\" +.\" The contents of this file are subject to the terms of the +.\" Common Development and Distribution License (the "License"). +.\" You may not use this file except in compliance with the License. +.\" +.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +.\" or http://www.opensolaris.org/os/licensing. +.\" See the License for the specific language governing permissions +.\" and limitations under the License. +.\" +.\" When distributing Covered Code, include this CDDL HEADER in each +.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. +.\" If applicable, add the following below this CDDL HEADER, with the +.\" fields enclosed by brackets "[]" replaced with your own identifying +.\" information: Portions Copyright [yyyy] [name of copyright owner] +.\" +.\" CDDL HEADER END +.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. +.TH dtrace 1M "5 Sep 2006" "SunOS 5.11" "System Administration Commands" +.SH NAME +dtrace \- DTrace dynamic tracing compiler and tracing utility +.SH SYNOPSIS +.LP +.nf +\fBdtrace\fR [\fB-32\fR | \fB-64\fR] [\fB-aACeFGHhlqSvVwZ\fR] [\fB-b\fR \fIbufsz\fR] [\fB-c\fR \fIcmd\fR] + [\fB-D\fR \fIname\fR [\fI=value\fR]] [\fB-I\fR \fIpath\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fIoutput\fR] + [\fB-s\fR \fIscript\fR] [\fB-U\fR \fIname\fR] [\fB-x\fR \fIarg\fR [\fI=val\fR]] + [\fB-X\fR a | c | s | t] [\fB-p\fR \fIpid\fR] + [\fB-P\fR \fIprovider\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-m\fR [\fIprovider:\fR] \fImodule\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-f\fR [[\fIprovider:\fR] \fImodule:\fR] \fIfunction\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-i\fR \fIprobe-id\fR [[\fIpredicate\fR] \fIaction\fR]] +.fi + +.SH DESCRIPTION +.sp +.LP +DTrace is a comprehensive dynamic tracing framework for the Solaris Operating System. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs. +.sp +.LP +The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe, debug, and tune system behavior. Refer to this book for a detailed description of DTrace features, including the bundled DTrace observability +tools, instrumentation providers, and the D programming language. +.sp +.LP +The \fBdtrace\fR command provides a generic interface to the essential services provided by the DTrace facility, including: +.RS +4 +.TP +.ie t \(bu +.el o +Options that list the set of probes and providers currently published by DTrace +.RE +.RS +4 +.TP +.ie t \(bu +.el o +Options that enable probes directly using any of the probe description specifiers (provider, module, function, name) +.RE +.RS +4 +.TP +.ie t \(bu +.el o +Options that run the D compiler and compile one or more D program files or programs written directly on the command line +.RE +.RS +4 +.TP +.ie t \(bu +.el o +Options that generate anonymous tracing programs +.RE +.RS +4 +.TP +.ie t \(bu +.el o +Options that generate program stability reports +.RE +.RS +4 +.TP +.ie t \(bu +.el o +Options that modify DTrace tracing and buffering behavior and enable additional D compiler features +.RE +.sp +.LP +You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the \fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks. +.SH OPTIONS +.sp +.LP +The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and \fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid intepretation of meta-characters by the shell. +.sp +.LP +The following options are supported: +.sp +.ne 2 +.mk +.na +\fB\fB-32\fR | \fB-64\fR\fR +.ad +.sp .6 +.RS 4n +The D compiler produces programs using the native data model of the operating system kernel. You can use the \fBisainfo\fR \fB-b\fR command to determine the current operating system data model. If the \fB-32\fR option is specified, \fBdtrace\fR forces +the D compiler to compile a D program using the 32-bit data model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler to compile a D program using the 64-bit data model. These options are typically not required as \fBdtrace\fR selects the +native data model as the default. The data model affects the sizes of integer types and other language properties. D programs compiled for either data model can be executed on both 32-bit and 64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file format +(ELF32 or ELF64) produced by the \fB-G\fR option. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-a\fR\fR +.ad +.sp .6 +.RS 4n +Claim anonymous tracing state and display the traced data. You can combine the \fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit immediately after consuming the anonymous tracing state rather than continuing to wait for new +data. See the \fISolaris Dynamic Tracing Guide\fR for more information about anonymous tracing. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-A\fR\fR +.ad +.sp .6 +.RS 4n +Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option constructs a set of \fBdtrace\fR(7D) configuration file directives to enable the specified probes for anonymous tracing and then exits. By default, \fBdtrace\fR attempts to store the directives to the file \fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the \fB-o\fR option to specify an alternate output file. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-b\fR \fIbufsz\fR\fR +.ad +.sp .6 +.RS 4n +Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts +to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-c\fR \fIcmd\fR\fR +.ad +.sp .6 +.RS 4n +Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it +terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information +on macro variables. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-C\fR\fR +.ad +.sp .6 +.RS 4n +Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, and \fB-H\fR options. You can select the degree of C standard conformance if you use the \fB-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB-X\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-D\fR \fIname\fR \fB[=\fR\fIvalue\fR\fB]\fR\fR +.ad +.sp .6 +.RS 4n +Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). If you specify the equals sign (\fB=\fR) +and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB-D\fR option to each \fBcpp\fR invocation. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-e\fR\fR +.ad +.sp .6 +.RS 4n +Exit after compiling any requests and consuming anonymous tracing state (\fB-a\fR option) but prior to enabling any probes. You can combine this option with the \fB-a\fR option to print anonymous tracing data and exit. You can also combine this option with D +compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR +.ad +.sp .6 +.RS 4n +Specify function name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR. +Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched. +The \fB-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-f\fR option on the command line at a time. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-F\fR\fR +.ad +.sp .6 +.RS 4n +Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call +entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-G\fR\fR +.ad +.sp .6 +.RS 4n +Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB-o\fR option is present, the ELF file is saved using the pathname specified +as the argument for this operand. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR. +Otherwise the ELF file is saved using the name \fBd.out\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-H\fR\fR +.ad +.sp .6 +.RS 4n +Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-H\fR option +to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-h\fR\fR +.ad +.sp .6 +.RS 4n +Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB-G\fR option. If the \fB-o\fR option +is present, the header file is saved using the pathname specified as the argument for that option. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved +using the name \fIfilename\fR\fB\&.h\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-i\fR \fIprobe-id\fR\fB[[\fR\fIpredicate\fR] \fIaction\fR\fB]\fR\fR +.ad +.sp .6 +.RS 4n +Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB-l\fR. The \fB-i\fR argument can be suffixed with an optional +D probe clause. You can specify more than one \fB-i\fR option at a time. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-I\fR \fIpath\fR\fR +.ad +.sp .6 +.RS 4n +Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled +using the \fB-C\fR option). This option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-L\fR \fIpath\fR\fR +.ad +.sp .6 +.RS 4n +Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library +search path. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-l\fR\fR +.ad +.sp .6 +.RS 4n +List probes instead of enabling them. If the \fB-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR, +and \fB-s\fR options. If none of these options are specified, this option lists all probes. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] \fIaction\fR]]\fR +.ad +.sp .6 +.RS 4n +Specify module name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match +any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed with an optional D +probe clause. More than one \fB-m\fR option can be specified on the command line at a time. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]\fR +.ad +.sp .6 +.RS 4n +Specify probe name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR, +or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are +matched. The \fB-n\fR argument can be suffixed with an optional D probe clause. More than one \fB-n\fR option can be specified on the command line at a time. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-o\fR \fIoutput\fR\fR +.ad +.sp .6 +.RS 4n +Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, and \fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is present and \fB-o\fR is not present, the default output file is \fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the \fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR. +Otherwise the default output file is \fBd.out\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-p\fR \fIpid\fR\fR +.ad +.sp .6 +.RS 4n +Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status +for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for +more information on macro variables. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-P\fR \fIprovider\fR \fB[[\fR\fIpredicate\fR\fB]\fR \fIaction\fR]\fR +.ad +.sp .6 +.RS 4n +Specify provider name to trace or list (\fB-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB-P\fR argument can be suffixed with an optional D +probe clause. You can specify more than one \fB-P\fR option on the command line at a time. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-q\fR\fR +.ad +.sp .6 +.RS 4n +Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program +statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-s\fR\fR +.ad +.sp .6 +.RS 4n +Compile the specified D program source file. If the \fB-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation +is not enabled. If none of \fB-e\fR, \fB-l\fR, \fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D program is enabled and tracing begins. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-S\fR\fR +.ad +.sp .6 +.RS 4n +Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-U\fR \fIname\fR\fR +.ad +.sp .6 +.RS 4n +Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-v\fR\fR +.ad +.sp .6 +.RS 4n +Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fISolaris Dynamic Tracing Guide\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-V\fR\fR +.ad +.sp .6 +.RS 4n +Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for +more information about DTrace versioning features. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-w\fR\fR +.ad +.sp .6 +.RS 4n +Permit destructive actions in D programs specified using the \fB-s\fR, \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR option is not specified, \fBdtrace\fR does not +permit the compilation or enabling of a D program that contains destructive actions. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-x\fR \fIarg\fR [\fI=val\fR]\fR +.ad +.sp .6 +.RS 4n +Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and +value with an equals sign (\fB=\fR). +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-X\fR \fBa | c | s | t\fR\fR +.ad +.sp .6 +.RS 4n +Specify the degree of conformance to the ISO C standard that should be selected when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). +The \fB-X\fR option argument affects the value and presence of the \fB__STDC__\fR macro depending upon the value of the argument letter. +.sp +The \fB-X\fR option supports the following arguments: +.sp +.ne 2 +.mk +.na +\fB\fBa\fR\fR +.ad +.RS 5n +.rt +Default. ISO C plus K&R compatibility extensions, with semantic changes required by ISO C. This is the default mode if \fB-X\fR is not specified. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction +with the \fB-Xa\fR option. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBc\fR\fR +.ad +.RS 5n +.rt +Conformance. Strictly conformant ISO C, without K&R C compatibility extensions. The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked in conjunction with the \fB-Xc\fR option. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBs\fR\fR +.ad +.RS 5n +.rt +K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked in conjunction with the \fB-Xs\fR option. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fBt\fR\fR +.ad +.RS 5n +.rt +Transition. ISO C plus K&R C compatibility extensions, without semantic changes required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option. +.RE + +As the \fB-X\fR option only affects how the D compiler invokes the C preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the perspective of D and both are provided only to ease re-use of settings from a C build environment. +.sp +Regardless of the \fB-X\fR mode, the following additional C preprocessor definitions are always specified and valid in all modes: +.RS +4 +.TP +.ie t \(bu +.el o +\fB__sun\fR +.RE +.RS +4 +.TP +.ie t \(bu +.el o +\fB__unix\fR +.RE +.RS +4 +.TP +.ie t \(bu +.el o +\fB__SVR4\fR +.RE +.RS +4 +.TP +.ie t \(bu +.el o +\fB__sparc\fR (on SPARC systems only) +.RE +.RS +4 +.TP +.ie t \(bu +.el o +\fB__sparcv9\fR (on SPARC systems only when 64-bit programs are compiled) +.RE +.RS +4 +.TP +.ie t \(bu +.el o +\fB__i386\fR (on x86 systems only when 32-bit programs are compiled) +.RE +.RS +4 +.TP +.ie t \(bu +.el o +\fB__amd64\fR (on x86 systems only when 64-bit programs are compiled) +.RE +.RS +4 +.TP +.ie t \(bu +.el o +\fB__\fI`uname -s`\fR_\fI`uname -r`\fR\fR (for example, \fB__SunOS_5_10\fR) +.RE +.RS +4 +.TP +.ie t \(bu +.el o +\fB__SUNW_D=1\fR +.RE +.RS +4 +.TP +.ie t \(bu +.el o +\fB__SUNW_D_VERSION=0x\fIMMmmmuuu\fR\fR +.sp +Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the minor release value in hexadecimal, and \fIuuu\fR is the +micro release value in hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information about DTrace versioning. +.RE +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-Z\fR\fR +.ad +.sp .6 +.RS 4n +Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB-s\fR option) or on the command line (\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain descriptions that do not match any known probes. +.RE + +.SH OPERANDS +.sp +.LP +You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB-s\fR option +or on the command line. The use of macro variables is described further in the \fISolaris Dynamic Tracing Guide\fR. +.SH EXIT STATUS +.sp +.LP +The following exit values are returned: +.sp +.ne 2 +.mk +.na +\fB0\fR +.ad +.RS 5n +.rt +Successful completion. +.sp +For D program requests, an exit status of \fB0\fR indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified tracing requests +encountered errors or drops. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB1\fR\fR +.ad +.RS 5n +.rt +An error occurred. +.sp +For D program requests, an exit status of \fB1\fR indicates that program compilation failed or that the specified request could not be satisfied. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB2\fR\fR +.ad +.RS 5n +.rt +Invalid command line options or arguments were specified. +.RE + +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +AvailabilitySUNWdtrc +_ +Interface StabilitySee below. +.TE + +.sp +.LP +The command-line syntax is Committed. The human-readable output is Uncommitted. +.SH SEE ALSO +.sp +.LP +\fBcpp\fR(1), \fBisainfo\fR(1), \fBlibdtrace\fR(3LIB), \fBdriver.conf\fR(4), \fBattributes\fR(5), \fBdtrace\fR(7D) +.sp +.LP +\fISolaris Dynamic Tracing Guide\fR From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 09:53:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEE981065673; Wed, 18 Jul 2012 09:53:21 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97AF68FC12; Wed, 18 Jul 2012 09:53:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I9rL0p052612; Wed, 18 Jul 2012 09:53:21 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6I9rLQF052608; Wed, 18 Jul 2012 09:53:21 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207180953.q6I9rLQF052608@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 09:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238581 - vendor/illumos/dist/man/man1m X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 09:53:21 -0000 Author: mm Date: Wed Jul 18 09:53:20 2012 New Revision: 238581 URL: http://svn.freebsd.org/changeset/base/238581 Log: Import relevant vendor manual pages from illumos-gate revision 13304:b54231762cfa Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Added: vendor/illumos/dist/man/man1m/lockstat.1m vendor/illumos/dist/man/man1m/plockstat.1m vendor/illumos/dist/man/man1m/zdb.1m vendor/illumos/dist/man/man1m/zfs.1m vendor/illumos/dist/man/man1m/zpool.1m vendor/illumos/dist/man/man1m/zstreamdump.1m Modified: vendor/illumos/dist/man/man1m/dtrace.1m Modified: vendor/illumos/dist/man/man1m/dtrace.1m ============================================================================== --- vendor/illumos/dist/man/man1m/dtrace.1m Wed Jul 18 09:47:48 2012 (r238580) +++ vendor/illumos/dist/man/man1m/dtrace.1m Wed Jul 18 09:53:20 2012 (r238581) @@ -1,51 +1,42 @@ '\" te -.\" CDDL HEADER START -.\" -.\" The contents of this file are subject to the terms of the -.\" Common Development and Distribution License (the "License"). -.\" You may not use this file except in compliance with the License. -.\" -.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -.\" or http://www.opensolaris.org/os/licensing. -.\" See the License for the specific language governing permissions -.\" and limitations under the License. -.\" -.\" When distributing Covered Code, include this CDDL HEADER in each -.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. -.\" If applicable, add the following below this CDDL HEADER, with the -.\" fields enclosed by brackets "[]" replaced with your own identifying -.\" information: Portions Copyright [yyyy] [name of copyright owner] -.\" -.\" CDDL HEADER END -.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. -.TH dtrace 1M "5 Sep 2006" "SunOS 5.11" "System Administration Commands" +.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved. +.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. +.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the +.\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] +.TH dtrace 1M "4 Aug 2009" "SunOS 5.11" "System Administration Commands" .SH NAME dtrace \- DTrace dynamic tracing compiler and tracing utility .SH SYNOPSIS .LP .nf \fBdtrace\fR [\fB-32\fR | \fB-64\fR] [\fB-aACeFGHhlqSvVwZ\fR] [\fB-b\fR \fIbufsz\fR] [\fB-c\fR \fIcmd\fR] - [\fB-D\fR \fIname\fR [\fI=value\fR]] [\fB-I\fR \fIpath\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fIoutput\fR] - [\fB-s\fR \fIscript\fR] [\fB-U\fR \fIname\fR] [\fB-x\fR \fIarg\fR [\fI=val\fR]] - [\fB-X\fR a | c | s | t] [\fB-p\fR \fIpid\fR] - [\fB-P\fR \fIprovider\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-m\fR [\fIprovider:\fR] \fImodule\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-f\fR [[\fIprovider:\fR] \fImodule:\fR] \fIfunction\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-i\fR \fIprobe-id\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-D\fR \fIname\fR [\fI=value\fR]] [\fB-I\fR \fIpath\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fIoutput\fR] + [\fB-s\fR \fIscript\fR] [\fB-U\fR \fIname\fR] [\fB-x\fR \fIarg\fR [\fI=val\fR]] + [\fB-X\fR a | c | s | t] [\fB-p\fR \fIpid\fR] + [\fB-P\fR \fIprovider\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-m\fR [\fIprovider:\fR] \fImodule\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-f\fR [[\fIprovider:\fR] \fImodule:\fR] \fIfunction\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]] + [\fB-i\fR \fIprobe-id\fR [[\fIpredicate\fR] \fIaction\fR]] .fi .SH DESCRIPTION .sp .LP -DTrace is a comprehensive dynamic tracing framework for the Solaris Operating System. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs. +DTrace is a comprehensive dynamic tracing framework for the Solaris Operating +System. DTrace provides a powerful infrastructure that permits administrators, +developers, and service personnel to concisely answer arbitrary questions about +the behavior of the operating system and user programs. .sp .LP -The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe, debug, and tune system behavior. Refer to this book for a detailed description of DTrace features, including the bundled DTrace observability -tools, instrumentation providers, and the D programming language. +The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe, +debug, and tune system behavior. Refer to this book for a detailed description +of DTrace features, including the bundled DTrace observability tools, +instrumentation providers, and the D programming language. .sp .LP -The \fBdtrace\fR command provides a generic interface to the essential services provided by the DTrace facility, including: +The \fBdtrace\fR command provides a generic interface to the essential services +provided by the DTrace facility, including: .RS +4 .TP .ie t \(bu @@ -56,13 +47,15 @@ Options that list the set of probes and .TP .ie t \(bu .el o -Options that enable probes directly using any of the probe description specifiers (provider, module, function, name) +Options that enable probes directly using any of the probe description +specifiers (provider, module, function, name) .RE .RS +4 .TP .ie t \(bu .el o -Options that run the D compiler and compile one or more D program files or programs written directly on the command line +Options that run the D compiler and compile one or more D program files or +programs written directly on the command line .RE .RS +4 .TP @@ -80,15 +73,25 @@ Options that generate program stability .TP .ie t \(bu .el o -Options that modify DTrace tracing and buffering behavior and enable additional D compiler features +Options that modify DTrace tracing and buffering behavior and enable additional +D compiler features .RE .sp .LP -You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the \fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks. +You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR +declaration to create an interpreter file. You can also use \fBdtrace\fR to +attempt to compile D programs and determine their properties without actually +enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the +\fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the +\fBdtrace\fR utility to perform these tasks. .SH OPTIONS .sp .LP -The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and \fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid intepretation of meta-characters by the shell. +The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and +\fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in +slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed +in braces \fB{}\fR. D program code specified on the command line must be +appropriately quoted to avoid interpretation of meta-characters by the shell. .sp .LP The following options are supported: @@ -100,10 +103,17 @@ The following options are supported: .ad .sp .6 .RS 4n -The D compiler produces programs using the native data model of the operating system kernel. You can use the \fBisainfo\fR \fB-b\fR command to determine the current operating system data model. If the \fB-32\fR option is specified, \fBdtrace\fR forces -the D compiler to compile a D program using the 32-bit data model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler to compile a D program using the 64-bit data model. These options are typically not required as \fBdtrace\fR selects the -native data model as the default. The data model affects the sizes of integer types and other language properties. D programs compiled for either data model can be executed on both 32-bit and 64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file format -(ELF32 or ELF64) produced by the \fB-G\fR option. +The D compiler produces programs using the native data model of the operating +system kernel. You can use the \fBisainfo\fR \fB-b\fR command to determine the +current operating system data model. If the \fB-32\fR option is specified, +\fBdtrace\fR forces the D compiler to compile a D program using the 32-bit data +model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler +to compile a D program using the 64-bit data model. These options are typically +not required as \fBdtrace\fR selects the native data model as the default. The +data model affects the sizes of integer types and other language properties. D +programs compiled for either data model can be executed on both 32-bit and +64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file +format (ELF32 or ELF64) produced by the \fB-G\fR option. .RE .sp @@ -114,8 +124,11 @@ native data model as the default. The da .ad .sp .6 .RS 4n -Claim anonymous tracing state and display the traced data. You can combine the \fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit immediately after consuming the anonymous tracing state rather than continuing to wait for new -data. See the \fISolaris Dynamic Tracing Guide\fR for more information about anonymous tracing. +Claim anonymous tracing state and display the traced data. You can combine the +\fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit +immediately after consuming the anonymous tracing state rather than continuing +to wait for new data. See the \fISolaris Dynamic Tracing Guide\fR for more +information about anonymous tracing. .RE .sp @@ -126,7 +139,12 @@ data. See the \fISolaris Dynamic Tracing .ad .sp .6 .RS 4n -Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option constructs a set of \fBdtrace\fR(7D) configuration file directives to enable the specified probes for anonymous tracing and then exits. By default, \fBdtrace\fR attempts to store the directives to the file \fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the \fB-o\fR option to specify an alternate output file. +Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option +constructs a set of \fBdtrace\fR(7D) configuration file directives to enable +the specified probes for anonymous tracing and then exits. By default, +\fBdtrace\fR attempts to store the directives to the file +\fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the +\fB-o\fR option to specify an alternate output file. .RE .sp @@ -137,8 +155,10 @@ Generate \fBdriver.conf\fR(4) directives .ad .sp .6 .RS 4n -Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts -to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property. +Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can +include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the +buffer space cannot be allocated, \fBdtrace\fR attempts to reduce the buffer +size or exit depending on the setting of the \fBbufresize\fR property. .RE .sp @@ -149,9 +169,13 @@ to reduce the buffer size or exit depend .ad .sp .6 .RS 4n -Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it -terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information -on macro variables. +Run the specified command \fIcmd\fR and exit upon its completion. If more than +one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all +commands have exited, reporting the exit status for each child process as it +terminates. The process-ID of the first command is made available to any D +programs specified on the command line or using the \fB-s\fR option through the +\fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR +for more information on macro variables. .RE .sp @@ -162,7 +186,11 @@ on macro variables. .ad .sp .6 .RS 4n -Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, and \fB-H\fR options. You can select the degree of C standard conformance if you use the \fB-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB-X\fR. +Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You +can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, +and \fB-H\fR options. You can select the degree of C standard conformance if +you use the \fB-X\fR option. For a description of the set of tokens defined by +the D compiler when invoking the C preprocessor, see \fB-X\fR. .RE .sp @@ -173,8 +201,10 @@ Run the C preprocessor \fBcpp\fR(1) over .ad .sp .6 .RS 4n -Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). If you specify the equals sign (\fB=\fR) -and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB-D\fR option to each \fBcpp\fR invocation. +Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR +option). If you specify the equals sign (\fB=\fR) and additional \fIvalue\fR, +the name is assigned the corresponding value. This option passes the \fB-D\fR +option to each \fBcpp\fR invocation. .RE .sp @@ -185,21 +215,32 @@ and additional \fIvalue\fR, the name is .ad .sp .6 .RS 4n -Exit after compiling any requests and consuming anonymous tracing state (\fB-a\fR option) but prior to enabling any probes. You can combine this option with the \fB-a\fR option to print anonymous tracing data and exit. You can also combine this option with D -compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation. +Exit after compiling any requests and consuming anonymous tracing state +(\fB-a\fR option) but prior to enabling any probes. You can combine this option +with the \fB-a\fR option to print anonymous tracing data and exit. You can also +combine this option with D compiler options. This combination verifies that the +programs compile without actually executing them and enabling the corresponding +instrumentation. .RE .sp .ne 2 .mk .na -\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR +\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[ +[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR .ad .sp .6 .RS 4n -Specify function name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR. -Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched. -The \fB-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-f\fR option on the command line at a time. +Specify function name to trace or list (\fB-l\fR option). The corresponding +argument can include any of the probe description forms +\fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR. +Unspecified probe description fields are left blank and match any probes +regardless of the values in those fields. If no qualifiers other than +\fIfunction\fR are specified in the description, all probes with the +corresponding \fIfunction\fR are matched. The \fB-f\fR argument can be suffixed +with an optional D probe clause. You can specify more than one \fB-f\fR option +on the command line at a time. .RE .sp @@ -210,8 +251,12 @@ The \fB-f\fR argument can be suffixed wi .ad .sp .6 .RS 4n -Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call -entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&. +Coalesce trace output by identifying function entry and return. Function entry +probe reports are indented and their output is prefixed with \fB->\fR. Function +return probe reports are unindented and their output is prefixed with +\fB<-\fR\&. System call entry probe reports are indented and their output is +prefixed with \fB=>\fR. System call return probe reports are unindented and +their output is prefixed with \fB<=\fR\&. .RE .sp @@ -222,9 +267,14 @@ entry probe reports are indented and the .ad .sp .6 .RS 4n -Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB-o\fR option is present, the ELF file is saved using the pathname specified -as the argument for this operand. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR. -Otherwise the ELF file is saved using the name \fBd.out\fR. +Generate an ELF file containing an embedded DTrace program. The DTrace probes +specified in the program are saved inside of a relocatable ELF object which can +be linked into another program. If the \fB-o\fR option is present, the ELF file +is saved using the pathname specified as the argument for this operand. If the +\fB-o\fR option is not present and the DTrace program is contained with a file +whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name +\fB\fIfilename\fR.o\fR. Otherwise the ELF file is saved using the name +\fBd.out\fR. .RE .sp @@ -235,8 +285,10 @@ Otherwise the ELF file is saved using th .ad .sp .6 .RS 4n -Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-H\fR option -to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR. +Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using +the \fB-C\fR option). This option passes the \fB-H\fR option to each \fBcpp\fR +invocation, causing it to display the list of pathnames, one for each line, to +\fBstderr\fR. .RE .sp @@ -247,9 +299,14 @@ to each \fBcpp\fR invocation, causing it .ad .sp .6 .RS 4n -Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB-G\fR option. If the \fB-o\fR option -is present, the header file is saved using the pathname specified as the argument for that option. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved -using the name \fIfilename\fR\fB\&.h\fR. +Generate a header file containing macros that correspond to probes in the +specified provider definitions. This option should be used to generate a header +file that is included by other source files for later use with the \fB-G\fR +option. If the \fB-o\fR option is present, the header file is saved using the +pathname specified as the argument for that option. If the \fB-o\fR option is +not present and the DTrace program is contained with a file whose name is +\fIfilename\fR\fB\&.d\fR, then the header file is saved using the name +\fIfilename\fR\fB\&.h\fR. .RE .sp @@ -260,8 +317,10 @@ using the name \fIfilename\fR\fB\&.h\fR. .ad .sp .6 .RS 4n -Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB-l\fR. The \fB-i\fR argument can be suffixed with an optional -D probe clause. You can specify more than one \fB-i\fR option at a time. +Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). +You can specify probe IDs using decimal integers as shown by \fBdtrace\fR +\fB-l\fR. The \fB-i\fR argument can be suffixed with an optional D probe +clause. You can specify more than one \fB-i\fR option at a time. .RE .sp @@ -272,8 +331,11 @@ D probe clause. You can specify more tha .ad .sp .6 .RS 4n -Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled -using the \fB-C\fR option). This option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list. +Add the specified directory \fIpath\fR to the search path for \fB#include\fR +files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This +option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified +\fIpath\fR is inserted into the search path ahead of the default directory +list. .RE .sp @@ -284,7 +346,9 @@ using the \fB-C\fR option). This option .ad .sp .6 .RS 4n -Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library +Add the specified directory \fIpath\fR to the search path for DTrace libraries. +DTrace libraries are used to contain common definitions that can be used when +writing D programs. The specified \fIpath\fR is added after the default library search path. .RE @@ -296,34 +360,49 @@ search path. .ad .sp .6 .RS 4n -List probes instead of enabling them. If the \fB-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR, -and \fB-s\fR options. If none of these options are specified, this option lists all probes. +List probes instead of enabling them. If the \fB-l\fR option is specified, +\fBdtrace\fR produces a report of the probes matching the descriptions given +using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR, and \fB-s\fR +options. If none of these options are specified, this option lists all probes. .RE .sp .ne 2 .mk .na -\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] \fIaction\fR]]\fR +\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] +\fIaction\fR]]\fR .ad .sp .6 .RS 4n -Specify module name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match -any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed with an optional D -probe clause. More than one \fB-m\fR option can be specified on the command line at a time. +Specify module name to trace or list (\fB-l\fR option). The corresponding +argument can include any of the probe description forms \fIprovider:module\fR +or \fImodule\fR. Unspecified probe description fields are left blank and match +any probes regardless of the values in those fields. If no qualifiers other +than \fImodule\fR are specified in the description, all probes with a +corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed +with an optional D probe clause. More than one \fB-m\fR option can be specified +on the command line at a time. .RE .sp .ne 2 .mk .na -\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]\fR +\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR +[[\fIpredicate\fR] \fIaction\fR]\fR .ad .sp .6 .RS 4n -Specify probe name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR, -or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are -matched. The \fB-n\fR argument can be suffixed with an optional D probe clause. More than one \fB-n\fR option can be specified on the command line at a time. +Specify probe name to trace or list (\fB-l\fR option). The corresponding +argument can include any of the probe description forms +\fIprovider:module:function:name\fR, \fImodule:function:name\fR, +\fIfunction:name\fR, or \fIname\fR. Unspecified probe description fields are +left blank and match any probes regardless of the values in those fields. If no +qualifiers other than \fIname\fR are specified in the description, all probes +with a corresponding \fIname\fR are matched. The \fB-n\fR argument can be +suffixed with an optional D probe clause. More than one \fB-n\fR option can be +specified on the command line at a time. .RE .sp @@ -334,8 +413,13 @@ matched. The \fB-n\fR argument can be su .ad .sp .6 .RS 4n -Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, and \fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is present and \fB-o\fR is not present, the default output file is \fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the \fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR. -Otherwise the default output file is \fBd.out\fR. +Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, \fB-h\fR, and +\fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is +present and \fB-o\fR is not present, the default output file is +\fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the +\fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR +is not present, the default output file is \fB\fIfilename\fR.o\fR. Otherwise +the default output file is \fBd.out\fR. .RE .sp @@ -346,9 +430,13 @@ Otherwise the default output file is \fB .ad .sp .6 .RS 4n -Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status -for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for -more information on macro variables. +Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon +its completion. If more than one \fB-p\fR option is present on the command +line, \fBdtrace\fR exits when all commands have exited, reporting the exit +status for each process as it terminates. The first process-ID is made +available to any D programs specified on the command line or using the \fB-s\fR +option through the \fB$target\fR macro variable. Refer to the \fISolaris +Dynamic Tracing Guide\fR for more information on macro variables. .RE .sp @@ -359,8 +447,11 @@ more information on macro variables. .ad .sp .6 .RS 4n -Specify provider name to trace or list (\fB-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB-P\fR argument can be suffixed with an optional D -probe clause. You can specify more than one \fB-P\fR option on the command line at a time. +Specify provider name to trace or list (\fB-l\fR option). The remaining probe +description fields module, function, and name are left blank and match any +probes regardless of the values in those fields. The \fB-P\fR argument can be +suffixed with an optional D probe clause. You can specify more than one +\fB-P\fR option on the command line at a time. .RE .sp @@ -371,8 +462,11 @@ probe clause. You can specify more than .ad .sp .6 .RS 4n -Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program -statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR. +Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes +matched by the specified options and D programs and does not print column +headers, the CPU ID, the probe ID, or insert newlines into the output. Only +data traced and formatted by D program statements such as \fBtrace()\fR and +\fBprintf()\fR is displayed to \fBstdout\fR. .RE .sp @@ -383,8 +477,12 @@ statements such as \fBtrace()\fR and \fB .ad .sp .6 .RS 4n -Compile the specified D program source file. If the \fB-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation -is not enabled. If none of \fB-e\fR, \fB-l\fR, \fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D program is enabled and tracing begins. +Compile the specified D program source file. If the \fB-e\fR option is present, +the program is compiled but instrumentation is not enabled. If the \fB-l\fR +option is present, the program is compiled and the set of probes matched by it +is listed, but instrumentation is not enabled. If none of \fB-e\fR, \fB-l\fR, +\fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D +program is enabled and tracing begins. .RE .sp @@ -395,7 +493,8 @@ is not enabled. If none of \fB-e\fR, \fB .ad .sp .6 .RS 4n -Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR. +Show D compiler intermediate code. The D compiler produces a report of the +intermediate code generated for each D program to \fBstderr\fR. .RE .sp @@ -406,7 +505,9 @@ Show D compiler intermediate code. The D .ad .sp .6 .RS 4n -Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation. +Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the +\fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR +invocation. .RE .sp @@ -417,7 +518,10 @@ Undefine the specified \fIname\fR when i .ad .sp .6 .RS 4n -Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fISolaris Dynamic Tracing Guide\fR. +Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a +program stability report showing the minimum interface stability and dependency +level for the specified D programs. DTrace stability levels are explained in +further detail in the \fISolaris Dynamic Tracing Guide\fR. .RE .sp @@ -428,8 +532,10 @@ Set verbose mode. If the \fB-v\fR option .ad .sp .6 .RS 4n -Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for -more information about DTrace versioning features. +Report the highest D programming interface version supported by \fBdtrace\fR. +The version information is printed to \fBstdout\fR and the \fBdtrace\fR command +exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information +about DTrace versioning features. .RE .sp @@ -440,8 +546,10 @@ more information about DTrace versioning .ad .sp .6 .RS 4n -Permit destructive actions in D programs specified using the \fB-s\fR, \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR option is not specified, \fBdtrace\fR does not -permit the compilation or enabling of a D program that contains destructive actions. +Permit destructive actions in D programs specified using the \fB-s\fR, +\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR +option is not specified, \fBdtrace\fR does not permit the compilation or +enabling of a D program that contains destructive actions. .RE .sp @@ -452,8 +560,10 @@ permit the compilation or enabling of a .ad .sp .6 .RS 4n -Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and -value with an equals sign (\fB=\fR). +Enable or modify a DTrace runtime option or D compiler option. The list of +options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options +are enabled by specifying their name. Options with values are set by separating +the option name and value with an equals sign (\fB=\fR). .RE .sp @@ -464,8 +574,10 @@ value with an equals sign (\fB=\fR). .ad .sp .6 .RS 4n -Specify the degree of conformance to the ISO C standard that should be selected when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). -The \fB-X\fR option argument affects the value and presence of the \fB__STDC__\fR macro depending upon the value of the argument letter. +Specify the degree of conformance to the ISO C standard that should be selected +when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). The \fB-X\fR +option argument affects the value and presence of the \fB__STDC__\fR macro +depending upon the value of the argument letter. .sp The \fB-X\fR option supports the following arguments: .sp @@ -476,8 +588,10 @@ The \fB-X\fR option supports the followi .ad .RS 5n .rt -Default. ISO C plus K&R compatibility extensions, with semantic changes required by ISO C. This is the default mode if \fB-X\fR is not specified. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction -with the \fB-Xa\fR option. +Default. ISO C plus K&R compatibility extensions, with semantic changes +required by ISO C. This is the default mode if \fB-X\fR is not specified. The +predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in +conjunction with the \fB-Xa\fR option. .RE .sp @@ -488,7 +602,9 @@ with the \fB-Xa\fR option. .ad .RS 5n .rt -Conformance. Strictly conformant ISO C, without K&R C compatibility extensions. The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked in conjunction with the \fB-Xc\fR option. +Conformance. Strictly conformant ISO C, without K&R C compatibility extensions. +The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked +in conjunction with the \fB-Xc\fR option. .RE .sp @@ -499,7 +615,8 @@ Conformance. Strictly conformant ISO C, .ad .RS 5n .rt -K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked in conjunction with the \fB-Xs\fR option. +K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked +in conjunction with the \fB-Xs\fR option. .RE .sp @@ -510,12 +627,18 @@ K&R C only. The macro \fB__STDC__\fR is .ad .RS 5n .rt -Transition. ISO C plus K&R C compatibility extensions, without semantic changes required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option. +Transition. ISO C plus K&R C compatibility extensions, without semantic changes +required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when +\fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option. .RE -As the \fB-X\fR option only affects how the D compiler invokes the C preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the perspective of D and both are provided only to ease re-use of settings from a C build environment. +As the \fB-X\fR option only affects how the D compiler invokes the C +preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the +perspective of D and both are provided only to ease re-use of settings from a C +build environment. .sp -Regardless of the \fB-X\fR mode, the following additional C preprocessor definitions are always specified and valid in all modes: +Regardless of the \fB-X\fR mode, the following additional C preprocessor +definitions are always specified and valid in all modes: .RS +4 .TP .ie t \(bu @@ -576,8 +699,10 @@ Regardless of the \fB-X\fR mode, the fol .el o \fB__SUNW_D_VERSION=0x\fIMMmmmuuu\fR\fR .sp -Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the minor release value in hexadecimal, and \fIuuu\fR is the -micro release value in hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information about DTrace versioning. +Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the +minor release value in hexadecimal, and \fIuuu\fR is the micro release value in +hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more +information about DTrace versioning. .RE .RE @@ -589,14 +714,21 @@ micro release value in hexadecimal. Refe .ad .sp .6 .RS 4n -Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB-s\fR option) or on the command line (\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain descriptions that do not match any known probes. +Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not +specified, \fBdtrace\fR reports an error and exits if any probe descriptions +specified in D program files (\fB-s\fR option) or on the command line +(\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain +descriptions that do not match any known probes. .RE .SH OPERANDS .sp .LP -You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB-s\fR option -or on the command line. The use of macro variables is described further in the \fISolaris Dynamic Tracing Guide\fR. +You can specify zero or more additional arguments on the \fBdtrace\fR command +line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The +additional arguments can be used in D programs specified using the \fB-s\fR +option or on the command line. The use of macro variables is described further +in the \fISolaris Dynamic Tracing Guide\fR. .SH EXIT STATUS .sp .LP @@ -609,10 +741,12 @@ The following exit values are returned: .ad .RS 5n .rt -Successful completion. +Successful completion. .sp -For D program requests, an exit status of \fB0\fR indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified tracing requests -encountered errors or drops. +For D program requests, an exit status of \fB0\fR indicates that programs were +successfully compiled, probes were successfully enabled, or anonymous state was +successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified +tracing requests encountered errors or drops. .RE .sp @@ -625,7 +759,8 @@ encountered errors or drops. .rt An error occurred. .sp -For D program requests, an exit status of \fB1\fR indicates that program compilation failed or that the specified request could not be satisfied. +For D program requests, an exit status of \fB1\fR indicates that program +compilation failed or that the specified request could not be satisfied. .RE .sp @@ -653,8 +788,6 @@ lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ -AvailabilitySUNWdtrc -_ Interface StabilitySee below. .TE @@ -664,7 +797,19 @@ The command-line syntax is Committed. Th .SH SEE ALSO .sp .LP -\fBcpp\fR(1), \fBisainfo\fR(1), \fBlibdtrace\fR(3LIB), \fBdriver.conf\fR(4), \fBattributes\fR(5), \fBdtrace\fR(7D) +\fBcpp\fR(1), \fBisainfo\fR(1), \fBssh\fR(1), \fBlibdtrace\fR(3LIB), +\fBdriver.conf\fR(4), \fBattributes\fR(5), \fBdtrace\fR(7D) .sp .LP \fISolaris Dynamic Tracing Guide\fR +.SH USAGE +.sp +.LP +When using the \fB-p\fR flag, \fBdtrace\fR stops the target processes while it +is inspecting them and reporting results. A process can do nothing while it is +stopped. This means that, if , for example, the X server is inspected by +\fBdtrace\fR running in a window under the X server's control, the whole window +system can become deadlocked, because the \fBproc\fR tool would be attempting +to display its results to a window that cannot be refreshed. In such a case, +logging in from another system using \fBssh\fR(1) and killing the offending +\fBproc\fR tool clears the deadlock. Added: vendor/illumos/dist/man/man1m/lockstat.1m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/man/man1m/lockstat.1m Wed Jul 18 09:53:20 2012 (r238581) @@ -0,0 +1,909 @@ +'\" te +.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. +.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. +.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. +.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] +.TH lockstat 1M "28 Feb 2008" "SunOS 5.11" "System Administration Commands" +.SH NAME +lockstat \- report kernel lock and profiling statistics +.SH SYNOPSIS +.LP +.nf +\fBlockstat\fR [\fB-ACEHI\fR] [\fB-e\fR \fIevent_list\fR] [\fB-i\fR \fIrate\fR] + [\fB-b\fR | \fB-t\fR | \fB-h\fR | \fB-s\fR \fIdepth\fR] [\fB-n\fR \fInrecords\fR] + [\fB-l\fR \fIlock\fR [, \fIsize\fR]] [\fB-d\fR \fIduration\fR] + [\fB-f\fR \fIfunction\fR [, \fIsize\fR]] [\fB-T\fR] [\fB-ckgwWRpP\fR] [\fB-D\fR \fIcount\fR] + [\fB-o\fR \fIfilename\fR] [\fB-x\fR \fIopt\fR [=val]] \fIcommand\fR [\fIargs\fR] +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBlockstat\fR utility gathers and displays kernel locking and profiling +statistics. \fBlockstat\fR allows you to specify which events to watch (for +example, spin on adaptive mutex, block on read access to rwlock due to waiting +writers, and so forth) how much data to gather for each event, and how to +display the data. By default, \fBlockstat\fR monitors all lock contention +events, gathers frequency and timing data about those events, and displays the +data in decreasing frequency order, so that the most common events appear +first. +.sp +.LP +\fBlockstat\fR gathers data until the specified command completes. For example, +to gather statistics for a fixed-time interval, use \fBsleep\fR(1) as the +command, as follows: +.sp +.LP +\fBexample#\fR \fBlockstat\fR \fBsleep\fR \fB5\fR +.sp +.LP +When the \fB-I\fR option is specified, \fBlockstat\fR establishes a +per-processor high-level periodic interrupt source to gather profiling data. +The interrupt handler simply generates a \fBlockstat\fR event whose caller is +the interrupted PC (program counter). The profiling event is just like any +other \fBlockstat\fR event, so all of the normal \fBlockstat\fR options are +applicable. +.sp +.LP +\fBlockstat\fR relies on DTrace to modify the running kernel's text to +intercept events of interest. This imposes a small but measurable overhead on +all system activity, so access to \fBlockstat\fR is restricted to super-user by +default. The system administrator can permit other users to use \fBlockstat\fR +by granting them additional DTrace privileges. Refer to the \fISolaris Dynamic +Tracing Guide\fR for more information about DTrace security features. +.SH OPTIONS +.sp +.LP +The following options are supported: +.SS "Event Selection" +.sp +.LP +If no event selection options are specified, the default is \fB-C\fR. +.sp +.ne 2 +.mk +.na +\fB\fB-A\fR\fR +.ad +.sp .6 +.RS 4n +Watch all lock events. \fB-A\fR is equivalent to \fB-CH\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-C\fR\fR +.ad +.sp .6 +.RS 4n +Watch contention events. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-E\fR\fR +.ad +.sp .6 +.RS 4n +Watch error events. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB\fR\fB-e\fR \fIevent_list\fR\fR +.ad +.sp .6 +.RS 4n +Only watch the specified events. \fIevent\fR \fIlist\fR is a comma-separated +list of events or ranges of events such as 1,4-7,35. Run \fBlockstat\fR with no +arguments to get a brief description of all events. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-H\fR\fR +.ad +.sp .6 +.RS 4n +Watch hold events. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-I\fR\fR +.ad +.sp .6 +.RS 4n +Watch profiling interrupt events. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB\fR\fB-i\fR \fIrate\fR\fR +.ad +.sp .6 +.RS 4n +Interrupt rate (per second) for \fB-I\fR. The default is 97 Hz, so that +profiling doesn't run in lockstep with the clock interrupt (which runs at 100 +Hz). +.RE + +.SS "Data Gathering" +.sp +.ne 2 +.mk +.na +\fB\fB-x\fR \fIarg\fR[=\fIval\fR]\fR +.ad +.sp .6 +.RS 4n +Enable or modify a DTrace runtime option or D compiler option. The list of +options is found in the \fI\fR. Boolean options are enabled by specifying their +name. Options with values are set by separating the option name and value with +an equals sign (=). +.RE + +.SS "Data Gathering (Mutually Exclusive)" +.sp +.ne 2 +.mk +.na +\fB\fB-b\fR\fR +.ad +.sp .6 +.RS 4n +Basic statistics: lock, caller, number of events. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-h\fR\fR +.ad +.sp .6 +.RS 4n +Histogram: Timing plus time-distribution histograms. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB\fR\fB-s\fR \fIdepth\fR\fR +.ad +.sp .6 +.RS 4n +Stack trace: Histogram plus stack traces up to \fIdepth\fR frames deep. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-t\fR\fR +.ad +.sp .6 +.RS 4n +Timing: Basic plus timing for all events [default]. +.RE + +.SS "Data Filtering" +.sp +.ne 2 +.mk +.na +\fB\fB\fR\fB-d\fR \fIduration\fR\fR +.ad +.sp .6 +.RS 4n +Only watch events longer than \fIduration\fR. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB\fR\fB-f\fR \fIfunc[,size]\fR\fR +.ad +.sp .6 +.RS 4n +Only watch events generated by \fIfunc\fR, which can be specified as a symbolic +name or hex address. \fIsize\fR defaults to the \fBELF\fR symbol size if +available, or \fB1\fR if not. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB\fR\fB-l\fR \fIlock[,size]\fR\fR +.ad +.sp .6 +.RS 4n +Only watch \fIlock\fR, which can be specified as a symbolic name or hex +address. \fBsize\fR defaults to the \fBELF\fR symbol size or \fB1\fR if the +symbol size is not available. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB\fR\fB-n\fR \fInrecords\fR\fR +.ad +.sp .6 +.RS 4n +Maximum number of data records. +.RE + +.sp +.ne 2 +.mk +.na *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:19:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06EB3106566C; Wed, 18 Jul 2012 10:19:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E14958FC15; Wed, 18 Jul 2012 10:19:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAJ6q8054556; Wed, 18 Jul 2012 10:19:06 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAJ6EN054536; Wed, 18 Jul 2012 10:19:06 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207181019.q6IAJ6EN054536@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 10:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238582 - in vendor/illumos/dist: cmd/dtrace/test/cmd/jdtrace cmd/dtrace/test/cmd/scripts cmd/dtrace/test/tst/common/aggs cmd/dtrace/test/tst/common/buffering cmd/dtrace/test/tst/common... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:19:07 -0000 Author: mm Date: Wed Jul 18 10:19:06 2012 New Revision: 238582 URL: http://svn.freebsd.org/changeset/base/238582 Log: Update vendor/illumos/dist to pre libzfs_core state (dtrace and ctf part) illumos-gate revision 13742:b6bbdd77139c Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Added: vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtfailures.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.tolower.d vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.toupper.d vendor/illumos/dist/cmd/dtrace/test/tst/common/include/ vendor/illumos/dist/cmd/dtrace/test/tst/common/include/tst.includefirst.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/ vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.bases.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.basic.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.normal.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.range.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.range.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.steps.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/print/ vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.array.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.array.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.bitfield.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.bitfield.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.primitive.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.primitive.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.struct.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.struct.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.noprivdrop.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.noprivrestrict.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.tick.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_TRACE_DYN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh vendor/illumos/dist/lib/libdtrace/common/dt_print.c Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/JDTrace.java vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/exception.lst vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/jdtrace.c vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.subr.d vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize1.d vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize2.d vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/java_api/src/TestBean.java vendor/illumos/dist/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.include.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.header.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.include.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.static.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.user.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh vendor/illumos/dist/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh vendor/illumos/dist/lib/libctf/common/ctf_lib.c vendor/illumos/dist/lib/libdtrace/common/dt_aggregate.c vendor/illumos/dist/lib/libdtrace/common/dt_cc.c vendor/illumos/dist/lib/libdtrace/common/dt_consume.c vendor/illumos/dist/lib/libdtrace/common/dt_dof.c vendor/illumos/dist/lib/libdtrace/common/dt_errtags.h vendor/illumos/dist/lib/libdtrace/common/dt_impl.h vendor/illumos/dist/lib/libdtrace/common/dt_map.c vendor/illumos/dist/lib/libdtrace/common/dt_open.c vendor/illumos/dist/lib/libdtrace/common/dt_options.c vendor/illumos/dist/lib/libdtrace/common/dt_parser.c vendor/illumos/dist/lib/libdtrace/common/dt_pragma.c vendor/illumos/dist/lib/libdtrace/common/dt_printf.c vendor/illumos/dist/lib/libdtrace/common/dt_program.c vendor/illumos/dist/lib/libdtrace/common/dtrace.h vendor/illumos/dist/lib/libdtrace/i386/regs.d.in vendor/illumos/dist/man/man1m/dtrace.1m vendor/illumos/dist/man/man1m/lockstat.1m vendor/illumos/dist/man/man1m/plockstat.1m vendor/illumos/dist/tools/ctf/cvt/dwarf.c Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/JDTrace.java ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/JDTrace.java Wed Jul 18 09:53:20 2012 (r238581) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/JDTrace.java Wed Jul 18 10:19:06 2012 (r238582) @@ -23,7 +23,6 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * - * ident "%Z%%M% %I% %E% SMI" */ import org.opensolaris.os.dtrace.*; import java.io.*; @@ -303,6 +302,7 @@ public class JDTrace { Distribution.Bucket bucket; int b1 = 0; // first displayed bucket int b2 = d.size() - 1; // last displayed bucket + for (; (b1 <= b2) && (d.get(b1).getFrequency() == 0); ++b1); // If possible, get one bucket before the first non-zero // bucket and one bucket after the last. @@ -337,9 +337,14 @@ public class JDTrace { v = bucket.getFrequency(); b = bucket.getMin(); - if (d instanceof LinearDistribution) { + if ((d instanceof LinearDistribution) || + (d instanceof LogLinearDistribution)) { if (b == Long.MIN_VALUE) { - String lt = "< " + ((LinearDistribution)d).getBase(); + String lt; + if (d instanceof LinearDistribution) + lt = "< " + ((LinearDistribution)d).getBase(); + else + lt = "< " + ((LogLinearDistribution)d).getBase(); out.printf("%16s ", lt); } else if (bucket.getMax() == Long.MAX_VALUE) { String ge = ">= " + b; Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/exception.lst ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/exception.lst Wed Jul 18 09:53:20 2012 (r238581) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/exception.lst Wed Jul 18 10:19:06 2012 (r238582) @@ -23,7 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" # Exception list: names tests that are bypassed when running in Java # mode (relative to /opt/SUNWdtrt/tst) @@ -52,14 +51,17 @@ common/usdt/tst.enabled.ksh common/usdt/tst.enabled2.ksh common/usdt/tst.entryreturn.ksh common/usdt/tst.fork.ksh -common/usdt/tst.header.ksh common/usdt/tst.guess32.ksh common/usdt/tst.guess64.ksh +common/usdt/tst.header.ksh common/usdt/tst.linkpriv.ksh common/usdt/tst.linkunpriv.ksh common/usdt/tst.multiple.ksh common/usdt/tst.nodtrace.ksh +common/usdt/tst.noreap.ksh +common/usdt/tst.noreapring.ksh common/usdt/tst.onlyenabled.ksh +common/usdt/tst.reap.ksh common/usdt/tst.reeval.ksh common/usdt/tst.static.ksh common/usdt/tst.static2.ksh Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/jdtrace.c ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/jdtrace.c Wed Jul 18 09:53:20 2012 (r238581) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/jdtrace/jdtrace.c Wed Jul 18 10:19:06 2012 (r238582) @@ -22,25 +22,27 @@ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2011, Richard Lowe */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include +#include #include int main(int argc, char **argv) { - int i, ac, has64; + int i, ac; char **av, **p; + char isaname[16]; ac = argc + 3; av = p = alloca(sizeof (char *) * ac); - *p++ = "java"; + *p++ = "/usr/java/bin/java"; *p++ = "-jar"; *p++ = "/opt/SUNWdtrt/lib/java/jdtrace.jar"; @@ -52,9 +54,9 @@ main(int argc, char **argv) } p[i] = NULL; - (void) execvp(av[0], av); - - perror("exec failed"); + if (sysinfo(SI_ARCHITECTURE_64, isaname, sizeof (isaname)) != -1) + asprintf(av, "/usr/java/bin/%s/java", isaname); - return (0); + (void) execv(av[0], av); + err(1, "exec failed"); } Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl Wed Jul 18 09:53:20 2012 (r238581) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl Wed Jul 18 10:19:06 2012 (r238582) @@ -25,6 +25,9 @@ # Use is subject to license terms. # +# +# Copyright (c) 2011, Joyent, Inc. All rights reserved. +# require 5.8.4; use File::Find; @@ -35,8 +38,8 @@ use Cwd 'abs_path'; $PNAME = $0; $PNAME =~ s:.*/::; -$OPTSTR = 'abd:fghi:jlnqsx:'; -$USAGE = "Usage: $PNAME [-abfghjlnqs] [-d dir] [-i isa] " +$OPTSTR = 'abd:fFghi:jlnqsx:'; +$USAGE = "Usage: $PNAME [-abfFghjlnqs] [-d dir] [-i isa] " . "[-x opt[=arg]] [file | dir ...]\n"; ($MACH = `uname -p`) =~ s/\W*\n//; ($PLATFORM = `uname -i`) =~ s/\W*\n//; @@ -69,6 +72,20 @@ sub dirname { return $i == -1 ? '.' : $i == 0 ? '/' : $s; } +sub inpath +{ + my ($exec) = (@_); + my @path = File::Spec->path(); + + for my $dir (@path) { + if (-x $dir . "/" . $exec) { + return 1; + } + } + + return 0; +} + sub usage { print $USAGE; @@ -77,6 +94,7 @@ sub usage print "\t -d specify directory for test results files and cores\n"; print "\t -g enable libumem debugging when running tests\n"; print "\t -f force bypassed tests to run\n"; + print "\t -F force tests to be run, even if missing dependencies\n"; print "\t -h display verbose usage message\n"; print "\t -i specify ISA to test instead of isaexec(3C) default\n"; print "\t -j execute test suite using jdtrace (Java API) only\n"; @@ -240,8 +258,8 @@ sub run_tests { my($failed) = $errs; my($total) = 0; - die "$PNAME: $dtrace not found\n" unless (-x "$dtrace"); - logmsg($dtrace . "\n"); + die "$PNAME: $dtrace not found; aborting\n" unless (-x "$dtrace"); + logmsg("executing tests using $dtrace ...\n"); load_exceptions($exceptions_path); @@ -546,9 +564,20 @@ $dt_bin = '/opt/SUNWdtrt/bin'; $defdir = -d $dt_tst ? $dt_tst : '.'; $bindir = -d $dt_bin ? $dt_bin : '.'; +if (!$opt_F) { + my @dependencies = ("gcc", "make", "java", "perl"); + + for my $dep (@dependencies) { + if (!inpath($dep)) { + die "$PNAME: '$dep' not found (use -F to force run)\n"; + } + } +} + find(\&wanted, "$defdir/common") if (scalar(@ARGV) == 0); find(\&wanted, "$defdir/$MACH") if (scalar(@ARGV) == 0); find(\&wanted, "$defdir/$PLATFORM") if (scalar(@ARGV) == 0); + die $USAGE if (scalar(@files) == 0); $dtrace_path = '/usr/sbin/dtrace'; @@ -562,7 +591,7 @@ if ($opt_j || $opt_n || $opt_i) { push(@dtrace_cmds, $jdtrace_path) if ($opt_j); push(@dtrace_cmds, "/usr/sbin/$opt_i/dtrace") if ($opt_i); } else { - @dtrace_cmds = ($dtrace_path, $jdtrace_path); + @dtrace_cmds = ($dtrace_path); } if ($opt_d) { @@ -589,12 +618,6 @@ if ($opt_g) { $ENV{'LD_PRELOAD'} = 'libumem.so'; } -# -# Ensure that $PATH contains a cc(1) so that we can execute the -# test programs that require compilation of C code. -# -$ENV{'PATH'} = $ENV{'PATH'} . ':/ws/onnv-tools/SUNWspro/SS11/bin'; - if ($opt_b) { logmsg("badioctl'ing ... "); Added: vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtfailures.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtfailures.ksh Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,42 @@ +#!/usr/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2011, Joyent, Inc. All rights reserved. +# + +let failure=0 + +printf "%-3s %-10s %-31s %s\n" "#" "KIND" "TEST" "DETAILS" + +while [[ -d failure.$failure ]]; do + dir=failure.$failure + tst=`cat $dir/README | head -1 | nawk '{ print $2 }'` + kind=`basename $(dirname $tst)` + name=`basename $tst` + cols=$(expr `tput cols` - 47) + details=`tail -1 $dir/*.err | cut -c1-$cols` + printf "%-3d %-10s %-31s " $failure $kind $name + echo $details + let failure=failure+1 +done + Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.subr.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.subr.d Wed Jul 18 09:53:20 2012 (r238581) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.subr.d Wed Jul 18 10:19:06 2012 (r238582) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #define INTFUNC(x) \ @@ -98,6 +96,8 @@ INTFUNC(ntohll(0x1234567890abcdefL)) STRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof (ipaddr_t)))) STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t)))) STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t)))) +STRFUNC(toupper("foo")) +STRFUNC(tolower("BAR")) BEGIN /subr == DIF_SUBR_MAX + 1/ Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize1.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize1.d Wed Jul 18 09:53:20 2012 (r238581) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize1.d Wed Jul 18 10:19:06 2012 (r238582) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: * Checks that setting "bufresize" to "auto" will cause buffer @@ -34,14 +32,8 @@ * SECTION: Buffers and Buffering/Buffer Resizing Policy; * Options and Tunables/bufsize; * Options and Tunables/bufresize - * - * NOTES: - * We use the undocumented "preallocate" option to make sure dtrace(1M) - * has enough space in its heap to allocate a buffer as large as the - * kernel's trace buffer. */ -#pragma D option preallocate=100t #pragma D option bufresize=auto #pragma D option bufsize=100t Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize2.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize2.d Wed Jul 18 09:53:20 2012 (r238581) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.resize2.d Wed Jul 18 10:19:06 2012 (r238582) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: * Checks that setting "bufresize" to "auto" will cause buffer @@ -34,14 +32,8 @@ * SECTION: Buffers and Buffering/Buffer Resizing Policy; * Options and Tunables/aggsize; * Options and Tunables/bufresize - * - * NOTES: - * We use the undocumented "preallocate" option to make sure dtrace(1M) - * has enough space in its heap to allocate a buffer as large as the - * kernel's trace buffer. */ -#pragma D option preallocate=100t #pragma D option bufresize=auto #pragma D option aggsize=100t Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(tolower(2152006)); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(toupper(timestamp)); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(tolower()); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(tolower("dory", "eel", "roughy")); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(toupper()); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +BEGIN +{ + trace(tolower("haino", "tylo")); + exit(1); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,80 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet + +int64_t val[int]; + +BEGIN +{ + base = -2; + i = 0; + val[i++] = -10; + val[i++] = -1; + val[i++] = 0; + val[i++] = 10; + val[i++] = 100; + val[i++] = 1000; + val[i++] = (1LL << 62); + maxval = i; + i = 0; +} + +tick-1ms +/i < maxval/ +{ + printf("base %2d of %20d: ", base, val[i]); +} + +tick-1ms +/i < maxval/ +{ + printf(" %s\n", lltostr(val[i], base)); +} + +ERROR +{ + printf(" \n"); +} + +tick-1ms +/i < maxval/ +{ + i++; +} + +tick-1ms +/i == maxval/ +{ + i = 0; + base++; +} + +tick-1ms +/base > 40/ +{ + exit(0); +} + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,302 @@ +base -2 of -10: +base -2 of -1: +base -2 of 0: +base -2 of 10: +base -2 of 100: +base -2 of 1000: +base -2 of 4611686018427387904: +base -1 of -10: +base -1 of -1: +base -1 of 0: +base -1 of 10: +base -1 of 100: +base -1 of 1000: +base -1 of 4611686018427387904: +base 0 of -10: +base 0 of -1: +base 0 of 0: +base 0 of 10: +base 0 of 100: +base 0 of 1000: +base 0 of 4611686018427387904: +base 1 of -10: +base 1 of -1: +base 1 of 0: +base 1 of 10: +base 1 of 100: +base 1 of 1000: +base 1 of 4611686018427387904: +base 2 of -10: 1111111111111111111111111111111111111111111111111111111111110110 +base 2 of -1: 1111111111111111111111111111111111111111111111111111111111111111 +base 2 of 0: 0 +base 2 of 10: 1010 +base 2 of 100: 1100100 +base 2 of 1000: 1111101000 +base 2 of 4611686018427387904: 100000000000000000000000000000000000000000000000000000000000000 +base 3 of -10: 11112220022122120101211020120210210211120 +base 3 of -1: 11112220022122120101211020120210210211220 +base 3 of 0: 0 +base 3 of 10: 101 +base 3 of 100: 10201 +base 3 of 1000: 1101001 +base 3 of 4611686018427387904: 1010201120122220002201001122110012110111 +base 4 of -10: 33333333333333333333333333333312 +base 4 of -1: 33333333333333333333333333333333 +base 4 of 0: 0 +base 4 of 10: 22 +base 4 of 100: 1210 +base 4 of 1000: 33220 +base 4 of 4611686018427387904: 10000000000000000000000000000000 +base 5 of -10: 2214220303114400424121122411 +base 5 of -1: 2214220303114400424121122430 +base 5 of 0: 0 +base 5 of 10: 20 +base 5 of 100: 400 +base 5 of 1000: 13000 +base 5 of 4611686018427387904: 302141200402211214402403104 +base 6 of -10: 3520522010102100444244410 +base 6 of -1: 3520522010102100444244423 +base 6 of 0: 0 +base 6 of 10: 14 +base 6 of 100: 244 +base 6 of 1000: 4344 +base 6 of 4611686018427387904: 550120301313313111041104 +base 7 of -10: 45012021522523134134556 +base 7 of -1: 45012021522523134134601 +base 7 of 0: 0 +base 7 of 10: 13 +base 7 of 100: 202 +base 7 of 1000: 2626 +base 7 of 4611686018427387904: 11154003640456024361134 +base 8 of -10: 01777777777777777777766 +base 8 of -1: 01777777777777777777777 +base 8 of 0: 0 +base 8 of 10: 012 +base 8 of 100: 0144 +base 8 of 1000: 01750 +base 8 of 4611686018427387904: 0400000000000000000000 +base 9 of -10: 145808576354216723746 +base 9 of -1: 145808576354216723756 +base 9 of 0: 0 +base 9 of 10: 11 +base 9 of 100: 121 +base 9 of 1000: 1331 +base 9 of 4611686018427387904: 33646586081048405414 +base 10 of -10: -10 +base 10 of -1: -1 +base 10 of 0: 0 +base 10 of 10: 10 +base 10 of 100: 100 +base 10 of 1000: 1000 +base 10 of 4611686018427387904: 4611686018427387904 +base 11 of -10: 335500516a429071276 +base 11 of -1: 335500516a429071284 +base 11 of 0: 0 +base 11 of 10: a +base 11 of 100: 91 +base 11 of 1000: 82a +base 11 of 4611686018427387904: 9140013181078458a4 +base 12 of -10: 839365134a2a240706 +base 12 of -1: 839365134a2a240713 +base 12 of 0: 0 +base 12 of 10: a +base 12 of 100: 84 +base 12 of 1000: 6b4 +base 12 of 4611686018427387904: 20b3a733a268670194 +base 13 of -10: 219505a9511a867b66 +base 13 of -1: 219505a9511a867b72 +base 13 of 0: 0 +base 13 of 10: a +base 13 of 100: 79 +base 13 of 1000: 5bc +base 13 of 4611686018427387904: 6c1349246a2881c84 +base 14 of -10: 8681049adb03db166 +base 14 of -1: 8681049adb03db171 +base 14 of 0: 0 +base 14 of 10: a +base 14 of 100: 72 +base 14 of 1000: 516 +base 14 of 4611686018427387904: 219038263637dd3c4 +base 15 of -10: 2c1d56b648c6cd106 +base 15 of -1: 2c1d56b648c6cd110 +base 15 of 0: 0 +base 15 of 10: a +base 15 of 100: 6a +base 15 of 1000: 46a +base 15 of 4611686018427387904: a7e8ce189a933404 +base 16 of -10: 0xfffffffffffffff6 +base 16 of -1: 0xffffffffffffffff +base 16 of 0: 0x0 +base 16 of 10: 0xa +base 16 of 100: 0x64 +base 16 of 1000: 0x3e8 +base 16 of 4611686018427387904: 0x4000000000000000 +base 17 of -10: 67979g60f5428008 +base 17 of -1: 67979g60f5428010 +base 17 of 0: 0 +base 17 of 10: a +base 17 of 100: 5f +base 17 of 1000: 37e +base 17 of 4611686018427387904: 1a6a6ca03e10a88d +base 18 of -10: 2d3fgb0b9cg4bd26 +base 18 of -1: 2d3fgb0b9cg4bd2f +base 18 of 0: 0 +base 18 of 10: a +base 18 of 100: 5a +base 18 of 1000: 31a +base 18 of 4611686018427387904: c588bdbfgd12ge4 +base 19 of -10: 141c8786h1ccaag7 +base 19 of -1: 141c8786h1ccaagg +base 19 of 0: 0 +base 19 of 10: a +base 19 of 100: 55 +base 19 of 1000: 2ec +base 19 of 4611686018427387904: 5ecbb6fi9h7ggi9 +base 20 of -10: b53bjh07be4dj06 +base 20 of -1: b53bjh07be4dj0f +base 20 of 0: 0 +base 20 of 10: a +base 20 of 100: 50 +base 20 of 1000: 2a0 +base 20 of 4611686018427387904: 2g5hjj51hib39f4 +base 21 of -10: 5e8g4ggg7g56di6 +base 21 of -1: 5e8g4ggg7g56dif +base 21 of 0: 0 +base 21 of 10: a +base 21 of 100: 4g +base 21 of 1000: 25d +base 21 of 4611686018427387904: 18hjgjjjhebh8f4 +base 22 of -10: 2l4lf104353j8k6 +base 22 of -1: 2l4lf104353j8kf +base 22 of 0: 0 +base 22 of 10: a +base 22 of 100: 4c +base 22 of 1000: 21a +base 22 of 4611686018427387904: g6g95gc0hha7g4 +base 23 of -10: 1ddh88h2782i50j +base 23 of -1: 1ddh88h2782i515 +base 23 of 0: 0 +base 23 of 10: a +base 23 of 100: 48 +base 23 of 1000: 1kb +base 23 of 4611686018427387904: 93a22467dc4chd +base 24 of -10: l12ee5fn0ji1i6 +base 24 of -1: l12ee5fn0ji1if +base 24 of 0: 0 +base 24 of 10: a +base 24 of 100: 44 +base 24 of 1000: 1hg +base 24 of 4611686018427387904: 566ffd9ni4mcag +base 25 of -10: c9c336o0mlb7e6 +base 25 of -1: c9c336o0mlb7ef +base 25 of 0: 0 +base 25 of 10: a +base 25 of 100: 40 +base 25 of 1000: 1f0 +base 25 of 4611686018427387904: 32970kc6bo2kg4 +base 26 of -10: 7b7n2pcniokcg6 +base 26 of -1: 7b7n2pcniokcgf +base 26 of 0: 0 +base 26 of 10: a +base 26 of 100: 3m +base 26 of 1000: 1cc +base 26 of 4611686018427387904: 1m8c769io65344 +base 27 of -10: 4eo8hfam6fllmf +base 27 of -1: 4eo8hfam6fllmo +base 27 of 0: 0 +base 27 of 10: a +base 27 of 100: 3j +base 27 of 1000: 1a1 +base 27 of 4611686018427387904: 13jfho2j1hc5cd +base 28 of -10: 2nc6j26l66rho6 +base 28 of -1: 2nc6j26l66rhof +base 28 of 0: 0 +base 28 of 10: a +base 28 of 100: 3g +base 28 of 1000: 17k +base 28 of 4611686018427387904: jo1ilfj8fkpd4 +base 29 of -10: 1n3rsh11f098re +base 29 of -1: 1n3rsh11f098rn +base 29 of 0: 0 +base 29 of 10: a +base 29 of 100: 3d +base 29 of 1000: 15e +base 29 of 4611686018427387904: d0slim0b029e6 +base 30 of -10: 14l9lkmo30o406 +base 30 of -1: 14l9lkmo30o40f +base 30 of 0: 0 +base 30 of 10: a +base 30 of 100: 3a +base 30 of 1000: 13a +base 30 of 4611686018427387904: 8k9rrkl0ml104 +base 31 of -10: nd075ib45k866 +base 31 of -1: nd075ib45k86f +base 31 of 0: 0 +base 31 of 10: a +base 31 of 100: 37 +base 31 of 1000: 118 +base 31 of 4611686018427387904: 5qfh94i8okhh4 +base 32 of -10: fvvvvvvvvvvvm +base 32 of -1: fvvvvvvvvvvvv +base 32 of 0: 0 +base 32 of 10: a +base 32 of 100: 34 +base 32 of 1000: v8 +base 32 of 4611686018427387904: 4000000000000 +base 33 of -10: b1w8p7j5q9r66 +base 33 of -1: b1w8p7j5q9r6f +base 33 of 0: 0 +base 33 of 10: a +base 33 of 100: 31 +base 33 of 1000: ua +base 33 of 4611686018427387904: 2p826a4q6ivi4 +base 34 of -10: 7orp63sh4dph8 +base 34 of -1: 7orp63sh4dphh +base 34 of 0: 0 +base 34 of 10: a +base 34 of 100: 2w +base 34 of 1000: te +base 34 of 4611686018427387904: 1vnvr0wl9ketu +base 35 of -10: 5g24a25twkwf6 +base 35 of -1: 5g24a25twkwff +base 35 of 0: 0 +base 35 of 10: a +base 35 of 100: 2u +base 35 of 1000: sk +base 35 of 4611686018427387904: 1cqrb9a7gvgu4 +base 36 of -10: 3w5e11264sgs6 +base 36 of -1: 3w5e11264sgsf +base 36 of 0: 0 +base 36 of 10: a +base 36 of 100: 2s +base 36 of 1000: rs +base 36 of 4611686018427387904: z1ci99jj7474 +base 37 of -10: +base 37 of -1: +base 37 of 0: +base 37 of 10: +base 37 of 100: +base 37 of 1000: +base 37 of 4611686018427387904: +base 38 of -10: +base 38 of -1: +base 38 of 0: +base 38 of 10: +base 38 of 100: +base 38 of 1000: +base 38 of 4611686018427387904: +base 39 of -10: +base 39 of -1: +base 39 of 0: +base 39 of 10: +base 39 of 100: +base 39 of 1000: +base 39 of 4611686018427387904: +base 40 of -10: +base 40 of -1: +base 40 of 0: +base 40 of 10: +base 40 of 100: +base 40 of 1000: +base 40 of 4611686018427387904: + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.tolower.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.tolower.d Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,66 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; + + input[i] = "ahi"; + expected[i++] = "ahi"; + + input[i] = "MaHi!"; + expected[i++] = "mahi!"; + + input[i] = " Nase-5"; + expected[i++] = " nase-5"; + + input[i] = "!@#$%"; + expected[i++] = "!@#$%"; + + i = 0; +} + +tick-1ms +/input[i] != NULL && (this->out = tolower(input[i])) != expected[i]/ +{ + printf("expected tolower(\"%s\") to be \"%s\"; found \"%s\"\n", + input[i], expected[i], this->out); + exit(1); +} + +tick-1ms +/input[i] != NULL/ +{ + printf("tolower(\"%s\") is \"%s\", as expected\n", + input[i], expected[i]); +} + +tick-1ms +/input[i++] == NULL/ +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.toupper.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/funcs/tst.toupper.d Wed Jul 18 10:19:06 2012 (r238582) @@ -0,0 +1,66 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:19:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A2FB10656A7; Wed, 18 Jul 2012 10:19:51 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81A828FC14; Wed, 18 Jul 2012 10:19:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAJpH4054643; Wed, 18 Jul 2012 10:19:51 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAJpp0054639; Wed, 18 Jul 2012 10:19:51 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207181019.q6IAJpp0054639@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 10:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238583 - in vendor/illumos/dist: cmd/zdb cmd/zfs cmd/zpool cmd/ztest lib/libnvpair lib/libuutil/common lib/libzfs/common lib/libzpool/common lib/libzpool/common/sys man/man1m X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:19:51 -0000 Author: mm Date: Wed Jul 18 10:19:51 2012 New Revision: 238583 URL: http://svn.freebsd.org/changeset/base/238583 Log: Update vendor/illumos/dist to pre libzfs_core state (zfs part) illumos-gate revision 13742:b6bbdd77139c Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Added: vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c Deleted: vendor/illumos/dist/lib/libzfs/common/libzfs_graph.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/cmd/zpool/zpool_main.c vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/lib/libnvpair/libnvpair.c vendor/illumos/dist/lib/libuutil/common/uu_list.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_config.c vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h vendor/illumos/dist/lib/libzfs/common/libzfs_import.c vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/illumos/dist/lib/libzfs/common/libzfs_status.c vendor/illumos/dist/lib/libzfs/common/libzfs_util.c vendor/illumos/dist/lib/libzpool/common/kernel.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h vendor/illumos/dist/lib/libzpool/common/taskq.c vendor/illumos/dist/man/man1m/zdb.1m vendor/illumos/dist/man/man1m/zfs.1m vendor/illumos/dist/man/man1m/zpool.1m vendor/illumos/dist/man/man1m/zstreamdump.1m Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Wed Jul 18 10:19:06 2012 (r238582) +++ vendor/illumos/dist/cmd/zdb/zdb.c Wed Jul 18 10:19:51 2012 (r238583) @@ -18,8 +18,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -54,6 +56,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -63,7 +66,8 @@ #define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ zio_checksum_table[(idx)].ci_name : "UNKNOWN") #define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ - dmu_ot[(idx)].ot_name : "UNKNOWN") + dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ + dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") #define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) #ifndef lint @@ -102,13 +106,16 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumdibcsDvhL] poolname [object...]\n" - " %s [-div] dataset [object...]\n" - " %s -m [-L] poolname [vdev [metaslab...]]\n" - " %s -R poolname vdev:offset:size[:flags]\n" - " %s -S poolname\n" - " %s -l [-u] device\n" - " %s -C\n\n", + "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " + "poolname [object...]\n" + " %s [-divPA] [-e -p path...] dataset [object...]\n" + " %s -m [-LXFPA] [-t txg] [-e [-p path...]] " + "poolname [vdev [metaslab...]]\n" + " %s -R [-A] [-e [-p path...]] poolname " + "vdev:offset:size[:flags]\n" + " %s -S [-PA] [-e [-p path...]] poolname\n" + " %s -l [-uA] device\n" + " %s -C [-A] [-U config]\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); (void) fprintf(stderr, " Dataset name must include at least one " @@ -150,7 +157,7 @@ usage(void) "has altroot/not in a cachefile\n"); (void) fprintf(stderr, " -p -- use one or more with " "-e to specify path to vdev dir\n"); - (void) fprintf(stderr, " -P print numbers parsable\n"); + (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " @@ -1085,7 +1092,7 @@ dump_dsl_dataset(objset_t *os, uint64_t ASSERT(size == sizeof (*ds)); crtime = ds->ds_creation_time; - zdb_nicenum(ds->ds_used_bytes, used); + zdb_nicenum(ds->ds_referenced_bytes, used); zdb_nicenum(ds->ds_compressed_bytes, compressed); zdb_nicenum(ds->ds_uncompressed_bytes, uncompressed); zdb_nicenum(ds->ds_unique_bytes, unique); @@ -1129,6 +1136,44 @@ dump_dsl_dataset(objset_t *os, uint64_t /* ARGSUSED */ static int +dump_bptree_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) +{ + char blkbuf[BP_SPRINTF_LEN]; + + if (bp->blk_birth != 0) { + sprintf_blkptr(blkbuf, bp); + (void) printf("\t%s\n", blkbuf); + } + return (0); +} + +static void +dump_bptree(objset_t *os, uint64_t obj, char *name) +{ + char bytes[32]; + bptree_phys_t *bt; + dmu_buf_t *db; + + if (dump_opt['d'] < 3) + return; + + VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db)); + bt = db->db_data; + zdb_nicenum(bt->bt_bytes, bytes); + (void) printf("\n %s: %llu datasets, %s\n", + name, (unsigned long long)(bt->bt_end - bt->bt_begin), bytes); + dmu_buf_rele(db, FTAG); + + if (dump_opt['d'] < 5) + return; + + (void) printf("\n"); + + (void) bptree_iterate(os, obj, B_FALSE, dump_bptree_cb, NULL, NULL); +} + +/* ARGSUSED */ +static int dump_bpobj_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) { char blkbuf[BP_SPRINTF_LEN]; @@ -1880,11 +1925,13 @@ typedef struct zdb_blkstats { */ #define ZDB_OT_DEFERRED (DMU_OT_NUMTYPES + 0) #define ZDB_OT_DITTO (DMU_OT_NUMTYPES + 1) -#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 2) +#define ZDB_OT_OTHER (DMU_OT_NUMTYPES + 2) +#define ZDB_OT_TOTAL (DMU_OT_NUMTYPES + 3) static char *zdb_ot_extname[] = { "deferred free", "dedup ditto", + "other", "Total", }; @@ -1965,9 +2012,10 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog type = BP_GET_TYPE(bp); - zdb_count_block(zcb, zilog, bp, type); + zdb_count_block(zcb, zilog, bp, + (type & DMU_OT_NEWTYPE) ? ZDB_OT_OTHER : type); - is_metadata = (BP_GET_LEVEL(bp) != 0 || dmu_ot[type].ot_metadata); + is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)); if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) { int ioerr; @@ -2192,6 +2240,12 @@ dump_block_stats(spa_t *spa) count_block_cb, &zcb, NULL); (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, count_block_cb, &zcb, NULL); + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset, + spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb, + &zcb, NULL)); + } if (dump_opt['c'] > 1) flags |= TRAVERSE_PREFETCH_DATA; @@ -2368,7 +2422,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo } if (BP_IS_HOLE(bp) || BP_GET_CHECKSUM(bp) == ZIO_CHECKSUM_OFF || - BP_GET_LEVEL(bp) > 0 || dmu_ot[BP_GET_TYPE(bp)].ot_metadata) + BP_GET_LEVEL(bp) > 0 || DMU_OT_IS_METADATA(BP_GET_TYPE(bp))) return (0); ddt_key_fill(&zdde_search.zdde_key, bp); @@ -2473,7 +2527,14 @@ dump_zpool(spa_t *spa) dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool frees"); + "Pool snapshot frees"); + } + + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + dump_bptree(spa->spa_meta_objset, + spa->spa_dsl_pool->dp_bptree_obj, + "Pool dataset frees"); } dump_dtl(spa->spa_root_vdev, 0); } Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_main.c Wed Jul 18 10:19:06 2012 (r238582) +++ vendor/illumos/dist/cmd/zfs/zfs_main.c Wed Jul 18 10:19:51 2012 (r238583) @@ -21,6 +21,10 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #include @@ -41,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +56,11 @@ #include #include +#include +#include #include +#include +#include #include "zfs_iter.h" #include "zfs_util.h" @@ -61,7 +70,6 @@ libzfs_handle_t *g_zfs; static FILE *mnttab_file; static char history_str[HIS_MAX_RECORD_LEN]; -const char *pypath = "/usr/lib/zfs/pyzfs.py"; static int zfs_do_clone(int argc, char **argv); static int zfs_do_create(int argc, char **argv); @@ -82,8 +90,10 @@ static int zfs_do_send(int argc, char ** static int zfs_do_receive(int argc, char **argv); static int zfs_do_promote(int argc, char **argv); static int zfs_do_userspace(int argc, char **argv); -static int zfs_do_python(int argc, char **argv); +static int zfs_do_allow(int argc, char **argv); +static int zfs_do_unallow(int argc, char **argv); static int zfs_do_hold(int argc, char **argv); +static int zfs_do_holds(int argc, char **argv); static int zfs_do_release(int argc, char **argv); static int zfs_do_diff(int argc, char **argv); @@ -131,7 +141,7 @@ typedef enum { HELP_HOLD, HELP_HOLDS, HELP_RELEASE, - HELP_DIFF + HELP_DIFF, } zfs_help_t; typedef struct zfs_command { @@ -176,12 +186,12 @@ static zfs_command_t command_table[] = { { "send", zfs_do_send, HELP_SEND }, { "receive", zfs_do_receive, HELP_RECEIVE }, { NULL }, - { "allow", zfs_do_python, HELP_ALLOW }, + { "allow", zfs_do_allow, HELP_ALLOW }, { NULL }, - { "unallow", zfs_do_python, HELP_UNALLOW }, + { "unallow", zfs_do_unallow, HELP_UNALLOW }, { NULL }, { "hold", zfs_do_hold, HELP_HOLD }, - { "holds", zfs_do_python, HELP_HOLDS }, + { "holds", zfs_do_holds, HELP_HOLDS }, { "release", zfs_do_release, HELP_RELEASE }, { "diff", zfs_do_diff, HELP_DIFF }, }; @@ -203,11 +213,13 @@ get_usage(zfs_help_t idx) "\tcreate [-ps] [-b blocksize] [-o property=value] ... " "-V \n")); case HELP_DESTROY: - return (gettext("\tdestroy [-rRf] \n" - "\tdestroy [-rRd] \n")); + return (gettext("\tdestroy [-fnpRrv] \n" + "\tdestroy [-dnpRrv] " + "@[%][,...]\n")); case HELP_GET: return (gettext("\tget [-rHp] [-d max] " - "[-o \"all\" | field[,...]] [-s source[,...]]\n" + "[-o \"all\" | field[,...]] [-t type[,...]] " + "[-s source[,...]]\n" "\t <\"all\" | property[,...]> " "[filesystem|volume|snapshot] ...\n")); case HELP_INHERIT: @@ -231,14 +243,15 @@ get_usage(zfs_help_t idx) "snapshot>\n" "\treceive [-vnFu] [-d | -e] \n")); case HELP_RENAME: - return (gettext("\trename " + return (gettext("\trename [-f] " "\n" - "\trename -p \n" + "\trename [-f] -p \n" "\trename -r ")); case HELP_ROLLBACK: return (gettext("\trollback [-rRf] \n")); case HELP_SEND: - return (gettext("\tsend [-RDp] [-[iI] snapshot] \n")); + return (gettext("\tsend [-DnPpRrv] [-[iI] snapshot] " + "\n")); case HELP_SET: return (gettext("\tset " " ...\n")); @@ -417,6 +430,8 @@ usage(boolean_t requested) (void) fprintf(fp, "YES NO | none\n"); (void) fprintf(fp, "\t%-15s ", "groupquota@..."); (void) fprintf(fp, "YES NO | none\n"); + (void) fprintf(fp, "\t%-15s ", "written@"); + (void) fprintf(fp, " NO NO \n"); (void) fprintf(fp, gettext("\nSizes are specified in bytes " "with standard units such as K, M, G, etc.\n")); @@ -562,7 +577,7 @@ zfs_do_clone(int argc, char **argv) zfs_handle_t *zhp = NULL; boolean_t parents = B_FALSE; nvlist_t *props; - int ret; + int ret = 0; int c; if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) @@ -729,7 +744,6 @@ zfs_do_create(int argc, char **argv) (void) fprintf(stderr, gettext("missing size " "argument\n")); goto badusage; - break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -862,15 +876,23 @@ badusage: */ typedef struct destroy_cbdata { boolean_t cb_first; - int cb_force; - int cb_recurse; - int cb_error; - int cb_needforce; - int cb_doclones; - boolean_t cb_closezhp; + boolean_t cb_force; + boolean_t cb_recurse; + boolean_t cb_error; + boolean_t cb_doclones; zfs_handle_t *cb_target; - char *cb_snapname; boolean_t cb_defer_destroy; + boolean_t cb_verbose; + boolean_t cb_parsable; + boolean_t cb_dryrun; + nvlist_t *cb_nvl; + + /* first snap in contiguous run */ + zfs_handle_t *cb_firstsnap; + /* previous snap in contiguous run */ + zfs_handle_t *cb_prevsnap; + int64_t cb_snapused; + char *cb_snapspec; } destroy_cbdata_t; /* @@ -900,7 +922,7 @@ destroy_check_dependent(zfs_handle_t *zh (void) fprintf(stderr, gettext("use '-r' to destroy " "the following datasets:\n")); cbp->cb_first = B_FALSE; - cbp->cb_error = 1; + cbp->cb_error = B_TRUE; } (void) fprintf(stderr, "%s\n", zfs_get_name(zhp)); @@ -921,7 +943,8 @@ destroy_check_dependent(zfs_handle_t *zh (void) fprintf(stderr, gettext("use '-R' to destroy " "the following datasets:\n")); cbp->cb_first = B_FALSE; - cbp->cb_error = 1; + cbp->cb_error = B_TRUE; + cbp->cb_dryrun = B_TRUE; } (void) fprintf(stderr, "%s\n", zfs_get_name(zhp)); @@ -935,7 +958,20 @@ out: static int destroy_callback(zfs_handle_t *zhp, void *data) { - destroy_cbdata_t *cbp = data; + destroy_cbdata_t *cb = data; + const char *name = zfs_get_name(zhp); + + if (cb->cb_verbose) { + if (cb->cb_parsable) { + (void) printf("destroy\t%s\n", name); + } else if (cb->cb_dryrun) { + (void) printf(gettext("would destroy %s\n"), + name); + } else { + (void) printf(gettext("will destroy %s\n"), + name); + } + } /* * Ignore pools (which we've already flagged as an error before getting @@ -947,13 +983,12 @@ destroy_callback(zfs_handle_t *zhp, void return (0); } - /* - * Bail out on the first error. - */ - if (zfs_unmount(zhp, NULL, cbp->cb_force ? MS_FORCE : 0) != 0 || - zfs_destroy(zhp, cbp->cb_defer_destroy) != 0) { - zfs_close(zhp); - return (-1); + if (!cb->cb_dryrun) { + if (zfs_unmount(zhp, NULL, cb->cb_force ? MS_FORCE : 0) != 0 || + zfs_destroy(zhp, cb->cb_defer_destroy) != 0) { + zfs_close(zhp); + return (-1); + } } zfs_close(zhp); @@ -961,39 +996,142 @@ destroy_callback(zfs_handle_t *zhp, void } static int -destroy_snap_clones(zfs_handle_t *zhp, void *arg) +destroy_print_cb(zfs_handle_t *zhp, void *arg) { - destroy_cbdata_t *cbp = arg; - char thissnap[MAXPATHLEN]; - zfs_handle_t *szhp; - boolean_t closezhp = cbp->cb_closezhp; - int rv; + destroy_cbdata_t *cb = arg; + const char *name = zfs_get_name(zhp); + int err = 0; - (void) snprintf(thissnap, sizeof (thissnap), - "%s@%s", zfs_get_name(zhp), cbp->cb_snapname); + if (nvlist_exists(cb->cb_nvl, name)) { + if (cb->cb_firstsnap == NULL) + cb->cb_firstsnap = zfs_handle_dup(zhp); + if (cb->cb_prevsnap != NULL) + zfs_close(cb->cb_prevsnap); + /* this snap continues the current range */ + cb->cb_prevsnap = zfs_handle_dup(zhp); + if (cb->cb_verbose) { + if (cb->cb_parsable) { + (void) printf("destroy\t%s\n", name); + } else if (cb->cb_dryrun) { + (void) printf(gettext("would destroy %s\n"), + name); + } else { + (void) printf(gettext("will destroy %s\n"), + name); + } + } + } else if (cb->cb_firstsnap != NULL) { + /* end of this range */ + uint64_t used = 0; + err = zfs_get_snapused_int(cb->cb_firstsnap, + cb->cb_prevsnap, &used); + cb->cb_snapused += used; + zfs_close(cb->cb_firstsnap); + cb->cb_firstsnap = NULL; + zfs_close(cb->cb_prevsnap); + cb->cb_prevsnap = NULL; + } + zfs_close(zhp); + return (err); +} - libzfs_print_on_error(g_zfs, B_FALSE); - szhp = zfs_open(g_zfs, thissnap, ZFS_TYPE_SNAPSHOT); - libzfs_print_on_error(g_zfs, B_TRUE); - if (szhp) { - /* - * Destroy any clones of this snapshot - */ - if (zfs_iter_dependents(szhp, B_FALSE, destroy_callback, - cbp) != 0) { - zfs_close(szhp); - if (closezhp) - zfs_close(zhp); - return (-1); +static int +destroy_print_snapshots(zfs_handle_t *fs_zhp, destroy_cbdata_t *cb) +{ + int err = 0; + assert(cb->cb_firstsnap == NULL); + assert(cb->cb_prevsnap == NULL); + err = zfs_iter_snapshots_sorted(fs_zhp, destroy_print_cb, cb); + if (cb->cb_firstsnap != NULL) { + uint64_t used = 0; + if (err == 0) { + err = zfs_get_snapused_int(cb->cb_firstsnap, + cb->cb_prevsnap, &used); } - zfs_close(szhp); + cb->cb_snapused += used; + zfs_close(cb->cb_firstsnap); + cb->cb_firstsnap = NULL; + zfs_close(cb->cb_prevsnap); + cb->cb_prevsnap = NULL; } + return (err); +} - cbp->cb_closezhp = B_TRUE; - rv = zfs_iter_filesystems(zhp, destroy_snap_clones, arg); - if (closezhp) - zfs_close(zhp); - return (rv); +static int +snapshot_to_nvl_cb(zfs_handle_t *zhp, void *arg) +{ + destroy_cbdata_t *cb = arg; + int err = 0; + + /* Check for clones. */ + if (!cb->cb_doclones) { + cb->cb_target = zhp; + cb->cb_first = B_TRUE; + err = zfs_iter_dependents(zhp, B_TRUE, + destroy_check_dependent, cb); + } + + if (err == 0) { + if (nvlist_add_boolean(cb->cb_nvl, zfs_get_name(zhp))) + nomem(); + } + zfs_close(zhp); + return (err); +} + +static int +gather_snapshots(zfs_handle_t *zhp, void *arg) +{ + destroy_cbdata_t *cb = arg; + int err = 0; + + err = zfs_iter_snapspec(zhp, cb->cb_snapspec, snapshot_to_nvl_cb, cb); + if (err == ENOENT) + err = 0; + if (err != 0) + goto out; + + if (cb->cb_verbose) { + err = destroy_print_snapshots(zhp, cb); + if (err != 0) + goto out; + } + + if (cb->cb_recurse) + err = zfs_iter_filesystems(zhp, gather_snapshots, cb); + +out: + zfs_close(zhp); + return (err); +} + +static int +destroy_clones(destroy_cbdata_t *cb) +{ + nvpair_t *pair; + for (pair = nvlist_next_nvpair(cb->cb_nvl, NULL); + pair != NULL; + pair = nvlist_next_nvpair(cb->cb_nvl, pair)) { + zfs_handle_t *zhp = zfs_open(g_zfs, nvpair_name(pair), + ZFS_TYPE_SNAPSHOT); + if (zhp != NULL) { + boolean_t defer = cb->cb_defer_destroy; + int err = 0; + + /* + * We can't defer destroy non-snapshots, so set it to + * false while destroying the clones. + */ + cb->cb_defer_destroy = B_FALSE; + err = zfs_iter_dependents(zhp, B_FALSE, + destroy_callback, cb); + cb->cb_defer_destroy = defer; + zfs_close(zhp); + if (err != 0) + return (err); + } + } + return (0); } static int @@ -1002,25 +1140,35 @@ zfs_do_destroy(int argc, char **argv) destroy_cbdata_t cb = { 0 }; int c; zfs_handle_t *zhp; - char *cp; + char *at; zfs_type_t type = ZFS_TYPE_DATASET; /* check options */ - while ((c = getopt(argc, argv, "dfrR")) != -1) { + while ((c = getopt(argc, argv, "vpndfrR")) != -1) { switch (c) { + case 'v': + cb.cb_verbose = B_TRUE; + break; + case 'p': + cb.cb_verbose = B_TRUE; + cb.cb_parsable = B_TRUE; + break; + case 'n': + cb.cb_dryrun = B_TRUE; + break; case 'd': cb.cb_defer_destroy = B_TRUE; type = ZFS_TYPE_SNAPSHOT; break; case 'f': - cb.cb_force = 1; + cb.cb_force = B_TRUE; break; case 'r': - cb.cb_recurse = 1; + cb.cb_recurse = B_TRUE; break; case 'R': - cb.cb_recurse = 1; - cb.cb_doclones = 1; + cb.cb_recurse = B_TRUE; + cb.cb_doclones = B_TRUE; break; case '?': default: @@ -1035,7 +1183,7 @@ zfs_do_destroy(int argc, char **argv) /* check number of arguments */ if (argc == 0) { - (void) fprintf(stderr, gettext("missing path argument\n")); + (void) fprintf(stderr, gettext("missing dataset argument\n")); usage(B_FALSE); } if (argc > 1) { @@ -1043,91 +1191,117 @@ zfs_do_destroy(int argc, char **argv) usage(B_FALSE); } - /* - * If we are doing recursive destroy of a snapshot, then the - * named snapshot may not exist. Go straight to libzfs. - */ - if (cb.cb_recurse && (cp = strchr(argv[0], '@'))) { - int ret; + at = strchr(argv[0], '@'); + if (at != NULL) { + int err = 0; + + /* Build the list of snaps to destroy in cb_nvl. */ + if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) + nomem(); - *cp = '\0'; - if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_DATASET)) == NULL) + *at = '\0'; + zhp = zfs_open(g_zfs, argv[0], + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME); + if (zhp == NULL) return (1); - *cp = '@'; - cp++; - if (cb.cb_doclones) { - boolean_t defer = cb.cb_defer_destroy; + cb.cb_snapspec = at + 1; + if (gather_snapshots(zfs_handle_dup(zhp), &cb) != 0 || + cb.cb_error) { + zfs_close(zhp); + nvlist_free(cb.cb_nvl); + return (1); + } - /* - * Temporarily ignore the defer_destroy setting since - * it's not supported for clones. - */ - cb.cb_defer_destroy = B_FALSE; - cb.cb_snapname = cp; - if (destroy_snap_clones(zhp, &cb) != 0) { - zfs_close(zhp); - return (1); + if (nvlist_empty(cb.cb_nvl)) { + (void) fprintf(stderr, gettext("could not find any " + "snapshots to destroy; check snapshot names.\n")); + zfs_close(zhp); + nvlist_free(cb.cb_nvl); + return (1); + } + + if (cb.cb_verbose) { + char buf[16]; + zfs_nicenum(cb.cb_snapused, buf, sizeof (buf)); + if (cb.cb_parsable) { + (void) printf("reclaim\t%llu\n", + cb.cb_snapused); + } else if (cb.cb_dryrun) { + (void) printf(gettext("would reclaim %s\n"), + buf); + } else { + (void) printf(gettext("will reclaim %s\n"), + buf); } - cb.cb_defer_destroy = defer; } - ret = zfs_destroy_snaps(zhp, cp, cb.cb_defer_destroy); - zfs_close(zhp); - if (ret) { - (void) fprintf(stderr, - gettext("no snapshots destroyed\n")); + if (!cb.cb_dryrun) { + if (cb.cb_doclones) + err = destroy_clones(&cb); + if (err == 0) { + err = zfs_destroy_snaps_nvl(zhp, cb.cb_nvl, + cb.cb_defer_destroy); + } } - return (ret != 0); - } - /* Open the given dataset */ - if ((zhp = zfs_open(g_zfs, argv[0], type)) == NULL) - return (1); + zfs_close(zhp); + nvlist_free(cb.cb_nvl); + if (err != 0) + return (1); + } else { + /* Open the given dataset */ + if ((zhp = zfs_open(g_zfs, argv[0], type)) == NULL) + return (1); - cb.cb_target = zhp; + cb.cb_target = zhp; - /* - * Perform an explicit check for pools before going any further. - */ - if (!cb.cb_recurse && strchr(zfs_get_name(zhp), '/') == NULL && - zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) { - (void) fprintf(stderr, gettext("cannot destroy '%s': " - "operation does not apply to pools\n"), - zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use 'zfs destroy -r " - "%s' to destroy all datasets in the pool\n"), - zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use 'zpool destroy %s' " - "to destroy the pool itself\n"), zfs_get_name(zhp)); - zfs_close(zhp); - return (1); - } + /* + * Perform an explicit check for pools before going any further. + */ + if (!cb.cb_recurse && strchr(zfs_get_name(zhp), '/') == NULL && + zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) { + (void) fprintf(stderr, gettext("cannot destroy '%s': " + "operation does not apply to pools\n"), + zfs_get_name(zhp)); + (void) fprintf(stderr, gettext("use 'zfs destroy -r " + "%s' to destroy all datasets in the pool\n"), + zfs_get_name(zhp)); + (void) fprintf(stderr, gettext("use 'zpool destroy %s' " + "to destroy the pool itself\n"), zfs_get_name(zhp)); + zfs_close(zhp); + return (1); + } - /* - * Check for any dependents and/or clones. - */ - cb.cb_first = B_TRUE; - if (!cb.cb_doclones && !cb.cb_defer_destroy && - zfs_iter_dependents(zhp, B_TRUE, destroy_check_dependent, - &cb) != 0) { - zfs_close(zhp); - return (1); - } + /* + * Check for any dependents and/or clones. + */ + cb.cb_first = B_TRUE; + if (!cb.cb_doclones && + zfs_iter_dependents(zhp, B_TRUE, destroy_check_dependent, + &cb) != 0) { + zfs_close(zhp); + return (1); + } - if (cb.cb_error || (!cb.cb_defer_destroy && - (zfs_iter_dependents(zhp, B_FALSE, destroy_callback, &cb) != 0))) { - zfs_close(zhp); - return (1); - } + if (cb.cb_error) { + zfs_close(zhp); + return (1); + } - /* - * Do the real thing. The callback will close the handle regardless of - * whether it succeeds or not. - */ + if (zfs_iter_dependents(zhp, B_FALSE, destroy_callback, + &cb) != 0) { + zfs_close(zhp); + return (1); + } - if (destroy_callback(zhp, &cb) != 0) - return (1); + /* + * Do the real thing. The callback will close the + * handle regardless of whether it succeeds or not. + */ + if (destroy_callback(zhp, &cb) != 0) + return (1); + } return (0); } @@ -1229,6 +1403,17 @@ get_callback(zfs_handle_t *zhp, void *da zprop_print_one_property(zfs_get_name(zhp), cbp, pl->pl_user_prop, buf, sourcetype, source, NULL); + } else if (zfs_prop_written(pl->pl_user_prop)) { + sourcetype = ZPROP_SRC_LOCAL; + + if (zfs_prop_get_written(zhp, pl->pl_user_prop, + buf, sizeof (buf), cbp->cb_literal) != 0) { + sourcetype = ZPROP_SRC_NONE; + (void) strlcpy(buf, "-", sizeof (buf)); + } + + zprop_print_one_property(zfs_get_name(zhp), cbp, + pl->pl_user_prop, buf, sourcetype, source, NULL); } else { if (nvlist_lookup_nvlist(user_props, pl->pl_user_prop, &propval) != 0) { @@ -1273,9 +1458,10 @@ static int zfs_do_get(int argc, char **argv) { zprop_get_cbdata_t cb = { 0 }; - int i, c, flags = 0; + int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; + int types = ZFS_TYPE_DATASET; char *value, *fields; - int ret; + int ret = 0; int limit = 0; zprop_list_t fake_name = { 0 }; @@ -1290,7 +1476,7 @@ zfs_do_get(int argc, char **argv) cb.cb_type = ZFS_TYPE_DATASET; /* check options */ - while ((c = getopt(argc, argv, ":d:o:s:rHp")) != -1) { + while ((c = getopt(argc, argv, ":d:o:s:rt:Hp")) != -1) { switch (c) { case 'p': cb.cb_literal = B_TRUE; @@ -1408,6 +1594,37 @@ zfs_do_get(int argc, char **argv) } break; + case 't': + types = 0; + flags &= ~ZFS_ITER_PROP_LISTSNAPS; + while (*optarg != '\0') { + static char *type_subopts[] = { "filesystem", + "volume", "snapshot", "all", NULL }; + + switch (getsubopt(&optarg, type_subopts, + &value)) { + case 0: + types |= ZFS_TYPE_FILESYSTEM; + break; + case 1: + types |= ZFS_TYPE_VOLUME; + break; + case 2: + types |= ZFS_TYPE_SNAPSHOT; + break; + case 3: + types = ZFS_TYPE_DATASET; + break; + + default: + (void) fprintf(stderr, + gettext("invalid type '%s'\n"), + value); + usage(B_FALSE); + } + } + break; + case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -1451,7 +1668,7 @@ zfs_do_get(int argc, char **argv) cb.cb_first = B_TRUE; /* run for each object */ - ret = zfs_for_each(argc, argv, flags, ZFS_TYPE_DATASET, NULL, + ret = zfs_for_each(argc, argv, flags, types, NULL, &cb.cb_proplist, limit, get_callback, &cb); if (cb.cb_proplist == &fake_name) @@ -1512,7 +1729,7 @@ zfs_do_inherit(int argc, char **argv) zfs_prop_t prop; inherit_cbdata_t cb = { 0 }; char *propname; - int ret; + int ret = 0; int flags = 0; boolean_t received = B_FALSE; @@ -1718,7 +1935,7 @@ zfs_do_upgrade(int argc, char **argv) { boolean_t all = B_FALSE; boolean_t showversions = B_FALSE; - int ret; + int ret = 0; upgrade_cbdata_t cb = { 0 }; char c; int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -1773,8 +1990,8 @@ zfs_do_upgrade(int argc, char **argv) "---------------\n"); (void) printf(gettext(" 1 Initial ZFS filesystem version\n")); (void) printf(gettext(" 2 Enhanced directory entries\n")); - (void) printf(gettext(" 3 Case insensitive and File system " - "unique identifier (FUID)\n")); + (void) printf(gettext(" 3 Case insensitive and filesystem " + "user identifier (FUID)\n")); (void) printf(gettext(" 4 userquota, groupquota " "properties\n")); (void) printf(gettext(" 5 System attributes\n")); @@ -1823,87 +2040,727 @@ zfs_do_upgrade(int argc, char **argv) return (ret); } +#define USTYPE_USR_BIT (0) +#define USTYPE_GRP_BIT (1) +#define USTYPE_PSX_BIT (2) +#define USTYPE_SMB_BIT (3) + +#define USTYPE_USR (1 << USTYPE_USR_BIT) +#define USTYPE_GRP (1 << USTYPE_GRP_BIT) + +#define USTYPE_PSX (1 << USTYPE_PSX_BIT) +#define USTYPE_SMB (1 << USTYPE_SMB_BIT) + +#define USTYPE_PSX_USR (USTYPE_PSX | USTYPE_USR) +#define USTYPE_SMB_USR (USTYPE_SMB | USTYPE_USR) +#define USTYPE_PSX_GRP (USTYPE_PSX | USTYPE_GRP) +#define USTYPE_SMB_GRP (USTYPE_SMB | USTYPE_GRP) +#define USTYPE_ALL (USTYPE_PSX_USR | USTYPE_SMB_USR \ + | USTYPE_PSX_GRP | USTYPE_SMB_GRP) + + +#define USPROP_USED_BIT (0) +#define USPROP_QUOTA_BIT (1) + +#define USPROP_USED (1 << USPROP_USED_BIT) +#define USPROP_QUOTA (1 << USPROP_QUOTA_BIT) + +typedef struct us_node { + nvlist_t *usn_nvl; + uu_avl_node_t usn_avlnode; + uu_list_node_t usn_listnode; +} us_node_t; + +typedef struct us_cbdata { + nvlist_t **cb_nvlp; + uu_avl_pool_t *cb_avl_pool; + uu_avl_t *cb_avl; + boolean_t cb_numname; + boolean_t cb_nicenum; + boolean_t cb_sid2posix; + zfs_userquota_prop_t cb_prop; + zfs_sort_column_t *cb_sortcol; + size_t cb_max_typelen; + size_t cb_max_namelen; + size_t cb_max_usedlen; + size_t cb_max_quotalen; +} us_cbdata_t; + +typedef struct { + zfs_sort_column_t *si_sortcol; + boolean_t si_num_name; + boolean_t si_parsable; +} us_sort_info_t; + +static int +us_compare(const void *larg, const void *rarg, void *unused) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:24:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BA0B106566B; Wed, 18 Jul 2012 10:24:48 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F18B58FC15; Wed, 18 Jul 2012 10:24:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAOlPK055070; Wed, 18 Jul 2012 10:24:47 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAOlUh055069; Wed, 18 Jul 2012 10:24:47 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207181024.q6IAOlUh055069@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 10:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238584 - vendor-sys/illumos/20120614 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:24:48 -0000 Author: mm Date: Wed Jul 18 10:24:47 2012 New Revision: 238584 URL: http://svn.freebsd.org/changeset/base/238584 Log: Tag vendor-sys/illumos as 20120614 (illumos-gate 13742:b6bbdd77139c) Added: vendor-sys/illumos/20120614/ - copied from r238580, vendor-sys/illumos/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:26:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CF141065673; Wed, 18 Jul 2012 10:26:51 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF678FC15; Wed, 18 Jul 2012 10:26:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAQps5055269; Wed, 18 Jul 2012 10:26:51 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAQo93055268; Wed, 18 Jul 2012 10:26:50 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207181026.q6IAQo93055268@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 10:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238585 - vendor/illumos/20120614 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:26:51 -0000 Author: mm Date: Wed Jul 18 10:26:50 2012 New Revision: 238585 URL: http://svn.freebsd.org/changeset/base/238585 Log: Tag vendor/illumos/dist as 20120614 (illumos-gate 13742:b6bbdd77139c) Added: vendor/illumos/20120614/ - copied from r238584, vendor/illumos/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:42:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1451C106566C; Wed, 18 Jul 2012 10:42:31 +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 F2C2B8FC1E; Wed, 18 Jul 2012 10:42:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAgUi9056400; Wed, 18 Jul 2012 10:42:30 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAgUS0056398; Wed, 18 Jul 2012 10:42:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207181042.q6IAgUS0056398@svn.freebsd.org> From: Christian Brueffer Date: Wed, 18 Jul 2012 10:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238586 - stable/9/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:42:31 -0000 Author: brueffer Date: Wed Jul 18 10:42:30 2012 New Revision: 238586 URL: http://svn.freebsd.org/changeset/base/238586 Log: MFC: r238486 Fix typo in a message. Approved by: re (hrs) Modified: stable/9/sys/dev/isp/isp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/dev/isp/isp.c ============================================================================== --- stable/9/sys/dev/isp/isp.c Wed Jul 18 10:26:50 2012 (r238585) +++ stable/9/sys/dev/isp/isp.c Wed Jul 18 10:42:30 2012 (r238586) @@ -2142,7 +2142,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin goto out; } else if (plp->plogx_status != PLOGX_STATUS_IOCBERR) { isp_prt(isp, ISP_LOGWARN, - "status 0x%x on port login IOCB chanel %d", + "status 0x%x on port login IOCB channel %d", plp->plogx_status, chan); rval = -1; goto out; From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:42:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 230431065680; Wed, 18 Jul 2012 10:42:44 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CBFF8FC16; Wed, 18 Jul 2012 10:42:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAghTi056451; Wed, 18 Jul 2012 10:42:43 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAghYO056450; Wed, 18 Jul 2012 10:42:43 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207181042.q6IAghYO056450@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 10:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238587 - vendor/illumos/dist/cmd/zhack X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:42:44 -0000 Author: mm Date: Wed Jul 18 10:42:43 2012 New Revision: 238587 URL: http://svn.freebsd.org/changeset/base/238587 Log: Add zhack command missing from vendor import illumos-gate revision 13742:b6bbdd77139c Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Added: vendor/illumos/dist/cmd/zhack/ vendor/illumos/dist/cmd/zhack/zhack.c Added: vendor/illumos/dist/cmd/zhack/zhack.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/zhack/zhack.c Wed Jul 18 10:42:43 2012 (r238587) @@ -0,0 +1,533 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * zhack is a debugging tool that can write changes to ZFS pool using libzpool + * for testing purposes. Altering pools with zhack is unsupported and may + * result in corrupted pools. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#undef ZFS_MAXNAMELEN +#undef verify +#include + +extern boolean_t zfeature_checks_disable; + +const char cmdname[] = "zhack"; +libzfs_handle_t *g_zfs; +static importargs_t g_importargs; +static char *g_pool; +static boolean_t g_readonly; + +static void +usage(void) +{ + (void) fprintf(stderr, + "Usage: %s [-c cachefile] [-d dir] ...\n" + "where is one of the following:\n" + "\n", cmdname); + + (void) fprintf(stderr, + " feature stat \n" + " print information about enabled features\n" + " feature enable [-d desc] \n" + " add a new enabled feature to the pool\n" + " -d sets the feature's description\n" + " feature ref [-md] \n" + " change the refcount on the given feature\n" + " -d decrease instead of increase the refcount\n" + " -m add the feature to the label if increasing refcount\n" + "\n" + " : should be a feature guid\n"); + exit(1); +} + + +static void +fatal(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + (void) fprintf(stderr, "%s: ", cmdname); + (void) vfprintf(stderr, fmt, ap); + va_end(ap); + (void) fprintf(stderr, "\n"); + + exit(1); +} + +/* ARGSUSED */ +static int +space_delta_cb(dmu_object_type_t bonustype, void *data, + uint64_t *userp, uint64_t *groupp) +{ + /* + * Is it a valid type of object to track? + */ + if (bonustype != DMU_OT_ZNODE && bonustype != DMU_OT_SA) + return (ENOENT); + (void) fprintf(stderr, "modifying object that needs user accounting"); + abort(); + /* NOTREACHED */ +} + +/* + * Target is the dataset whose pool we want to open. + */ +static void +import_pool(const char *target, boolean_t readonly) +{ + nvlist_t *config; + nvlist_t *pools; + int error; + char *sepp; + spa_t *spa; + nvpair_t *elem; + nvlist_t *props; + const char *name; + + kernel_init(readonly ? FREAD : (FREAD | FWRITE)); + g_zfs = libzfs_init(); + ASSERT(g_zfs != NULL); + + dmu_objset_register_type(DMU_OST_ZFS, space_delta_cb); + + g_readonly = readonly; + + /* + * If we only want readonly access, it's OK if we find + * a potentially-active (ie, imported into the kernel) pool from the + * default cachefile. + */ + if (readonly && spa_open(target, &spa, FTAG) == 0) { + spa_close(spa, FTAG); + return; + } + + g_importargs.unique = B_TRUE; + g_importargs.can_be_active = readonly; + g_pool = strdup(target); + if ((sepp = strpbrk(g_pool, "/@")) != NULL) + *sepp = '\0'; + g_importargs.poolname = g_pool; + pools = zpool_search_import(g_zfs, &g_importargs); + + if (pools == NULL || nvlist_next_nvpair(pools, NULL) == NULL) { + if (!g_importargs.can_be_active) { + g_importargs.can_be_active = B_TRUE; + if (zpool_search_import(g_zfs, &g_importargs) != NULL || + spa_open(target, &spa, FTAG) == 0) { + fatal("cannot import '%s': pool is active; run " + "\"zpool export %s\" first\n", + g_pool, g_pool); + } + } + + fatal("cannot import '%s': no such pool available\n", g_pool); + } + + elem = nvlist_next_nvpair(pools, NULL); + name = nvpair_name(elem); + verify(nvpair_value_nvlist(elem, &config) == 0); + + props = NULL; + if (readonly) { + verify(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0); + verify(nvlist_add_uint64(props, + zpool_prop_to_name(ZPOOL_PROP_READONLY), 1) == 0); + } + + zfeature_checks_disable = B_TRUE; + error = spa_import(name, config, props, ZFS_IMPORT_NORMAL); + zfeature_checks_disable = B_FALSE; + if (error == EEXIST) + error = 0; + + if (error) + fatal("can't import '%s': %s", name, strerror(error)); +} + +static void +zhack_spa_open(const char *target, boolean_t readonly, void *tag, spa_t **spa) +{ + int err; + + import_pool(target, readonly); + + zfeature_checks_disable = B_TRUE; + err = spa_open(target, spa, tag); + zfeature_checks_disable = B_FALSE; + + if (err != 0) + fatal("cannot open '%s': %s", target, strerror(err)); + if (spa_version(*spa) < SPA_VERSION_FEATURES) { + fatal("'%s' has version %d, features not enabled", target, + (int)spa_version(*spa)); + } +} + +static void +dump_obj(objset_t *os, uint64_t obj, const char *name) +{ + zap_cursor_t zc; + zap_attribute_t za; + + (void) printf("%s_obj:\n", name); + + for (zap_cursor_init(&zc, os, obj); + zap_cursor_retrieve(&zc, &za) == 0; + zap_cursor_advance(&zc)) { + if (za.za_integer_length == 8) { + ASSERT(za.za_num_integers == 1); + (void) printf("\t%s = %llu\n", + za.za_name, (u_longlong_t)za.za_first_integer); + } else { + ASSERT(za.za_integer_length == 1); + char val[1024]; + VERIFY(zap_lookup(os, obj, za.za_name, + 1, sizeof (val), val) == 0); + (void) printf("\t%s = %s\n", za.za_name, val); + } + } + zap_cursor_fini(&zc); +} + +static void +dump_mos(spa_t *spa) +{ + nvlist_t *nv = spa->spa_label_features; + + (void) printf("label config:\n"); + for (nvpair_t *pair = nvlist_next_nvpair(nv, NULL); + pair != NULL; + pair = nvlist_next_nvpair(nv, pair)) { + (void) printf("\t%s\n", nvpair_name(pair)); + } +} + +static void +zhack_do_feature_stat(int argc, char **argv) +{ + spa_t *spa; + objset_t *os; + char *target; + + argc--; + argv++; + + if (argc < 1) { + (void) fprintf(stderr, "error: missing pool name\n"); + usage(); + } + target = argv[0]; + + zhack_spa_open(target, B_TRUE, FTAG, &spa); + os = spa->spa_meta_objset; + + dump_obj(os, spa->spa_feat_for_read_obj, "for_read"); + dump_obj(os, spa->spa_feat_for_write_obj, "for_write"); + dump_obj(os, spa->spa_feat_desc_obj, "descriptions"); + dump_mos(spa); + + spa_close(spa, FTAG); +} + +static void +feature_enable_sync(void *arg1, void *arg2, dmu_tx_t *tx) +{ + spa_t *spa = arg1; + zfeature_info_t *feature = arg2; + + spa_feature_enable(spa, feature, tx); +} + +static void +zhack_do_feature_enable(int argc, char **argv) +{ + char c; + char *desc, *target; + spa_t *spa; + objset_t *mos; + zfeature_info_t feature; + zfeature_info_t *nodeps[] = { NULL }; + + /* + * Features are not added to the pool's label until their refcounts + * are incremented, so fi_mos can just be left as false for now. + */ + desc = NULL; + feature.fi_uname = "zhack"; + feature.fi_mos = B_FALSE; + feature.fi_can_readonly = B_FALSE; + feature.fi_depends = nodeps; + + optind = 1; + while ((c = getopt(argc, argv, "rmd:")) != -1) { + switch (c) { + case 'r': + feature.fi_can_readonly = B_TRUE; + break; + case 'd': + desc = strdup(optarg); + break; + default: + usage(); + break; + } + } + + if (desc == NULL) + desc = strdup("zhack injected"); + feature.fi_desc = desc; + + argc -= optind; + argv += optind; + + if (argc < 2) { + (void) fprintf(stderr, "error: missing feature or pool name\n"); + usage(); + } + target = argv[0]; + feature.fi_guid = argv[1]; + + if (!zfeature_is_valid_guid(feature.fi_guid)) + fatal("invalid feature guid: %s", feature.fi_guid); + + zhack_spa_open(target, B_FALSE, FTAG, &spa); + mos = spa->spa_meta_objset; + + if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) + fatal("'%s' is a real feature, will not enable"); + if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid)) + fatal("feature already enabled: %s", feature.fi_guid); + + VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL, + feature_enable_sync, spa, &feature, 5)); + + spa_close(spa, FTAG); + + free(desc); +} + +static void +feature_incr_sync(void *arg1, void *arg2, dmu_tx_t *tx) +{ + spa_t *spa = arg1; + zfeature_info_t *feature = arg2; + + spa_feature_incr(spa, feature, tx); +} + +static void +feature_decr_sync(void *arg1, void *arg2, dmu_tx_t *tx) +{ + spa_t *spa = arg1; + zfeature_info_t *feature = arg2; + + spa_feature_decr(spa, feature, tx); +} + +static void +zhack_do_feature_ref(int argc, char **argv) +{ + char c; + char *target; + boolean_t decr = B_FALSE; + spa_t *spa; + objset_t *mos; + zfeature_info_t feature; + zfeature_info_t *nodeps[] = { NULL }; + + /* + * fi_desc does not matter here because it was written to disk + * when the feature was enabled, but we need to properly set the + * feature for read or write based on the information we read off + * disk later. + */ + feature.fi_uname = "zhack"; + feature.fi_mos = B_FALSE; + feature.fi_desc = NULL; + feature.fi_depends = nodeps; + + optind = 1; + while ((c = getopt(argc, argv, "md")) != -1) { + switch (c) { + case 'm': + feature.fi_mos = B_TRUE; + break; + case 'd': + decr = B_TRUE; + break; + default: + usage(); + break; + } + } + argc -= optind; + argv += optind; + + if (argc < 2) { + (void) fprintf(stderr, "error: missing feature or pool name\n"); + usage(); + } + target = argv[0]; + feature.fi_guid = argv[1]; + + if (!zfeature_is_valid_guid(feature.fi_guid)) + fatal("invalid feature guid: %s", feature.fi_guid); + + zhack_spa_open(target, B_FALSE, FTAG, &spa); + mos = spa->spa_meta_objset; + + if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) + fatal("'%s' is a real feature, will not change refcount"); + + if (0 == zap_contains(mos, spa->spa_feat_for_read_obj, + feature.fi_guid)) { + feature.fi_can_readonly = B_FALSE; + } else if (0 == zap_contains(mos, spa->spa_feat_for_write_obj, + feature.fi_guid)) { + feature.fi_can_readonly = B_TRUE; + } else { + fatal("feature is not enabled: %s", feature.fi_guid); + } + + if (decr && !spa_feature_is_active(spa, &feature)) + fatal("feature refcount already 0: %s", feature.fi_guid); + + VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL, + decr ? feature_decr_sync : feature_incr_sync, spa, &feature, 5)); + + spa_close(spa, FTAG); +} + +static int +zhack_do_feature(int argc, char **argv) +{ + char *subcommand; + + argc--; + argv++; + if (argc == 0) { + (void) fprintf(stderr, + "error: no feature operation specified\n"); + usage(); + } + + subcommand = argv[0]; + if (strcmp(subcommand, "stat") == 0) { + zhack_do_feature_stat(argc, argv); + } else if (strcmp(subcommand, "enable") == 0) { + zhack_do_feature_enable(argc, argv); + } else if (strcmp(subcommand, "ref") == 0) { + zhack_do_feature_ref(argc, argv); + } else { + (void) fprintf(stderr, "error: unknown subcommand: %s\n", + subcommand); + usage(); + } + + return (0); +} + +#define MAX_NUM_PATHS 1024 + +int +main(int argc, char **argv) +{ + extern void zfs_prop_init(void); + + char *path[MAX_NUM_PATHS]; + const char *subcommand; + int rv = 0; + char c; + + g_importargs.path = path; + + dprintf_setup(&argc, argv); + zfs_prop_init(); + + while ((c = getopt(argc, argv, "c:d:")) != -1) { + switch (c) { + case 'c': + g_importargs.cachefile = optarg; + break; + case 'd': + assert(g_importargs.paths < MAX_NUM_PATHS); + g_importargs.path[g_importargs.paths++] = optarg; + break; + default: + usage(); + break; + } + } + + argc -= optind; + argv += optind; + optind = 1; + + if (argc == 0) { + (void) fprintf(stderr, "error: no command specified\n"); + usage(); + } + + subcommand = argv[0]; + + if (strcmp(subcommand, "feature") == 0) { + rv = zhack_do_feature(argc, argv); + } else { + (void) fprintf(stderr, "error: unknown subcommand: %s\n", + subcommand); + usage(); + } + + if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_TRUE) != 0) { + fatal("pool export failed; " + "changes may not be committed to disk\n"); + } + + libzfs_fini(g_zfs); + kernel_fini(); + + return (rv); +} From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:45:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E78C106566C; Wed, 18 Jul 2012 10:45:39 +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 590388FC14; Wed, 18 Jul 2012 10:45:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAjdM3061796; Wed, 18 Jul 2012 10:45:39 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAjcih061794; Wed, 18 Jul 2012 10:45:38 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207181045.q6IAjcih061794@svn.freebsd.org> From: Christian Brueffer Date: Wed, 18 Jul 2012 10:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238588 - stable/8/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:45:39 -0000 Author: brueffer Date: Wed Jul 18 10:45:38 2012 New Revision: 238588 URL: http://svn.freebsd.org/changeset/base/238588 Log: MFC: r238486 Fix typo in a message. Modified: stable/8/sys/dev/isp/isp.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/isp/isp.c ============================================================================== --- stable/8/sys/dev/isp/isp.c Wed Jul 18 10:42:43 2012 (r238587) +++ stable/8/sys/dev/isp/isp.c Wed Jul 18 10:45:38 2012 (r238588) @@ -2143,7 +2143,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin goto out; } else if (plp->plogx_status != PLOGX_STATUS_IOCBERR) { isp_prt(isp, ISP_LOGWARN, - "status 0x%x on port login IOCB chanel %d", + "status 0x%x on port login IOCB channel %d", plp->plogx_status, chan); rval = -1; goto out; From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:46:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7AA16106564A; Wed, 18 Jul 2012 10:46:32 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB3D8FC1F; Wed, 18 Jul 2012 10:46:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAkWAh061899; Wed, 18 Jul 2012 10:46:32 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAkWCr061898; Wed, 18 Jul 2012 10:46:32 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207181046.q6IAkWCr061898@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 10:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238589 - vendor/illumos/20120614/cmd/zhack X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:46:32 -0000 Author: mm Date: Wed Jul 18 10:46:31 2012 New Revision: 238589 URL: http://svn.freebsd.org/changeset/base/238589 Log: Merge r238587 into 20120614 tag Added: vendor/illumos/20120614/cmd/zhack/ - copied from r238587, vendor/illumos/dist/cmd/zhack/ Modified: Directory Properties: vendor/illumos/20120614/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:51:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42DFB106566B; Wed, 18 Jul 2012 10:51:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29E2C8FC25; Wed, 18 Jul 2012 10:51:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IApCYB062343; Wed, 18 Jul 2012 10:51:12 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IApBGk062334; Wed, 18 Jul 2012 10:51:11 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207181051.q6IApBGk062334@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 10:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238590 - in vendor-sys/illumos/dist: common/zfs uts/common/fs/zfs uts/common/fs/zfs/sys uts/common/sys uts/common/sys/fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:51:12 -0000 Author: mm Date: Wed Jul 18 10:51:11 2012 New Revision: 238590 URL: http://svn.freebsd.org/changeset/base/238590 Log: Update vendor-sys/illumos/dist to illumos-gate 13752:9f5f6c52ba19 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor-sys/illumos/dist/common/zfs/zfs_comutil.c vendor-sys/illumos/dist/common/zfs/zfs_comutil.h vendor-sys/illumos/dist/common/zfs/zprop_common.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deleg.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_synctask.c vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_deleg.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_prop.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c vendor-sys/illumos/dist/uts/common/sys/feature_tests.h vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Modified: vendor-sys/illumos/dist/common/zfs/zfs_comutil.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfs_comutil.c Wed Jul 18 10:46:31 2012 (r238589) +++ vendor-sys/illumos/dist/common/zfs/zfs_comutil.c Wed Jul 18 10:51:11 2012 (r238590) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -157,7 +158,11 @@ zfs_spa_version_map(int zpl_version) return (version); } -const char *zfs_history_event_names[LOG_END] = { +/* + * This is the table of legacy internal event names; it should not be modified. + * The internal events are now stored in the history log as strings. + */ +const char *zfs_history_event_names[ZFS_NUM_LEGACY_HISTORY_EVENTS] = { "invalid event", "pool create", "vdev add", Modified: vendor-sys/illumos/dist/common/zfs/zfs_comutil.h ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfs_comutil.h Wed Jul 18 10:46:31 2012 (r238589) +++ vendor-sys/illumos/dist/common/zfs/zfs_comutil.h Wed Jul 18 10:51:11 2012 (r238590) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _ZFS_COMUTIL_H @@ -37,7 +38,8 @@ extern void zpool_get_rewind_policy(nvli extern int zfs_zpl_version_map(int spa_version); extern int zfs_spa_version_map(int zpl_version); -extern const char *zfs_history_event_names[LOG_END]; +#define ZFS_NUM_LEGACY_HISTORY_EVENTS 41 +extern const char *zfs_history_event_names[ZFS_NUM_LEGACY_HISTORY_EVENTS]; #ifdef __cplusplus } Modified: vendor-sys/illumos/dist/common/zfs/zprop_common.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zprop_common.c Wed Jul 18 10:46:31 2012 (r238589) +++ vendor-sys/illumos/dist/common/zfs/zprop_common.c Wed Jul 18 10:51:11 2012 (r238590) @@ -22,6 +22,9 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * Common routines used by zfs and zpool property management. @@ -129,7 +132,8 @@ zprop_register_hidden(int prop, const ch zprop_attr_t attr, int objset_types, const char *colname) { zprop_register_impl(prop, name, type, 0, NULL, attr, - objset_types, NULL, colname, B_FALSE, B_FALSE, NULL); + objset_types, NULL, colname, + type == PROP_TYPE_NUMBER, B_FALSE, NULL); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Wed Jul 18 10:46:31 2012 (r238589) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Wed Jul 18 10:51:11 2012 (r238590) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -699,30 +700,33 @@ dmu_objset_create_sync(void *arg1, void spa_t *spa = dd->dd_pool->dp_spa; struct oscarg *oa = arg2; uint64_t obj; + dsl_dataset_t *ds; + blkptr_t *bp; ASSERT(dmu_tx_is_syncing(tx)); obj = dsl_dataset_create_sync(dd, oa->lastname, oa->clone_origin, oa->flags, oa->cr, tx); - if (oa->clone_origin == NULL) { - dsl_pool_t *dp = dd->dd_pool; - dsl_dataset_t *ds; - blkptr_t *bp; - objset_t *os; - - VERIFY3U(0, ==, dsl_dataset_hold_obj(dp, obj, FTAG, &ds)); - bp = dsl_dataset_get_blkptr(ds); - ASSERT(BP_IS_HOLE(bp)); - - os = dmu_objset_create_impl(spa, ds, bp, oa->type, tx); + VERIFY3U(0, ==, dsl_dataset_hold_obj(dd->dd_pool, obj, FTAG, &ds)); + bp = dsl_dataset_get_blkptr(ds); + if (BP_IS_HOLE(bp)) { + objset_t *os = + dmu_objset_create_impl(spa, ds, bp, oa->type, tx); if (oa->userfunc) oa->userfunc(os, oa->userarg, oa->cr, tx); - dsl_dataset_rele(ds, FTAG); } - spa_history_log_internal(LOG_DS_CREATE, spa, tx, "dataset = %llu", obj); + if (oa->clone_origin == NULL) { + spa_history_log_internal_ds(ds, "create", tx, ""); + } else { + char namebuf[MAXNAMELEN]; + dsl_dataset_name(oa->clone_origin, namebuf); + spa_history_log_internal_ds(ds, "clone", tx, + "origin=%s (%llu)", namebuf, oa->clone_origin->ds_object); + } + dsl_dataset_rele(ds, FTAG); } int @@ -799,34 +803,40 @@ dmu_objset_destroy(const char *name, boo return (error); } -struct snaparg { - dsl_sync_task_group_t *dstg; - char *snapname; - char *htag; - char failed[MAXPATHLEN]; - boolean_t recursive; - boolean_t needsuspend; - boolean_t temporary; - nvlist_t *props; - struct dsl_ds_holdarg *ha; /* only needed in the temporary case */ - dsl_dataset_t *newds; -}; +typedef struct snapallarg { + dsl_sync_task_group_t *saa_dstg; + boolean_t saa_needsuspend; + nvlist_t *saa_props; + + /* the following are used only if 'temporary' is set: */ + boolean_t saa_temporary; + const char *saa_htag; + struct dsl_ds_holdarg *saa_ha; + dsl_dataset_t *saa_newds; +} snapallarg_t; + +typedef struct snaponearg { + const char *soa_longname; /* long snap name */ + const char *soa_snapname; /* short snap name */ + snapallarg_t *soa_saa; +} snaponearg_t; static int snapshot_check(void *arg1, void *arg2, dmu_tx_t *tx) { objset_t *os = arg1; - struct snaparg *sn = arg2; + snaponearg_t *soa = arg2; + snapallarg_t *saa = soa->soa_saa; int error; /* The props have already been checked by zfs_check_userprops(). */ error = dsl_dataset_snapshot_check(os->os_dsl_dataset, - sn->snapname, tx); + soa->soa_snapname, tx); if (error) return (error); - if (sn->temporary) { + if (saa->saa_temporary) { /* * Ideally we would just call * dsl_dataset_user_hold_check() and @@ -844,12 +854,13 @@ snapshot_check(void *arg1, void *arg2, d * Not checking number of tags because the tag will be * unique, as it will be the only tag. */ - if (strlen(sn->htag) + MAX_TAG_PREFIX_LEN >= MAXNAMELEN) + if (strlen(saa->saa_htag) + MAX_TAG_PREFIX_LEN >= MAXNAMELEN) return (E2BIG); - sn->ha = kmem_alloc(sizeof (struct dsl_ds_holdarg), KM_SLEEP); - sn->ha->temphold = B_TRUE; - sn->ha->htag = sn->htag; + saa->saa_ha = kmem_alloc(sizeof (struct dsl_ds_holdarg), + KM_SLEEP); + saa->saa_ha->temphold = B_TRUE; + saa->saa_ha->htag = saa->saa_htag; } return (error); } @@ -859,24 +870,25 @@ snapshot_sync(void *arg1, void *arg2, dm { objset_t *os = arg1; dsl_dataset_t *ds = os->os_dsl_dataset; - struct snaparg *sn = arg2; + snaponearg_t *soa = arg2; + snapallarg_t *saa = soa->soa_saa; - dsl_dataset_snapshot_sync(ds, sn->snapname, tx); + dsl_dataset_snapshot_sync(ds, soa->soa_snapname, tx); - if (sn->props) { + if (saa->saa_props != NULL) { dsl_props_arg_t pa; - pa.pa_props = sn->props; + pa.pa_props = saa->saa_props; pa.pa_source = ZPROP_SRC_LOCAL; dsl_props_set_sync(ds->ds_prev, &pa, tx); } - if (sn->temporary) { + if (saa->saa_temporary) { struct dsl_ds_destroyarg da; - dsl_dataset_user_hold_sync(ds->ds_prev, sn->ha, tx); - kmem_free(sn->ha, sizeof (struct dsl_ds_holdarg)); - sn->ha = NULL; - sn->newds = ds->ds_prev; + dsl_dataset_user_hold_sync(ds->ds_prev, saa->saa_ha, tx); + kmem_free(saa->saa_ha, sizeof (struct dsl_ds_holdarg)); + saa->saa_ha = NULL; + saa->saa_newds = ds->ds_prev; da.ds = ds->ds_prev; da.defer = B_TRUE; @@ -885,131 +897,180 @@ snapshot_sync(void *arg1, void *arg2, dm } static int -dmu_objset_snapshot_one(const char *name, void *arg) +snapshot_one_impl(const char *snapname, void *arg) { - struct snaparg *sn = arg; + char fsname[MAXPATHLEN]; + snapallarg_t *saa = arg; + snaponearg_t *soa; objset_t *os; int err; - char *cp; - /* - * If the objset starts with a '%', then ignore it unless it was - * explicitly named (ie, not recursive). These hidden datasets - * are always inconsistent, and by not opening them here, we can - * avoid a race with dsl_dir_destroy_check(). - */ - cp = strrchr(name, '/'); - if (cp && cp[1] == '%' && sn->recursive) - return (0); - - (void) strcpy(sn->failed, name); - - /* - * Check permissions if we are doing a recursive snapshot. The - * permission checks for the starting dataset have already been - * performed in zfs_secpolicy_snapshot() - */ - if (sn->recursive && (err = zfs_secpolicy_snapshot_perms(name, CRED()))) - return (err); + (void) strlcpy(fsname, snapname, sizeof (fsname)); + strchr(fsname, '@')[0] = '\0'; - err = dmu_objset_hold(name, sn, &os); + err = dmu_objset_hold(fsname, saa, &os); if (err != 0) return (err); /* * If the objset is in an inconsistent state (eg, in the process - * of being destroyed), don't snapshot it. As with %hidden - * datasets, we return EBUSY if this name was explicitly - * requested (ie, not recursive), and otherwise ignore it. + * of being destroyed), don't snapshot it. */ if (os->os_dsl_dataset->ds_phys->ds_flags & DS_FLAG_INCONSISTENT) { - dmu_objset_rele(os, sn); - return (sn->recursive ? 0 : EBUSY); + dmu_objset_rele(os, saa); + return (EBUSY); } - if (sn->needsuspend) { + if (saa->saa_needsuspend) { err = zil_suspend(dmu_objset_zil(os)); if (err) { - dmu_objset_rele(os, sn); + dmu_objset_rele(os, saa); return (err); } } - dsl_sync_task_create(sn->dstg, snapshot_check, snapshot_sync, - os, sn, 3); + + soa = kmem_zalloc(sizeof (*soa), KM_SLEEP); + soa->soa_saa = saa; + soa->soa_longname = snapname; + soa->soa_snapname = strchr(snapname, '@') + 1; + + dsl_sync_task_create(saa->saa_dstg, snapshot_check, snapshot_sync, + os, soa, 3); return (0); } +/* + * The snapshots must all be in the same pool. + */ int -dmu_objset_snapshot(char *fsname, char *snapname, char *tag, - nvlist_t *props, boolean_t recursive, boolean_t temporary, int cleanup_fd) +dmu_objset_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t *errors) { dsl_sync_task_t *dst; - struct snaparg sn; + snapallarg_t saa = { 0 }; spa_t *spa; - minor_t minor; + int rv = 0; int err; + nvpair_t *pair; - (void) strcpy(sn.failed, fsname); + pair = nvlist_next_nvpair(snaps, NULL); + if (pair == NULL) + return (0); - err = spa_open(fsname, &spa, FTAG); + err = spa_open(nvpair_name(pair), &spa, FTAG); if (err) return (err); - - if (temporary) { - if (cleanup_fd < 0) { - spa_close(spa, FTAG); - return (EINVAL); + saa.saa_dstg = dsl_sync_task_group_create(spa_get_dsl(spa)); + saa.saa_props = props; + saa.saa_needsuspend = (spa_version(spa) < SPA_VERSION_FAST_SNAP); + + for (pair = nvlist_next_nvpair(snaps, NULL); pair != NULL; + pair = nvlist_next_nvpair(snaps, pair)) { + err = snapshot_one_impl(nvpair_name(pair), &saa); + if (err != 0) { + if (errors != NULL) { + fnvlist_add_int32(errors, + nvpair_name(pair), err); + } + rv = err; } - if ((err = zfs_onexit_fd_hold(cleanup_fd, &minor)) != 0) { - spa_close(spa, FTAG); - return (err); + } + + /* + * If any call to snapshot_one_impl() failed, don't execute the + * sync task. The error handling code below will clean up the + * snaponearg_t from any successful calls to + * snapshot_one_impl(). + */ + if (rv == 0) + err = dsl_sync_task_group_wait(saa.saa_dstg); + if (err != 0) + rv = err; + + for (dst = list_head(&saa.saa_dstg->dstg_tasks); dst; + dst = list_next(&saa.saa_dstg->dstg_tasks, dst)) { + objset_t *os = dst->dst_arg1; + snaponearg_t *soa = dst->dst_arg2; + if (dst->dst_err != 0) { + if (errors != NULL) { + fnvlist_add_int32(errors, + soa->soa_longname, dst->dst_err); + } + rv = dst->dst_err; } + + if (saa.saa_needsuspend) + zil_resume(dmu_objset_zil(os)); + dmu_objset_rele(os, &saa); + kmem_free(soa, sizeof (*soa)); } - sn.dstg = dsl_sync_task_group_create(spa_get_dsl(spa)); - sn.snapname = snapname; - sn.htag = tag; - sn.props = props; - sn.recursive = recursive; - sn.needsuspend = (spa_version(spa) < SPA_VERSION_FAST_SNAP); - sn.temporary = temporary; - sn.ha = NULL; - sn.newds = NULL; - - if (recursive) { - err = dmu_objset_find(fsname, - dmu_objset_snapshot_one, &sn, DS_FIND_CHILDREN); - } else { - err = dmu_objset_snapshot_one(fsname, &sn); + dsl_sync_task_group_destroy(saa.saa_dstg); + spa_close(spa, FTAG); + return (rv); +} + +int +dmu_objset_snapshot_one(const char *fsname, const char *snapname) +{ + int err; + char *longsnap = kmem_asprintf("%s@%s", fsname, snapname); + nvlist_t *snaps = fnvlist_alloc(); + + fnvlist_add_boolean(snaps, longsnap); + err = dmu_objset_snapshot(snaps, NULL, NULL); + fnvlist_free(snaps); + strfree(longsnap); + return (err); +} + +int +dmu_objset_snapshot_tmp(const char *snapname, const char *tag, int cleanup_fd) +{ + dsl_sync_task_t *dst; + snapallarg_t saa = { 0 }; + spa_t *spa; + minor_t minor; + int err; + + err = spa_open(snapname, &spa, FTAG); + if (err) + return (err); + saa.saa_dstg = dsl_sync_task_group_create(spa_get_dsl(spa)); + saa.saa_htag = tag; + saa.saa_needsuspend = (spa_version(spa) < SPA_VERSION_FAST_SNAP); + saa.saa_temporary = B_TRUE; + + if (cleanup_fd < 0) { + spa_close(spa, FTAG); + return (EINVAL); + } + if ((err = zfs_onexit_fd_hold(cleanup_fd, &minor)) != 0) { + spa_close(spa, FTAG); + return (err); } + err = snapshot_one_impl(snapname, &saa); + if (err == 0) - err = dsl_sync_task_group_wait(sn.dstg); + err = dsl_sync_task_group_wait(saa.saa_dstg); - for (dst = list_head(&sn.dstg->dstg_tasks); dst; - dst = list_next(&sn.dstg->dstg_tasks, dst)) { + for (dst = list_head(&saa.saa_dstg->dstg_tasks); dst; + dst = list_next(&saa.saa_dstg->dstg_tasks, dst)) { objset_t *os = dst->dst_arg1; - dsl_dataset_t *ds = os->os_dsl_dataset; - if (dst->dst_err) { - dsl_dataset_name(ds, sn.failed); - } else if (temporary) { - dsl_register_onexit_hold_cleanup(sn.newds, tag, minor); - } - if (sn.needsuspend) + dsl_register_onexit_hold_cleanup(saa.saa_newds, tag, minor); + if (saa.saa_needsuspend) zil_resume(dmu_objset_zil(os)); - dmu_objset_rele(os, &sn); + dmu_objset_rele(os, &saa); } - if (err) - (void) strcpy(fsname, sn.failed); - if (temporary) - zfs_onexit_fd_rele(cleanup_fd); - dsl_sync_task_group_destroy(sn.dstg); + zfs_onexit_fd_rele(cleanup_fd); + dsl_sync_task_group_destroy(saa.saa_dstg); spa_close(spa, FTAG); return (err); } + static void dmu_objset_sync_dnodes(list_t *list, list_t *newlist, dmu_tx_t *tx) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Wed Jul 18 10:46:31 2012 (r238589) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Wed Jul 18 10:51:11 2012 (r238590) @@ -387,9 +387,48 @@ backup_cb(spa_t *spa, zilog_t *zilog, co return (err); } +/* + * Return TRUE if 'earlier' is an earlier snapshot in 'later's timeline. + * For example, they could both be snapshots of the same filesystem, and + * 'earlier' is before 'later'. Or 'earlier' could be the origin of + * 'later's filesystem. Or 'earlier' could be an older snapshot in the origin's + * filesystem. Or 'earlier' could be the origin's origin. + */ +static boolean_t +is_before(dsl_dataset_t *later, dsl_dataset_t *earlier) +{ + dsl_pool_t *dp = later->ds_dir->dd_pool; + int error; + boolean_t ret; + dsl_dataset_t *origin; + + if (earlier->ds_phys->ds_creation_txg >= + later->ds_phys->ds_creation_txg) + return (B_FALSE); + + if (later->ds_dir == earlier->ds_dir) + return (B_TRUE); + if (!dsl_dir_is_clone(later->ds_dir)) + return (B_FALSE); + + rw_enter(&dp->dp_config_rwlock, RW_READER); + if (later->ds_dir->dd_phys->dd_origin_obj == earlier->ds_object) { + rw_exit(&dp->dp_config_rwlock); + return (B_TRUE); + } + error = dsl_dataset_hold_obj(dp, + later->ds_dir->dd_phys->dd_origin_obj, FTAG, &origin); + rw_exit(&dp->dp_config_rwlock); + if (error != 0) + return (B_FALSE); + ret = is_before(origin, earlier); + dsl_dataset_rele(origin, FTAG); + return (ret); +} + int -dmu_send(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, - int outfd, vnode_t *vp, offset_t *off) +dmu_send(objset_t *tosnap, objset_t *fromsnap, int outfd, vnode_t *vp, + offset_t *off) { dsl_dataset_t *ds = tosnap->os_dsl_dataset; dsl_dataset_t *fromds = fromsnap ? fromsnap->os_dsl_dataset : NULL; @@ -402,30 +441,13 @@ dmu_send(objset_t *tosnap, objset_t *fro if (ds->ds_phys->ds_next_snap_obj == 0) return (EINVAL); - /* fromsnap must be an earlier snapshot from the same fs as tosnap */ - if (fromds && (ds->ds_dir != fromds->ds_dir || - fromds->ds_phys->ds_creation_txg >= ds->ds_phys->ds_creation_txg)) + /* + * fromsnap must be an earlier snapshot from the same fs as tosnap, + * or the origin's fs. + */ + if (fromds != NULL && !is_before(ds, fromds)) return (EXDEV); - if (fromorigin) { - dsl_pool_t *dp = ds->ds_dir->dd_pool; - - if (fromsnap) - return (EINVAL); - - if (dsl_dir_is_clone(ds->ds_dir)) { - rw_enter(&dp->dp_config_rwlock, RW_READER); - err = dsl_dataset_hold_obj(dp, - ds->ds_dir->dd_phys->dd_origin_obj, FTAG, &fromds); - rw_exit(&dp->dp_config_rwlock); - if (err) - return (err); - } else { - fromorigin = B_FALSE; - } - } - - drr = kmem_zalloc(sizeof (dmu_replay_record_t), KM_SLEEP); drr->drr_type = DRR_BEGIN; drr->drr_u.drr_begin.drr_magic = DMU_BACKUP_MAGIC; @@ -450,7 +472,7 @@ dmu_send(objset_t *tosnap, objset_t *fro drr->drr_u.drr_begin.drr_creation_time = ds->ds_phys->ds_creation_time; drr->drr_u.drr_begin.drr_type = tosnap->os_phys->os_type; - if (fromorigin) + if (fromds != NULL && ds->ds_dir != fromds->ds_dir) drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CLONE; drr->drr_u.drr_begin.drr_toguid = ds->ds_phys->ds_guid; if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) @@ -462,8 +484,6 @@ dmu_send(objset_t *tosnap, objset_t *fro if (fromds) fromtxg = fromds->ds_phys->ds_creation_txg; - if (fromorigin) - dsl_dataset_rele(fromds, FTAG); dsp = kmem_zalloc(sizeof (dmu_sendarg_t), KM_SLEEP); @@ -521,8 +541,7 @@ out: } int -dmu_send_estimate(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin, - uint64_t *sizep) +dmu_send_estimate(objset_t *tosnap, objset_t *fromsnap, uint64_t *sizep) { dsl_dataset_t *ds = tosnap->os_dsl_dataset; dsl_dataset_t *fromds = fromsnap ? fromsnap->os_dsl_dataset : NULL; @@ -534,27 +553,13 @@ dmu_send_estimate(objset_t *tosnap, objs if (ds->ds_phys->ds_next_snap_obj == 0) return (EINVAL); - /* fromsnap must be an earlier snapshot from the same fs as tosnap */ - if (fromds && (ds->ds_dir != fromds->ds_dir || - fromds->ds_phys->ds_creation_txg >= ds->ds_phys->ds_creation_txg)) + /* + * fromsnap must be an earlier snapshot from the same fs as tosnap, + * or the origin's fs. + */ + if (fromds != NULL && !is_before(ds, fromds)) return (EXDEV); - if (fromorigin) { - if (fromsnap) - return (EINVAL); - - if (dsl_dir_is_clone(ds->ds_dir)) { - rw_enter(&dp->dp_config_rwlock, RW_READER); - err = dsl_dataset_hold_obj(dp, - ds->ds_dir->dd_phys->dd_origin_obj, FTAG, &fromds); - rw_exit(&dp->dp_config_rwlock); - if (err) - return (err); - } else { - fromorigin = B_FALSE; - } - } - /* Get uncompressed size estimate of changed data. */ if (fromds == NULL) { size = ds->ds_phys->ds_uncompressed_bytes; @@ -562,8 +567,6 @@ dmu_send_estimate(objset_t *tosnap, objs uint64_t used, comp; err = dsl_dataset_space_written(fromds, ds, &used, &comp, &size); - if (fromorigin) - dsl_dataset_rele(fromds, FTAG); if (err) return (err); } @@ -662,8 +665,7 @@ recv_new_sync(void *arg1, void *arg2, dm rbsa->ds, &rbsa->ds->ds_phys->ds_bp, rbsa->type, tx); } - spa_history_log_internal(LOG_DS_REPLAY_FULL_SYNC, - dd->dd_pool->dp_spa, tx, "dataset = %lld", dsobj); + spa_history_log_internal_ds(rbsa->ds, "receive new", tx, ""); } /* ARGSUSED */ @@ -764,8 +766,7 @@ recv_existing_sync(void *arg1, void *arg rbsa->ds = cds; - spa_history_log_internal(LOG_DS_REPLAY_INC_SYNC, - dp->dp_spa, tx, "dataset = %lld", dsobj); + spa_history_log_internal_ds(cds, "receive over existing", tx, ""); } static boolean_t @@ -1573,6 +1574,7 @@ recv_end_sync(void *arg1, void *arg2, dm dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_phys->ds_flags &= ~DS_FLAG_INCONSISTENT; + spa_history_log_internal_ds(ds, "finished receiving", tx, ""); } static int Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Wed Jul 18 10:46:31 2012 (r238589) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Wed Jul 18 10:51:11 2012 (r238590) @@ -48,7 +48,7 @@ dmu_tx_create_dd(dsl_dir_t *dd) { dmu_tx_t *tx = kmem_zalloc(sizeof (dmu_tx_t), KM_SLEEP); tx->tx_dir = dd; - if (dd) + if (dd != NULL) tx->tx_pool = dd->dd_pool; list_create(&tx->tx_holds, sizeof (dmu_tx_hold_t), offsetof(dmu_tx_hold_t, txh_node)); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Wed Jul 18 10:46:31 2012 (r238589) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Wed Jul 18 10:51:11 2012 (r238590) @@ -914,7 +914,8 @@ dsl_dataset_create_sync(dsl_dir_t *pdd, * The snapshots must all be in the same pool. */ int -dmu_snapshots_destroy_nvl(nvlist_t *snaps, boolean_t defer, char *failed) +dmu_snapshots_destroy_nvl(nvlist_t *snaps, boolean_t defer, + nvlist_t *errlist) { int err; dsl_sync_task_t *dst; @@ -949,7 +950,7 @@ dmu_snapshots_destroy_nvl(nvlist_t *snap } else if (err == ENOENT) { err = 0; } else { - (void) strcpy(failed, nvpair_name(pair)); + fnvlist_add_int32(errlist, nvpair_name(pair), err); break; } } @@ -963,10 +964,12 @@ dmu_snapshots_destroy_nvl(nvlist_t *snap dsl_dataset_t *ds = dsda->ds; /* - * Return the file system name that triggered the error + * Return the snapshots that triggered the error. */ - if (dst->dst_err) { - dsl_dataset_name(ds, failed); + if (dst->dst_err != 0) { + char name[ZFS_MAXNAMELEN]; + dsl_dataset_name(ds, name); + fnvlist_add_int32(errlist, name, dst->dst_err); } ASSERT3P(dsda->rm_origin, ==, NULL); dsl_dataset_disown(ds, dstg); @@ -1045,7 +1048,6 @@ dsl_dataset_destroy(dsl_dataset_t *ds, v dsl_dir_t *dd; uint64_t obj; struct dsl_ds_destroyarg dsda = { 0 }; - dsl_dataset_t dummy_ds = { 0 }; dsda.ds = ds; @@ -1065,8 +1067,6 @@ dsl_dataset_destroy(dsl_dataset_t *ds, v } dd = ds->ds_dir; - dummy_ds.ds_dir = dd; - dummy_ds.ds_object = ds->ds_object; /* * Check for errors and mark this ds as inconsistent, in @@ -1153,7 +1153,7 @@ dsl_dataset_destroy(dsl_dataset_t *ds, v dsl_sync_task_create(dstg, dsl_dataset_destroy_check, dsl_dataset_destroy_sync, &dsda, tag, 0); dsl_sync_task_create(dstg, dsl_dir_destroy_check, - dsl_dir_destroy_sync, &dummy_ds, FTAG, 0); + dsl_dir_destroy_sync, dd, FTAG, 0); err = dsl_sync_task_group_wait(dstg); dsl_sync_task_group_destroy(dstg); @@ -1328,14 +1328,12 @@ static void dsl_dataset_destroy_begin_sync(void *arg1, void *arg2, dmu_tx_t *tx) { dsl_dataset_t *ds = arg1; - dsl_pool_t *dp = ds->ds_dir->dd_pool; /* Mark it as inconsistent on-disk, in case we crash */ dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_phys->ds_flags |= DS_FLAG_INCONSISTENT; - spa_history_log_internal(LOG_DS_DESTROY_BEGIN, dp->dp_spa, tx, - "dataset = %llu", ds->ds_object); + spa_history_log_internal_ds(ds, "destroy begin", tx, ""); } static int @@ -1660,9 +1658,13 @@ dsl_dataset_destroy_sync(void *arg1, voi ASSERT(spa_version(dp->dp_spa) >= SPA_VERSION_USERREFS); dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_phys->ds_flags |= DS_FLAG_DEFER_DESTROY; + spa_history_log_internal_ds(ds, "defer_destroy", tx, ""); return; } + /* We need to log before removing it from the namespace. */ + spa_history_log_internal_ds(ds, "destroy", tx, ""); + /* signal any waiters that this dataset is going away */ mutex_enter(&ds->ds_lock); ds->ds_owner = dsl_reaper; @@ -1957,8 +1959,6 @@ dsl_dataset_destroy_sync(void *arg1, voi dsl_dataset_rele(ds_prev, FTAG); spa_prop_clear_bootfs(dp->dp_spa, ds->ds_object, tx); - spa_history_log_internal(LOG_DS_DESTROY, dp->dp_spa, tx, - "dataset = %llu", ds->ds_object); if (ds->ds_phys->ds_next_clones_obj != 0) { uint64_t count; @@ -2006,7 +2006,7 @@ dsl_dataset_snapshot_reserve_space(dsl_d return (ENOSPC); /* - * Propogate any reserved space for this snapshot to other + * Propagate any reserved space for this snapshot to other * snapshot checks in this sync group. */ if (asize > 0) @@ -2016,10 +2016,9 @@ dsl_dataset_snapshot_reserve_space(dsl_d } int -dsl_dataset_snapshot_check(void *arg1, void *arg2, dmu_tx_t *tx) +dsl_dataset_snapshot_check(dsl_dataset_t *ds, const char *snapname, + dmu_tx_t *tx) { - dsl_dataset_t *ds = arg1; - const char *snapname = arg2; int err; uint64_t value; @@ -2031,7 +2030,7 @@ dsl_dataset_snapshot_check(void *arg1, v return (EAGAIN); /* - * Check for conflicting name snapshot name. + * Check for conflicting snapshot name. */ err = dsl_dataset_snap_lookup(ds, snapname, &value); if (err == 0) @@ -2055,10 +2054,9 @@ dsl_dataset_snapshot_check(void *arg1, v } void -dsl_dataset_snapshot_sync(void *arg1, void *arg2, dmu_tx_t *tx) +dsl_dataset_snapshot_sync(dsl_dataset_t *ds, const char *snapname, + dmu_tx_t *tx) { - dsl_dataset_t *ds = arg1; - const char *snapname = arg2; dsl_pool_t *dp = ds->ds_dir->dd_pool; dmu_buf_t *dbuf; dsl_dataset_phys_t *dsphys; @@ -2164,8 +2162,7 @@ dsl_dataset_snapshot_sync(void *arg1, vo dsl_dir_snap_cmtime_update(ds->ds_dir); - spa_history_log_internal(LOG_DS_SNAPSHOT, dp->dp_spa, tx, - "dataset = %llu", dsobj); + spa_history_log_internal_ds(ds->ds_prev, "snapshot", tx, ""); } void @@ -2252,7 +2249,20 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl { uint64_t refd, avail, uobjs, aobjs, ratio; - dsl_dir_stats(ds->ds_dir, nv); + ratio = ds->ds_phys->ds_compressed_bytes == 0 ? 100 : + (ds->ds_phys->ds_uncompressed_bytes * 100 / + ds->ds_phys->ds_compressed_bytes); + + dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_REFRATIO, ratio); + + if (dsl_dataset_is_snapshot(ds)) { + dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_COMPRESSRATIO, ratio); + dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USED, + ds->ds_phys->ds_unique_bytes); + get_clones_stat(ds, nv); + } else { + dsl_dir_stats(ds->ds_dir, nv); + } dsl_dataset_space(ds, &refd, &avail, &uobjs, &aobjs); dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_AVAILABLE, avail); @@ -2297,22 +2307,6 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl } } - ratio = ds->ds_phys->ds_compressed_bytes == 0 ? 100 : - (ds->ds_phys->ds_uncompressed_bytes * 100 / - ds->ds_phys->ds_compressed_bytes); - dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_REFRATIO, ratio); - - if (ds->ds_phys->ds_next_snap_obj) { - /* - * This is a snapshot; override the dd's space used with - * our unique space and compression ratio. - */ - dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USED, - ds->ds_phys->ds_unique_bytes); - dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_COMPRESSRATIO, ratio); - - get_clones_stat(ds, nv); - } } void @@ -2321,27 +2315,25 @@ dsl_dataset_fast_stat(dsl_dataset_t *ds, stat->dds_creation_txg = ds->ds_phys->ds_creation_txg; stat->dds_inconsistent = ds->ds_phys->ds_flags & DS_FLAG_INCONSISTENT; stat->dds_guid = ds->ds_phys->ds_guid; - if (ds->ds_phys->ds_next_snap_obj) { + stat->dds_origin[0] = '\0'; + if (dsl_dataset_is_snapshot(ds)) { stat->dds_is_snapshot = B_TRUE; stat->dds_num_clones = ds->ds_phys->ds_num_children - 1; } else { stat->dds_is_snapshot = B_FALSE; stat->dds_num_clones = 0; - } - - /* clone origin is really a dsl_dir thing... */ - rw_enter(&ds->ds_dir->dd_pool->dp_config_rwlock, RW_READER); - if (dsl_dir_is_clone(ds->ds_dir)) { - dsl_dataset_t *ods; - VERIFY(0 == dsl_dataset_get_ref(ds->ds_dir->dd_pool, - ds->ds_dir->dd_phys->dd_origin_obj, FTAG, &ods)); - dsl_dataset_name(ods, stat->dds_origin); - dsl_dataset_drop_ref(ods, FTAG); - } else { - stat->dds_origin[0] = '\0'; + rw_enter(&ds->ds_dir->dd_pool->dp_config_rwlock, RW_READER); + if (dsl_dir_is_clone(ds->ds_dir)) { + dsl_dataset_t *ods; + + VERIFY(0 == dsl_dataset_get_ref(ds->ds_dir->dd_pool, + ds->ds_dir->dd_phys->dd_origin_obj, FTAG, &ods)); + dsl_dataset_name(ods, stat->dds_origin); + dsl_dataset_drop_ref(ods, FTAG); + } + rw_exit(&ds->ds_dir->dd_pool->dp_config_rwlock); } - rw_exit(&ds->ds_dir->dd_pool->dp_config_rwlock); } uint64_t @@ -2458,8 +2450,8 @@ dsl_dataset_snapshot_rename_sync(void *a ds->ds_snapname, 8, 1, &ds->ds_object, tx); ASSERT3U(err, ==, 0); - spa_history_log_internal(LOG_DS_RENAME, dd->dd_pool->dp_spa, tx, - "dataset = %llu", ds->ds_object); + spa_history_log_internal_ds(ds, "rename", tx, + "-> @%s", newsnapname); dsl_dataset_rele(hds, FTAG); } @@ -2939,8 +2931,7 @@ dsl_dataset_promote_sync(void *arg1, voi origin_ds->ds_phys->ds_unique_bytes = pa->unique; /* log history record */ - spa_history_log_internal(LOG_DS_PROMOTE, dd->dd_pool->dp_spa, tx, - "dataset = %llu", hds->ds_object); + spa_history_log_internal_ds(hds, "promote", tx, ""); dsl_dir_close(odd, FTAG); } @@ -3298,6 +3289,9 @@ dsl_dataset_clone_swap_sync(void *arg1, csa->ohds->ds_phys->ds_deadlist_obj); dsl_scan_ds_clone_swapped(csa->ohds, csa->cds, tx); + + spa_history_log_internal_ds(csa->cds, "clone swap", tx, + "parent=%s", csa->ohds->ds_dir->dd_myname); } /* @@ -3454,9 +3448,8 @@ dsl_dataset_set_quota_sync(void *arg1, v dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_quota = effective_value; - spa_history_log_internal(LOG_DS_REFQUOTA, - ds->ds_dir->dd_pool->dp_spa, tx, "%lld dataset = %llu ", - (longlong_t)ds->ds_quota, ds->ds_object); + spa_history_log_internal_ds(ds, "set refquota", tx, + "refquota=%lld", (longlong_t)ds->ds_quota); } } @@ -3561,9 +3554,8 @@ dsl_dataset_set_reservation_sync(void *a dsl_dir_diduse_space(ds->ds_dir, DD_USED_REFRSRV, delta, 0, 0, tx); mutex_exit(&ds->ds_dir->dd_lock); - spa_history_log_internal(LOG_DS_REFRESERV, - ds->ds_dir->dd_pool->dp_spa, tx, "%lld dataset = %llu", - (longlong_t)effective_value, ds->ds_object); + spa_history_log_internal_ds(ds, "set refreservation", tx, + "refreservation=%lld", (longlong_t)effective_value); } int @@ -3629,7 +3621,7 @@ dsl_dataset_user_hold_check(void *arg1, { dsl_dataset_t *ds = arg1; struct dsl_ds_holdarg *ha = arg2; - char *htag = ha->htag; + const char *htag = ha->htag; objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; int error = 0; @@ -3663,7 +3655,7 @@ dsl_dataset_user_hold_sync(void *arg1, v { dsl_dataset_t *ds = arg1; struct dsl_ds_holdarg *ha = arg2; - char *htag = ha->htag; + const char *htag = ha->htag; dsl_pool_t *dp = ds->ds_dir->dd_pool; objset_t *mos = dp->dp_meta_objset; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:56:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D40F910656FF; Wed, 18 Jul 2012 10:56:48 +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 BE80F8FC0A; Wed, 18 Jul 2012 10:56:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAumre062760; Wed, 18 Jul 2012 10:56:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAum7x062758; Wed, 18 Jul 2012 10:56:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207181056.q6IAum7x062758@svn.freebsd.org> From: Christian Brueffer Date: Wed, 18 Jul 2012 10:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238591 - stable/9/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:56:49 -0000 Author: brueffer Date: Wed Jul 18 10:56:48 2012 New Revision: 238591 URL: http://svn.freebsd.org/changeset/base/238591 Log: MFC: r238363 - fix description of SECURITY_FREEZE_LOCK - add missing underscores to SECURITY_DISABLE_PASSWORD Approved by: re (hrs) Modified: stable/9/sys/cam/ata/ata_all.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_all.c ============================================================================== --- stable/9/sys/cam/ata/ata_all.c Wed Jul 18 10:51:11 2012 (r238590) +++ stable/9/sys/cam/ata/ata_all.c Wed Jul 18 10:56:48 2012 (r238591) @@ -171,8 +171,8 @@ ata_op_string(struct ata_cmd *cmd) case 0xf2: return ("SECURITY_UNLOCK"); case 0xf3: return ("SECURITY_ERASE_PREPARE"); case 0xf4: return ("SECURITY_ERASE_UNIT"); - case 0xf5: return ("SECURITY_FREE_LOCK"); - case 0xf6: return ("SECURITY DISABLE PASSWORD"); + case 0xf5: return ("SECURITY_FREEZE_LOCK"); + case 0xf6: return ("SECURITY_DISABLE_PASSWORD"); case 0xf8: return ("READ_NATIVE_MAX_ADDRESS"); case 0xf9: return ("SET_MAX_ADDRESS"); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:58:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D161F106564A; Wed, 18 Jul 2012 10:58:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B82118FC21; Wed, 18 Jul 2012 10:58:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAw7XC062901; Wed, 18 Jul 2012 10:58:07 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAw7Y2062891; Wed, 18 Jul 2012 10:58:07 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207181058.q6IAw7Y2062891@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 10:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238592 - in vendor/illumos/dist: cmd/zdb cmd/zfs cmd/zhack cmd/zpool cmd/ztest lib/libzfs/common lib/libzfs_core lib/libzfs_core/common lib/libzpool/common lib/libzpool/common/sys man/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:58:07 -0000 Author: mm Date: Wed Jul 18 10:58:07 2012 New Revision: 238592 URL: http://svn.freebsd.org/changeset/base/238592 Log: Update vendor-sys/illumos/dist to illumos-gate 13752:9f5f6c52ba19 (zfs part) Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Added: vendor/illumos/dist/lib/libzfs_core/ vendor/illumos/dist/lib/libzfs_core/common/ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/cmd/zhack/zhack.c vendor/illumos/dist/cmd/zpool/zpool_main.c vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_config.c vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/lib/libzfs/common/libzfs_impl.h vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/illumos/dist/lib/libzfs/common/libzfs_util.c vendor/illumos/dist/lib/libzpool/common/kernel.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Wed Jul 18 10:56:48 2012 (r238591) +++ vendor/illumos/dist/cmd/zdb/zdb.c Wed Jul 18 10:58:07 2012 (r238592) @@ -57,6 +57,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -204,6 +205,27 @@ dump_packed_nvlist(objset_t *os, uint64_ nvlist_free(nv); } +/* ARGSUSED */ +static void +dump_history_offsets(objset_t *os, uint64_t object, void *data, size_t size) +{ + spa_history_phys_t *shp = data; + + if (shp == NULL) + return; + + (void) printf("\t\tpool_create_len = %llu\n", + (u_longlong_t)shp->sh_pool_create_len); + (void) printf("\t\tphys_max_off = %llu\n", + (u_longlong_t)shp->sh_phys_max_off); + (void) printf("\t\tbof = %llu\n", + (u_longlong_t)shp->sh_bof); + (void) printf("\t\teof = %llu\n", + (u_longlong_t)shp->sh_eof); + (void) printf("\t\trecords_lost = %llu\n", + (u_longlong_t)shp->sh_records_lost); +} + static void zdb_nicenum(uint64_t num, char *buf) { @@ -853,21 +875,22 @@ dump_history(spa_t *spa) for (int i = 0; i < num; i++) { uint64_t time, txg, ievent; char *cmd, *intstr; + boolean_t printed = B_FALSE; if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_TIME, &time) != 0) - continue; + goto next; if (nvlist_lookup_string(events[i], ZPOOL_HIST_CMD, &cmd) != 0) { if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_INT_EVENT, &ievent) != 0) - continue; + goto next; verify(nvlist_lookup_uint64(events[i], ZPOOL_HIST_TXG, &txg) == 0); verify(nvlist_lookup_string(events[i], ZPOOL_HIST_INT_STR, &intstr) == 0); - if (ievent >= LOG_END) - continue; + if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS) + goto next; (void) snprintf(internalstr, sizeof (internalstr), @@ -880,6 +903,14 @@ dump_history(spa_t *spa) (void) localtime_r(&tsec, &t); (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); (void) printf("%s %s\n", tbuf, cmd); + printed = B_TRUE; + +next: + if (dump_opt['h'] > 1) { + if (!printed) + (void) printf("unrecognized record:\n"); + dump_nvlist(events[i], 2); + } } } @@ -1456,7 +1487,7 @@ static object_viewer_t *object_viewer[DM dump_zap, /* other ZAP */ dump_zap, /* persistent error log */ dump_uint8, /* SPA history */ - dump_uint64, /* SPA history offsets */ + dump_history_offsets, /* SPA history offsets */ dump_zap, /* Pool properties */ dump_zap, /* DSL permissions */ dump_acl, /* ZFS ACL */ Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_main.c Wed Jul 18 10:56:48 2012 (r238591) +++ vendor/illumos/dist/cmd/zfs/zfs_main.c Wed Jul 18 10:58:07 2012 (r238592) @@ -56,6 +56,7 @@ #include #include +#include #include #include #include @@ -70,6 +71,7 @@ libzfs_handle_t *g_zfs; static FILE *mnttab_file; static char history_str[HIS_MAX_RECORD_LEN]; +static boolean_t log_history = B_TRUE; static int zfs_do_clone(int argc, char **argv); static int zfs_do_create(int argc, char **argv); @@ -259,7 +261,7 @@ get_usage(zfs_help_t idx) return (gettext("\tshare <-a | filesystem>\n")); case HELP_SNAPSHOT: return (gettext("\tsnapshot [-r] [-o property=value] ... " - "\n")); + " ...\n")); case HELP_UNMOUNT: return (gettext("\tunmount [-f] " "<-a | filesystem|mountpoint>\n")); @@ -888,9 +890,9 @@ typedef struct destroy_cbdata { nvlist_t *cb_nvl; /* first snap in contiguous run */ - zfs_handle_t *cb_firstsnap; + char *cb_firstsnap; /* previous snap in contiguous run */ - zfs_handle_t *cb_prevsnap; + char *cb_prevsnap; int64_t cb_snapused; char *cb_snapspec; } destroy_cbdata_t; @@ -1004,11 +1006,13 @@ destroy_print_cb(zfs_handle_t *zhp, void if (nvlist_exists(cb->cb_nvl, name)) { if (cb->cb_firstsnap == NULL) - cb->cb_firstsnap = zfs_handle_dup(zhp); + cb->cb_firstsnap = strdup(name); if (cb->cb_prevsnap != NULL) - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); /* this snap continues the current range */ - cb->cb_prevsnap = zfs_handle_dup(zhp); + cb->cb_prevsnap = strdup(name); + if (cb->cb_firstsnap == NULL || cb->cb_prevsnap == NULL) + nomem(); if (cb->cb_verbose) { if (cb->cb_parsable) { (void) printf("destroy\t%s\n", name); @@ -1023,12 +1027,12 @@ destroy_print_cb(zfs_handle_t *zhp, void } else if (cb->cb_firstsnap != NULL) { /* end of this range */ uint64_t used = 0; - err = zfs_get_snapused_int(cb->cb_firstsnap, + err = lzc_snaprange_space(cb->cb_firstsnap, cb->cb_prevsnap, &used); cb->cb_snapused += used; - zfs_close(cb->cb_firstsnap); + free(cb->cb_firstsnap); cb->cb_firstsnap = NULL; - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); cb->cb_prevsnap = NULL; } zfs_close(zhp); @@ -1045,13 +1049,13 @@ destroy_print_snapshots(zfs_handle_t *fs if (cb->cb_firstsnap != NULL) { uint64_t used = 0; if (err == 0) { - err = zfs_get_snapused_int(cb->cb_firstsnap, + err = lzc_snaprange_space(cb->cb_firstsnap, cb->cb_prevsnap, &used); } cb->cb_snapused += used; - zfs_close(cb->cb_firstsnap); + free(cb->cb_firstsnap); cb->cb_firstsnap = NULL; - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); cb->cb_prevsnap = NULL; } return (err); @@ -1064,7 +1068,7 @@ snapshot_to_nvl_cb(zfs_handle_t *zhp, vo int err = 0; /* Check for clones. */ - if (!cb->cb_doclones) { + if (!cb->cb_doclones && !cb->cb_defer_destroy) { cb->cb_target = zhp; cb->cb_first = B_TRUE; err = zfs_iter_dependents(zhp, B_TRUE, @@ -1904,9 +1908,11 @@ upgrade_set_callback(zfs_handle_t *zhp, /* * If they did "zfs upgrade -a", then we could * be doing ioctls to different pools. We need - * to log this history once to each pool. + * to log this history once to each pool, and bypass + * the normal history logging that happens in main(). */ - verify(zpool_stage_history(g_zfs, history_str) == 0); + (void) zpool_log_history(g_zfs, history_str); + log_history = B_FALSE; } if (zfs_prop_set(zhp, "version", verstr) == 0) cb->cb_numupgraded++; @@ -3424,6 +3430,32 @@ zfs_do_set(int argc, char **argv) return (ret); } +typedef struct snap_cbdata { + nvlist_t *sd_nvl; + boolean_t sd_recursive; + const char *sd_snapname; +} snap_cbdata_t; + +static int +zfs_snapshot_cb(zfs_handle_t *zhp, void *arg) +{ + snap_cbdata_t *sd = arg; + char *name; + int rv = 0; + int error; + + error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname); + if (error == -1) + nomem(); + fnvlist_add_boolean(sd->sd_nvl, name); + free(name); + + if (sd->sd_recursive) + rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + zfs_close(zhp); + return (rv); +} + /* * zfs snapshot [-r] [-o prop=value] ... * @@ -3433,13 +3465,16 @@ zfs_do_set(int argc, char **argv) static int zfs_do_snapshot(int argc, char **argv) { - boolean_t recursive = B_FALSE; int ret = 0; char c; nvlist_t *props; + snap_cbdata_t sd = { 0 }; + boolean_t multiple_snaps = B_FALSE; if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) nomem(); + if (nvlist_alloc(&sd.sd_nvl, NV_UNIQUE_NAME, 0) != 0) + nomem(); /* check options */ while ((c = getopt(argc, argv, "ro:")) != -1) { @@ -3449,7 +3484,8 @@ zfs_do_snapshot(int argc, char **argv) return (1); break; case 'r': - recursive = B_TRUE; + sd.sd_recursive = B_TRUE; + multiple_snaps = B_TRUE; break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), @@ -3466,18 +3502,35 @@ zfs_do_snapshot(int argc, char **argv) (void) fprintf(stderr, gettext("missing snapshot argument\n")); goto usage; } - if (argc > 1) { - (void) fprintf(stderr, gettext("too many arguments\n")); - goto usage; + + if (argc > 1) + multiple_snaps = B_TRUE; + for (; argc > 0; argc--, argv++) { + char *atp; + zfs_handle_t *zhp; + + atp = strchr(argv[0], '@'); + if (atp == NULL) + goto usage; + *atp = '\0'; + sd.sd_snapname = atp + 1; + zhp = zfs_open(g_zfs, argv[0], + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME); + if (zhp == NULL) + goto usage; + if (zfs_snapshot_cb(zhp, &sd) != 0) + goto usage; } - ret = zfs_snapshot(g_zfs, argv[0], recursive, props); + ret = zfs_snapshot_nvl(g_zfs, sd.sd_nvl, props); + nvlist_free(sd.sd_nvl); nvlist_free(props); - if (ret && recursive) + if (ret != 0 && multiple_snaps) (void) fprintf(stderr, gettext("no snapshots were created\n")); return (ret != 0); usage: + nvlist_free(sd.sd_nvl); nvlist_free(props); usage(B_FALSE); return (-1); @@ -6479,8 +6532,7 @@ main(int argc, char **argv) return (1); } - zpool_set_history_str("zfs", argc, argv, history_str); - verify(zpool_stage_history(g_zfs, history_str) == 0); + zfs_save_arguments(argc, argv, history_str, sizeof (history_str)); libzfs_print_on_error(g_zfs, B_TRUE); @@ -6549,6 +6601,9 @@ main(int argc, char **argv) (void) fclose(mnttab_file); + if (ret == 0 && log_history) + (void) zpool_log_history(g_zfs, history_str); + libzfs_fini(g_zfs); /* Modified: vendor/illumos/dist/cmd/zhack/zhack.c ============================================================================== --- vendor/illumos/dist/cmd/zhack/zhack.c Wed Jul 18 10:56:48 2012 (r238591) +++ vendor/illumos/dist/cmd/zhack/zhack.c Wed Jul 18 10:58:07 2012 (r238592) @@ -279,6 +279,9 @@ feature_enable_sync(void *arg1, void *ar zfeature_info_t *feature = arg2; spa_feature_enable(spa, feature, tx); + spa_history_log_internal(spa, "zhack enable feature", tx, + "name=%s can_readonly=%u", + feature->fi_guid, feature->fi_can_readonly); } static void @@ -356,6 +359,8 @@ feature_incr_sync(void *arg1, void *arg2 zfeature_info_t *feature = arg2; spa_feature_incr(spa, feature, tx); + spa_history_log_internal(spa, "zhack feature incr", tx, + "name=%s", feature->fi_guid); } static void @@ -365,6 +370,8 @@ feature_decr_sync(void *arg1, void *arg2 zfeature_info_t *feature = arg2; spa_feature_decr(spa, feature, tx); + spa_history_log_internal(spa, "zhack feature decr", tx, + "name=%s", feature->fi_guid); } static void Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c ============================================================================== --- vendor/illumos/dist/cmd/zpool/zpool_main.c Wed Jul 18 10:56:48 2012 (r238591) +++ vendor/illumos/dist/cmd/zpool/zpool_main.c Wed Jul 18 10:58:07 2012 (r238592) @@ -185,9 +185,9 @@ static zpool_command_t command_table[] = #define NCOMMAND (sizeof (command_table) / sizeof (command_table[0])) -zpool_command_t *current_command; +static zpool_command_t *current_command; static char history_str[HIS_MAX_RECORD_LEN]; - +static boolean_t log_history = B_TRUE; static uint_t timestamp_fmt = NODATE; static const char * @@ -935,7 +935,10 @@ zpool_do_destroy(int argc, char **argv) return (1); } - ret = (zpool_destroy(zhp) != 0); + /* The history must be logged as part of the export */ + log_history = B_FALSE; + + ret = (zpool_destroy(zhp, history_str) != 0); zpool_close(zhp); @@ -999,10 +1002,13 @@ zpool_do_export(int argc, char **argv) continue; } + /* The history must be logged as part of the export */ + log_history = B_FALSE; + if (hardforce) { - if (zpool_export_force(zhp) != 0) + if (zpool_export_force(zhp, history_str) != 0) ret = 1; - } else if (zpool_export(zhp, force) != 0) { + } else if (zpool_export(zhp, force, history_str) != 0) { ret = 1; } @@ -4269,6 +4275,14 @@ upgrade_cb(zpool_handle_t *zhp, void *ar (void) printf(gettext("Successfully upgraded " "'%s'\n\n"), zpool_get_name(zhp)); } + /* + * If they did "zpool upgrade -a", then we could + * be doing ioctls to different pools. We need + * to log this history once to each pool, and bypass + * the normal history logging that happens in main(). + */ + (void) zpool_log_history(g_zfs, history_str); + log_history = B_FALSE; } } else if (cbp->cb_newer && !SPA_VERSION_IS_SUPPORTED(version)) { assert(!cbp->cb_all); @@ -4491,8 +4505,8 @@ zpool_do_upgrade(int argc, char **argv) typedef struct hist_cbdata { boolean_t first; - int longfmt; - int internal; + boolean_t longfmt; + boolean_t internal; } hist_cbdata_t; /* @@ -4504,21 +4518,8 @@ get_history_one(zpool_handle_t *zhp, voi nvlist_t *nvhis; nvlist_t **records; uint_t numrecords; - char *cmdstr; - char *pathstr; - uint64_t dst_time; - time_t tsec; - struct tm t; - char tbuf[30]; int ret, i; - uint64_t who; - struct passwd *pwd; - char *hostname; - char *zonename; - char internalstr[MAXPATHLEN]; hist_cbdata_t *cb = (hist_cbdata_t *)data; - uint64_t txg; - uint64_t ievent; cb->first = B_FALSE; @@ -4530,64 +4531,94 @@ get_history_one(zpool_handle_t *zhp, voi verify(nvlist_lookup_nvlist_array(nvhis, ZPOOL_HIST_RECORD, &records, &numrecords) == 0); for (i = 0; i < numrecords; i++) { - if (nvlist_lookup_uint64(records[i], ZPOOL_HIST_TIME, - &dst_time) != 0) - continue; + nvlist_t *rec = records[i]; + char tbuf[30] = ""; - /* is it an internal event or a standard event? */ - if (nvlist_lookup_string(records[i], ZPOOL_HIST_CMD, - &cmdstr) != 0) { - if (cb->internal == 0) + if (nvlist_exists(rec, ZPOOL_HIST_TIME)) { + time_t tsec; + struct tm t; + + tsec = fnvlist_lookup_uint64(records[i], + ZPOOL_HIST_TIME); + (void) localtime_r(&tsec, &t); + (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); + } + + if (nvlist_exists(rec, ZPOOL_HIST_CMD)) { + (void) printf("%s %s", tbuf, + fnvlist_lookup_string(rec, ZPOOL_HIST_CMD)); + } else if (nvlist_exists(rec, ZPOOL_HIST_INT_EVENT)) { + int ievent = + fnvlist_lookup_uint64(rec, ZPOOL_HIST_INT_EVENT); + if (!cb->internal) continue; - - if (nvlist_lookup_uint64(records[i], - ZPOOL_HIST_INT_EVENT, &ievent) != 0) + if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS) { + (void) printf("%s unrecognized record:\n", + tbuf); + dump_nvlist(rec, 4); + continue; + } + (void) printf("%s [internal %s txg:%lld] %s", tbuf, + zfs_history_event_names[ievent], + fnvlist_lookup_uint64(rec, ZPOOL_HIST_TXG), + fnvlist_lookup_string(rec, ZPOOL_HIST_INT_STR)); + } else if (nvlist_exists(rec, ZPOOL_HIST_INT_NAME)) { + if (!cb->internal) continue; - verify(nvlist_lookup_uint64(records[i], - ZPOOL_HIST_TXG, &txg) == 0); - verify(nvlist_lookup_string(records[i], - ZPOOL_HIST_INT_STR, &pathstr) == 0); - if (ievent >= LOG_END) + (void) printf("%s [txg:%lld] %s", tbuf, + fnvlist_lookup_uint64(rec, ZPOOL_HIST_TXG), + fnvlist_lookup_string(rec, ZPOOL_HIST_INT_NAME)); + if (nvlist_exists(rec, ZPOOL_HIST_DSNAME)) { + (void) printf(" %s (%llu)", + fnvlist_lookup_string(rec, + ZPOOL_HIST_DSNAME), + fnvlist_lookup_uint64(rec, + ZPOOL_HIST_DSID)); + } + (void) printf(" %s", fnvlist_lookup_string(rec, + ZPOOL_HIST_INT_STR)); + } else if (nvlist_exists(rec, ZPOOL_HIST_IOCTL)) { + if (!cb->internal) continue; - (void) snprintf(internalstr, - sizeof (internalstr), - "[internal %s txg:%lld] %s", - zfs_history_event_names[ievent], txg, - pathstr); - cmdstr = internalstr; - } - tsec = dst_time; - (void) localtime_r(&tsec, &t); - (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); - (void) printf("%s %s", tbuf, cmdstr); + (void) printf("%s ioctl %s\n", tbuf, + fnvlist_lookup_string(rec, ZPOOL_HIST_IOCTL)); + if (nvlist_exists(rec, ZPOOL_HIST_INPUT_NVL)) { + (void) printf(" input:\n"); + dump_nvlist(fnvlist_lookup_nvlist(rec, + ZPOOL_HIST_INPUT_NVL), 8); + } + if (nvlist_exists(rec, ZPOOL_HIST_OUTPUT_NVL)) { + (void) printf(" output:\n"); + dump_nvlist(fnvlist_lookup_nvlist(rec, + ZPOOL_HIST_OUTPUT_NVL), 8); + } + } else { + if (!cb->internal) + continue; + (void) printf("%s unrecognized record:\n", tbuf); + dump_nvlist(rec, 4); + } if (!cb->longfmt) { (void) printf("\n"); continue; } (void) printf(" ["); - if (nvlist_lookup_uint64(records[i], - ZPOOL_HIST_WHO, &who) == 0) { - pwd = getpwuid((uid_t)who); - if (pwd) - (void) printf("user %s on", - pwd->pw_name); - else - (void) printf("user %d on", - (int)who); - } else { - (void) printf(gettext("no info]\n")); - continue; + if (nvlist_exists(rec, ZPOOL_HIST_WHO)) { + uid_t who = fnvlist_lookup_uint64(rec, ZPOOL_HIST_WHO); + struct passwd *pwd = getpwuid(who); + (void) printf("user %d ", (int)who); + if (pwd != NULL) + (void) printf("(%s) ", pwd->pw_name); + } + if (nvlist_exists(rec, ZPOOL_HIST_HOST)) { + (void) printf("on %s", + fnvlist_lookup_string(rec, ZPOOL_HIST_HOST)); + } + if (nvlist_exists(rec, ZPOOL_HIST_ZONE)) { + (void) printf(":%s", + fnvlist_lookup_string(rec, ZPOOL_HIST_ZONE)); } - if (nvlist_lookup_string(records[i], - ZPOOL_HIST_HOST, &hostname) == 0) { - (void) printf(" %s", hostname); - } - if (nvlist_lookup_string(records[i], - ZPOOL_HIST_ZONE, &zonename) == 0) { - (void) printf(":%s", zonename); - } - (void) printf("]"); (void) printf("\n"); } @@ -4602,8 +4633,6 @@ get_history_one(zpool_handle_t *zhp, voi * * Displays the history of commands that modified pools. */ - - int zpool_do_history(int argc, char **argv) { @@ -4616,10 +4645,10 @@ zpool_do_history(int argc, char **argv) while ((c = getopt(argc, argv, "li")) != -1) { switch (c) { case 'l': - cbdata.longfmt = 1; + cbdata.longfmt = B_TRUE; break; case 'i': - cbdata.internal = 1; + cbdata.internal = B_TRUE; break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), @@ -4844,8 +4873,7 @@ main(int argc, char **argv) if (strcmp(cmdname, "-?") == 0) usage(B_TRUE); - zpool_set_history_str("zpool", argc, argv, history_str); - verify(zpool_stage_history(g_zfs, history_str) == 0); + zfs_save_arguments(argc, argv, history_str, sizeof (history_str)); /* * Run the appropriate command. @@ -4872,6 +4900,9 @@ main(int argc, char **argv) usage(B_FALSE); } + if (ret == 0 && log_history) + (void) zpool_log_history(g_zfs, history_str); + libzfs_fini(g_zfs); /* Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Wed Jul 18 10:56:48 2012 (r238591) +++ vendor/illumos/dist/cmd/ztest/ztest.c Wed Jul 18 10:58:07 2012 (r238592) @@ -2252,7 +2252,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, */ nvroot = make_vdev_root("/dev/bogus", NULL, 0, 0, 0, 0, 0, 1); VERIFY3U(ENOENT, ==, - spa_create("ztest_bad_file", nvroot, NULL, NULL, NULL)); + spa_create("ztest_bad_file", nvroot, NULL, NULL)); nvlist_free(nvroot); /* @@ -2260,7 +2260,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, */ nvroot = make_vdev_root("/dev/bogus", NULL, 0, 0, 0, 0, 2, 1); VERIFY3U(ENOENT, ==, - spa_create("ztest_bad_mirror", nvroot, NULL, NULL, NULL)); + spa_create("ztest_bad_mirror", nvroot, NULL, NULL)); nvlist_free(nvroot); /* @@ -2269,7 +2269,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, */ (void) rw_rdlock(&ztest_name_lock); nvroot = make_vdev_root("/dev/bogus", NULL, 0, 0, 0, 0, 0, 1); - VERIFY3U(EEXIST, ==, spa_create(zo->zo_pool, nvroot, NULL, NULL, NULL)); + VERIFY3U(EEXIST, ==, spa_create(zo->zo_pool, nvroot, NULL, NULL)); nvlist_free(nvroot); VERIFY3U(0, ==, spa_open(zo->zo_pool, &spa, FTAG)); VERIFY3U(EBUSY, ==, spa_destroy(zo->zo_pool)); @@ -3056,8 +3056,7 @@ ztest_snapshot_create(char *osname, uint (void) snprintf(snapname, MAXNAMELEN, "%s@%llu", osname, (u_longlong_t)id); - error = dmu_objset_snapshot(osname, strchr(snapname, '@') + 1, - NULL, NULL, B_FALSE, B_FALSE, -1); + error = dmu_objset_snapshot_one(osname, strchr(snapname, '@') + 1); if (error == ENOSPC) { ztest_record_enospc(FTAG); return (B_FALSE); @@ -3257,8 +3256,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_ (void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu", osname, id); (void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu", clone1name, id); - error = dmu_objset_snapshot(osname, strchr(snap1name, '@')+1, - NULL, NULL, B_FALSE, B_FALSE, -1); + error = dmu_objset_snapshot_one(osname, strchr(snap1name, '@') + 1); if (error && error != EEXIST) { if (error == ENOSPC) { ztest_record_enospc(FTAG); @@ -3281,8 +3279,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_ fatal(0, "dmu_objset_create(%s) = %d", clone1name, error); } - error = dmu_objset_snapshot(clone1name, strchr(snap2name, '@')+1, - NULL, NULL, B_FALSE, B_FALSE, -1); + error = dmu_objset_snapshot_one(clone1name, strchr(snap2name, '@') + 1); if (error && error != EEXIST) { if (error == ENOSPC) { ztest_record_enospc(FTAG); @@ -3291,8 +3288,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_ fatal(0, "dmu_open_snapshot(%s) = %d", snap2name, error); } - error = dmu_objset_snapshot(clone1name, strchr(snap3name, '@')+1, - NULL, NULL, B_FALSE, B_FALSE, -1); + error = dmu_objset_snapshot_one(clone1name, strchr(snap3name, '@') + 1); if (error && error != EEXIST) { if (error == ENOSPC) { ztest_record_enospc(FTAG); @@ -4480,8 +4476,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, * Create snapshot, clone it, mark snap for deferred destroy, * destroy clone, verify snap was also destroyed. */ - error = dmu_objset_snapshot(osname, snapname, NULL, NULL, FALSE, - FALSE, -1); + error = dmu_objset_snapshot_one(osname, snapname); if (error) { if (error == ENOSPC) { ztest_record_enospc("dmu_objset_snapshot"); @@ -4523,8 +4518,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, * destroy a held snapshot, mark for deferred destroy, * release hold, verify snapshot was destroyed. */ - error = dmu_objset_snapshot(osname, snapname, NULL, NULL, FALSE, - FALSE, -1); + error = dmu_objset_snapshot_one(osname, snapname); if (error) { if (error == ENOSPC) { ztest_record_enospc("dmu_objset_snapshot"); @@ -5612,8 +5606,7 @@ ztest_init(ztest_shared_t *zs) spa_feature_table[i].fi_uname); VERIFY3U(0, ==, nvlist_add_uint64(props, buf, 0)); } - VERIFY3U(0, ==, spa_create(ztest_opts.zo_pool, nvroot, props, - NULL, NULL)); + VERIFY3U(0, ==, spa_create(ztest_opts.zo_pool, nvroot, props, NULL)); nvlist_free(nvroot); VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG)); Modified: vendor/illumos/dist/lib/libzfs/common/libzfs.h ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs.h Wed Jul 18 10:56:48 2012 (r238591) +++ vendor/illumos/dist/lib/libzfs/common/libzfs.h Wed Jul 18 10:58:07 2012 (r238592) @@ -54,7 +54,8 @@ extern "C" { /* * libzfs errors */ -enum { +typedef enum zfs_error { + EZFS_SUCCESS = 0, /* no error -- success */ EZFS_NOMEM = 2000, /* out of memory */ EZFS_BADPROP, /* invalid property value */ EZFS_PROPREADONLY, /* cannot set readonly property */ @@ -126,7 +127,7 @@ enum { EZFS_DIFFDATA, /* bad zfs diff data */ EZFS_POOLREADONLY, /* pool is in read-only mode */ EZFS_UNKNOWN -}; +} zfs_error_t; /* * The following data structures are all part @@ -182,6 +183,9 @@ extern libzfs_handle_t *zfs_get_handle(z extern void libzfs_print_on_error(libzfs_handle_t *, boolean_t); +extern void zfs_save_arguments(int argc, char **, char *, int); +extern int zpool_log_history(libzfs_handle_t *, const char *); + extern int libzfs_errno(libzfs_handle_t *); extern const char *libzfs_error_action(libzfs_handle_t *); extern const char *libzfs_error_description(libzfs_handle_t *); @@ -216,7 +220,7 @@ extern int zpool_iter(libzfs_handle_t *, */ extern int zpool_create(libzfs_handle_t *, const char *, nvlist_t *, nvlist_t *, nvlist_t *); -extern int zpool_destroy(zpool_handle_t *); +extern int zpool_destroy(zpool_handle_t *, const char *); extern int zpool_add(zpool_handle_t *, nvlist_t *); typedef struct splitflags { @@ -338,8 +342,8 @@ extern int zpool_get_errlog(zpool_handle /* * Import and export functions */ -extern int zpool_export(zpool_handle_t *, boolean_t); -extern int zpool_export_force(zpool_handle_t *); +extern int zpool_export(zpool_handle_t *, boolean_t, const char *); +extern int zpool_export_force(zpool_handle_t *, const char *); extern int zpool_import(libzfs_handle_t *, nvlist_t *, const char *, char *altroot); extern int zpool_import_props(libzfs_handle_t *, nvlist_t *, const char *, @@ -373,7 +377,7 @@ extern nvlist_t *zpool_find_import_cache */ struct zfs_cmd; -extern const char *zfs_history_event_names[LOG_END]; +extern const char *zfs_history_event_names[]; extern char *zpool_vdev_name(libzfs_handle_t *, zpool_handle_t *, nvlist_t *, boolean_t verbose); @@ -381,9 +385,6 @@ extern int zpool_upgrade(zpool_handle_t extern int zpool_get_history(zpool_handle_t *, nvlist_t **); extern int zpool_history_unpack(char *, uint64_t, uint64_t *, nvlist_t ***, uint_t *); -extern void zpool_set_history_str(const char *subcommand, int argc, - char **argv, char *history_str); -extern int zpool_stage_history(libzfs_handle_t *, const char *); extern void zpool_obj_to_path(zpool_handle_t *, uint64_t, uint64_t, char *, size_t len); extern int zfs_ioctl(libzfs_handle_t *, int, struct zfs_cmd *); @@ -436,8 +437,6 @@ extern int zfs_prop_get_written(zfs_hand char *propbuf, int proplen, boolean_t literal); extern int zfs_prop_get_feature(zfs_handle_t *zhp, const char *propname, char *buf, size_t len); -extern int zfs_get_snapused_int(zfs_handle_t *firstsnap, zfs_handle_t *lastsnap, - uint64_t *usedp); extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t); extern int zfs_prop_inherit(zfs_handle_t *, const char *, boolean_t); extern const char *zfs_prop_values(zfs_prop_t); @@ -553,6 +552,8 @@ extern int zfs_destroy_snaps(zfs_handle_ extern int zfs_destroy_snaps_nvl(zfs_handle_t *, nvlist_t *, boolean_t); extern int zfs_clone(zfs_handle_t *, const char *, nvlist_t *); extern int zfs_snapshot(libzfs_handle_t *, const char *, boolean_t, nvlist_t *); +extern int zfs_snapshot_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, + nvlist_t *props); extern int zfs_rollback(zfs_handle_t *, zfs_handle_t *, boolean_t); extern int zfs_rename(zfs_handle_t *, const char *, boolean_t, boolean_t); Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_config.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_config.c Wed Jul 18 10:56:48 2012 (r238591) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_config.c Wed Jul 18 10:58:07 2012 (r238592) @@ -337,6 +337,48 @@ zpool_refresh_stats(zpool_handle_t *zhp, } /* + * If the __ZFS_POOL_RESTRICT environment variable is set we only iterate over + * pools it lists. + * + * This is an undocumented feature for use during testing only. + * + * This function returns B_TRUE if the pool should be skipped + * during iteration. + */ +static boolean_t +check_restricted(const char *poolname) +{ + static boolean_t initialized = B_FALSE; + static char *restricted = NULL; + + const char *cur, *end; + int len, namelen; + + if (!initialized) { + initialized = B_TRUE; + restricted = getenv("__ZFS_POOL_RESTRICT"); + } + + if (NULL == restricted) + return (B_FALSE); + + cur = restricted; + namelen = strlen(poolname); + do { + end = strchr(cur, ' '); + len = (NULL == end) ? strlen(cur) : (end - cur); + + if (len == namelen && 0 == strncmp(cur, poolname, len)) { + return (B_FALSE); + } + + cur += (len + 1); + } while (NULL != end); + + return (B_TRUE); +} + +/* * Iterate over all pools in the system. */ int @@ -359,6 +401,9 @@ zpool_iter(libzfs_handle_t *hdl, zpool_i for (cn = uu_avl_first(hdl->libzfs_ns_avl); cn != NULL; cn = uu_avl_next(hdl->libzfs_ns_avl, cn)) { + if (check_restricted(cn->cn_name)) + continue; + if (zpool_open_silent(hdl, cn->cn_name, &zhp) != 0) { hdl->libzfs_pool_iter--; return (-1); @@ -394,6 +439,9 @@ zfs_iter_root(libzfs_handle_t *hdl, zfs_ for (cn = uu_avl_first(hdl->libzfs_ns_avl); cn != NULL; cn = uu_avl_next(hdl->libzfs_ns_avl, cn)) { + if (check_restricted(cn->cn_name)) + continue; + if ((zhp = make_dataset_handle(hdl, cn->cn_name)) == NULL) continue; Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Wed Jul 18 10:56:48 2012 (r238591) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Wed Jul 18 10:58:07 2012 (r238592) @@ -1407,8 +1407,7 @@ zfs_prop_set(zfs_handle_t *zhp, const ch libzfs_handle_t *hdl = zhp->zfs_hdl; nvlist_t *nvl = NULL, *realprops; zfs_prop_t prop; - boolean_t do_prefix; - uint64_t idx; + boolean_t do_prefix = B_TRUE; int added_resv; (void) snprintf(errbuf, sizeof (errbuf), @@ -1447,12 +1446,17 @@ zfs_prop_set(zfs_handle_t *zhp, const ch } /* - * If the dataset's canmount property is being set to noauto, - * then we want to prevent unmounting & remounting it. - */ - do_prefix = !((prop == ZFS_PROP_CANMOUNT) && - (zprop_string_to_index(prop, propval, &idx, - ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO)); + * We don't want to unmount & remount the dataset when changing + * its canmount property to 'on' or 'noauto'. We only use + * the changelist logic to unmount when setting canmount=off. + */ + if (prop == ZFS_PROP_CANMOUNT) { + uint64_t idx; + int err = zprop_string_to_index(prop, propval, &idx, + ZFS_TYPE_DATASET); + if (err == 0 && idx != ZFS_CANMOUNT_OFF) + do_prefix = B_FALSE; + } if (do_prefix && (ret = changelist_prefix(cl)) != 0) goto error; @@ -2641,25 +2645,6 @@ zfs_prop_get_written(zfs_handle_t *zhp, return (0); } -int -zfs_get_snapused_int(zfs_handle_t *firstsnap, zfs_handle_t *lastsnap, - uint64_t *usedp) -{ - int err; - zfs_cmd_t zc = { 0 }; - - (void) strlcpy(zc.zc_name, lastsnap->zfs_name, sizeof (zc.zc_name)); - (void) strlcpy(zc.zc_value, firstsnap->zfs_name, sizeof (zc.zc_value)); - - err = ioctl(lastsnap->zfs_hdl->libzfs_fd, ZFS_IOC_SPACE_SNAPS, &zc); - if (err) - return (err); - - *usedp = zc.zc_cookie; - - return (0); -} - /* * Returns the name of the given zfs handle. */ @@ -2860,7 +2845,6 @@ create_parents(libzfs_handle_t *hdl, cha */ for (cp = target + prefixlen + 1; cp = strchr(cp, '/'); *cp = '/', cp++) { - char *logstr; *cp = '\0'; @@ -2871,16 +2855,12 @@ create_parents(libzfs_handle_t *hdl, cha continue; } - logstr = hdl->libzfs_log_str; - hdl->libzfs_log_str = NULL; if (zfs_create(hdl, target, ZFS_TYPE_FILESYSTEM, NULL) != 0) { - hdl->libzfs_log_str = logstr; opname = dgettext(TEXT_DOMAIN, "create"); goto ancestorerr; } - hdl->libzfs_log_str = logstr; h = zfs_open(hdl, target, ZFS_TYPE_FILESYSTEM); if (h == NULL) { opname = dgettext(TEXT_DOMAIN, "open"); @@ -2938,12 +2918,12 @@ int zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type, nvlist_t *props) { - zfs_cmd_t zc = { 0 }; int ret; uint64_t size = 0; uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); char errbuf[1024]; uint64_t zoned; + dmu_objset_type_t ost; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot create '%s'"), path); @@ -2963,17 +2943,16 @@ zfs_create(libzfs_handle_t *hdl, const c * will return ENOENT, not EEXIST. To prevent this from happening, we * first try to see if the dataset exists. */ - (void) strlcpy(zc.zc_name, path, sizeof (zc.zc_name)); - if (zfs_dataset_exists(hdl, zc.zc_name, ZFS_TYPE_DATASET)) { + if (zfs_dataset_exists(hdl, path, ZFS_TYPE_DATASET)) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "dataset already exists")); return (zfs_error(hdl, EZFS_EXISTS, errbuf)); } if (type == ZFS_TYPE_VOLUME) - zc.zc_objset_type = DMU_OST_ZVOL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 10:58:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8B1A1065708; Wed, 18 Jul 2012 10:58:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A99368FC12; Wed, 18 Jul 2012 10:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IAwUaD062960; Wed, 18 Jul 2012 10:58:30 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IAwUWB062958; Wed, 18 Jul 2012 10:58:30 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207181058.q6IAwUWB062958@svn.freebsd.org> From: Martin Matuska Date: Wed, 18 Jul 2012 10:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238593 - vendor/illumos/dist/tools/ctf/cvt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 10:58:30 -0000 Author: mm Date: Wed Jul 18 10:58:30 2012 New Revision: 238593 URL: http://svn.freebsd.org/changeset/base/238593 Log: Update vendor-sys/illumos/dist to illumos-gate 13752:9f5f6c52ba19 (non-zfs part) Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor/illumos/dist/tools/ctf/cvt/dwarf.c Modified: vendor/illumos/dist/tools/ctf/cvt/dwarf.c ============================================================================== --- vendor/illumos/dist/tools/ctf/cvt/dwarf.c Wed Jul 18 10:58:07 2012 (r238592) +++ vendor/illumos/dist/tools/ctf/cvt/dwarf.c Wed Jul 18 10:58:30 2012 (r238593) @@ -22,6 +22,10 @@ * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2012 Jason King. All rights reserved. + * Use is subject to license terms. + */ /* * DWARF to tdata conversion @@ -360,6 +364,37 @@ die_attr_form(dwarf_t *dw, Dwarf_Attribu return (0); } +/* + * the following functions lookup the value of an attribute in a DIE: + * + * die_signed + * die_unsigned + * die_bool + * die_string + * + * They all take the same parameters (with the exception of valp which is + * a pointer to the type of the attribute we are looking up): + * + * dw - the dwarf object to look in + * die - the DIE we're interested in + * name - the name of the attribute to lookup + * valp - pointer to where the value of the attribute is placed + * req - if the value is required (0 / non-zero) + * + * If the attribute is not found, one of the following happens: + * - program terminates (req is non-zero) + * - function returns 0 + * + * If the value is found, and in a form (class) we can handle, the function + * returns 1. + * + * Currently, we can only handle attribute values that are stored as + * constants (immediate value). If an attribute has a form we cannot + * handle (for example VLAs may store the dimensions of the array + * as a DWARF expression that can compute it at runtime by reading + * values off the stack or other locations in memory), it is treated + * the same as if the attribute does not exist. + */ static int die_signed(dwarf_t *dw, Dwarf_Die die, Dwarf_Half name, Dwarf_Signed *valp, int req) @@ -371,6 +406,9 @@ die_signed(dwarf_t *dw, Dwarf_Die die, D return (0); /* die_attr will terminate for us if necessary */ if (dwarf_formsdata(attr, &val, &dw->dw_err) != DW_DLV_OK) { + if (req == 0) + return (0); + terminate("die %llu: failed to get signed (form 0x%x)\n", die_off(dw, die), die_attr_form(dw, attr)); } @@ -392,6 +430,9 @@ die_unsigned(dwarf_t *dw, Dwarf_Die die, return (0); /* die_attr will terminate for us if necessary */ if (dwarf_formudata(attr, &val, &dw->dw_err) != DW_DLV_OK) { + if (req == 0) + return (0); + terminate("die %llu: failed to get unsigned (form 0x%x)\n", die_off(dw, die), die_attr_form(dw, attr)); } @@ -412,6 +453,9 @@ die_bool(dwarf_t *dw, Dwarf_Die die, Dwa return (0); /* die_attr will terminate for us if necessary */ if (dwarf_formflag(attr, &val, &dw->dw_err) != DW_DLV_OK) { + if (req == 0) + return (0); + terminate("die %llu: failed to get bool (form 0x%x)\n", die_off(dw, die), die_attr_form(dw, attr)); } @@ -432,6 +476,9 @@ die_string(dwarf_t *dw, Dwarf_Die die, D return (0); /* die_attr will terminate for us if necessary */ if (dwarf_formstring(attr, &str, &dw->dw_err) != DW_DLV_OK) { + if (req == 0) + return (0); + terminate("die %llu: failed to get string (form 0x%x)\n", die_off(dw, die), die_attr_form(dw, attr)); } @@ -1791,6 +1838,27 @@ die_resolve(dwarf_t *dw) } while (dw->dw_nunres != 0); } +/* + * Any object containing at least one allocatable section of non-0 size is + * taken to be a file which should contain DWARF type information + */ +static boolean_t +should_have_dwarf(Elf *elf) +{ + Elf_Scn *scn = NULL; + + while ((scn = elf_nextscn(elf, scn)) != NULL) { + GElf_Shdr shdr; + gelf_getshdr(scn, &shdr); + + if ((shdr.sh_flags & SHF_ALLOC) && + (shdr.sh_size != 0)) + return (B_TRUE); + } + + return (B_FALSE); +} + /*ARGSUSED*/ int dw_read(tdata_t *td, Elf *elf, const char *filename) @@ -1814,8 +1882,12 @@ dw_read(tdata_t *td, Elf *elf, const cha if ((rc = dwarf_elf_init(elf, DW_DLC_READ, NULL, NULL, &dw.dw_dw, &dw.dw_err)) == DW_DLV_NO_ENTRY) { - errno = ENOENT; - return (-1); + if (should_have_dwarf(elf)) { + errno = ENOENT; + return (-1); + } else { + return (0); + } } else if (rc != DW_DLV_OK) { if (dwarf_errno(dw.dw_err) == DW_DLE_DEBUG_INFO_NULL) { /* @@ -1834,10 +1906,18 @@ dw_read(tdata_t *td, Elf *elf, const cha terminate("file does not contain valid DWARF data: %s\n", dwarf_errmsg(dw.dw_err)); + /* + * Some compilers emit no DWARF for empty files, others emit an empty + * compilation unit. + */ if ((cu = die_sibling(&dw, NULL)) == NULL || - (child = die_child(&dw, cu)) == NULL) + ((child = die_child(&dw, cu)) == NULL) && + should_have_dwarf(elf)) { terminate("file does not contain dwarf type data " "(try compiling with -g)\n"); + } else if (child == NULL) { + return (0); + } dw.dw_maxoff = nxthdr - 1; From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 11:37:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86D52106566C; Wed, 18 Jul 2012 11:37:00 +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 7175A8FC0A; Wed, 18 Jul 2012 11:37:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IBb0rG066218; Wed, 18 Jul 2012 11:37:00 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IBb0K1066216; Wed, 18 Jul 2012 11:37:00 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207181137.q6IBb0K1066216@svn.freebsd.org> From: Christian Brueffer Date: Wed, 18 Jul 2012 11:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238594 - stable/8/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 11:37:00 -0000 Author: brueffer Date: Wed Jul 18 11:36:59 2012 New Revision: 238594 URL: http://svn.freebsd.org/changeset/base/238594 Log: MFC: r238363 - fix description of SECURITY_FREEZE_LOCK - add missing underscores to SECURITY_DISABLE_PASSWORD Modified: stable/8/sys/cam/ata/ata_all.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_all.c ============================================================================== --- stable/8/sys/cam/ata/ata_all.c Wed Jul 18 10:58:30 2012 (r238593) +++ stable/8/sys/cam/ata/ata_all.c Wed Jul 18 11:36:59 2012 (r238594) @@ -161,8 +161,8 @@ ata_op_string(struct ata_cmd *cmd) case 0xf2: return ("SECURITY_UNLOCK"); case 0xf3: return ("SECURITY_ERASE_PREPARE"); case 0xf4: return ("SECURITY_ERASE_UNIT"); - case 0xf5: return ("SECURITY_FREE_LOCK"); - case 0xf6: return ("SECURITY DISABLE PASSWORD"); + case 0xf5: return ("SECURITY_FREEZE_LOCK"); + case 0xf6: return ("SECURITY_DISABLE_PASSWORD"); case 0xf8: return ("READ_NATIVE_MAX_ADDRESS"); case 0xf9: return ("SET_MAX_ADDRESS"); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 12:11:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B18E106566C; Wed, 18 Jul 2012 12:11:11 +0000 (UTC) (envelope-from SRS0=YLKP=FT=FreeBSD.org=brueffer@srs.kundenserver.de) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by mx1.freebsd.org (Postfix) with ESMTP id DE6878FC15; Wed, 18 Jul 2012 12:11:10 +0000 (UTC) Received: from ip235-179.wireless.lu.se (ip235-179.wireless.lu.se [130.235.235.179]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MXkt1-1TKw2s2MXn-00WpcS; Wed, 18 Jul 2012 14:11:09 +0200 Message-ID: <5006A7DD.9050509@FreeBSD.org> Date: Wed, 18 Jul 2012 14:11:09 +0200 From: Christian Brueffer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: attilio@FreeBSD.org References: <201207162207.q6GM7UNS087234@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:Vshiz7BgukA1eHZHCbKTUE1zmWwc0mSn9thh6BwP20/ uXt8jsQvQbvcDwkw3xKtKTzNhF6fEN0+H3Ha4SM3ZJOOJaoIkQ COldzH1HlcHh0yRGHsNVZxZIjT774MqkijHv+sXpRz8vYEm67u TxnZEdYbknrtYalD5M+bj+2qCEg9KwuX8kOT5J5tSSEbqi5Zy6 rYE2nqWnQ7x5uv2JltqALyGmASlNeVGtQrSPi7XWp82sTFBTGf b8PpCYcNIHxNmjlPPPh1iiv3uujfYNBfwekqhaLLh+gKirRINQ E2AWiRGLNkbKd6uXQgLY9OVAfVq0Sh33YXg+xm1Z12RI4R7ZMC isJmN0ESGERScrbB69hUaxieL5VcrQF4sKqw51PH9 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik Subject: Re: svn commit: r238539 - head/sys/fs/smbfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 12:11:11 -0000 On 7/17/12 0:10 , Attilio Rao wrote: > 2012/7/16 Christian Brueffer : >> Author: brueffer >> Date: Mon Jul 16 22:07:29 2012 >> New Revision: 238539 >> URL: http://svn.freebsd.org/changeset/base/238539 >> >> Log: >> Simply error handling by moving the allocation of np down to where it is >> actually used. While here, improve style a little. > > Too bad that the biggest bug here is still in place. > Right now smbfs inserts in the mount list half-constructed vnodes. > Maybe you are interested in fixing this? > I can give it a shot, no promises though. Cheers, Chris From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 12:23:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D0851065674; Wed, 18 Jul 2012 12:23:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8693B8FC0C; Wed, 18 Jul 2012 12:23:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6ICNkAB069934; Wed, 18 Jul 2012 12:23:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6ICNkGG069932; Wed, 18 Jul 2012 12:23:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207181223.q6ICNkGG069932@svn.freebsd.org> From: Alexander Motin Date: Wed, 18 Jul 2012 12:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238595 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 12:23:46 -0000 Author: mav Date: Wed Jul 18 12:23:45 2012 New Revision: 238595 URL: http://svn.freebsd.org/changeset/base/238595 Log: Add bunch of new ASC/ASCQ values from T10 site. Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Wed Jul 18 11:36:59 2012 (r238594) +++ head/sys/cam/scsi/scsi_all.c Wed Jul 18 12:23:45 2012 (r238595) @@ -768,7 +768,7 @@ static struct asc_table_entry asc_table[ * * SCSI ASC/ASCQ Assignments * Numeric Sorted Listing - * as of 7/29/08 + * as of 5/20/12 * * D - DIRECT ACCESS DEVICE (SBC-2) device column key * .T - SEQUENTIAL ACCESS DEVICE (SSC) ------------------- @@ -854,6 +854,12 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x00, 0x1E, SS_RDEF, /* XXX TBD */ "Conflicting SA creation request") }, + /* DT B */ + { SST(0x00, 0x1F, SS_RDEF, /* XXX TBD */ + "Logical unit transitioning to another power condition") }, + /* DT P B */ + { SST(0x00, 0x20, SS_RDEF, /* XXX TBD */ + "Extended copy information available") }, /* D W O BK */ { SST(0x01, 0x00, SS_RDEF, "No index/sector signal") }, @@ -923,6 +929,33 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x04, 0x13, SS_RDEF, /* XXX TBD */ "Logical unit not ready, SA creation in progress") }, + /* D B */ + { SST(0x04, 0x14, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, space allocation in progress") }, + /* M */ + { SST(0x04, 0x15, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, robotics disabled") }, + /* M */ + { SST(0x04, 0x16, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, configuration required") }, + /* M */ + { SST(0x04, 0x17, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, calibration required") }, + /* M */ + { SST(0x04, 0x18, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, a door is open") }, + /* M */ + { SST(0x04, 0x19, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, operating in sequential mode") }, + /* DT B */ + { SST(0x04, 0x1A, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, START/STOP UNIT command in progress") }, + /* D B */ + { SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, sanitize in progress") }, + /* DT MAEB */ + { SST(0x04, 0x1C, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, additional power use not yet granted") }, /* DTL WROMAEBKVF */ { SST(0x05, 0x00, SS_RDEF, "Logical unit does not respond to selection") }, @@ -989,6 +1022,12 @@ static struct asc_table_entry asc_table[ /* DTLPWROMAEBKVF */ { SST(0x0B, 0x07, SS_RDEF, /* XXX TBD */ "Warning - degraded power to non-volatile cache") }, + /* DTLPWROMAEBKVF */ + { SST(0x0B, 0x08, SS_RDEF, /* XXX TBD */ + "Warning - power loss expected") }, + /* D */ + { SST(0x0B, 0x09, SS_RDEF, /* XXX TBD */ + "Warning - device statistics notification available") }, /* T R */ { SST(0x0C, 0x00, SS_RDEF, "Write error") }, @@ -1031,6 +1070,9 @@ static struct asc_table_entry asc_table[ /* DTLPWRO AEBKVF */ { SST(0x0C, 0x0D, SS_RDEF, /* XXX TBD */ "Write error - not enough unsolicited data") }, + /* DT W O BK */ + { SST(0x0C, 0x0E, SS_RDEF, /* XXX TBD */ + "Multiple write errors") }, /* R */ { SST(0x0C, 0x0F, SS_RDEF, /* XXX TBD */ "Defects in error window") }, @@ -1076,6 +1118,12 @@ static struct asc_table_entry asc_table[ /* DT W O */ { SST(0x10, 0x03, SS_RDEF, /* XXX TBD */ "Logical block reference tag check failed") }, + /* T */ + { SST(0x10, 0x04, SS_RDEF, /* XXX TBD */ + "Logical block protection error on recovered buffer data") }, + /* T */ + { SST(0x10, 0x05, SS_RDEF, /* XXX TBD */ + "Logical block protection method error") }, /* DT WRO BK */ { SST(0x11, 0x00, SS_FATAL|EIO, "Unrecovered read error") }, @@ -1280,6 +1328,9 @@ static struct asc_table_entry asc_table[ /* DT WRO BK */ { SST(0x1D, 0x00, SS_FATAL, "Miscompare during verify operation") }, + /* D B */ + { SST(0x1D, 0x01, SS_RDEF, /* XXX TBD */ + "Miscomparable verify of unmapped LBA") }, /* D W O BK */ { SST(0x1E, 0x00, SS_NOP | SSQ_PRINT_SENSE, "Recovered ID with ECC correction") }, @@ -1322,6 +1373,9 @@ static struct asc_table_entry asc_table[ /* DT PWROMAEBK */ { SST(0x20, 0x0B, SS_RDEF, /* XXX TBD */ "Access denied - ACL LUN conflict") }, + /* T */ + { SST(0x20, 0x0C, SS_FATAL | EINVAL, + "Illegal command when not in append-only mode") }, /* DT WRO BK */ { SST(0x21, 0x00, SS_FATAL | EINVAL, "Logical block address out of range") }, @@ -1337,6 +1391,39 @@ static struct asc_table_entry asc_table[ /* D */ { SST(0x22, 0x00, SS_FATAL | EINVAL, "Illegal function (use 20 00, 24 00, or 26 00)") }, + /* DT P B */ + { SST(0x23, 0x00, SS_RDEF, /* XXX TBD */ + "Invalid token operation, cause not reportable") }, + /* DT P B */ + { SST(0x23, 0x01, SS_RDEF, /* XXX TBD */ + "Invalid token operation, unsupported token type") }, + /* DT P B */ + { SST(0x23, 0x02, SS_RDEF, /* XXX TBD */ + "Invalid token operation, remote token usage not supported") }, + /* DT P B */ + { SST(0x23, 0x03, SS_RDEF, /* XXX TBD */ + "Invalid token operation, remote ROD token creation not supported") }, + /* DT P B */ + { SST(0x23, 0x04, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token unknown") }, + /* DT P B */ + { SST(0x23, 0x05, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token corrupt") }, + /* DT P B */ + { SST(0x23, 0x06, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token revoked") }, + /* DT P B */ + { SST(0x23, 0x07, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token expired") }, + /* DT P B */ + { SST(0x23, 0x08, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token cancelled") }, + /* DT P B */ + { SST(0x23, 0x09, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token deleted") }, + /* DT P B */ + { SST(0x23, 0x0A, SS_RDEF, /* XXX TBD */ + "Invalid token operation, invalid token length") }, /* DTLPWROMAEBKVF */ { SST(0x24, 0x00, SS_FATAL | EINVAL, "Invalid field in CDB") }, @@ -1445,6 +1532,9 @@ static struct asc_table_entry asc_table[ /* R F */ { SST(0x27, 0x06, SS_RDEF, /* XXX TBD */ "Conditional write protect") }, + /* D B */ + { SST(0x27, 0x07, SS_RDEF, /* XXX TBD */ + "Space allocation failed write protect") }, /* DTLPWROMAEBKVF */ { SST(0x28, 0x00, SS_FATAL | ENXIO, "Not ready to ready change, medium may have changed") }, @@ -1543,6 +1633,9 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x2A, 0x14, SS_RDEF, /* XXX TBD */ "SA creation capabilities data has changed") }, + /* T M V */ + { SST(0x2A, 0x15, SS_RDEF, /* XXX TBD */ + "Medium removal prevention preempted") }, /* DTLPWRO K */ { SST(0x2B, 0x00, SS_RDEF, "Copy cannot execute since host cannot disconnect") }, @@ -1582,6 +1675,9 @@ static struct asc_table_entry asc_table[ /* T */ { SST(0x2C, 0x0B, SS_RDEF, /* XXX TBD */ "Not reserved") }, + /* D */ + { SST(0x2C, 0x0C, SS_RDEF, /* XXX TBD */ + "ORWRITE generation does not match") }, /* T */ { SST(0x2D, 0x00, SS_RDEF, "Overwrite error on update in place") }, @@ -1645,6 +1741,9 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x30, 0x12, SS_RDEF, /* XXX TBD */ "Incompatible volume qualifier") }, + /* M */ + { SST(0x30, 0x13, SS_RDEF, /* XXX TBD */ + "Cleaning volume expired") }, /* DT WRO BK */ { SST(0x31, 0x00, SS_RDEF, "Medium format corrupted") }, @@ -1654,6 +1753,9 @@ static struct asc_table_entry asc_table[ /* R */ { SST(0x31, 0x02, SS_RDEF, /* XXX TBD */ "Zoned formatting failed due to spare linking") }, + /* D B */ + { SST(0x31, 0x03, SS_RDEF, /* XXX TBD */ + "SANITIZE command failed") }, /* D W O BK */ { SST(0x32, 0x00, SS_RDEF, "No defect spare location available") }, @@ -1702,6 +1804,9 @@ static struct asc_table_entry asc_table[ /* B */ { SST(0x38, 0x06, SS_RDEF, /* XXX TBD */ "ESN - device busy class event") }, + /* D */ + { SST(0x38, 0x07, SS_RDEF, /* XXX TBD */ + "Thin provisioning soft threshold reached") }, /* DTL WROMAE K */ { SST(0x39, 0x00, SS_RDEF, "Saving parameters not supported") }, @@ -1801,6 +1906,9 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x3B, 0x1B, SS_RDEF, /* XXX TBD */ "Data transfer device inserted") }, + /* T */ + { SST(0x3B, 0x1C, SS_RDEF, /* XXX TBD */ + "Too many logical objects on partition to support operation") }, /* DTLPWROMAE K */ { SST(0x3D, 0x00, SS_RDEF, "Invalid bits in IDENTIFY message") }, @@ -1904,6 +2012,9 @@ static struct asc_table_entry asc_table[ /* DTLPWROMAEBKVF */ { SST(0x44, 0x00, SS_RDEF, "Internal target failure") }, + /* DT P MAEBKVF */ + { SST(0x44, 0x01, SS_RDEF, /* XXX TBD */ + "Persistent reservation information lost") }, /* DT B */ { SST(0x44, 0x71, SS_RDEF, /* XXX TBD */ "ATA device failed set features") }, @@ -1967,6 +2078,27 @@ static struct asc_table_entry asc_table[ /* DT PWROMAEBK */ { SST(0x4B, 0x06, SS_RDEF, /* XXX TBD */ "Initiator response timeout") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x07, SS_RDEF, /* XXX TBD */ + "Connection lost") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x08, SS_RDEF, /* XXX TBD */ + "Data-in buffer overflow - data buffer size") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x09, SS_RDEF, /* XXX TBD */ + "Data-in buffer overflow - data buffer descriptor area") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0A, SS_RDEF, /* XXX TBD */ + "Data-in buffer error") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0B, SS_RDEF, /* XXX TBD */ + "Data-out buffer overflow - data buffer size") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0C, SS_RDEF, /* XXX TBD */ + "Data-out buffer overflow - data buffer descriptor area") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0D, SS_RDEF, /* XXX TBD */ + "Data-out buffer error") }, /* DTLPWROMAEBKVF */ { SST(0x4C, 0x00, SS_RDEF, "Logical unit failed self-configuration") }, @@ -2012,6 +2144,18 @@ static struct asc_table_entry asc_table[ /* T */ { SST(0x53, 0x04, SS_RDEF, /* XXX TBD */ "Medium thread or unthread failure") }, + /* M */ + { SST(0x53, 0x05, SS_RDEF, /* XXX TBD */ + "Volume identifier invalid") }, + /* T */ + { SST(0x53, 0x06, SS_RDEF, /* XXX TBD */ + "Volume identifier missing") }, + /* M */ + { SST(0x53, 0x07, SS_RDEF, /* XXX TBD */ + "Duplicate volume identifier") }, + /* M */ + { SST(0x53, 0x08, SS_RDEF, /* XXX TBD */ + "Element status unknown") }, /* P */ { SST(0x54, 0x00, SS_RDEF, "SCSI to host system interface failure") }, @@ -2048,6 +2192,15 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x55, 0x0A, SS_RDEF, /* XXX TBD */ "Data currently unavailable") }, + /* DTLPWROMAEBKVF */ + { SST(0x55, 0x0B, SS_RDEF, /* XXX TBD */ + "Insufficient power for operation") }, + /* DT P B */ + { SST(0x55, 0x0C, SS_RDEF, /* XXX TBD */ + "Insufficient reources to create ROD") }, + /* DT P B */ + { SST(0x55, 0x0D, SS_RDEF, /* XXX TBD */ + "Insufficient reources to create ROD token") }, /* R */ { SST(0x57, 0x00, SS_RDEF, "Unable to recover table-of-contents") }, @@ -2354,6 +2507,24 @@ static struct asc_table_entry asc_table[ /* DTLPWRO A K */ { SST(0x5E, 0x04, SS_RDEF, "Standby condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x05, SS_RDEF, + "Idle-B condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x06, SS_RDEF, + "Idle-B condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x07, SS_RDEF, + "Idle-C condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x08, SS_RDEF, + "Idle-C condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x09, SS_RDEF, + "Stabdby-Y condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x0A, SS_RDEF, + "Standby-Y condition activated by command") }, /* B */ { SST(0x5E, 0x41, SS_RDEF, /* XXX TBD */ "Power state change to active") }, From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 12:41:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04D41106566C; Wed, 18 Jul 2012 12:41:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4C2B8FC0A; Wed, 18 Jul 2012 12:41:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6ICf98Q071587; Wed, 18 Jul 2012 12:41:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6ICf9tg071584; Wed, 18 Jul 2012 12:41:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207181241.q6ICf9tg071584@svn.freebsd.org> From: Alexander Motin Date: Wed, 18 Jul 2012 12:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238596 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 12:41:10 -0000 Author: mav Date: Wed Jul 18 12:41:09 2012 New Revision: 238596 URL: http://svn.freebsd.org/changeset/base/238596 Log: Fix some typos in r238595. Reported by: brueffer Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Wed Jul 18 12:23:45 2012 (r238595) +++ head/sys/cam/scsi/scsi_all.c Wed Jul 18 12:41:09 2012 (r238596) @@ -2197,10 +2197,10 @@ static struct asc_table_entry asc_table[ "Insufficient power for operation") }, /* DT P B */ { SST(0x55, 0x0C, SS_RDEF, /* XXX TBD */ - "Insufficient reources to create ROD") }, + "Insufficient resources to create ROD") }, /* DT P B */ { SST(0x55, 0x0D, SS_RDEF, /* XXX TBD */ - "Insufficient reources to create ROD token") }, + "Insufficient resources to create ROD token") }, /* R */ { SST(0x57, 0x00, SS_RDEF, "Unable to recover table-of-contents") }, @@ -2521,7 +2521,7 @@ static struct asc_table_entry asc_table[ "Idle-C condition activated by command") }, /* DTLPWRO A K */ { SST(0x5E, 0x09, SS_RDEF, - "Stabdby-Y condition activated by timer") }, + "Standby-Y condition activated by timer") }, /* DTLPWRO A K */ { SST(0x5E, 0x0A, SS_RDEF, "Standby-Y condition activated by command") }, From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 15:36:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A2511065680; Wed, 18 Jul 2012 15:36: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 45F038FC19; Wed, 18 Jul 2012 15:36:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IFa41Q084776; Wed, 18 Jul 2012 15:36:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IFa45h084774; Wed, 18 Jul 2012 15:36:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207181536.q6IFa45h084774@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 18 Jul 2012 15:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238597 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 15:36:04 -0000 Author: kib Date: Wed Jul 18 15:36:03 2012 New Revision: 238597 URL: http://svn.freebsd.org/changeset/base/238597 Log: Add stmxcsr. Submitted by: Ed Alley PR: amd64/169927 MFC after: 3 weeks Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Wed Jul 18 12:41:09 2012 (r238596) +++ head/sys/amd64/amd64/fpu.c Wed Jul 18 15:36:03 2012 (r238597) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #define ldmxcsr(csr) __asm __volatile("ldmxcsr %0" : : "m" (csr)) +#define stmxcsr(addr) __asm __volatile("stmxcsr %0" : : "m" (*(addr))) static __inline void xrstor(char *addr, uint64_t mask) @@ -105,6 +106,7 @@ void fnstsw(caddr_t addr); void fxsave(caddr_t addr); void fxrstor(caddr_t addr); void ldmxcsr(u_int csr); +void stmxcsr(u_int csr); void xrstor(char *addr, uint64_t mask); void xsave(char *addr, uint64_t mask); From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 15:43:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD1351065677; Wed, 18 Jul 2012 15:43:47 +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 B71D48FC08; Wed, 18 Jul 2012 15:43:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IFhlhN085359; Wed, 18 Jul 2012 15:43:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IFhlZh085355; Wed, 18 Jul 2012 15:43:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207181543.q6IFhlZh085355@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 18 Jul 2012 15:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238598 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 15:43:47 -0000 Author: kib Date: Wed Jul 18 15:43:47 2012 New Revision: 238598 URL: http://svn.freebsd.org/changeset/base/238598 Log: On AMD64, provide siginfo.si_code for floating point errors when error occurs using the SSE math processor. Update comments describing the handling of the exception status bits in coprocessors control words. Remove GET_FPU_CW and GET_FPU_SW macros which were used only once. Prefer to use curpcb to access pcb_save over the longer path of referencing pcb through the thread structure. Based on the submission by: Ed Alley PR: amd64/169927 Reviewed by: bde MFC after: 3 weeks Modified: head/sys/amd64/amd64/fpu.c head/sys/amd64/amd64/trap.c head/sys/amd64/include/fpu.h Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Wed Jul 18 15:36:03 2012 (r238597) +++ head/sys/amd64/amd64/fpu.c Wed Jul 18 15:43:47 2012 (r238598) @@ -115,9 +115,6 @@ void xsave(char *addr, uint64_t mask); #define start_emulating() load_cr0(rcr0() | CR0_TS) #define stop_emulating() clts() -#define GET_FPU_CW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_cw) -#define GET_FPU_SW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_sw) - CTASSERT(sizeof(struct savefpu) == 512); CTASSERT(sizeof(struct xstate_hdr) == 64); CTASSERT(sizeof(struct savefpu_ymm) == 832); @@ -516,11 +513,15 @@ static char fpetable[128] = { }; /* - * Preserve the FP status word, clear FP exceptions, then generate a SIGFPE. + * Preserve the FP status word, clear FP exceptions for x87, then + * generate a SIGFPE. + * + * Clearing exceptions was necessary mainly to avoid IRQ13 bugs and is + * engraved in our i386 ABI. We now depend on longjmp() restoring a + * usable state. Restoring the state or examining it might fail if we + * didn't clear exceptions. * - * Clearing exceptions is necessary mainly to avoid IRQ13 bugs. We now - * depend on longjmp() restoring a usable state. Restoring the state - * or examining it might fail if we didn't clear exceptions. + * For SSE exceptions, the exceptions are not cleared. * * The error code chosen will be one of the FPE_... macros. It will be * sent as the second argument to old BSD-style signal handlers and as @@ -533,8 +534,9 @@ static char fpetable[128] = { * solution for signals other than SIGFPE. */ int -fputrap() +fputrap_x87(void) { + struct savefpu *pcb_save; u_short control, status; critical_enter(); @@ -545,19 +547,33 @@ fputrap() * wherever they are. */ if (PCPU_GET(fpcurthread) != curthread) { - control = GET_FPU_CW(curthread); - status = GET_FPU_SW(curthread); + pcb_save = PCPU_GET(curpcb)->pcb_save; + control = pcb_save->sv_env.en_cw; + status = pcb_save->sv_env.en_sw; } else { fnstcw(&control); fnstsw(&status); + fnclex(); } - if (PCPU_GET(fpcurthread) == curthread) - fnclex(); critical_exit(); return (fpetable[status & ((~control & 0x3f) | 0x40)]); } +int +fputrap_sse(void) +{ + u_int mxcsr; + + critical_enter(); + if (PCPU_GET(fpcurthread) != curthread) + mxcsr = PCPU_GET(curpcb)->pcb_save->sv_env.en_mxcsr; + else + stmxcsr(&mxcsr); + critical_exit(); + return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); +} + /* * Implement device not available (DNA) exception * Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Jul 18 15:36:03 2012 (r238597) +++ head/sys/amd64/amd64/trap.c Wed Jul 18 15:43:47 2012 (r238598) @@ -328,7 +328,7 @@ trap(struct trapframe *frame) break; case T_ARITHTRAP: /* arithmetic trap */ - ucode = fputrap(); + ucode = fputrap_x87(); if (ucode == -1) goto userout; i = SIGFPE; @@ -442,7 +442,9 @@ trap(struct trapframe *frame) break; case T_XMMFLT: /* SIMD floating-point exception */ - ucode = 0; /* XXX */ + ucode = fputrap_sse(); + if (ucode == -1) + goto userout; i = SIGFPE; break; } Modified: head/sys/amd64/include/fpu.h ============================================================================== --- head/sys/amd64/include/fpu.h Wed Jul 18 15:36:03 2012 (r238597) +++ head/sys/amd64/include/fpu.h Wed Jul 18 15:43:47 2012 (r238598) @@ -62,7 +62,8 @@ int fpusetregs(struct thread *td, struct char *xfpustate, size_t xfpustate_size); int fpusetxstate(struct thread *td, char *xfpustate, size_t xfpustate_size); -int fputrap(void); +int fputrap_sse(void); +int fputrap_x87(void); void fpuuserinited(struct thread *td); struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int flags); void fpu_kern_free_ctx(struct fpu_kern_ctx *ctx); From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 15:52:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AFF71065677; Wed, 18 Jul 2012 15:52:10 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05B6F8FC16; Wed, 18 Jul 2012 15:52:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IFq9GC086115; Wed, 18 Jul 2012 15:52:09 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IFq9TP086113; Wed, 18 Jul 2012 15:52:09 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201207181552.q6IFq9TP086113@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 18 Jul 2012 15:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238599 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 15:52:10 -0000 Author: emax Date: Wed Jul 18 15:52:09 2012 New Revision: 238599 URL: http://svn.freebsd.org/changeset/base/238599 Log: Return zero from get_addrselectpolicy() when no source-address-selection policy is installed. MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Wed Jul 18 15:43:47 2012 (r238598) +++ head/lib/libc/net/getaddrinfo.c Wed Jul 18 15:52:09 2012 (r238599) @@ -692,6 +692,8 @@ get_addrselectpolicy(struct policyhead * if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &l, NULL, 0) < 0) return (0); + if (l == 0) + return (0); if ((buf = malloc(l)) == NULL) return (0); if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &l, NULL, 0) < 0) { From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 16:13:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92F45106566C; Wed, 18 Jul 2012 16:13:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72A628FC1D; Wed, 18 Jul 2012 16:13:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IGD4so087603; Wed, 18 Jul 2012 16:13:04 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IGD4gZ087600; Wed, 18 Jul 2012 16:13:04 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207181613.q6IGD4gZ087600@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 18 Jul 2012 16:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238600 - stable/9/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 16:13:04 -0000 Author: glebius Date: Wed Jul 18 16:13:03 2012 New Revision: 238600 URL: http://svn.freebsd.org/changeset/base/238600 Log: Merge r230119, r238498 from head: ------------------------------------------------------------------------ r230119 | csjp | 2012-01-15 02:51:34 +0400 (вс, 15 янв 2012) | 9 lines Revert to the old behavior of allocating table/table entries using M_NOWAIT. Currently, the code allows for sleeping in the ioctl path to guarantee allocation. However code also handles ENOMEM gracefully, so propagate this error back to user-space, rather than sleeping while holding the global pf mutex. Reviewed by: glebius Discussed with: bz ------------------------------------------------------------------------ r238498 | glebius | 2012-07-15 23:10:00 +0400 (вс, 15 июл 2012) | 2 lines Use M_NOWAIT while holding the pf giant lock. Approved by: re (kib) Modified: stable/9/sys/contrib/pf/net/pf_if.c stable/9/sys/contrib/pf/net/pf_table.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/contrib/pf/ (props changed) Modified: stable/9/sys/contrib/pf/net/pf_if.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_if.c Wed Jul 18 15:52:09 2012 (r238599) +++ stable/9/sys/contrib/pf/net/pf_if.c Wed Jul 18 16:13:03 2012 (r238600) @@ -506,8 +506,7 @@ pfi_dynaddr_setup(struct pf_addr_wrap *a if (aw->type != PF_ADDR_DYNIFTL) return (0); #ifdef __FreeBSD__ - /* XXX: revisit! */ - if ((dyn = pool_get(&V_pfi_addr_pl, PR_WAITOK | PR_ZERO)) + if ((dyn = pool_get(&V_pfi_addr_pl, PR_NOWAIT | PR_ZERO)) #else if ((dyn = pool_get(&pfi_addr_pl, PR_WAITOK | PR_LIMITFAIL | PR_ZERO)) #endif Modified: stable/9/sys/contrib/pf/net/pf_table.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_table.c Wed Jul 18 15:52:09 2012 (r238599) +++ stable/9/sys/contrib/pf/net/pf_table.c Wed Jul 18 16:13:03 2012 (r238600) @@ -926,16 +926,12 @@ pfr_create_kentry(struct pfr_addr *ad, i { struct pfr_kentry *ke; - if (intr) #ifdef __FreeBSD__ - ke = pool_get(&V_pfr_kentry_pl, PR_NOWAIT | PR_ZERO); + ke = pool_get(&V_pfr_kentry_pl, PR_NOWAIT | PR_ZERO); #else + if (intr) ke = pool_get(&pfr_kentry_pl, PR_NOWAIT | PR_ZERO); -#endif else -#ifdef __FreeBSD__ - ke = pool_get(&V_pfr_kentry_pl, PR_WAITOK|PR_ZERO); -#else ke = pool_get(&pfr_kentry_pl, PR_WAITOK|PR_ZERO|PR_LIMITFAIL); #endif if (ke == NULL) @@ -2080,16 +2076,12 @@ pfr_create_ktable(struct pfr_table *tbl, struct pfr_ktable *kt; struct pf_ruleset *rs; - if (intr) #ifdef __FreeBSD__ - kt = pool_get(&V_pfr_ktable_pl, PR_NOWAIT|PR_ZERO); + kt = pool_get(&V_pfr_ktable_pl, PR_NOWAIT|PR_ZERO); #else + if (intr) kt = pool_get(&pfr_ktable_pl, PR_NOWAIT|PR_ZERO|PR_LIMITFAIL); -#endif else -#ifdef __FreeBSD__ - kt = pool_get(&V_pfr_ktable_pl, PR_WAITOK|PR_ZERO); -#else kt = pool_get(&pfr_ktable_pl, PR_WAITOK|PR_ZERO|PR_LIMITFAIL); #endif if (kt == NULL) From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 18:10:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91E8B1065672; Wed, 18 Jul 2012 18:10:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CB138FC14; Wed, 18 Jul 2012 18:10:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IIAStD096860; Wed, 18 Jul 2012 18:10:28 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IIASs1096858; Wed, 18 Jul 2012 18:10:28 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201207181810.q6IIASs1096858@svn.freebsd.org> From: Sean Bruno Date: Wed, 18 Jul 2012 18:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238601 - head/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 18:10:28 -0000 Author: sbruno Date: Wed Jul 18 18:10:27 2012 New Revision: 238601 URL: http://svn.freebsd.org/changeset/base/238601 Log: On BIO_ERROR, set bio_resid to stop losing data in the error case. Submitted by: Mark Johnston Reviewed by: scottl@freebsd.org MFC after: 2 weeks Modified: head/sys/dev/aac/aac_disk.c Modified: head/sys/dev/aac/aac_disk.c ============================================================================== --- head/sys/dev/aac/aac_disk.c Wed Jul 18 16:13:03 2012 (r238600) +++ head/sys/dev/aac/aac_disk.c Wed Jul 18 18:10:27 2012 (r238601) @@ -334,8 +334,10 @@ aac_biodone(struct bio *bp) { fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - if (bp->bio_flags & BIO_ERROR) + if (bp->bio_flags & BIO_ERROR) { + bp->bio_resid = bp->bio_bcount; disk_err(bp, "hard error", -1, 1); + } biodone(bp); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 19:28:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E406B106564A; Wed, 18 Jul 2012 19:28:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B50B68FC0C; Wed, 18 Jul 2012 19:28:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IJSM6t003203; Wed, 18 Jul 2012 19:28:22 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IJSMgZ003200; Wed, 18 Jul 2012 19:28:22 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201207181928.q6IJSMgZ003200@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 18 Jul 2012 19:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238602 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 19:28:23 -0000 Author: des Date: Wed Jul 18 19:28:22 2012 New Revision: 238602 URL: http://svn.freebsd.org/changeset/base/238602 Log: Add -g (gigabyte) flag to complement -k (kilobyte) and -m (megabyte). MFC after: 1 week Modified: head/usr.bin/du/du.1 head/usr.bin/du/du.c Modified: head/usr.bin/du/du.1 ============================================================================== --- head/usr.bin/du/du.1 Wed Jul 18 18:10:27 2012 (r238601) +++ head/usr.bin/du/du.1 Wed Jul 18 19:28:22 2012 (r238602) @@ -28,7 +28,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd December 17, 2011 +.Dd July 18, 2012 .Dt DU 1 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nm .Op Fl Aclnx .Op Fl H | L | P -.Op Fl h | k | m +.Op Fl g | h | k | m .Op Fl a | s | d Ar depth .Op Fl B Ar blocksize .Op Fl I Ar mask @@ -63,9 +63,9 @@ Calculate block counts in .Ar blocksize byte blocks. This is different from the -.Fl h, k +.Fl h, k, m and -.Fl m +.Fl g options or setting .Ev BLOCKSIZE and gives an estimate of how much space the examined file hierarchy would @@ -95,13 +95,15 @@ Display a grand total. Display an entry for all files and directories .Ar depth directories deep. +.It Fl g +Display block counts in 1073741824-byte (1 GiB) blocks. .It Fl h .Dq Human-readable output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte. .It Fl k -Display block counts in 1024-byte (1-Kbyte) blocks. +Display block counts in 1024-byte (1 kiB) blocks. .It Fl l If a file has multiple hard links, count its size multiple times. The default behavior of @@ -112,7 +114,7 @@ When the option is specified, the hard link checks are disabled, and these files are counted (and displayed) as many times as they are found. .It Fl m -Display block counts in 1048576-byte (1-Mbyte) blocks. +Display block counts in 1048576-byte (1 MiB) blocks. .It Fl n Ignore files and directories with user .Dq nodump Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Wed Jul 18 18:10:27 2012 (r238601) +++ head/usr.bin/du/du.c Wed Jul 18 19:28:22 2012 (r238602) @@ -109,7 +109,7 @@ main(int argc, char *argv[]) depth = INT_MAX; SLIST_INIT(&ignores); - while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrt:x")) != -1) + while ((ch = getopt(argc, argv, "AB:HI:LPasd:cghklmnrt:x")) != -1) switch (ch) { case 'A': Aflag = 1; @@ -156,6 +156,10 @@ main(int argc, char *argv[]) case 'c': cflag = 1; break; + case 'g': + hflag = 0; + blocksize = 1073741824; + break; case 'h': hflag = 1; break; From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 21:30:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9A98106566B; Wed, 18 Jul 2012 21:30:17 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3D358FC15; Wed, 18 Jul 2012 21:30:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6ILUHPr013124; Wed, 18 Jul 2012 21:30:17 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6ILUHDx013116; Wed, 18 Jul 2012 21:30:17 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201207182130.q6ILUHDx013116@svn.freebsd.org> From: Joerg Wunsch Date: Wed, 18 Jul 2012 21:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238603 - in head/share/examples: . libusb20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 21:30:17 -0000 Author: joerg Date: Wed Jul 18 21:30:17 2012 New Revision: 238603 URL: http://svn.freebsd.org/changeset/base/238603 Log: Add some examples about how to use FreeBSD's libusb20 in your own code. Added: head/share/examples/libusb20/ head/share/examples/libusb20/Makefile (contents, props changed) head/share/examples/libusb20/README (contents, props changed) head/share/examples/libusb20/aux.c (contents, props changed) head/share/examples/libusb20/aux.h (contents, props changed) head/share/examples/libusb20/bulk.c (contents, props changed) head/share/examples/libusb20/control.c (contents, props changed) Modified: head/share/examples/Makefile Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Wed Jul 18 19:28:22 2012 (r238602) +++ head/share/examples/Makefile Wed Jul 18 21:30:17 2012 (r238603) @@ -20,6 +20,7 @@ LDIRS= BSD_daemon \ ipfw \ jails \ kld \ + libusb20 \ libvgl \ mdoc \ netgraph \ @@ -110,6 +111,12 @@ XFILES= BSD_daemon/FreeBSD.pfa \ kld/syscall/module/syscall.c \ kld/syscall/test/Makefile \ kld/syscall/test/call.c \ + libusb20/Makefile \ + libusb20/README \ + libusb20/aux.c \ + libusb20/aux.h \ + libusb20/bulk.c \ + libusb20/control.c \ libvgl/Makefile \ libvgl/demo.c \ mdoc/POSIX-copyright \ Added: head/share/examples/libusb20/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/libusb20/Makefile Wed Jul 18 21:30:17 2012 (r238603) @@ -0,0 +1,13 @@ +# $FreeBSD$ +TARGETS= bulk control + +all: $(TARGETS) + +bulk: bulk.o aux.o + $(CC) $(CFLAGS) -o bulk bulk.o aux.o -lusb + +control: control.o aux.o + $(CC) $(CFLAGS) -o control control.o aux.o -lusb + +clean: + rm -f $(TARGETS) *.o *~ Added: head/share/examples/libusb20/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/libusb20/README Wed Jul 18 21:30:17 2012 (r238603) @@ -0,0 +1,42 @@ +As I dug my own way through the documentation of libusb 2.0 that ships +with FreeBSD 8+ as the OS'es own USB library API, I noticed there are +only few code examples around under /usr/src (namely, usbconfig +itself). + +The libusb20(3) man page is a starting point, but it's a reference +manual, nothing less, nothing more. Using just a reference, it's not +very easy to start writing your own code based on that. + +So I started writing my own examples, to "get a feeling" about how to +use the library. I covered two typical scenarios which are common for +a number of devices. + +The first one is called "bulk", and uses bulk output (host to device) +and input transfers to talk to an USB device. + +The second one is called "control", and can use both control output +and input transfers, as well as so-called interrupt transfers. The +latter are used for data that are being reported frequently or +repeatedly, like position updates from a pointing device (mouse). +Despite of its name, the host has to poll devices for their interrupt +transfers on each USB frame (i.e., each 1 ms). + +Recommended reading is the USB 3.0 specification (the older 2.0 one +would do as well), to be found under + +http://www.usb.org/developers/docs/ + +as well as documents for individual USB device classes where +appropriate. + +Feel free to be liberal in the licensing of these examples: while the +beer-ware license mandates to keep the license notice, this only +applies to modifications of the original examples itself. For +copy&pasting (even a larger) piece of an example into your own work, I +won't imply you have to reproduce the beer-ware license text there. +Feel free to credit my name in your derived work if you want. + +Dresden, July 2012 +Joerg Wunsch + +# $FreeBSD$ Added: head/share/examples/libusb20/aux.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/libusb20/aux.c Wed Jul 18 21:30:17 2012 (r238603) @@ -0,0 +1,120 @@ +/* ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42) (by Poul-Henning Kamp): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Joerg Wunsch + * ---------------------------------------------------------------------------- + * + * $FreeBSD$ + */ + +/* + * Helper functions common to all examples + */ + +#include +#include +#include + +#include +#include + +#include "aux.h" + +/* + * Return a textual description for error "r". + */ +const char * +usb_error(enum libusb20_error r) +{ + const char *msg = "UNKNOWN"; + + switch (r) + { + case LIBUSB20_SUCCESS: + msg = "success"; + break; + + case LIBUSB20_ERROR_IO: + msg = "IO error"; + break; + + case LIBUSB20_ERROR_INVALID_PARAM: + msg = "Invalid parameter"; + break; + + case LIBUSB20_ERROR_ACCESS: + msg = "Access denied"; + break; + + case LIBUSB20_ERROR_NO_DEVICE: + msg = "No such device"; + break; + + case LIBUSB20_ERROR_NOT_FOUND: + msg = "Entity not found"; + break; + + case LIBUSB20_ERROR_BUSY: + msg = "Resource busy"; + break; + + case LIBUSB20_ERROR_TIMEOUT: + msg = "Operation timed out"; + break; + + case LIBUSB20_ERROR_OVERFLOW: + msg = "Overflow"; + break; + + case LIBUSB20_ERROR_PIPE: + msg = "Pipe error"; + break; + + case LIBUSB20_ERROR_INTERRUPTED: + msg = "System call interrupted"; + break; + + case LIBUSB20_ERROR_NO_MEM: + msg = "Insufficient memory"; + break; + + case LIBUSB20_ERROR_NOT_SUPPORTED: + msg = "Operation not supported"; + break; + + case LIBUSB20_ERROR_OTHER: + msg = "Other error"; + break; + } + + return msg; +} + +/* + * Print "len" bytes from "buf" in hex, followed by an ASCII + * representation (somewhat resembling the output of hd(1)). + */ +void +print_formatted(uint8_t *buf, uint32_t len) +{ + int i, j; + + for (j = 0; j < len; j += 16) + { + printf("%02x: ", j); + + for (i = 0; i < 16 && i + j < len; i++) + printf("%02x ", buf[i + j]); + printf(" "); + for (i = 0; i < 16 && i + j < len; i++) + { + uint8_t c = buf[i + j]; + if(c >= ' ' && c <= '~') + printf("%c", (char)c); + else + putchar('.'); + } + putchar('\n'); + } +} Added: head/share/examples/libusb20/aux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/libusb20/aux.h Wed Jul 18 21:30:17 2012 (r238603) @@ -0,0 +1,15 @@ +/* ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42) (by Poul-Henning Kamp): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Joerg Wunsch + * ---------------------------------------------------------------------------- + * + * $FreeBSD$ + */ + +#include +#include + +const char *usb_error(enum libusb20_error r); +void print_formatted(uint8_t *buf, uint32_t len); Added: head/share/examples/libusb20/bulk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/libusb20/bulk.c Wed Jul 18 21:30:17 2012 (r238603) @@ -0,0 +1,243 @@ +/* ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42) (by Poul-Henning Kamp): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Joerg Wunsch + * ---------------------------------------------------------------------------- + * + * $FreeBSD$ + */ + +/* + * Simple demo program to illustrate the handling of FreeBSD's + * libusb20. + * + * Issues a bulk output, and then requests a bulk input. + */ + +/* + * Examples: + * Just list all VID:PID pairs + * ./bulk + * + * Say "hello" to an Atmel JTAGICEmkII. + * ./bulk -o 2 -i 0x82 -v 0x03eb -p 0x2103 0x1b 0 0 1 0 0 0 0x0e 1 0xf3 0x97 + * + * Return the INQUIRY data of an USB mass storage device. + * (It's best to have the umass(4) driver unloaded while doing such + * experiments, and perform a "usbconfig reset" for the device if it + * gets stuck.) + * ./bulk -v 0x5e3 -p 0x723 -i 0x81 -o 2 0x55 0x53 0x42 0x43 1 2 3 4 31 12 0x80 0x24 0 0 0 0x12 0 0 0 36 0 0 0 0 0 0 0 0 0 0 + */ + + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "aux.h" + +/* + * If you want to see the details of the internal datastructures + * in the debugger, unifdef the following. + */ +#ifdef DEBUG +# include +# include "/usr/src/lib/libusb/libusb20_int.h" +#endif + +#define BUFLEN 64 + +#define TIMEOUT 5000 /* 5 s */ + +int in_ep, out_ep; /* endpoints */ +uint8_t out_buf[BUFLEN]; +uint16_t out_len; + +static void +doit(struct libusb20_device *dev) +{ + int rv; + + /* + * Open the device, allocating memory for two possible (bulk or + * interrupt) transfers. + * + * If only control transfers are intended (via + * libusb20_dev_request_sync()), transfer_max can be given as 0. + */ + if ((rv = libusb20_dev_open(dev, 2)) != 0) + { + fprintf(stderr, "libusb20_dev_open: %s\n", usb_error(rv)); + return; + } + + /* + * If the device has more than one configuration, select the desired + * one here. + */ + if ((rv = libusb20_dev_set_config_index(dev, 0)) != 0) + { + fprintf(stderr, "libusb20_dev_set_config_index: %s\n", usb_error(rv)); + return; + } + + /* + * Two transfers have been requested in libusb20_dev_open() above; + * obtain the corresponding transfer struct pointers. + */ + struct libusb20_transfer *xfr_out = libusb20_tr_get_pointer(dev, 0); + struct libusb20_transfer *xfr_in = libusb20_tr_get_pointer(dev, 1); + + if (xfr_in == NULL || xfr_out == NULL) + { + fprintf(stderr, "libusb20_tr_get_pointer: %s\n", usb_error(rv)); + return; + } + + /* + * Open both transfers, the "out" one for the write endpoint, the + * "in" one for the read endpoint (ep | 0x80). + */ + if ((rv = libusb20_tr_open(xfr_out, 0, 1, out_ep)) != 0) + { + fprintf(stderr, "libusb20_tr_open: %s\n", usb_error(rv)); + return; + } + if ((rv = libusb20_tr_open(xfr_in, 0, 1, in_ep)) != 0) + { + fprintf(stderr, "libusb20_tr_open: %s\n", usb_error(rv)); + return; + } + + uint8_t in_buf[BUFLEN]; + uint32_t rlen; + + if (out_len > 0) + { + if ((rv = libusb20_tr_bulk_intr_sync(xfr_out, out_buf, out_len, &rlen, TIMEOUT)) + != 0) + { + fprintf(stderr, "libusb20_tr_bulk_intr_sync (OUT): %s\n", usb_error(rv)); + } + printf("sent %d bytes\n", rlen); + } + + if ((rv = libusb20_tr_bulk_intr_sync(xfr_in, in_buf, BUFLEN, &rlen, TIMEOUT)) + != 0) + { + fprintf(stderr, "libusb20_tr_bulk_intr_sync: %s\n", usb_error(rv)); + } + printf("received %d bytes\n", rlen); + if (rlen > 0) + print_formatted(in_buf, rlen); + + libusb20_tr_close(xfr_out); + libusb20_tr_close(xfr_in); + + libusb20_dev_close(dev); +} + +static void +usage(void) +{ + fprintf(stderr, + "Usage ./usb -i -o -v -p [ ...\n]"); + exit(EX_USAGE); +} + +int +main(int argc, char **argv) +{ + unsigned int vid = UINT_MAX, pid = UINT_MAX; /* impossible VID:PID */ + int c; + + while ((c = getopt(argc, argv, "i:o:p:v:")) != -1) + switch (c) + { + case 'i': + in_ep = strtol(optarg, NULL, 0); + break; + + case 'o': + out_ep = strtol(optarg, NULL, 0); + break; + + case 'p': + pid = strtol(optarg, NULL, 0); + break; + + case 'v': + vid = strtol(optarg, NULL, 0); + break; + + default: + usage(); + break; + } + argc -= optind; + argv += optind; + + if (vid != UINT_MAX || pid != UINT_MAX) + { + if (in_ep == 0 || out_ep == 0) + { + usage(); + } + if ((in_ep & 0x80) == 0) + { + fprintf(stderr, "IN_EP must have bit 7 set\n"); + return (EX_USAGE); + } + + if (argc > 0) + { + for (out_len = 0; argc > 0 && out_len < BUFLEN; out_len++, argc--) + { + unsigned n = strtoul(argv[out_len], 0, 0); + if (n > 255) + fprintf(stderr, + "Warning: data #%d 0x%0x > 0xff, truncating\n", + out_len, n); + out_buf[out_len] = (uint8_t)n; + } + out_len++; + if (argc > 0) + fprintf(stderr, + "Data count exceeds maximum of %d, ignoring %d elements\n", + BUFLEN, optind); + } + } + + struct libusb20_backend *be; + struct libusb20_device *dev; + + if ((be = libusb20_be_alloc_default()) == NULL) + { + perror("libusb20_be_alloc()"); + return 1; + } + + dev = NULL; + while ((dev = libusb20_be_device_foreach(be, dev)) != NULL) + { + struct LIBUSB20_DEVICE_DESC_DECODED *ddp = + libusb20_dev_get_device_desc(dev); + + printf("Found device %s (VID:PID = 0x%04x:0x%04x)\n", + libusb20_dev_get_desc(dev), + ddp->idVendor, ddp->idProduct); + + if (ddp->idVendor == vid && ddp->idProduct == pid) + doit(dev); + } + + libusb20_be_free(be); + return 0; +} Added: head/share/examples/libusb20/control.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/libusb20/control.c Wed Jul 18 21:30:17 2012 (r238603) @@ -0,0 +1,414 @@ +/* ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42) (by Poul-Henning Kamp): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Joerg Wunsch + * ---------------------------------------------------------------------------- + * + * $FreeBSD$ + */ + +/* + * Simple demo program to illustrate the handling of FreeBSD's + * libusb20. + * + * XXX + */ + +/* + * Examples: + * Just list all VID:PID pairs + * ./control + * + * Standard device request GET_STATUS, report two bytes of status + * (bit 0 in the first byte returned is the "self powered" bit) + * ./control -v 0x3eb -p 0x2103 in std dev get_status 0 0 2 + * + * Request input reports through the interrupt pipe from a mouse + * device (move the mouse around after issuing the command): + * ./control -v 0x093a -p 0x2516 -i 0x81 + * + */ + + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/* + * If you want to see the details of the internal datastructures + * in the debugger, unifdef the following. + */ +#ifdef DEBUG +# include "/usr/src/lib/libusb/libusb20_int.h" +#endif + +#define BUFLEN 64 + +#define TIMEOUT 5000 /* 5 s */ + +int intr_ep; /* endpoints */ +struct LIBUSB20_CONTROL_SETUP_DECODED setup; + +uint8_t out_buf[BUFLEN]; +uint16_t out_len; + +bool do_request; + +static void +doit(struct libusb20_device *dev) +{ + int rv; + + if (do_request) + printf("doit(): bmRequestType 0x%02x, bRequest 0x%02x, wValue 0x%04x, wIndex 0x%04x, wLength 0x%04x\n", + setup.bmRequestType, + setup.bRequest, + setup.wValue, + setup.wIndex, + setup.wLength); + + /* + * Open the device, allocating memory for two possible (bulk or + * interrupt) transfers. + * + * If only control transfers are intended (via + * libusb20_dev_request_sync()), transfer_max can be given as 0. + */ + if ((rv = libusb20_dev_open(dev, 1)) != 0) + { + fprintf(stderr, "libusb20_dev_open: %s\n", usb_error(rv)); + return; + } + + /* + * If the device has more than one configuration, select the desired + * one here. + */ + if ((rv = libusb20_dev_set_config_index(dev, 0)) != 0) + { + fprintf(stderr, "libusb20_dev_set_config_index: %s\n", usb_error(rv)); + return; + } + + uint8_t *data = 0; + uint16_t actlen; + + if ((setup.bmRequestType & 0x80) != 0) + { + /* this is an IN request, allocate a buffer */ + data = malloc(setup.wLength); + if (data == 0) + { + fprintf(stderr, + "Out of memory allocating %u bytes of reply buffer\n", + setup.wLength); + return; + } + } + else + data = out_buf; + + if (do_request) + { + if ((rv = libusb20_dev_request_sync(dev, &setup, data, + &actlen, + TIMEOUT, + 0 /* flags */)) != 0) + { + fprintf(stderr, + "libusb20_dev_request_sync: %s\n", usb_error(rv)); + } + printf("sent %d bytes\n", actlen); + if ((setup.bmRequestType & 0x80) != 0) + { + print_formatted(data, (uint32_t)setup.wLength); + free(data); + } + } + + if (intr_ep != 0) + { + /* + * One transfer has been requested in libusb20_dev_open() above; + * obtain the corresponding transfer struct pointer. + */ + struct libusb20_transfer *xfr_intr = libusb20_tr_get_pointer(dev, 0); + + if (xfr_intr == NULL) + { + fprintf(stderr, "libusb20_tr_get_pointer: %s\n", usb_error(rv)); + return; + } + + /* + * Open the interrupt transfer. + */ + if ((rv = libusb20_tr_open(xfr_intr, 0, 1, intr_ep)) != 0) + { + fprintf(stderr, "libusb20_tr_open: %s\n", usb_error(rv)); + return; + } + + uint8_t in_buf[BUFLEN]; + uint32_t rlen; + + if ((rv = libusb20_tr_bulk_intr_sync(xfr_intr, in_buf, BUFLEN, &rlen, TIMEOUT)) + != 0) + { + fprintf(stderr, "libusb20_tr_bulk_intr_sync: %s\n", usb_error(rv)); + } + printf("received %d bytes\n", rlen); + if (rlen > 0) + print_formatted(in_buf, rlen); + + libusb20_tr_close(xfr_intr); + } + + libusb20_dev_close(dev); +} + +static void +usage(void) +{ + fprintf(stderr, + "Usage ./usb [-i ] -v -p [dir type rcpt req wValue wIndex wLength [ ...]]\n"); + exit(EX_USAGE); +} + +static const char *reqnames[] = +{ + "get_status", + "clear_feature", + "res1", + "set_feature", + "res2", + "set_address", + "get_descriptor", + "set_descriptor", + "get_configuration", + "set_configuration", + "get_interface", + "set_interface", + "synch_frame", +}; + +static int +get_req(const char *reqname) +{ + size_t i; + size_t l = strlen(reqname); + + for (i = 0; + i < sizeof reqnames / sizeof reqnames[0]; + i++) + if (strncasecmp(reqname, reqnames[i], l) == 0) + return i; + + return strtoul(reqname, 0, 0); +} + + +static int +parse_req(int argc, char **argv) +{ + int idx; + uint8_t rt = 0; + + for (idx = 0; argc != 0 && idx <= 6; argc--, idx++) + switch (idx) + { + case 0: + /* dir[ection]: i[n] | o[ut] */ + if (*argv[idx] == 'i') + rt |= 0x80; + else if (*argv[idx] == 'o') + /* nop */; + else + { + fprintf(stderr, "request direction must be \"in\" or \"out\" (got %s)\n", + argv[idx]); + return -1; + } + break; + + case 1: + /* type: s[tandard] | c[lass] | v[endor] */ + if (*argv[idx] == 's') + /* nop */; + else if (*argv[idx] == 'c') + rt |= 0x20; + else if (*argv[idx] == 'v') + rt |= 0x40; + else + { + fprintf(stderr, + "request type must be one of \"standard\", \"class\", or \"vendor\" (got %s)\n", + argv[idx]); + return -1; + } + break; + + case 2: + /* rcpt: d[evice], i[nterface], e[ndpoint], o[ther] */ + if (*argv[idx] == 'd') + /* nop */; + else if (*argv[idx] == 'i') + rt |= 1; + else if (*argv[idx] == 'e') + rt |= 2; + else if (*argv[idx] == 'o') + rt |= 3; + else + { + fprintf(stderr, + "recipient must be one of \"device\", \"interface\", \"endpoint\", or \"other\" (got %s)\n", + argv[idx]); + return -1; + } + setup.bmRequestType = rt; + break; + + case 3: + setup.bRequest = get_req(argv[idx]); + break; + + case 4: + setup.wValue = strtoul(argv[idx], 0, 0); + break; + + case 5: + setup.wIndex = strtoul(argv[idx], 0, 0); + break; + + case 6: + setup.wLength = strtoul(argv[idx], 0, 0); + break; + } + + return argc; +} + + +int +main(int argc, char **argv) +{ + unsigned int vid = UINT_MAX, pid = UINT_MAX; /* impossible VID:PID */ + int c; + + /* + * Initialize setup struct. This step is required, and initializes + * internal fields in the struct. + * + * All the "public" fields are named exactly the way as the USB + * standard describes them, namely: + * + * setup.bmRequestType: bitmask, bit 7 is direction + * bits 6/5 is request type + * (standard, class, vendor) + * bits 4..0 is recipient + * (device, interface, endpoint, + * other) + * setup.bRequest: the request itself (see get_req() for standard + * requests, or specific value) + * setup.wValue: a 16-bit value + * setup.wIndex: another 16-bit value + * setup.wLength: length of associated data transfer, direction + * depends on bit 7 of bmRequestType + */ + LIBUSB20_INIT(LIBUSB20_CONTROL_SETUP, &setup); + + while ((c = getopt(argc, argv, "i:p:v:")) != -1) + switch (c) + { + case 'i': + intr_ep = strtol(optarg, NULL, 0); + break; + + case 'p': + pid = strtol(optarg, NULL, 0); + break; + + case 'v': + vid = strtol(optarg, NULL, 0); + break; + + default: + usage(); + break; + } + argc -= optind; + argv += optind; + + if (vid != UINT_MAX || pid != UINT_MAX) + { + if (intr_ep != 0 && (intr_ep & 0x80) == 0) + { + fprintf(stderr, "Interrupt endpoint must be of type IN\n"); + usage(); + } + + if (argc > 0) + { + do_request = true; + + int rv = parse_req(argc, argv); + if (rv < 0) + return EX_USAGE; + argc = rv; + + if (argc > 0) + { + for (out_len = 0; argc > 0 && out_len < BUFLEN; out_len++, argc--) + { + unsigned n = strtoul(argv[out_len], 0, 0); + if (n > 255) + fprintf(stderr, + "Warning: data #%d 0x%0x > 0xff, truncating\n", + out_len, n); + out_buf[out_len] = (uint8_t)n; + } + out_len++; + if (argc > 0) + fprintf(stderr, + "Data count exceeds maximum of %d, ignoring %d elements\n", + BUFLEN, optind); + } + } + } + + struct libusb20_backend *be; + struct libusb20_device *dev; + + if ((be = libusb20_be_alloc_default()) == NULL) + { + perror("libusb20_be_alloc()"); + return 1; + } + + dev = NULL; + while ((dev = libusb20_be_device_foreach(be, dev)) != NULL) + { + struct LIBUSB20_DEVICE_DESC_DECODED *ddp = + libusb20_dev_get_device_desc(dev); + + printf("Found device %s (VID:PID = 0x%04x:0x%04x)\n", + libusb20_dev_get_desc(dev), + ddp->idVendor, ddp->idProduct); + + if (ddp->idVendor == vid && ddp->idProduct == pid) + doit(dev); + } + + libusb20_be_free(be); + return 0; +} From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 21:47:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E770106564A; Wed, 18 Jul 2012 21:47:51 +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 498678FC14; Wed, 18 Jul 2012 21:47:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6ILlp4h014432; Wed, 18 Jul 2012 21:47:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6ILlpZQ014430; Wed, 18 Jul 2012 21:47:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207182147.q6ILlpZQ014430@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 18 Jul 2012 21:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238604 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 21:47:51 -0000 Author: kib Date: Wed Jul 18 21:47:50 2012 New Revision: 238604 URL: http://svn.freebsd.org/changeset/base/238604 Log: Do not restart scan of the inactive queue when non-inactive page is found. Rather, we shall not find such pages on inactive queue at all. Requested and reviewed by: alc MFC after: 2 weeks Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Jul 18 21:30:17 2012 (r238603) +++ head/sys/vm/vm_pageout.c Wed Jul 18 21:47:50 2012 (r238604) @@ -921,7 +921,6 @@ vm_pageout_scan(int pass) maxlaunder = 10000; vm_page_lock_queues(); queues_locked = TRUE; -rescan0: addl_page_shortage = addl_page_shortage_init; maxscan = cnt.v_inactive_count; @@ -930,12 +929,9 @@ rescan0: m = next) { KASSERT(queues_locked, ("unlocked queues")); mtx_assert(&vm_page_queue_mtx, MA_OWNED); + KASSERT(m->queue == PQ_INACTIVE, ("Inactive queue %p", m)); cnt.v_pdpages++; - - if (m->queue != PQ_INACTIVE) - goto rescan0; - next = TAILQ_NEXT(m, pageq); /* From owner-svn-src-all@FreeBSD.ORG Wed Jul 18 23:01:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B2CF106566C; Wed, 18 Jul 2012 23:01:24 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 369248FC0A; Wed, 18 Jul 2012 23:01:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IN1OeF019858; Wed, 18 Jul 2012 23:01:24 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IN1OGn019856; Wed, 18 Jul 2012 23:01:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201207182301.q6IN1OGn019856@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 18 Jul 2012 23:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238605 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 23:01:24 -0000 Author: des Date: Wed Jul 18 23:01:23 2012 New Revision: 238605 URL: http://svn.freebsd.org/changeset/base/238605 Log: Move -n ${_jail} before ${_flags} so that any -n options in ${_flags} will override ours instead of the other way around. Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Wed Jul 18 21:47:50 2012 (r238604) +++ head/etc/rc.d/jail Wed Jul 18 23:01:23 2012 (r238605) @@ -641,7 +641,7 @@ jail_start() i=$((i + 1)) done - eval ${_setfib} jail ${_flags} -n ${_jail} -i ${_rootdir} ${_hostname} \ + eval ${_setfib} jail -n ${_jail} ${_flags} -i ${_rootdir} ${_hostname} \ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CB1F1065670; Wed, 18 Jul 2012 23:32:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 680F58FC14; Wed, 18 Jul 2012 23:32:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6INWDGA021985; Wed, 18 Jul 2012 23:32:13 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6INWDrd021983; Wed, 18 Jul 2012 23:32:13 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201207182332.q6INWDrd021983@svn.freebsd.org> From: Glen Barber Date: Wed, 18 Jul 2012 23:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238606 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 23:32:13 -0000 Author: gjb (doc,ports committer) Date: Wed Jul 18 23:32:12 2012 New Revision: 238606 URL: http://svn.freebsd.org/changeset/base/238606 Log: Xref mwl(4) and rum(4) in hostapd(8). MFC after: 3 days Modified: head/usr.sbin/wpa/hostapd/hostapd.8 Modified: head/usr.sbin/wpa/hostapd/hostapd.8 ============================================================================== --- head/usr.sbin/wpa/hostapd/hostapd.8 Wed Jul 18 23:01:23 2012 (r238605) +++ head/usr.sbin/wpa/hostapd/hostapd.8 Wed Jul 18 23:32:12 2012 (r238606) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2007 +.Dd July 18, 2012 .Dt HOSTAPD 8 .Os .Sh NAME @@ -111,7 +111,9 @@ Store PID in .Xr ath 4 , .Xr ipw 4 , .Xr iwi 4 , +.Xr mwl 4 , .Xr ral 4 , +.Xr rum 4 , .Xr run 4 , .Xr ural 4 , .Xr wi 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 02:25:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E673106564A; Thu, 19 Jul 2012 02:25:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F52A8FC0A; Thu, 19 Jul 2012 02:25:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6J2PF3F034023; Thu, 19 Jul 2012 02:25:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6J2PEKA034011; Thu, 19 Jul 2012 02:25:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207190225.q6J2PEKA034011@svn.freebsd.org> From: Adrian Chadd Date: Thu, 19 Jul 2012 02:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238607 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 02:25:15 -0000 Author: adrian Date: Thu Jul 19 02:25:14 2012 New Revision: 238607 URL: http://svn.freebsd.org/changeset/base/238607 Log: Break out the TX descriptor link field into HAL methods. The DMA FIFO chips (AR93xx and later) differ slightly to th elegacy chips: * The RX DMA descriptors don't have a ds_link field; * The TX DMA descriptors have a ds_link field however at a different offset. This is a reimplementation based on what the reference driver and ath9k does. A subsequent commit will enable it in the TX and beacon paths. Obtained from: Linux ath9k, Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ah.h Thu Jul 19 02:25:14 2012 (r238607) @@ -1084,6 +1084,12 @@ struct ath_hal { void __ahdecl(*ah_reqTxIntrDesc)(struct ath_hal *, struct ath_desc*); HAL_BOOL __ahdecl(*ah_getTxCompletionRates)(struct ath_hal *, const struct ath_desc *ds, int *rates, int *tries); + void __ahdecl(*ah_setTxDescLink)(struct ath_hal *ah, void *ds, + uint32_t link); + void __ahdecl(*ah_getTxDescLink)(struct ath_hal *ah, void *ds, + uint32_t *link); + void __ahdecl(*ah_getTxDescLinkPtr)(struct ath_hal *ah, void *ds, + uint32_t **linkptr); /* Receive Functions */ uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*, HAL_RX_QUEUE); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Thu Jul 19 02:25:14 2012 (r238607) @@ -179,6 +179,12 @@ extern void ar5210GetTxIntrQueue(struct extern void ar5210IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *); extern HAL_BOOL ar5210GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *, int *rates, int *tries); +extern void ar5210SetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t link); +extern void ar5210GetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t *link); +extern void ar5210GetTxDescLinkPtr(struct ath_hal *ah, void *ds, + uint32_t **linkptr); extern uint32_t ar5210GetRxDP(struct ath_hal *, HAL_RX_QUEUE); extern void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Thu Jul 19 02:25:14 2012 (r238607) @@ -75,6 +75,9 @@ static const struct ath_hal_private ar52 .ah_getTxIntrQueue = ar5210GetTxIntrQueue, .ah_reqTxIntrDesc = ar5210IntrReqTxDesc, .ah_getTxCompletionRates = ar5210GetTxCompletionRates, + .ah_setTxDescLink = ar5210SetTxDescLink, + .ah_getTxDescLink = ar5210GetTxDescLink, + .ah_getTxDescLinkPtr = ar5210GetTxDescLinkPtr, /* RX Functions */ .ah_getRxDP = ar5210GetRxDP, Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c Thu Jul 19 02:25:14 2012 (r238607) @@ -630,3 +630,36 @@ ar5210GetTxCompletionRates(struct ath_ha { return AH_FALSE; } + +/* + * Set the TX descriptor link pointer + */ +void +ar5210SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link) +{ + struct ar5210_desc *ads = AR5210DESC(ds); + + ads->ds_link = link; +} + +/* + * Get the TX descriptor link pointer + */ +void +ar5210GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link) +{ + struct ar5210_desc *ads = AR5210DESC(ds); + + *link = ads->ds_link; +} + +/* + * Get a pointer to the TX descriptor link pointer + */ +void +ar5210GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr) +{ + struct ar5210_desc *ads = AR5210DESC(ds); + + *linkptr = &ads->ds_link; +} Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Thu Jul 19 02:25:14 2012 (r238607) @@ -204,6 +204,12 @@ extern void ar5211GetTxIntrQueue(struct extern void ar5211IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *); extern HAL_BOOL ar5211GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries); +extern void ar5211SetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t link); +extern void ar5211GetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t *link); +extern void ar5211GetTxDescLinkPtr(struct ath_hal *ah, void *ds, + uint32_t **linkptr); extern uint32_t ar5211GetRxDP(struct ath_hal *, HAL_RX_QUEUE); extern void ar5211SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE); Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Thu Jul 19 02:25:14 2012 (r238607) @@ -75,6 +75,9 @@ static const struct ath_hal_private ar52 .ah_getTxIntrQueue = ar5211GetTxIntrQueue, .ah_reqTxIntrDesc = ar5211IntrReqTxDesc, .ah_getTxCompletionRates = ar5211GetTxCompletionRates, + .ah_setTxDescLink = ar5211SetTxDescLink, + .ah_getTxDescLink = ar5211GetTxDescLink, + .ah_getTxDescLinkPtr = ar5211GetTxDescLinkPtr, /* RX Functions */ .ah_getRxDP = ar5211GetRxDP, Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c Thu Jul 19 02:25:14 2012 (r238607) @@ -671,3 +671,27 @@ ar5211GetTxCompletionRates(struct ath_ha return AH_FALSE; } + +void +ar5211SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link) +{ + struct ar5211_desc *ads = AR5211DESC(ds); + + ads->ds_link = link; +} + +void +ar5211GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link) +{ + struct ar5211_desc *ads = AR5211DESC(ds); + + *link = ads->ds_link; +} + +void +ar5211GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr) +{ + struct ar5211_desc *ads = AR5211DESC(ds); + + *linkptr = &ads->ds_link; +} Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Thu Jul 19 02:25:14 2012 (r238607) @@ -602,6 +602,12 @@ extern void ar5212GetTxIntrQueue(struct extern void ar5212IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *); extern HAL_BOOL ar5212GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries); +extern void ar5212SetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t link); +extern void ar5212GetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t *link); +extern void ar5212GetTxDescLinkPtr(struct ath_hal *ah, void *ds, + uint32_t **linkptr); extern const HAL_RATE_TABLE *ar5212GetRateTable(struct ath_hal *, u_int mode); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu Jul 19 02:25:14 2012 (r238607) @@ -71,6 +71,9 @@ static const struct ath_hal_private ar52 .ah_getTxIntrQueue = ar5212GetTxIntrQueue, .ah_reqTxIntrDesc = ar5212IntrReqTxDesc, .ah_getTxCompletionRates = ar5212GetTxCompletionRates, + .ah_setTxDescLink = ar5212SetTxDescLink, + .ah_getTxDescLink = ar5212GetTxDescLink, + .ah_getTxDescLinkPtr = ar5212GetTxDescLinkPtr, /* RX Functions */ .ah_getRxDP = ar5212GetRxDP, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Thu Jul 19 02:25:14 2012 (r238607) @@ -971,3 +971,27 @@ ar5212GetTxCompletionRates(struct ath_ha return AH_TRUE; } + +void +ar5212SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link) +{ + struct ar5212_desc *ads = AR5212DESC(ds); + + ads->ds_link = link; +} + +void +ar5212GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link) +{ + struct ar5212_desc *ads = AR5212DESC(ds); + + *link = ads->ds_link; +} + +void +ar5212GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr) +{ + struct ar5212_desc *ads = AR5212DESC(ds); + + *linkptr = &ads->ds_link; +} Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/if_athvar.h Thu Jul 19 02:25:14 2012 (r238607) @@ -1067,6 +1067,12 @@ void ath_intr(void *); ((*(_ah)->ah_getTxIntrQueue)((_ah), (_txqs))) #define ath_hal_gettxcompletionrates(_ah, _ds, _rates, _tries) \ ((*(_ah)->ah_getTxCompletionRates)((_ah), (_ds), (_rates), (_tries))) +#define ath_hal_settxdesclink(_ah, _ds, _link) \ + ((*(_ah)->ah_setTxDescLink)((_ah), (_ds), (_link))) +#define ath_hal_gettxdesclink(_ah, _ds, _link) \ + ((*(_ah)->ah_getTxDescLink)((_ah), (_ds), (_link))) +#define ath_hal_gettxdesclinkptr(_ah, _ds, _linkptr) \ + ((*(_ah)->ah_getTxDescLinkPtr)((_ah), (_ds), (_linkptr))) #define ath_hal_setupfirsttxdesc(_ah, _ds, _aggrlen, _flags, _txpower, \ _txr0, _txtr0, _antm, _rcr, _rcd) \ From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 03:18:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 900A1106564A; Thu, 19 Jul 2012 03:18:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B4848FC15; Thu, 19 Jul 2012 03:18:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6J3IGfO037985; Thu, 19 Jul 2012 03:18:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6J3IGqG037983; Thu, 19 Jul 2012 03:18:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207190318.q6J3IGqG037983@svn.freebsd.org> From: Adrian Chadd Date: Thu, 19 Jul 2012 03:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238608 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 03:18:16 -0000 Author: adrian Date: Thu Jul 19 03:18:15 2012 New Revision: 238608 URL: http://svn.freebsd.org/changeset/base/238608 Log: Use HAL_NUM_RX_QUEUES rather than a magic constant. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Jul 19 02:25:14 2012 (r238607) +++ head/sys/dev/ath/if_athvar.h Thu Jul 19 03:18:15 2012 (r238608) @@ -410,7 +410,7 @@ struct ath_softc { uint32_t sc_bssidmask; /* bssid mask */ struct ath_rx_methods sc_rx; - struct ath_rx_edma sc_rxedma[2]; /* HP/LP queues */ + struct ath_rx_edma sc_rxedma[HAL_NUM_RX_QUEUES]; /* HP/LP queues */ int sc_rx_statuslen; int sc_tx_desclen; int sc_tx_statuslen; From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 03:51:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5377B106564A; Thu, 19 Jul 2012 03:51:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 349228FC0A; Thu, 19 Jul 2012 03:51:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6J3pHul040249; Thu, 19 Jul 2012 03:51:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6J3pG9f040246; Thu, 19 Jul 2012 03:51:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207190351.q6J3pG9f040246@svn.freebsd.org> From: Adrian Chadd Date: Thu, 19 Jul 2012 03:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238609 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 03:51:17 -0000 Author: adrian Date: Thu Jul 19 03:51:16 2012 New Revision: 238609 URL: http://svn.freebsd.org/changeset/base/238609 Log: Convert the TX path to use the new HAL methods for accessing the TX descriptor link pointers. This is required for the AR93xx and later chipsets. The RX path is slightly different - the legacy RX path directly accesses ath_desc->ds_link for now, however this isn't at all done for EDMA (FIFO) RX. Now, for those performing a little software archeology here: This is all a bit sub-optimal. "struct ath_desc" is only really relevant for the pre-AR93xx NICs - where ds_link and ds_data is always in the same location. The AR93xx and later NICs have different descriptor layouts altogether. Now, for AR93xx and later NICs, you should never directly reference ds_link and ds_data, as: * the RX descriptors don't have either - the data is _after_ the RX descriptor. They're just one large buffer. There's also no need for a per-descriptor RX buffer size as they're all fixed sizes. * the TX descriptors have 4 buffer and 4 length fields _and_ a link pointer. Each frame takes up one TX FIFO pointer, but it can contain multiple subframes (either multiple frames in a buffer, and/or multiple frames in an aggregate/RIFS burst.) * .. so, when TX frames are queued to a hardware queue, the link pointer is ONLY for buffers in that frame/aggregate. The next frame starts in a new FIFO pointer. * Finally, descriptor completion status is in a different ring. I'll write something up about that when its time to do so. This was inspired by Linux ath9k and the reference driver but is a reimplementation. Obtained from: Linux ath9k, Qualcomm Atheros Modified: head/sys/dev/ath/if_ath_beacon.c head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- head/sys/dev/ath/if_ath_beacon.c Thu Jul 19 03:18:15 2012 (r238608) +++ head/sys/dev/ath/if_ath_beacon.c Thu Jul 19 03:51:16 2012 (r238609) @@ -277,14 +277,15 @@ ath_beacon_setup(struct ath_softc *sc, s flags = HAL_TXDESC_NOACK; if (ic->ic_opmode == IEEE80211_M_IBSS && sc->sc_hasveol) { - ds->ds_link = bf->bf_daddr; /* self-linked */ + /* self-linked descriptor */ + ath_hal_settxdesclink(sc->sc_ah, ds, bf->bf_daddr); flags |= HAL_TXDESC_VEOL; /* * Let hardware handle antenna switching. */ antenna = sc->sc_txantenna; } else { - ds->ds_link = 0; + ath_hal_settxdesclink(sc->sc_ah, ds, 0); /* * Switch antenna every 4 beacons. * XXX assumes two antenna @@ -405,8 +406,10 @@ ath_beacon_proc(void *arg, int pending) if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { bf = ath_beacon_generate(sc, vap); if (bf != NULL) { + /* XXX should do this using the ds */ *bflink = bf->bf_daddr; - bflink = &bf->bf_desc->ds_link; + ath_hal_gettxdesclinkptr(sc->sc_ah, + bf->bf_desc, &bflink); } } } Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Jul 19 03:18:15 2012 (r238608) +++ head/sys/dev/ath/if_ath_tx.c Thu Jul 19 03:51:16 2012 (r238609) @@ -310,9 +310,10 @@ ath_tx_chaindesclist(struct ath_softc *s for (i = 0; i < bf->bf_nseg; i++, ds++) { ds->ds_data = bf->bf_segs[i].ds_addr; if (i == bf->bf_nseg - 1) - ds->ds_link = 0; + ath_hal_settxdesclink(ah, ds, 0); else - ds->ds_link = bf->bf_daddr + sizeof(*ds) * (i + 1); + ath_hal_settxdesclink(ah, ds, + bf->bf_daddr + sizeof(*ds) * (i + 1)); ath_hal_filltxdesc(ah, ds , bf->bf_segs[i].ds_len /* segment length */ , i == 0 /* first segment */ @@ -350,9 +351,10 @@ ath_tx_chaindesclist_subframe(struct ath for (i = 0; i < bf->bf_nseg; i++, ds++) { ds->ds_data = bf->bf_segs[i].ds_addr; if (i == bf->bf_nseg - 1) - ds->ds_link = 0; + ath_hal_settxdesclink(ah, ds, 0); else - ds->ds_link = bf->bf_daddr + sizeof(*ds) * (i + 1); + ath_hal_settxdesclink(ah, ds, + bf->bf_daddr + sizeof(*ds) * (i + 1)); /* * This performs the setup for an aggregate frame. @@ -414,7 +416,8 @@ ath_tx_setds_11n(struct ath_softc *sc, s * to the beginning descriptor of this frame. */ if (bf_prev != NULL) - bf_prev->bf_lastds->ds_link = bf->bf_daddr; + ath_hal_settxdesclink(sc->sc_ah, bf_prev->bf_lastds, + bf->bf_daddr); /* Save a copy so we can link the next descriptor in */ bf_prev = bf; @@ -482,7 +485,7 @@ ath_tx_handoff_mcast(struct ath_softc *s *txq->axq_link = bf->bf_daddr; } ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); - txq->axq_link = &bf->bf_lastds->ds_link; + ath_hal_gettxdesclinkptr(sc->sc_ah, bf->bf_lastds, &txq->axq_link); } /* @@ -616,7 +619,7 @@ ath_tx_handoff_hw(struct ath_softc *sc, #endif /* IEEE80211_SUPPORT_TDMA */ if (bf->bf_state.bfs_aggr) txq->axq_aggr_depth++; - txq->axq_link = &bf->bf_lastds->ds_link; + ath_hal_gettxdesclinkptr(ah, bf->bf_lastds, &txq->axq_link); ath_hal_txstart(ah, txq->axq_qnum); } } @@ -645,7 +648,7 @@ ath_txq_restart_dma(struct ath_softc *sc return; ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); - txq->axq_link = &bf_last->bf_lastds->ds_link; + ath_hal_gettxdesclinkptr(ah, bf->bf_lastds, &txq->axq_link); ath_hal_txstart(ah, txq->axq_qnum); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 05:34:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1AF9106564A; Thu, 19 Jul 2012 05:34:19 +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 BCB858FC0A; Thu, 19 Jul 2012 05:34:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6J5YJHl047457; Thu, 19 Jul 2012 05:34:19 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6J5YJm5047455; Thu, 19 Jul 2012 05:34:19 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207190534.q6J5YJm5047455@svn.freebsd.org> From: Alan Cox Date: Thu, 19 Jul 2012 05:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238610 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 05:34:19 -0000 Author: alc Date: Thu Jul 19 05:34:19 2012 New Revision: 238610 URL: http://svn.freebsd.org/changeset/base/238610 Log: Don't unnecessarily set PGA_REFERENCED in pmap_enter(). Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jul 19 03:51:16 2012 (r238609) +++ head/sys/amd64/amd64/pmap.c Thu Jul 19 05:34:19 2012 (r238610) @@ -3576,13 +3576,9 @@ validate: if ((origpte & PG_V) != 0) { invlva = FALSE; origpte = pte_load_store(pte, newpte); - if ((origpte & PG_A) != 0) { - if ((origpte & PG_MANAGED) != 0) - vm_page_aflag_set(om, PGA_REFERENCED); - if (opa != pa || ((origpte & PG_NX) == 0 && - (newpte & PG_NX) != 0)) - invlva = TRUE; - } + if ((origpte & PG_A) != 0 && (opa != pa || + ((origpte & PG_NX) == 0 && (newpte & PG_NX) != 0))) + invlva = TRUE; if ((origpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { if ((origpte & PG_MANAGED) != 0) vm_page_dirty(om); @@ -3590,6 +3586,8 @@ validate: invlva = TRUE; } if (opa != pa && (origpte & PG_MANAGED) != 0) { + if ((origpte & PG_A) != 0) + vm_page_aflag_set(om, PGA_REFERENCED); CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); pmap_pvh_free(&om->md, pmap, va); if ((om->aflags & PGA_WRITEABLE) != 0 && From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 08:56:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 979F6106564A; Thu, 19 Jul 2012 08:56:31 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82EAB8FC0C; Thu, 19 Jul 2012 08:56:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6J8uVj3061640; Thu, 19 Jul 2012 08:56:31 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6J8uVBR061638; Thu, 19 Jul 2012 08:56:31 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201207190856.q6J8uVBR061638@svn.freebsd.org> From: Niclas Zeising Date: Thu, 19 Jul 2012 08:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238612 - head/usr.sbin/ipfwpcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 08:56:31 -0000 Author: zeising (ports committer) Date: Thu Jul 19 08:56:30 2012 New Revision: 238612 URL: http://svn.freebsd.org/changeset/base/238612 Log: Update my e-mail to my FreeBSD one. Approved by: joel (mentor) Modified: head/usr.sbin/ipfwpcap/ipfwpcap.8 Modified: head/usr.sbin/ipfwpcap/ipfwpcap.8 ============================================================================== --- head/usr.sbin/ipfwpcap/ipfwpcap.8 Thu Jul 19 08:42:31 2012 (r238611) +++ head/usr.sbin/ipfwpcap/ipfwpcap.8 Thu Jul 19 08:56:30 2012 (r238612) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006 Niclas Zeising +.\" Copyright (c) 2006 Niclas Zeising .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -129,4 +129,4 @@ utility first appeared in was written by .An P. Kern Aq pkern@cns.utoronto.ca . This manual page was written by -.An Niclas Zeising Aq niclas.zeising@gmail.com . +.An Niclas Zeising Aq zeising@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 09:33:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1C481065672; Thu, 19 Jul 2012 09:33:00 +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 993998FC12; Thu, 19 Jul 2012 09:33:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6J9X0Kw064248; Thu, 19 Jul 2012 09:33:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6J9X0k0064240; Thu, 19 Jul 2012 09:33:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207190933.q6J9X0k0064240@svn.freebsd.org> From: Michael Tuexen Date: Thu, 19 Jul 2012 09:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238613 - in stable/9: sys/netinet sys/netinet6 usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 09:33:00 -0000 Author: tuexen Date: Thu Jul 19 09:32:59 2012 New Revision: 238613 URL: http://svn.freebsd.org/changeset/base/238613 Log: MFC r238501, r 238514: Changes which improve compilation if neither INET nor INET6 is defined. Allow netstat to be build if INET is not defined in the kernel. Thanks to Garrett Cooper for reporting the issue. This also fixes a bug where netstat doesn't work correctly for SCTP on INET only (no INET6) kernels. Approved by: re@ Modified: stable/9/sys/netinet/sctp_asconf.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_uio.h stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet6/sctp6_usrreq.c stable/9/usr.bin/netstat/Makefile stable/9/usr.bin/netstat/sctp.c Directory Properties: stable/9/sys/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/netstat/ (props changed) Modified: stable/9/sys/netinet/sctp_asconf.c ============================================================================== --- stable/9/sys/netinet/sctp_asconf.c Thu Jul 19 08:56:30 2012 (r238612) +++ stable/9/sys/netinet/sctp_asconf.c Thu Jul 19 09:32:59 2012 (r238613) @@ -2806,13 +2806,14 @@ sctp_process_initack_addresses(struct sc struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; struct sctp_ifa *sctp_ifa; - struct sctp_ipv6addr_param addr_store; #ifdef INET6 + struct sctp_ipv6addr_param addr6_store; struct sockaddr_in6 sin6; #endif #ifdef INET + struct sctp_ipv4addr_param addr4_store; struct sockaddr_in sin; #endif @@ -2861,7 +2862,7 @@ sctp_process_initack_addresses(struct sc a6p = (struct sctp_ipv6addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv6addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr6_store); if (plen != sizeof(struct sctp_ipv6addr_param) || a6p == NULL) { return; @@ -2880,7 +2881,7 @@ sctp_process_initack_addresses(struct sc /* get the entire IPv4 address param */ a4p = (struct sctp_ipv4addr_param *)sctp_m_getptr(m, offset, sizeof(struct sctp_ipv4addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr4_store); if (plen != sizeof(struct sctp_ipv4addr_param) || a4p == NULL) { return; @@ -2958,16 +2959,17 @@ sctp_addr_in_initack(struct mbuf *m, uin { struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; - struct sctp_ipv6addr_param addr_store; #ifdef INET struct sockaddr_in *sin; struct sctp_ipv4addr_param *a4p; + struct sctp_ipv6addr_param addr4_store; #endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *a6p; + struct sctp_ipv6addr_param addr6_store; struct sockaddr_in6 sin6_tmp; #endif @@ -3013,7 +3015,7 @@ sctp_addr_in_initack(struct mbuf *m, uin a6p = (struct sctp_ipv6addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv6addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr6_store); if (a6p == NULL) { return (0); } @@ -3043,7 +3045,7 @@ sctp_addr_in_initack(struct mbuf *m, uin a4p = (struct sctp_ipv4addr_param *) sctp_m_getptr(m, offset, sizeof(struct sctp_ipv4addr_param), - (uint8_t *) & addr_store); + (uint8_t *) & addr4_store); if (a4p == NULL) { return (0); } Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Thu Jul 19 08:56:30 2012 (r238612) +++ stable/9/sys/netinet/sctp_output.c Thu Jul 19 09:32:59 2012 (r238613) @@ -3799,6 +3799,7 @@ sctp_get_ect(struct sctp_tcb *stcb) } } +#if defined(INET) || defined(INET6) static void sctp_handle_no_route(struct sctp_tcb *stcb, struct sctp_nets *net, @@ -3843,6 +3844,8 @@ sctp_handle_no_route(struct sctp_tcb *st } } +#endif + static int sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, /* may be NULL */ @@ -3882,14 +3885,18 @@ sctp_lowlevel_chunk_output(struct sctp_i * interface and smallest_mtu size as well. */ /* Will need ifdefs around this */ - struct mbuf *o_pak; struct mbuf *newm; struct sctphdr *sctphdr; int packet_length; int ret; uint32_t vrf_id; + +#if defined(INET) || defined(INET6) + struct mbuf *o_pak; sctp_route_t *ro = NULL; struct udphdr *udp = NULL; + +#endif uint8_t tos_value; #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) Modified: stable/9/sys/netinet/sctp_uio.h ============================================================================== --- stable/9/sys/netinet/sctp_uio.h Thu Jul 19 08:56:30 2012 (r238612) +++ stable/9/sys/netinet/sctp_uio.h Thu Jul 19 09:32:59 2012 (r238613) @@ -1124,10 +1124,10 @@ struct sctpstat { #define SCTP_STAT_DECR_GAUGE32(_x) SCTP_STAT_DECR(_x) union sctp_sockstore { -#if defined(INET) || !defined(_KERNEL) +#if defined(INET) struct sockaddr_in sin; #endif -#if defined(INET6) || !defined(_KERNEL) +#if defined(INET6) struct sockaddr_in6 sin6; #endif struct sockaddr sa; Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Thu Jul 19 08:56:30 2012 (r238612) +++ stable/9/sys/netinet/sctp_usrreq.c Thu Jul 19 09:32:59 2012 (r238613) @@ -5258,7 +5258,6 @@ sctp_setopt(struct socket *so, int optna case SCTP_BINDX_ADD_ADDR: { struct sctp_getaddresses *addrs; - size_t sz; struct thread *td; td = (struct thread *)p; @@ -5266,8 +5265,7 @@ sctp_setopt(struct socket *so, int optna optsize); #ifdef INET if (addrs->addr->sa_family == AF_INET) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; @@ -5280,8 +5278,7 @@ sctp_setopt(struct socket *so, int optna #endif #ifdef INET6 if (addrs->addr->sa_family == AF_INET6) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; @@ -5305,7 +5302,6 @@ sctp_setopt(struct socket *so, int optna case SCTP_BINDX_REM_ADDR: { struct sctp_getaddresses *addrs; - size_t sz; struct thread *td; td = (struct thread *)p; @@ -5313,8 +5309,7 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(addrs, optval, struct sctp_getaddresses, optsize); #ifdef INET if (addrs->addr->sa_family == AF_INET) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; @@ -5327,8 +5322,7 @@ sctp_setopt(struct socket *so, int optna #endif #ifdef INET6 if (addrs->addr->sa_family == AF_INET6) { - sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6); - if (optsize < sz) { + if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Thu Jul 19 08:56:30 2012 (r238612) +++ stable/9/sys/netinet6/sctp6_usrreq.c Thu Jul 19 09:32:59 2012 (r238613) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#ifdef INET6 #include #include #include @@ -1354,3 +1355,5 @@ struct pr_usrreqs sctp6_usrreqs = { .pru_sosend = sctp_sosend, .pru_soreceive = sctp_soreceive }; + +#endif Modified: stable/9/usr.bin/netstat/Makefile ============================================================================== --- stable/9/usr.bin/netstat/Makefile Thu Jul 19 08:56:30 2012 (r238612) +++ stable/9/usr.bin/netstat/Makefile Thu Jul 19 09:32:59 2012 (r238613) @@ -13,6 +13,10 @@ CFLAGS+=-fno-strict-aliasing CFLAGS+=-DIPSEC CFLAGS+=-DSCTP +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+=-DINET +.endif + .if ${MK_INET6_SUPPORT} != "no" SRCS+= inet6.c CFLAGS+=-DINET6 Modified: stable/9/usr.bin/netstat/sctp.c ============================================================================== --- stable/9/usr.bin/netstat/sctp.c Thu Jul 19 08:56:30 2012 (r238612) +++ stable/9/usr.bin/netstat/sctp.c Thu Jul 19 09:32:59 2012 (r238613) @@ -107,6 +107,7 @@ struct xraddr_entry { * If numeric_addr has been supplied, give * numeric value, otherwise try for symbolic name. */ +#ifdef INET static char * inetname(struct in_addr *inp) { @@ -146,6 +147,7 @@ inetname(struct in_addr *inp) } return (line); } +#endif #ifdef INET6 static char ntop_buf[INET6_ADDRSTRLEN]; @@ -197,9 +199,11 @@ sctp_print_address(union sctp_sockstore int width; switch (address->sa.sa_family) { +#ifdef INET case AF_INET: sprintf(line, "%.*s.", Wflag ? 39 : 16, inetname(&address->sin.sin_addr)); break; +#endif #ifdef INET6 case AF_INET6: sprintf(line, "%.*s.", Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr)); From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 10:22:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8804310656AB; Thu, 19 Jul 2012 10:22:55 +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 597B68FC0A; Thu, 19 Jul 2012 10:22:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JAMtSs068162; Thu, 19 Jul 2012 10:22:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JAMtbw068159; Thu, 19 Jul 2012 10:22:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207191022.q6JAMtbw068159@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 19 Jul 2012 10:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238614 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 10:22:55 -0000 Author: kib Date: Thu Jul 19 10:22:54 2012 New Revision: 238614 URL: http://svn.freebsd.org/changeset/base/238614 Log: Implement F_DUPFD_CLOEXEC command for fcntl(2), specified by SUSv4. PR: standards/169962 Submitted by: Jukka A. Ukkonen MFC after: 1 week Modified: head/sys/kern/kern_descrip.c head/sys/sys/fcntl.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Jul 19 09:32:59 2012 (r238613) +++ head/sys/kern/kern_descrip.c Thu Jul 19 10:22:54 2012 (r238614) @@ -113,6 +113,7 @@ static uma_zone_t file_zone; /* Flags for do_dup() */ #define DUP_FIXED 0x1 /* Force fixed allocation */ #define DUP_FCNTL 0x2 /* fcntl()-style errors */ +#define DUP_CLOEXEC 0x4 /* Atomically set FD_CLOEXEC. */ static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); @@ -479,6 +480,12 @@ kern_fcntl(struct thread *td, int fd, in error = do_dup(td, DUP_FCNTL, fd, tmp, td->td_retval); break; + case F_DUPFD_CLOEXEC: + tmp = arg; + error = do_dup(td, DUP_FCNTL | DUP_CLOEXEC, fd, tmp, + td->td_retval); + break; + case F_DUP2FD: tmp = arg; error = do_dup(td, DUP_FIXED, fd, tmp, td->td_retval); @@ -895,6 +902,10 @@ do_dup(struct thread *td, int flags, int * Duplicate the source descriptor. */ fdp->fd_ofiles[new] = fp; + if ((flags & DUP_CLOEXEC) != 0) + fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] | UF_EXCLOSE; + else + fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] & ~UF_EXCLOSE; fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] &~ UF_EXCLOSE; if (new > fdp->fd_lastfile) fdp->fd_lastfile = new; Modified: head/sys/sys/fcntl.h ============================================================================== --- head/sys/sys/fcntl.h Thu Jul 19 09:32:59 2012 (r238613) +++ head/sys/sys/fcntl.h Thu Jul 19 10:22:54 2012 (r238614) @@ -225,6 +225,9 @@ typedef __pid_t pid_t; #define F_SETLK_REMOTE 14 /* debugging support for remote locks */ #define F_READAHEAD 15 /* read ahead */ #define F_RDAHEAD 16 /* Darwin compatible read ahead */ +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +#define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ +#endif /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 10:23:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A98281065674; Thu, 19 Jul 2012 10:23:59 +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 95A758FC1B; Thu, 19 Jul 2012 10:23:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JANxoG068269; Thu, 19 Jul 2012 10:23:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JANxiZ068267; Thu, 19 Jul 2012 10:23:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207191023.q6JANxiZ068267@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 19 Jul 2012 10:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238615 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 10:23:59 -0000 Author: kib Date: Thu Jul 19 10:23:59 2012 New Revision: 238615 URL: http://svn.freebsd.org/changeset/base/238615 Log: Document F_DUPFD_CLOEXEC. Also provide some wording changes for F_DUPFD to make it less confusing, at least for me. MFC after: 1 week Modified: head/lib/libc/sys/fcntl.2 Modified: head/lib/libc/sys/fcntl.2 ============================================================================== --- head/lib/libc/sys/fcntl.2 Thu Jul 19 10:22:54 2012 (r238614) +++ head/lib/libc/sys/fcntl.2 Thu Jul 19 10:23:59 2012 (r238615) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd January 28, 2012 +.Dd July 18, 2012 .Dt FCNTL 2 .Os .Sh NAME @@ -54,7 +54,7 @@ Depending on the value of .Fn fcntl can take an additional third argument .Fa "int arg" . -.Bl -tag -width F_GETOWNX +.Bl -tag -width F_DUPFD_CLOEXEC .It Dv F_DUPFD Return a new descriptor as follows: .Pp @@ -73,11 +73,22 @@ Same access mode (read, write or read/wr Same file status flags (i.e., both file descriptors share the same file status flags). .It -The close-on-exec flag associated with the new file descriptor -is set to remain open across +The close-on-exec flag +.Dv FD_CLOEXEC +associated with the new file descriptor is cleared, so the file descriptor is +to remain open across .Xr execve 2 system calls. .El +.It Dv F_DUPFD_CLOEXEC +Like +.Dv F_DUPFD , +but the +.Dv FD_CLOEXEC +flag associated with the new file descriptor is set, so the file descriptor +is closed when +.Xr execve 2 +system call executes. .It Dv F_DUP2FD It is functionally equivalent to .Bd -literal -offset indent From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 10:28:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01F22106564A; Thu, 19 Jul 2012 10:28:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E00158FC14; Thu, 19 Jul 2012 10:28:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JASTMW068693; Thu, 19 Jul 2012 10:28:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JAST6L068691; Thu, 19 Jul 2012 10:28:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201207191028.q6JAST6L068691@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 19 Jul 2012 10:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238616 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 10:28:30 -0000 Author: hselasky Date: Thu Jul 19 10:28:29 2012 New Revision: 238616 URL: http://svn.freebsd.org/changeset/base/238616 Log: MFC r213705: Add the XHCI USB controller to NOTES. Suggested by: dougb @ Modified: stable/8/sys/conf/NOTES Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Thu Jul 19 10:23:59 2012 (r238615) +++ stable/8/sys/conf/NOTES Thu Jul 19 10:28:29 2012 (r238616) @@ -2577,6 +2577,8 @@ device uhci device ohci # EHCI controller device ehci +# XHCI controller +device xhci # SL811 Controller #device slhci # General USB code (mandatory for USB) From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 10:47:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3900106564A; Thu, 19 Jul 2012 10:47:08 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-qa0-f54.google.com (mail-qa0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4B7B38FC15; Thu, 19 Jul 2012 10:47:08 +0000 (UTC) Received: by qaat11 with SMTP id t11so1677669qaa.13 for ; Thu, 19 Jul 2012 03:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=C5njcXtDi2WzRLL6a8aD0zmh2VqRDMjKqfXKSux9DGU=; b=gsX4WyNP0aS8IvKOf3UFNrorFVXDu3a6HEvfAszpc2U+jE76W2uiDOIGvuuyrY6Md4 0V9J35Tli8ovlreoq49PsnCWCh6JE8/0X1jMgkj5fIl1s2ceht9fbFYNhtyXdmc632+b IGBmR6KxXp5vkUvxJxK35DdrzbGskAXH5sl9zg/bUieXMwlSXJoBBRo9suPmY0lz51NR vuikUE9macfCp9ej7wxmcerirZKPJL3FOUM02cGmJEfzWoFK71N2bky5FV9GhLrHqgsp j3/bdMXtJ/iWkzC5wc6M3dIm6zDb1+9AXb8ZyNIu/+jmxDHeRtDPt7xGfCD9YC9KSJng z9pQ== MIME-Version: 1.0 Received: by 10.224.213.74 with SMTP id gv10mr2836028qab.25.1342694827571; Thu, 19 Jul 2012 03:47:07 -0700 (PDT) Sender: ermal.luci@gmail.com Received: by 10.229.161.211 with HTTP; Thu, 19 Jul 2012 03:47:07 -0700 (PDT) In-Reply-To: <201207181613.q6IGD4gZ087600@svn.freebsd.org> References: <201207181613.q6IGD4gZ087600@svn.freebsd.org> Date: Thu, 19 Jul 2012 12:47:07 +0200 X-Google-Sender-Auth: mRLF3P4P2LYkhWGRgIbfQtiLzDM Message-ID: From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r238600 - stable/9/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 10:47:09 -0000 I would prefer to be in CC for this or at least asked! On Wed, Jul 18, 2012 at 6:13 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Jul 18 16:13:03 2012 > New Revision: 238600 > URL: http://svn.freebsd.org/changeset/base/238600 > > Log: > Merge r230119, r238498 from head: > > -----------------------------------------------------------------------= - > r230119 | csjp | 2012-01-15 02:51:34 +0400 (=D0=B2=D1=81, 15 =D1=8F=D0= =BD=D0=B2 2012) | 9 lines > > Revert to the old behavior of allocating table/table entries using > M_NOWAIT. Currently, the code allows for sleeping in the ioctl path > to guarantee allocation. However code also handles ENOMEM gracefully, = so > propagate this error back to user-space, rather than sleeping while > holding the global pf mutex. > > Reviewed by: glebius > Discussed with: bz > > -----------------------------------------------------------------------= - > r238498 | glebius | 2012-07-15 23:10:00 +0400 (=D0=B2=D1=81, 15 =D0=B8= =D1=8E=D0=BB 2012) | 2 lines > > Use M_NOWAIT while holding the pf giant lock. > > Approved by: re (kib) > > Modified: > stable/9/sys/contrib/pf/net/pf_if.c > stable/9/sys/contrib/pf/net/pf_table.c > Directory Properties: > stable/9/sys/ (props changed) > stable/9/sys/contrib/pf/ (props changed) > > Modified: stable/9/sys/contrib/pf/net/pf_if.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/9/sys/contrib/pf/net/pf_if.c Wed Jul 18 15:52:09 2012 (= r238599) > +++ stable/9/sys/contrib/pf/net/pf_if.c Wed Jul 18 16:13:03 2012 (= r238600) > @@ -506,8 +506,7 @@ pfi_dynaddr_setup(struct pf_addr_wrap *a > if (aw->type !=3D PF_ADDR_DYNIFTL) > return (0); > #ifdef __FreeBSD__ > - /* XXX: revisit! */ > - if ((dyn =3D pool_get(&V_pfi_addr_pl, PR_WAITOK | PR_ZERO)) > + if ((dyn =3D pool_get(&V_pfi_addr_pl, PR_NOWAIT | PR_ZERO)) > #else > if ((dyn =3D pool_get(&pfi_addr_pl, PR_WAITOK | PR_LIMITFAIL | PR= _ZERO)) > #endif > > Modified: stable/9/sys/contrib/pf/net/pf_table.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/9/sys/contrib/pf/net/pf_table.c Wed Jul 18 15:52:09 2012 = (r238599) > +++ stable/9/sys/contrib/pf/net/pf_table.c Wed Jul 18 16:13:03 2012 = (r238600) > @@ -926,16 +926,12 @@ pfr_create_kentry(struct pfr_addr *ad, i > { > struct pfr_kentry *ke; > > - if (intr) > #ifdef __FreeBSD__ > - ke =3D pool_get(&V_pfr_kentry_pl, PR_NOWAIT | PR_ZERO); > + ke =3D pool_get(&V_pfr_kentry_pl, PR_NOWAIT | PR_ZERO); > #else > + if (intr) > ke =3D pool_get(&pfr_kentry_pl, PR_NOWAIT | PR_ZERO); > -#endif > else > -#ifdef __FreeBSD__ > - ke =3D pool_get(&V_pfr_kentry_pl, PR_WAITOK|PR_ZERO); > -#else > ke =3D pool_get(&pfr_kentry_pl, PR_WAITOK|PR_ZERO|PR_LIMI= TFAIL); > #endif > if (ke =3D=3D NULL) > @@ -2080,16 +2076,12 @@ pfr_create_ktable(struct pfr_table *tbl, > struct pfr_ktable *kt; > struct pf_ruleset *rs; > > - if (intr) > #ifdef __FreeBSD__ > - kt =3D pool_get(&V_pfr_ktable_pl, PR_NOWAIT|PR_ZERO); > + kt =3D pool_get(&V_pfr_ktable_pl, PR_NOWAIT|PR_ZERO); > #else > + if (intr) > kt =3D pool_get(&pfr_ktable_pl, PR_NOWAIT|PR_ZERO|PR_LIMI= TFAIL); > -#endif > else > -#ifdef __FreeBSD__ > - kt =3D pool_get(&V_pfr_ktable_pl, PR_WAITOK|PR_ZERO); > -#else > kt =3D pool_get(&pfr_ktable_pl, PR_WAITOK|PR_ZERO|PR_LIMI= TFAIL); > #endif > if (kt =3D=3D NULL) --=20 Ermal From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 11:15:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 509AF1065695; Thu, 19 Jul 2012 11:15: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 3BFB58FC1B; Thu, 19 Jul 2012 11:15:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JBFsOJ075302; Thu, 19 Jul 2012 11:15:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JBFsmf075300; Thu, 19 Jul 2012 11:15:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207191115.q6JBFsmf075300@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 19 Jul 2012 11:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238617 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 11:15:54 -0000 Author: kib Date: Thu Jul 19 11:15:53 2012 New Revision: 238617 URL: http://svn.freebsd.org/changeset/base/238617 Log: Fix several reads beyond the mapped first page of the binary in the ELF parser. Specifically, do not allow note reader and interpreter path comparision in the brandelf code to read past end of the page. This may happen if specially crafter ELF image is activated. Submitted by: Lukasz Wojcik MFC after: 3 days Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Thu Jul 19 10:28:29 2012 (r238616) +++ head/sys/kern/imgact_elf.c Thu Jul 19 11:15:53 2012 (r238617) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); static int __elfN(check_header)(const Elf_Ehdr *hdr); static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, - const char *interp, int32_t *osrel); + const char *interp, int interp_name_len, int32_t *osrel); static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, u_long *entry, size_t pagesize); static int __elfN(load_section)(struct image_params *imgp, vm_offset_t offset, @@ -254,7 +254,7 @@ __elfN(brand_inuse)(Elf_Brandinfo *entry static Elf_Brandinfo * __elfN(get_brandinfo)(struct image_params *imgp, const char *interp, - int32_t *osrel) + int interp_name_len, int32_t *osrel) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi; @@ -300,7 +300,10 @@ __elfN(get_brandinfo)(struct image_param if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) continue; if (hdr->e_machine == bi->machine && - strcmp(interp, bi->interp_path) == 0) + /* ELF image p_filesz includes terminating zero */ + strlen(bi->interp_path) + 1 == interp_name_len && + strncmp(interp, bi->interp_path, interp_name_len) + == 0) return (bi); } } @@ -722,7 +725,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i u_long seg_size, seg_addr; u_long addr, baddr, et_dyn_addr, entry = 0, proghdr = 0; int32_t osrel = 0; - int error = 0, i, n; + int error = 0, i, n, interp_name_len = 0; const char *interp = NULL, *newinterp = NULL; Elf_Brandinfo *brand_info; char *path; @@ -763,9 +766,11 @@ __CONCAT(exec_, __elfN(imgact))(struct i case PT_INTERP: /* Path to interpreter */ if (phdr[i].p_filesz > MAXPATHLEN || - phdr[i].p_offset + phdr[i].p_filesz > PAGE_SIZE) + phdr[i].p_offset >= PAGE_SIZE || + phdr[i].p_offset + phdr[i].p_filesz >= PAGE_SIZE) return (ENOEXEC); interp = imgp->image_header + phdr[i].p_offset; + interp_name_len = phdr[i].p_filesz; break; case PT_GNU_STACK: if (__elfN(nxstack)) @@ -775,7 +780,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i } } - brand_info = __elfN(get_brandinfo)(imgp, interp, &osrel); + brand_info = __elfN(get_brandinfo)(imgp, interp, interp_name_len, + &osrel); if (brand_info == NULL) { uprintf("ELF binary type \"%u\" not known.\n", hdr->e_ident[EI_OSABI]); @@ -1562,6 +1568,7 @@ __elfN(parse_notes)(struct image_params int i; if (pnote == NULL || pnote->p_offset >= PAGE_SIZE || + pnote->p_filesz > PAGE_SIZE || pnote->p_offset + pnote->p_filesz >= PAGE_SIZE) return (FALSE); @@ -1569,15 +1576,17 @@ __elfN(parse_notes)(struct image_params note_end = (const Elf_Note *)(imgp->image_header + pnote->p_offset + pnote->p_filesz); for (i = 0; i < 100 && note >= note0 && note < note_end; i++) { - if (!aligned(note, Elf32_Addr)) + if (!aligned(note, Elf32_Addr) || (const char *)note_end - + (const char *)note < sizeof(Elf_Note)) return (FALSE); if (note->n_namesz != checknote->hdr.n_namesz || note->n_descsz != checknote->hdr.n_descsz || note->n_type != checknote->hdr.n_type) goto nextnote; note_name = (const char *)(note + 1); - if (strncmp(checknote->vendor, note_name, - checknote->hdr.n_namesz) != 0) + if (note_name + checknote->hdr.n_namesz >= + (const char *)note_end || strncmp(checknote->vendor, + note_name, checknote->hdr.n_namesz) != 0) goto nextnote; /* From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 11:18:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61BBC106566B; Thu, 19 Jul 2012 11:18:42 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D2D28FC12; Thu, 19 Jul 2012 11:18:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JBIgmn075539; Thu, 19 Jul 2012 11:18:42 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JBIgW6075537; Thu, 19 Jul 2012 11:18:42 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201207191118.q6JBIgW6075537@svn.freebsd.org> From: Joerg Wunsch Date: Thu, 19 Jul 2012 11:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238618 - head/etc/mtree X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 11:18:42 -0000 Author: joerg Date: Thu Jul 19 11:18:41 2012 New Revision: 238618 URL: http://svn.freebsd.org/changeset/base/238618 Log: Add share/examples/libusb20 to the list of directories. Modified: head/etc/mtree/BSD.usr.dist Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Jul 19 11:15:53 2012 (r238617) +++ head/etc/mtree/BSD.usr.dist Thu Jul 19 11:18:41 2012 (r238618) @@ -271,6 +271,8 @@ .. .. .. + libusb20 + .. libvgl .. mdoc From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 11:43:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55E2A106566B; Thu, 19 Jul 2012 11:43:32 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CCB18FC0C; Thu, 19 Jul 2012 11:43:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JBhWmt077348; Thu, 19 Jul 2012 11:43:32 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JBhWWe077343; Thu, 19 Jul 2012 11:43:32 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201207191143.q6JBhWWe077343@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 19 Jul 2012 11:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238619 - in stable/8/sys: conf modules/netgraph/netflow netgraph/netflow X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 11:43:32 -0000 Author: melifaro Date: Thu Jul 19 11:43:31 2012 New Revision: 238619 URL: http://svn.freebsd.org/changeset/base/238619 Log: MFC r219182, r219229, r220769, r223706, r223787, r223822, r232921, r237162, r237163, r237164, r237226, r237227 Merge netflow v9 support (kernel side) r219182 - Add support for NetFlow version 9 into ng_netflow(4) node. r219229 - Unbreak the build for no options INET6. r220769 - ng_netflow_cache_init() can be void. r223706 - Fix double free. r223787 - Eliminate flow6_hash_entry in favor of flow_hash_entry r223822 - Add missing unlocks. r232921 - Use rt_numfibs variable instead of compile-time RT_NUMFIBS. r237162 - Fix improper L4 header handling for IPv6 packets passed via DLT_RAW. r237163 - Set netflow v9 observation domain value to fib number instead of node id r237164 - Use time_uptime instead of getnanotime for accouting integer number of seconds. r237226 - Simplify IP pointer recovery in case of mbuf reallocation. r237227 - Make radix lookup on src and dst flow addresses optional No objection from: glebius Approved by: ae(mentor) Added: stable/8/sys/netgraph/netflow/netflow_v9.c - copied, changed from r219182, head/sys/netgraph/netflow/netflow_v9.c stable/8/sys/netgraph/netflow/netflow_v9.h - copied unchanged from r219182, head/sys/netgraph/netflow/netflow_v9.h Modified: stable/8/sys/conf/files stable/8/sys/modules/netgraph/netflow/Makefile stable/8/sys/netgraph/netflow/netflow.c stable/8/sys/netgraph/netflow/netflow.h stable/8/sys/netgraph/netflow/ng_netflow.c stable/8/sys/netgraph/netflow/ng_netflow.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Thu Jul 19 11:18:41 2012 (r238618) +++ stable/8/sys/conf/files Thu Jul 19 11:43:31 2012 (r238619) @@ -2533,6 +2533,7 @@ netgraph/bluetooth/socket/ng_btsocket_l2 netgraph/bluetooth/socket/ng_btsocket_rfcomm.c optional netgraph_bluetooth_socket netgraph/bluetooth/socket/ng_btsocket_sco.c optional netgraph_bluetooth_socket netgraph/netflow/netflow.c optional netgraph_netflow +netgraph/netflow/netflow_v9.c optional netgraph_netflow netgraph/netflow/ng_netflow.c optional netgraph_netflow netgraph/ng_UI.c optional netgraph_UI netgraph/ng_async.c optional netgraph_async Modified: stable/8/sys/modules/netgraph/netflow/Makefile ============================================================================== --- stable/8/sys/modules/netgraph/netflow/Makefile Thu Jul 19 11:18:41 2012 (r238618) +++ stable/8/sys/modules/netgraph/netflow/Makefile Thu Jul 19 11:43:31 2012 (r238619) @@ -3,9 +3,20 @@ # Author: Gleb Smirnoff # +.include + .PATH: ${.CURDIR}/../../../netgraph/netflow KMOD= ng_netflow -SRCS= ng_netflow.c netflow.c +SRCS= ng_netflow.c netflow.c netflow_v9.c opt_inet6.h opt_route.h + +.if !defined(KERNBUILDDIR) + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + echo "#define INET6 1" > ${.TARGET} +.endif + +.endif .include Modified: stable/8/sys/netgraph/netflow/netflow.c ============================================================================== --- stable/8/sys/netgraph/netflow/netflow.c Thu Jul 19 11:18:41 2012 (r238618) +++ stable/8/sys/netgraph/netflow/netflow.c Thu Jul 19 11:43:31 2012 (r238619) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2010-2011 Alexander V. Chernikov * Copyright (c) 2004-2005 Gleb Smirnoff * Copyright (c) 2001-2003 Roman V. Palagin * All rights reserved. @@ -30,6 +31,8 @@ static const char rcs_id[] = "@(#) $FreeBSD$"; +#include "opt_inet6.h" +#include "opt_route.h" #include #include #include @@ -37,14 +40,18 @@ static const char rcs_id[] = #include #include #include +#include #include +#include #include #include +#include #include #include #include +#include #include #include @@ -52,6 +59,7 @@ static const char rcs_id[] = #include #include +#include #include #define NBUCKETS (65536) /* must be power of 2 */ @@ -83,25 +91,30 @@ static const char rcs_id[] = */ #define SMALL(fle) (fle->f.packets <= 4) -/* - * Cisco uses milliseconds for uptime. Bad idea, since it overflows - * every 48+ days. But we will do same to keep compatibility. This macro - * does overflowable multiplication to 1000. - */ -#define MILLIUPTIME(t) (((t) << 9) + /* 512 */ \ - ((t) << 8) + /* 256 */ \ - ((t) << 7) + /* 128 */ \ - ((t) << 6) + /* 64 */ \ - ((t) << 5) + /* 32 */ \ - ((t) << 3)) /* 8 */ MALLOC_DECLARE(M_NETFLOW_HASH); MALLOC_DEFINE(M_NETFLOW_HASH, "netflow_hash", "NetFlow hash"); static int export_add(item_p, struct flow_entry *); -static int export_send(priv_p, item_p, int flags); +static int export_send(priv_p, fib_export_p, item_p, int); + +static int hash_insert(priv_p, struct flow_hash_entry *, struct flow_rec *, int, uint8_t, uint8_t); +#ifdef INET6 +static int hash6_insert(priv_p, struct flow_hash_entry *, struct flow6_rec *, int, uint8_t, uint8_t); +#endif + +static __inline void expire_flow(priv_p, fib_export_p, struct flow_entry *, int); -/* Generate hash for a given flow record. */ +/* + * Generate hash for a given flow record. + * + * FIB is not used here, because: + * most VRFS will carry public IPv4 addresses which are unique even + * without FIB private addresses can overlap, but this is worked out + * via flow_rec bcmp() containing fib id. In IPv6 world addresses are + * all globally unique (it's not fully true, there is FC00::/7 for example, + * but chances of address overlap are MUCH smaller) + */ static __inline uint32_t ip_hash(struct flow_rec *r) { @@ -115,6 +128,24 @@ ip_hash(struct flow_rec *r) } } +#ifdef INET6 +/* Generate hash for a given flow6 record. Use lower 4 octets from v6 addresses */ +static __inline uint32_t +ip6_hash(struct flow6_rec *r) +{ + switch (r->r_ip_p) { + case IPPROTO_TCP: + case IPPROTO_UDP: + return FULL_HASH(r->src.r_src6.__u6_addr.__u6_addr32[3], + r->dst.r_dst6.__u6_addr.__u6_addr32[3], r->r_sport, + r->r_dport); + default: + return ADDR_HASH(r->src.r_src6.__u6_addr.__u6_addr32[3], + r->dst.r_dst6.__u6_addr.__u6_addr32[3]); + } +} +#endif + /* This is callback from uma(9), called on alloc. */ static int uma_ctor_flow(void *mem, int size, void *arg, int how) @@ -138,21 +169,46 @@ uma_dtor_flow(void *mem, int size, void atomic_subtract_32(&priv->info.nfinfo_used, 1); } +#ifdef INET6 +/* This is callback from uma(9), called on alloc. */ +static int +uma_ctor_flow6(void *mem, int size, void *arg, int how) +{ + priv_p priv = (priv_p )arg; + + if (atomic_load_acq_32(&priv->info.nfinfo_used6) >= CACHESIZE) + return (ENOMEM); + + atomic_add_32(&priv->info.nfinfo_used6, 1); + + return (0); +} + +/* This is callback from uma(9), called on free. */ +static void +uma_dtor_flow6(void *mem, int size, void *arg) +{ + priv_p priv = (priv_p )arg; + + atomic_subtract_32(&priv->info.nfinfo_used6, 1); +} +#endif + /* * Detach export datagram from priv, if there is any. * If there is no, allocate a new one. */ static item_p -get_export_dgram(priv_p priv) +get_export_dgram(priv_p priv, fib_export_p fe) { item_p item = NULL; - mtx_lock(&priv->export_mtx); - if (priv->export_item != NULL) { - item = priv->export_item; - priv->export_item = NULL; + mtx_lock(&fe->export_mtx); + if (fe->exp.item != NULL) { + item = fe->exp.item; + fe->exp.item = NULL; } - mtx_unlock(&priv->export_mtx); + mtx_unlock(&fe->export_mtx); if (item == NULL) { struct netflow_v5_export_dgram *dgram; @@ -178,20 +234,20 @@ get_export_dgram(priv_p priv) * Re-attach incomplete datagram back to priv. * If there is already another one, then send incomplete. */ static void -return_export_dgram(priv_p priv, item_p item, int flags) +return_export_dgram(priv_p priv, fib_export_p fe, item_p item, int flags) { /* * It may happen on SMP, that some thread has already * put its item there, in this case we bail out and * send what we have to collector. */ - mtx_lock(&priv->export_mtx); - if (priv->export_item == NULL) { - priv->export_item = item; - mtx_unlock(&priv->export_mtx); + mtx_lock(&fe->export_mtx); + if (fe->exp.item == NULL) { + fe->exp.item = item; + mtx_unlock(&fe->export_mtx); } else { - mtx_unlock(&priv->export_mtx); - export_send(priv, item, flags); + mtx_unlock(&fe->export_mtx); + export_send(priv, fe, item, flags); } } @@ -200,20 +256,55 @@ return_export_dgram(priv_p priv, item_p * full, then call export_send(). */ static __inline void -expire_flow(priv_p priv, item_p *item, struct flow_entry *fle, int flags) +expire_flow(priv_p priv, fib_export_p fe, struct flow_entry *fle, int flags) { - if (*item == NULL) - *item = get_export_dgram(priv); - if (*item == NULL) { - atomic_add_32(&priv->info.nfinfo_export_failed, 1); - uma_zfree_arg(priv->zone, fle, priv); - return; + struct netflow_export_item exp; + uint16_t version = fle->f.version; + + if ((priv->export != NULL) && (version == IPVERSION)) { + exp.item = get_export_dgram(priv, fe); + if (exp.item == NULL) { + atomic_add_32(&priv->info.nfinfo_export_failed, 1); + if (priv->export9 != NULL) + atomic_add_32(&priv->info.nfinfo_export9_failed, 1); + /* fle definitely contains IPv4 flow */ + uma_zfree_arg(priv->zone, fle, priv); + return; + } + + if (export_add(exp.item, fle) > 0) + export_send(priv, fe, exp.item, flags); + else + return_export_dgram(priv, fe, exp.item, NG_QUEUE); } - if (export_add(*item, fle) > 0) { - export_send(priv, *item, flags); - *item = NULL; + + if (priv->export9 != NULL) { + exp.item9 = get_export9_dgram(priv, fe, &exp.item9_opt); + if (exp.item9 == NULL) { + atomic_add_32(&priv->info.nfinfo_export9_failed, 1); + if (version == IPVERSION) + uma_zfree_arg(priv->zone, fle, priv); +#ifdef INET6 + else if (version == IP6VERSION) + uma_zfree_arg(priv->zone6, fle, priv); +#endif + else + panic("ng_netflow: Unknown IP proto: %d", version); + return; + } + + if (export9_add(exp.item9, exp.item9_opt, fle) > 0) + export9_send(priv, fe, exp.item9, exp.item9_opt, flags); + else + return_export9_dgram(priv, fe, exp.item9, exp.item9_opt, NG_QUEUE); } - uma_zfree_arg(priv->zone, fle, priv); + + if (version == IPVERSION) + uma_zfree_arg(priv->zone, fle, priv); +#ifdef INET6 + else if (version == IP6VERSION) + uma_zfree_arg(priv->zone6, fle, priv); +#endif } /* Get a snapshot of node statistics */ @@ -234,9 +325,9 @@ ng_netflow_copyinfo(priv_p priv, struct * as this was done in previous version. Need to test & profile * to be sure. */ -static __inline int -hash_insert(priv_p priv, struct flow_hash_entry *hsh, struct flow_rec *r, - int plen, uint8_t tcp_flags) +static int +hash_insert(priv_p priv, struct flow_hash_entry *hsh, struct flow_rec *r, + int plen, uint8_t flags, uint8_t tcp_flags) { struct flow_entry *fle; struct sockaddr_in sin; @@ -255,6 +346,7 @@ hash_insert(priv_p priv, struct flow_has * we can safely edit it. */ + fle->f.version = IPVERSION; bcopy(r, &fle->f.r, sizeof(struct flow_rec)); fle->f.bytes = plen; fle->f.packets = 1; @@ -266,46 +358,48 @@ hash_insert(priv_p priv, struct flow_has * First we do route table lookup on destination address. So we can * fill in out_ifx, dst_mask, nexthop, and dst_as in future releases. */ - bzero(&sin, sizeof(sin)); - sin.sin_len = sizeof(struct sockaddr_in); - sin.sin_family = AF_INET; - sin.sin_addr = fle->f.r.r_dst; - /* XXX MRT 0 as a default.. need the m here to get fib */ - rt = rtalloc1_fib((struct sockaddr *)&sin, 0, 0, 0); - if (rt != NULL) { - fle->f.fle_o_ifx = rt->rt_ifp->if_index; - - if (rt->rt_flags & RTF_GATEWAY && - rt->rt_gateway->sa_family == AF_INET) - fle->f.next_hop = - ((struct sockaddr_in *)(rt->rt_gateway))->sin_addr; - - if (rt_mask(rt)) - fle->f.dst_mask = bitcount32(((struct sockaddr_in *) - rt_mask(rt))->sin_addr.s_addr); - else if (rt->rt_flags & RTF_HOST) - /* Give up. We can't determine mask :( */ - fle->f.dst_mask = 32; + if ((flags & NG_NETFLOW_CONF_NODSTLOOKUP) == 0) { + bzero(&sin, sizeof(sin)); + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_family = AF_INET; + sin.sin_addr = fle->f.r.r_dst; + rt = rtalloc1_fib((struct sockaddr *)&sin, 0, 0, r->fib); + if (rt != NULL) { + fle->f.fle_o_ifx = rt->rt_ifp->if_index; + + if (rt->rt_flags & RTF_GATEWAY && + rt->rt_gateway->sa_family == AF_INET) + fle->f.next_hop = + ((struct sockaddr_in *)(rt->rt_gateway))->sin_addr; + + if (rt_mask(rt)) + fle->f.dst_mask = bitcount32(((struct sockaddr_in *) + rt_mask(rt))->sin_addr.s_addr); + else if (rt->rt_flags & RTF_HOST) + /* Give up. We can't determine mask :( */ + fle->f.dst_mask = 32; - RTFREE_LOCKED(rt); + RTFREE_LOCKED(rt); + } } /* Do route lookup on source address, to fill in src_mask. */ - bzero(&sin, sizeof(sin)); - sin.sin_len = sizeof(struct sockaddr_in); - sin.sin_family = AF_INET; - sin.sin_addr = fle->f.r.r_src; - /* XXX MRT 0 as a default revisit. need the mbuf for fib*/ - rt = rtalloc1_fib((struct sockaddr *)&sin, 0, 0, 0); - if (rt != NULL) { - if (rt_mask(rt)) - fle->f.src_mask = bitcount32(((struct sockaddr_in *) - rt_mask(rt))->sin_addr.s_addr); - else if (rt->rt_flags & RTF_HOST) - /* Give up. We can't determine mask :( */ - fle->f.src_mask = 32; + if ((flags & NG_NETFLOW_CONF_NOSRCLOOKUP) == 0) { + bzero(&sin, sizeof(sin)); + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_family = AF_INET; + sin.sin_addr = fle->f.r.r_src; + rt = rtalloc1_fib((struct sockaddr *)&sin, 0, 0, r->fib); + if (rt != NULL) { + if (rt_mask(rt)) + fle->f.src_mask = bitcount32(((struct sockaddr_in *) + rt_mask(rt))->sin_addr.s_addr); + else if (rt->rt_flags & RTF_HOST) + /* Give up. We can't determine mask :( */ + fle->f.src_mask = 32; - RTFREE_LOCKED(rt); + RTFREE_LOCKED(rt); + } } /* Push new flow at the and of hash. */ @@ -314,40 +408,186 @@ hash_insert(priv_p priv, struct flow_has return (0); } +#ifdef INET6 +/* XXX: make normal function, instead of.. */ +#define ipv6_masklen(x) bitcount32((x).__u6_addr.__u6_addr32[0]) + \ + bitcount32((x).__u6_addr.__u6_addr32[1]) + \ + bitcount32((x).__u6_addr.__u6_addr32[2]) + \ + bitcount32((x).__u6_addr.__u6_addr32[3]) +#define RT_MASK6(x) (ipv6_masklen(((struct sockaddr_in6 *)rt_mask(x))->sin6_addr)) +static int +hash6_insert(priv_p priv, struct flow_hash_entry *hsh6, struct flow6_rec *r, + int plen, uint8_t flags, uint8_t tcp_flags) +{ + struct flow6_entry *fle6; + struct sockaddr_in6 *src, *dst; + struct rtentry *rt; + struct route_in6 rin6; + + mtx_assert(&hsh6->mtx, MA_OWNED); + + fle6 = uma_zalloc_arg(priv->zone6, priv, M_NOWAIT); + if (fle6 == NULL) { + atomic_add_32(&priv->info.nfinfo_alloc_failed, 1); + return (ENOMEM); + } + + /* + * Now fle is totally ours. It is detached from all lists, + * we can safely edit it. + */ + + fle6->f.version = IP6VERSION; + bcopy(r, &fle6->f.r, sizeof(struct flow6_rec)); + fle6->f.bytes = plen; + fle6->f.packets = 1; + fle6->f.tcp_flags = tcp_flags; + + fle6->f.first = fle6->f.last = time_uptime; + + /* + * First we do route table lookup on destination address. So we can + * fill in out_ifx, dst_mask, nexthop, and dst_as in future releases. + */ + if ((flags & NG_NETFLOW_CONF_NODSTLOOKUP) == 0) + { + bzero(&rin6, sizeof(struct route_in6)); + dst = (struct sockaddr_in6 *)&rin6.ro_dst; + dst->sin6_len = sizeof(struct sockaddr_in6); + dst->sin6_family = AF_INET6; + dst->sin6_addr = r->dst.r_dst6; + + rin6.ro_rt = rtalloc1_fib((struct sockaddr *)dst, 0, 0, r->fib); + + if (rin6.ro_rt != NULL) { + rt = rin6.ro_rt; + fle6->f.fle_o_ifx = rt->rt_ifp->if_index; + + if (rt->rt_flags & RTF_GATEWAY && + rt->rt_gateway->sa_family == AF_INET6) + fle6->f.n.next_hop6 = + ((struct sockaddr_in6 *)(rt->rt_gateway))->sin6_addr; + + if (rt_mask(rt)) + fle6->f.dst_mask = RT_MASK6(rt); + else + fle6->f.dst_mask = 128; + + RTFREE_LOCKED(rt); + } + } + + if ((flags & NG_NETFLOW_CONF_NODSTLOOKUP) == 0) + { + /* Do route lookup on source address, to fill in src_mask. */ + bzero(&rin6, sizeof(struct route_in6)); + src = (struct sockaddr_in6 *)&rin6.ro_dst; + src->sin6_len = sizeof(struct sockaddr_in6); + src->sin6_family = AF_INET6; + src->sin6_addr = r->src.r_src6; + + rin6.ro_rt = rtalloc1_fib((struct sockaddr *)src, 0, 0, r->fib); + + if (rin6.ro_rt != NULL) { + rt = rin6.ro_rt; + + if (rt_mask(rt)) + fle6->f.src_mask = RT_MASK6(rt); + else + fle6->f.src_mask = 128; + + RTFREE_LOCKED(rt); + } + } + + /* Push new flow at the and of hash. */ + TAILQ_INSERT_TAIL(&hsh6->head, (struct flow_entry *)fle6, fle_hash); + + return (0); +} +#undef ipv6_masklen +#undef RT_MASK6 +#endif + /* * Non-static functions called from ng_netflow.c */ /* Allocate memory and set up flow cache */ -int +void ng_netflow_cache_init(priv_p priv) { - struct flow_hash_entry *hsh; + struct flow_hash_entry *hsh; int i; /* Initialize cache UMA zone. */ - priv->zone = uma_zcreate("NetFlow cache", sizeof(struct flow_entry), + priv->zone = uma_zcreate("NetFlow IPv4 cache", sizeof(struct flow_entry), uma_ctor_flow, uma_dtor_flow, NULL, NULL, UMA_ALIGN_CACHE, 0); uma_zone_set_max(priv->zone, CACHESIZE); +#ifdef INET6 + priv->zone6 = uma_zcreate("NetFlow IPv6 cache", sizeof(struct flow6_entry), + uma_ctor_flow6, uma_dtor_flow6, NULL, NULL, UMA_ALIGN_CACHE, 0); + uma_zone_set_max(priv->zone6, CACHESIZE); +#endif /* Allocate hash. */ priv->hash = malloc(NBUCKETS * sizeof(struct flow_hash_entry), M_NETFLOW_HASH, M_WAITOK | M_ZERO); - if (priv->hash == NULL) { - uma_zdestroy(priv->zone); - return (ENOMEM); + /* Initialize hash. */ + for (i = 0, hsh = priv->hash; i < NBUCKETS; i++, hsh++) { + mtx_init(&hsh->mtx, "hash mutex", NULL, MTX_DEF); + TAILQ_INIT(&hsh->head); } +#ifdef INET6 + /* Allocate hash. */ + priv->hash6 = malloc(NBUCKETS * sizeof(struct flow_hash_entry), + M_NETFLOW_HASH, M_WAITOK | M_ZERO); + /* Initialize hash. */ - for (i = 0, hsh = priv->hash; i < NBUCKETS; i++, hsh++) { + for (i = 0, hsh = priv->hash6; i < NBUCKETS; i++, hsh++) { mtx_init(&hsh->mtx, "hash mutex", NULL, MTX_DEF); TAILQ_INIT(&hsh->head); } +#endif - mtx_init(&priv->export_mtx, "export dgram lock", NULL, MTX_DEF); + ng_netflow_v9_cache_init(priv); + CTR0(KTR_NET, "ng_netflow startup()"); +} +/* Initialize new FIB table for v5 and v9 */ +int +ng_netflow_fib_init(priv_p priv, int fib) +{ + fib_export_p fe = priv_to_fib(priv, fib); + + CTR1(KTR_NET, "ng_netflow(): fib init: %d", fib); + + if (fe != NULL) + return (0); + + if ((fe = malloc(sizeof(struct fib_export), M_NETGRAPH, M_NOWAIT | M_ZERO)) == NULL) + return (1); + + mtx_init(&fe->export_mtx, "export dgram lock", NULL, MTX_DEF); + mtx_init(&fe->export9_mtx, "export9 dgram lock", NULL, MTX_DEF); + fe->fib = fib; + fe->domain_id = fib; + + if (atomic_cmpset_ptr((volatile uintptr_t *)&priv->fib_data[fib], (uintptr_t)NULL, (uintptr_t)fe) == 0) { + /* FIB already set up by other ISR */ + CTR3(KTR_NET, "ng_netflow(): fib init: %d setup %p but got %p", fib, fe, priv_to_fib(priv, fib)); + mtx_destroy(&fe->export_mtx); + mtx_destroy(&fe->export9_mtx); + free(fe, M_NETGRAPH); + } else { + /* Increase counter for statistics */ + CTR3(KTR_NET, "ng_netflow(): fib %d setup to %p (%p)", fib, fe, priv_to_fib(priv, fib)); + atomic_fetchadd_32(&priv->info.nfinfo_alloc_fibs, 1); + } + return (0); } @@ -357,9 +597,12 @@ ng_netflow_cache_flush(priv_p priv) { struct flow_entry *fle, *fle1; struct flow_hash_entry *hsh; - item_p item = NULL; + struct netflow_export_item exp; + fib_export_p fe; int i; + bzero(&exp, sizeof(exp)); + /* * We are going to free probably billable data. * Expire everything before freeing it. @@ -368,36 +611,67 @@ ng_netflow_cache_flush(priv_p priv) for (hsh = priv->hash, i = 0; i < NBUCKETS; hsh++, i++) TAILQ_FOREACH_SAFE(fle, &hsh->head, fle_hash, fle1) { TAILQ_REMOVE(&hsh->head, fle, fle_hash); - expire_flow(priv, &item, fle, NG_QUEUE); + fe = priv_to_fib(priv, fle->f.r.fib); + expire_flow(priv, fe, fle, NG_QUEUE); } - - if (item != NULL) - export_send(priv, item, NG_QUEUE); +#ifdef INET6 + for (hsh = priv->hash6, i = 0; i < NBUCKETS; hsh++, i++) + TAILQ_FOREACH_SAFE(fle, &hsh->head, fle_hash, fle1) { + TAILQ_REMOVE(&hsh->head, fle, fle_hash); + fe = priv_to_fib(priv, fle->f.r.fib); + expire_flow(priv, fe, fle, NG_QUEUE); + } +#endif uma_zdestroy(priv->zone); - /* Destroy hash mutexes. */ for (i = 0, hsh = priv->hash; i < NBUCKETS; i++, hsh++) mtx_destroy(&hsh->mtx); /* Free hash memory. */ - if (priv->hash) + if (priv->hash != NULL) free(priv->hash, M_NETFLOW_HASH); +#ifdef INET6 + uma_zdestroy(priv->zone6); + /* Destroy hash mutexes. */ + for (i = 0, hsh = priv->hash6; i < NBUCKETS; i++, hsh++) + mtx_destroy(&hsh->mtx); + + /* Free hash memory. */ + if (priv->hash6 != NULL) + free(priv->hash6, M_NETFLOW_HASH); +#endif + + for (i = 0; i < priv->maxfibs; i++) { + if ((fe = priv_to_fib(priv, i)) == NULL) + continue; + + if (fe->exp.item != NULL) + export_send(priv, fe, fe->exp.item, NG_QUEUE); - mtx_destroy(&priv->export_mtx); + if (fe->exp.item9 != NULL) + export9_send(priv, fe, fe->exp.item9, fe->exp.item9_opt, NG_QUEUE); + + mtx_destroy(&fe->export_mtx); + mtx_destroy(&fe->export9_mtx); + free(fe, M_NETGRAPH); + } + + ng_netflow_v9_cache_flush(priv); } /* Insert packet from into flow cache. */ int -ng_netflow_flow_add(priv_p priv, struct ip *ip, unsigned int src_if_index) +ng_netflow_flow_add(priv_p priv, fib_export_p fe, struct ip *ip, caddr_t upper_ptr, uint8_t upper_proto, + uint8_t flags, unsigned int src_if_index) { register struct flow_entry *fle, *fle1; - struct flow_hash_entry *hsh; + struct flow_hash_entry *hsh; struct flow_rec r; - item_p item = NULL; int hlen, plen; int error = 0; uint8_t tcp_flags = 0; + uint16_t eproto; /* Try to fill flow_rec r */ bzero(&r, sizeof(r)); @@ -411,8 +685,13 @@ ng_netflow_flow_add(priv_p priv, struct if (hlen < sizeof(struct ip)) return (EINVAL); + eproto = ETHERTYPE_IP; + /* Assume L4 template by default */ + r.flow_type = NETFLOW_V9_FLOW_V4_L4; + r.r_src = ip->ip_src; r.r_dst = ip->ip_dst; + r.fib = fe->fib; /* save packet length */ plen = ntohs(ip->ip_len); @@ -448,8 +727,8 @@ ng_netflow_flow_add(priv_p priv, struct break; } - /* Update node statistics. XXX: race... */ - priv->info.nfinfo_packets ++; + atomic_fetchadd_32(&priv->info.nfinfo_packets, 1); + /* XXX: atomic */ priv->info.nfinfo_bytes += plen; /* Find hash slot. */ @@ -468,7 +747,7 @@ ng_netflow_flow_add(priv_p priv, struct break; if ((INACTIVE(fle) && SMALL(fle)) || AGED(fle)) { TAILQ_REMOVE(&hsh->head, fle, fle_hash); - expire_flow(priv, &item, fle, NG_QUEUE); + expire_flow(priv, priv_to_fib(priv, fle->f.r.fib), fle, NG_QUEUE); atomic_add_32(&priv->info.nfinfo_act_exp, 1); } } @@ -487,9 +766,9 @@ ng_netflow_flow_add(priv_p priv, struct * - it is going to overflow counter */ if (tcp_flags & TH_FIN || tcp_flags & TH_RST || AGED(fle) || - (fle->f.bytes >= (UINT_MAX - IF_MAXMTU)) ) { + (fle->f.bytes >= (CNTR_MAX - IF_MAXMTU)) ) { TAILQ_REMOVE(&hsh->head, fle, fle_hash); - expire_flow(priv, &item, fle, NG_QUEUE); + expire_flow(priv, priv_to_fib(priv, fle->f.r.fib), fle, NG_QUEUE); atomic_add_32(&priv->info.nfinfo_act_exp, 1); } else { /* @@ -503,15 +782,139 @@ ng_netflow_flow_add(priv_p priv, struct } } } else /* A new flow entry. */ - error = hash_insert(priv, hsh, &r, plen, tcp_flags); + error = hash_insert(priv, hsh, &r, plen, flags, tcp_flags); mtx_unlock(&hsh->mtx); - if (item != NULL) - return_export_dgram(priv, item, NG_QUEUE); + return (error); +} + +#ifdef INET6 +/* Insert IPv6 packet from into flow cache. */ +int +ng_netflow_flow6_add(priv_p priv, fib_export_p fe, struct ip6_hdr *ip6, caddr_t upper_ptr, uint8_t upper_proto, + uint8_t flags, unsigned int src_if_index) +{ + register struct flow_entry *fle = NULL, *fle1; + register struct flow6_entry *fle6; + struct flow_hash_entry *hsh; + struct flow6_rec r; + int plen; + int error = 0; + uint8_t tcp_flags = 0; + + /* check version */ + if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) + return (EINVAL); + + bzero(&r, sizeof(r)); + + r.src.r_src6 = ip6->ip6_src; + r.dst.r_dst6 = ip6->ip6_dst; + r.fib = fe->fib; + + /* Assume L4 template by default */ + r.flow_type = NETFLOW_V9_FLOW_V6_L4; + + /* save packet length */ + plen = ntohs(ip6->ip6_plen) + sizeof(struct ip6_hdr); + + /* XXX: set DSCP/CoS value */ +#if 0 + r.r_tos = ip->ip_tos; +#endif + if ((flags & NG_NETFLOW_IS_FRAG) == 0) { + switch(upper_proto) { + case IPPROTO_TCP: + { + register struct tcphdr *tcp; + + tcp = (struct tcphdr *)upper_ptr; + r.r_ports = *(uint32_t *)upper_ptr; + tcp_flags = tcp->th_flags; + break; + } + case IPPROTO_UDP: + case IPPROTO_SCTP: + { + r.r_ports = *(uint32_t *)upper_ptr; + break; + } + + } + } + + r.r_ip_p = upper_proto; + r.r_i_ifx = src_if_index; + + atomic_fetchadd_32(&priv->info.nfinfo_packets6, 1); + /* XXX: atomic */ + priv->info.nfinfo_bytes6 += plen; + + /* Find hash slot. */ + hsh = &priv->hash6[ip6_hash(&r)]; + + mtx_lock(&hsh->mtx); + + /* + * Go through hash and find our entry. If we encounter an + * entry, that should be expired, purge it. We do a reverse + * search since most active entries are first, and most + * searches are done on most active entries. + */ + TAILQ_FOREACH_REVERSE_SAFE(fle, &hsh->head, fhead, fle_hash, fle1) { + if (fle->f.version != IP6VERSION) + continue; + fle6 = (struct flow6_entry *)fle; + if (bcmp(&r, &fle6->f.r, sizeof(struct flow6_rec)) == 0) + break; + if ((INACTIVE(fle6) && SMALL(fle6)) || AGED(fle6)) { + TAILQ_REMOVE(&hsh->head, fle, fle_hash); + expire_flow(priv, priv_to_fib(priv, fle->f.r.fib), fle, + NG_QUEUE); + atomic_add_32(&priv->info.nfinfo_act_exp, 1); + } + } + + if (fle != NULL) { /* An existent entry. */ + fle6 = (struct flow6_entry *)fle; + + fle6->f.bytes += plen; + fle6->f.packets ++; + fle6->f.tcp_flags |= tcp_flags; + fle6->f.last = time_uptime; + + /* + * We have the following reasons to expire flow in active way: + * - it hit active timeout + * - a TCP connection closed + * - it is going to overflow counter + */ + if (tcp_flags & TH_FIN || tcp_flags & TH_RST || AGED(fle6) || + (fle6->f.bytes >= (CNTR_MAX - IF_MAXMTU)) ) { + TAILQ_REMOVE(&hsh->head, fle, fle_hash); + expire_flow(priv, priv_to_fib(priv, fle->f.r.fib), fle, + NG_QUEUE); + atomic_add_32(&priv->info.nfinfo_act_exp, 1); + } else { + /* + * It is the newest, move it to the tail, + * if it isn't there already. Next search will + * locate it quicker. + */ + if (fle != TAILQ_LAST(&hsh->head, fhead)) { + TAILQ_REMOVE(&hsh->head, fle, fle_hash); + TAILQ_INSERT_TAIL(&hsh->head, fle, fle_hash); + } + } + } else /* A new flow entry. */ + error = hash6_insert(priv, hsh, &r, plen, flags, tcp_flags); + + mtx_unlock(&hsh->mtx); return (error); } +#endif /* * Return records from cache to userland. @@ -519,67 +922,113 @@ ng_netflow_flow_add(priv_p priv, struct * TODO: matching particular IP should be done in kernel, here. */ int -ng_netflow_flow_show(priv_p priv, uint32_t last, struct ng_mesg *resp) +ng_netflow_flow_show(priv_p priv, struct ngnf_show_header *req, +struct ngnf_show_header *resp) { - struct flow_hash_entry *hsh; - struct flow_entry *fle; - struct ngnf_flows *data; - int i; + struct flow_hash_entry *hsh; + struct flow_entry *fle; + struct flow_entry_data *data = (struct flow_entry_data *)(resp + 1); +#ifdef INET6 + struct flow6_entry_data *data6 = (struct flow6_entry_data *)(resp + 1); +#endif + int i, max; - data = (struct ngnf_flows *)resp->data; - data->last = 0; - data->nentries = 0; - - /* Check if this is a first run */ - if (last == 0) { - hsh = priv->hash; - i = 0; - } else { - if (last > NBUCKETS-1) - return (EINVAL); - hsh = priv->hash + last; - i = last; - } + i = req->hash_id; + if (i > NBUCKETS-1) + return (EINVAL); + +#ifdef INET6 + if (req->version == 6) { + resp->version = 6; + hsh = priv->hash6 + i; + max = NREC6_AT_ONCE; + } else +#endif + if (req->version == 4) { + resp->version = 4; + hsh = priv->hash + i; + max = NREC_AT_ONCE; + } else + return (EINVAL); /* * We will transfer not more than NREC_AT_ONCE. More data * will come in next message. - * We send current hash index to userland, and userland should - * return it back to us. Then, we will restart with new entry. + * We send current hash index and current record number in list + * to userland, and userland should return it back to us. + * Then, we will restart with new entry. * - * The resulting cache snapshot is inaccurate for the - * following reasons: - * - we skip locked hash entries - * - we bail out, if someone wants our entry - * - we skip rest of entry, when hit NREC_AT_ONCE + * The resulting cache snapshot can be inaccurate if flow expiration + * is taking place on hash item between userland data requests for + * this hash item id. */ + resp->nentries = 0; for (; i < NBUCKETS; hsh++, i++) { - if (mtx_trylock(&hsh->mtx) == 0) - continue; + int list_id; + if (mtx_trylock(&hsh->mtx) == 0) { + /* + * Requested hash index is not available, + * relay decision to skip or re-request data + * to userland. + */ + resp->hash_id = i; + resp->list_id = 0; + return (0); + } + + list_id = 0; TAILQ_FOREACH(fle, &hsh->head, fle_hash) { - if (hsh->mtx.mtx_lock & MTX_CONTESTED) - break; + if (hsh->mtx.mtx_lock & MTX_CONTESTED) { + resp->hash_id = i; + resp->list_id = list_id; + mtx_unlock(&hsh->mtx); + return (0); + } + + list_id++; + /* Search for particular record in list. */ + if (req->list_id > 0) { + if (list_id < req->list_id) + continue; - bcopy(&fle->f, &(data->entries[data->nentries]), - sizeof(fle->f)); - data->nentries++; - if (data->nentries == NREC_AT_ONCE) { + /* Requested list position found. */ + req->list_id = 0; + } +#ifdef INET6 + if (req->version == 6) { + struct flow6_entry *fle6; + + fle6 = (struct flow6_entry *)fle; + bcopy(&fle6->f, data6 + resp->nentries, + sizeof(fle6->f)); + } else +#endif + bcopy(&fle->f, data + resp->nentries, + sizeof(fle->f)); + resp->nentries++; + if (resp->nentries == max) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 11:53:15 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D69310656AD; Thu, 19 Jul 2012 11:53:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id E84678FC1C; Thu, 19 Jul 2012 11:53:14 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q6JBrDFb086336; Thu, 19 Jul 2012 15:53:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q6JBrDqM086335; Thu, 19 Jul 2012 15:53:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Jul 2012 15:53:13 +0400 From: Gleb Smirnoff To: Ermal Lu?i Message-ID: <20120719115313.GB85230@FreeBSD.org> References: <201207181613.q6IGD4gZ087600@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org Subject: Re: svn commit: r238600 - stable/9/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 11:53:15 -0000 Ermal, On Thu, Jul 19, 2012 at 12:47:07PM +0200, Ermal Lu?i wrote: E> I would prefer to be in CC for this or at least asked! You could comment on this when original revisions were committed to head. Any problems with this particular merge? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 13:00:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60BD91065673; Thu, 19 Jul 2012 13:00:32 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40BA68FC12; Thu, 19 Jul 2012 13:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JD0Waj083284; Thu, 19 Jul 2012 13:00:32 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JD0WTs083280; Thu, 19 Jul 2012 13:00:32 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201207191300.q6JD0WTs083280@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 19 Jul 2012 13:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238620 - stable/8/usr.sbin/flowctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 13:00:32 -0000 Author: melifaro Date: Thu Jul 19 13:00:31 2012 New Revision: 238620 URL: http://svn.freebsd.org/changeset/base/238620 Log: MFC r223788, r223790, r223824 236808 Merge netflow v9 support (user side) r223788 - Rewrite the flowctl utility to add it support for displaying both IPv4 and IPv4 flows. r223790 - Update manual page. Mention IPv6 support, .. r223824 - Conditionally compile in the IPv4/IPv6 address family support. r236808 - Add "human" option to print IPv4/IPv6 flows in human-readable format. Additionally, implement compatibility code for syntax changes introduced in r223788. Flowctl supports specifying node both as absolute path (new style) and as node name without colon (old style). No objection from: glebius Approved by: ae(mentor) Modified: stable/8/usr.sbin/flowctl/Makefile stable/8/usr.sbin/flowctl/flowctl.8 stable/8/usr.sbin/flowctl/flowctl.c Directory Properties: stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) Modified: stable/8/usr.sbin/flowctl/Makefile ============================================================================== --- stable/8/usr.sbin/flowctl/Makefile Thu Jul 19 11:43:31 2012 (r238619) +++ stable/8/usr.sbin/flowctl/Makefile Thu Jul 19 13:00:31 2012 (r238620) @@ -2,6 +2,8 @@ # $FreeBSD$ # +.include + PROG= flowctl MAN= flowctl.8 @@ -9,4 +11,11 @@ WARNS?= 2 DPADD= ${LIBNETGRAPH} LDADD= -lnetgraph +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DINET6 +.endif +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif + .include Modified: stable/8/usr.sbin/flowctl/flowctl.8 ============================================================================== --- stable/8/usr.sbin/flowctl/flowctl.8 Thu Jul 19 11:43:31 2012 (r238619) +++ stable/8/usr.sbin/flowctl/flowctl.8 Thu Jul 19 13:00:31 2012 (r238620) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2005 +.Dd June 8, 2012 .Dt FLOWCTL 8 .Os .Sh NAME @@ -35,7 +35,7 @@ control utility .Sh SYNOPSIS .Nm .Op Fl d Ar level -.Ar node command +.Ar path command .Sh DESCRIPTION The .Nm @@ -56,16 +56,23 @@ Currently, supports only one command. .Pp .Bl -tag -width ".Cm show" -.It Cm show +.It Cm show Oo Cm ipv4|ipv6 Oc Op Cm human|verbose This command is the analog of the .Dq "show ip cache flow" command of a Cisco router. It dumps the contents of the flow cache in Cisco-like format. +Specifing either +.Cm ipv4 +or +.Cm ipv6 +would extract only IPv4 or IPv6 flows respectively. It has optional parameter .Cm verbose , which is analog of the .Dq "show ip cache verbose flow" -command. +command. Additionally, +.Cm human +parameter can be specify to show selected flows in human-readable format. .El .Sh EXIT STATUS .Ex -std Modified: stable/8/usr.sbin/flowctl/flowctl.c ============================================================================== --- stable/8/usr.sbin/flowctl/flowctl.c Thu Jul 19 11:43:31 2012 (r238619) +++ stable/8/usr.sbin/flowctl/flowctl.c Thu Jul 19 13:00:31 2012 (r238620) @@ -46,29 +46,61 @@ static const char rcs_id[] = #include #include #include +#include #include #include #include -#define CISCO_SH_FLOW_HEADER "SrcIf SrcIPaddress DstIf DstIPaddress Pr SrcP DstP Pkts\n" +#define CISCO_SH_FLOW_HEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Pr SrcP DstP Pkts\n" #define CISCO_SH_FLOW "%-13s %-15s %-13s %-15s %2u %4.4x %4.4x %6lu\n" -#define CISCO_SH_VERB_FLOW_HEADER "SrcIf SrcIPaddress DstIf DstIPaddress Pr TOS Flgs Pkts\n" \ +/* human-readable IPv4 header */ +#define CISCO_SH_FLOW_HHEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Proto SrcPort DstPort Pkts\n" +#define CISCO_SH_FLOW_H "%-13s %-15s %-13s %-15s %5u %8d %8d %8lu\n" + +#define CISCO_SH_FLOW6_HEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Pr SrcP DstP Pkts\n" +#define CISCO_SH_FLOW6 "%-13s %-30s %-13s %-30s %2u %4.4x %4.4x %6lu\n" + +/* Human-readable IPv6 headers */ +#define CISCO_SH_FLOW6_HHEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Proto SrcPort DstPort Pkts\n" +#define CISCO_SH_FLOW6_H "%-13s %-36s %-13s %-36s %5u %8d %8d %8lu\n" + +#define CISCO_SH_VERB_FLOW_HEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Pr TOS Flgs Pkts\n" \ "Port Msk AS Port Msk AS NextHop B/Pk Active\n" #define CISCO_SH_VERB_FLOW "%-14s %-15s %-14s %-15s %2u %3x %4x %6lu\n" \ "%4.4x /%-2u %-5u %4.4x /%-2u %-5u %-15s %9u %8u\n\n" -static int flow_cache_print(struct ngnf_flows *recs); -static int flow_cache_print_verbose(struct ngnf_flows *recs); -static int ctl_show(int, char **); +#define CISCO_SH_VERB_FLOW6_HEADER "SrcIf SrcIPaddress " \ +"DstIf DstIPaddress Pr TOS Flgs Pkts\n" \ +"Port Msk AS Port Msk AS NextHop B/Pk Active\n" + +#define CISCO_SH_VERB_FLOW6 "%-14s %-30s %-14s %-30s %2u %3x %4x %6lu\n" \ + "%4.4x /%-2u %-5u %4.4x /%-2u %-5u %-30s %9u %8u\n\n" +#ifdef INET +static void flow_cache_print(struct ngnf_show_header *resp); +static void flow_cache_print_verbose(struct ngnf_show_header *resp); +#endif +#ifdef INET6 +static void flow_cache_print6(struct ngnf_show_header *resp); +static void flow_cache_print6_verbose(struct ngnf_show_header *resp); +#endif +static void ctl_show(int, char **); +#if defined(INET) || defined(INET6) +static void do_show(int, void (*func)(struct ngnf_show_header *)); +#endif static void help(void); static void execute_command(int, char **); struct ip_ctl_cmd { char *cmd_name; - int (*cmd_func)(int argc, char **argv); + void (*cmd_func)(int argc, char **argv); }; struct ip_ctl_cmd cmds[] = { @@ -76,8 +108,8 @@ struct ip_ctl_cmd cmds[] = { {NULL, NULL}, }; -int cs; -char ng_nodename[NG_PATHSIZ]; +int cs, human = 0; +char *ng_path, ng_nodename[NG_PATHSIZ]; int main(int argc, char **argv) @@ -85,7 +117,6 @@ main(int argc, char **argv) int c; char sname[NG_NODESIZ]; int rcvbuf = SORCVBUF_SIZE; - char *ng_name; /* parse options */ while ((c = getopt(argc, argv, "d:")) != -1) { @@ -98,14 +129,26 @@ main(int argc, char **argv) argc -= optind; argv += optind; - ng_name = argv[0]; - if (ng_name == NULL) + ng_path = argv[0]; + if (ng_path == NULL || (strlen(ng_path) > NG_PATHSIZ)) help(); + + /* + * Compatibility check: + * If ng_path contains ':' we assume absolute path (new style) + * e.g. ( '.:', '[3f]:', 'foo:' or 'foo:hook1[.hook2][.hook3]' ) + * otherwise assume old style (node name) + */ + + if (strchr(ng_path, ':') == NULL) { + /* Old style, convert to absolute path */ + snprintf(ng_nodename, sizeof(ng_nodename), "%s:", ng_path); + ng_path = ng_nodename; + } + argc--; argv++; - snprintf(ng_nodename, sizeof(ng_nodename), "%s:", ng_name); - /* create control socket. */ snprintf(sname, sizeof(sname), "flowctl%i", getpid()); @@ -145,77 +188,116 @@ execute_command(int argc, char **argv) (*cmds[cindex].cmd_func)(argc, argv); } -static int +static void ctl_show(int argc, char **argv) { - struct ng_mesg *ng_mesg; - struct ngnf_flows *data; - char path[NG_PATHSIZ]; - int token, nread, last = 0; - int verbose = 0; + int ipv4, ipv6, verbose = 0; + + ipv4 = feature_present("inet"); + ipv6 = feature_present("inet6"); + + if (argc > 0 && !strncmp(argv[0], "ipv4", 4)) { + ipv6 = 0; + argc--; + argv++; + } + if (argc > 0 && !strncmp(argv[0], "ipv6", 4)) { + ipv4 = 0; + argc--; + argv++; + } if (argc > 0 && !strncmp(argv[0], "verbose", strlen(argv[0]))) verbose = 1; + if (argc > 0 && !strncmp(argv[0], "human", strlen(argv[0]))) + human = 1; + +#ifdef INET + if (ipv4) { + if (verbose) + do_show(4, &flow_cache_print_verbose); + else + do_show(4, &flow_cache_print); + } +#endif + +#ifdef INET6 + if (ipv6) { + if (verbose) + do_show(6, &flow_cache_print6_verbose); + else + do_show(6, &flow_cache_print6); + } +#endif +} + +#if defined(INET) || defined(INET6) +static void +do_show(int version, void (*func)(struct ngnf_show_header *)) +{ + struct ng_mesg *ng_mesg; + struct ngnf_show_header req, *resp; + int token, nread; + ng_mesg = alloca(SORCVBUF_SIZE); - if (verbose) - printf(CISCO_SH_VERB_FLOW_HEADER); - else - printf(CISCO_SH_FLOW_HEADER); + req.version = version; + req.hash_id = req.list_id = 0; for (;;) { /* request set of accounting records */ - token = NgSendMsg(cs, ng_nodename, NGM_NETFLOW_COOKIE, - NGM_NETFLOW_SHOW, (void *)&last, sizeof(last)); + token = NgSendMsg(cs, ng_path, NGM_NETFLOW_COOKIE, + NGM_NETFLOW_SHOW, (void *)&req, sizeof(req)); if (token == -1) err(1, "NgSendMsg(NGM_NETFLOW_SHOW)"); /* read reply */ - nread = NgRecvMsg(cs, ng_mesg, SORCVBUF_SIZE, path); + nread = NgRecvMsg(cs, ng_mesg, SORCVBUF_SIZE, NULL); if (nread == -1) err(1, "NgRecvMsg() failed"); if (ng_mesg->header.token != token) err(1, "NgRecvMsg(NGM_NETFLOW_SHOW): token mismatch"); - data = (struct ngnf_flows*)ng_mesg->data; - if ((ng_mesg->header.arglen < (sizeof(*data))) || - (ng_mesg->header.arglen < (sizeof(*data) + - (data->nentries * sizeof(struct flow_entry_data))))) + resp = (struct ngnf_show_header *)ng_mesg->data; + if ((ng_mesg->header.arglen < (sizeof(*resp))) || + (ng_mesg->header.arglen < (sizeof(*resp) + + (resp->nentries * sizeof(struct flow_entry_data))))) err(1, "NgRecvMsg(NGM_NETFLOW_SHOW): arglen too small"); - if (verbose) - (void )flow_cache_print_verbose(data); - else - (void )flow_cache_print(data); + (*func)(resp); - if (data->last != 0) - last = data->last; + if (resp->hash_id != 0) + req.hash_id = resp->hash_id; else break; + req.list_id = resp->list_id; } - - return (0); } +#endif -static int -flow_cache_print(struct ngnf_flows *recs) +#ifdef INET +static void +flow_cache_print(struct ngnf_show_header *resp) { struct flow_entry_data *fle; char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; char src_if[IFNAMSIZ], dst_if[IFNAMSIZ]; int i; - /* quick check */ - if (recs->nentries == 0) - return (0); + if (resp->version != 4) + errx(EX_SOFTWARE, "%s: version mismatch: %u", + __func__, resp->version); - fle = recs->entries; - for (i = 0; i < recs->nentries; i++, fle++) { + if (resp->nentries > 0) + printf(human ? CISCO_SH_FLOW_HHEADER : CISCO_SH_FLOW_HEADER); + + fle = (struct flow_entry_data *)(resp + 1); + for (i = 0; i < resp->nentries; i++, fle++) { inet_ntop(AF_INET, &fle->r.r_src, src, sizeof(src)); inet_ntop(AF_INET, &fle->r.r_dst, dst, sizeof(dst)); - printf(CISCO_SH_FLOW, + printf(human ? CISCO_SH_FLOW_H : CISCO_SH_FLOW, if_indextoname(fle->fle_i_ifx, src_if), src, if_indextoname(fle->fle_o_ifx, dst_if), @@ -226,24 +308,60 @@ flow_cache_print(struct ngnf_flows *recs fle->packets); } - - return (i); } +#endif + +#ifdef INET6 +static void +flow_cache_print6(struct ngnf_show_header *resp) +{ + struct flow6_entry_data *fle6; + char src6[INET6_ADDRSTRLEN], dst6[INET6_ADDRSTRLEN]; + char src_if[IFNAMSIZ], dst_if[IFNAMSIZ]; + int i; + + if (resp->version != 6) + errx(EX_SOFTWARE, "%s: version mismatch: %u", + __func__, resp->version); + + if (resp->nentries > 0) + printf(human ? CISCO_SH_FLOW6_HHEADER : CISCO_SH_FLOW6_HEADER); + + fle6 = (struct flow6_entry_data *)(resp + 1); + for (i = 0; i < resp->nentries; i++, fle6++) { + inet_ntop(AF_INET6, &fle6->r.src.r_src6, src6, sizeof(src6)); + inet_ntop(AF_INET6, &fle6->r.dst.r_dst6, dst6, sizeof(dst6)); + printf(human ? CISCO_SH_FLOW6_H : CISCO_SH_FLOW6, + if_indextoname(fle6->fle_i_ifx, src_if), + src6, + if_indextoname(fle6->fle_o_ifx, dst_if), + dst6, + fle6->r.r_ip_p, + ntohs(fle6->r.r_sport), + ntohs(fle6->r.r_dport), + fle6->packets); + + } +} +#endif -static int -flow_cache_print_verbose(struct ngnf_flows *recs) +#ifdef INET +static void +flow_cache_print_verbose(struct ngnf_show_header *resp) { struct flow_entry_data *fle; char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN], next[INET_ADDRSTRLEN]; char src_if[IFNAMSIZ], dst_if[IFNAMSIZ]; int i; - /* quick check */ - if (recs->nentries == 0) - return (0); + if (resp->version != 4) + errx(EX_SOFTWARE, "%s: version mismatch: %u", + __func__, resp->version); - fle = recs->entries; - for (i = 0; i < recs->nentries; i++, fle++) { + printf(CISCO_SH_VERB_FLOW_HEADER); + + fle = (struct flow_entry_data *)(resp + 1); + for (i = 0; i < resp->nentries; i++, fle++) { inet_ntop(AF_INET, &fle->r.r_src, src, sizeof(src)); inet_ntop(AF_INET, &fle->r.r_dst, dst, sizeof(dst)); inet_ntop(AF_INET, &fle->next_hop, next, sizeof(next)); @@ -267,9 +385,50 @@ flow_cache_print_verbose(struct ngnf_flo 0); } - - return (i); } +#endif + +#ifdef INET6 +static void +flow_cache_print6_verbose(struct ngnf_show_header *resp) +{ + struct flow6_entry_data *fle6; + char src6[INET6_ADDRSTRLEN], dst6[INET6_ADDRSTRLEN], next6[INET6_ADDRSTRLEN]; + char src_if[IFNAMSIZ], dst_if[IFNAMSIZ]; + int i; + + if (resp->version != 6) + errx(EX_SOFTWARE, "%s: version mismatch: %u", + __func__, resp->version); + + printf(CISCO_SH_VERB_FLOW6_HEADER); + + fle6 = (struct flow6_entry_data *)(resp + 1); + for (i = 0; i < resp->nentries; i++, fle6++) { + inet_ntop(AF_INET6, &fle6->r.src.r_src6, src6, sizeof(src6)); + inet_ntop(AF_INET6, &fle6->r.dst.r_dst6, dst6, sizeof(dst6)); + inet_ntop(AF_INET6, &fle6->n.next_hop6, next6, sizeof(next6)); + printf(CISCO_SH_VERB_FLOW6, + if_indextoname(fle6->fle_i_ifx, src_if), + src6, + if_indextoname(fle6->fle_o_ifx, dst_if), + dst6, + fle6->r.r_ip_p, + fle6->r.r_tos, + fle6->tcp_flags, + fle6->packets, + ntohs(fle6->r.r_sport), + fle6->src_mask, + 0, + ntohs(fle6->r.r_dport), + fle6->dst_mask, + 0, + next6, + (u_int)(fle6->bytes / fle6->packets), + 0); + } +} +#endif static void help(void) From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 13:36:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B358106566B; Thu, 19 Jul 2012 13:36:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id B73488FC12; Thu, 19 Jul 2012 13:36:23 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:10e7:52d2:303f:862c] (unknown [IPv6:2001:7b8:3a7:0:10e7:52d2:303f:862c]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 00E6E5C37; Thu, 19 Jul 2012 15:36:22 +0200 (CEST) Message-ID: <50080D5A.9040807@FreeBSD.org> Date: Thu, 19 Jul 2012 15:36:26 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Dag-Erling Smorgrav References: <201207181928.q6IJSMgZ003200@svn.freebsd.org> In-Reply-To: <201207181928.q6IJSMgZ003200@svn.freebsd.org> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238602 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 13:36:24 -0000 On 2012-07-18 21:28, Dag-Erling Smorgrav wrote: > Author: des > Date: Wed Jul 18 19:28:22 2012 > New Revision: 238602 > URL: http://svn.freebsd.org/changeset/base/238602 > > Log: > Add -g (gigabyte) flag to complement -k (kilobyte) and -m (megabyte). Too bad -t is already taken. :) From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 13:45:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 940B5106566B; Thu, 19 Jul 2012 13:45:15 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 9C718155DB2; Thu, 19 Jul 2012 13:44:54 +0000 (UTC) Message-ID: <50080F56.1080307@FreeBSD.org> Date: Thu, 19 Jul 2012 06:44:54 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:13.0) Gecko/20120624 Thunderbird/13.0.1 MIME-Version: 1.0 To: "Alexander V. Chernikov" References: <201207191300.q6JD0WTs083280@svn.freebsd.org> In-Reply-To: <201207191300.q6JD0WTs083280@svn.freebsd.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r238620 - stable/8/usr.sbin/flowctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 13:45:15 -0000 On 07/19/2012 06:00, Alexander V. Chernikov wrote: > Author: melifaro > Date: Thu Jul 19 13:00:31 2012 > New Revision: 238620 > URL: http://svn.freebsd.org/changeset/base/238620 > > Log: > MFC r223788, r223790, r223824 236808 > > Merge netflow v9 support (user side) Seems to have broken the build. Did you 'make universe' these changes? Doug -- Change is hard. From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 13:56:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id D4BFD106566C; Thu, 19 Jul 2012 13:56:20 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from dhcp170-36-red.yandex.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with ESMTP id AC74E14E482; Thu, 19 Jul 2012 13:56:18 +0000 (UTC) Message-ID: <50081192.50909@FreeBSD.org> Date: Thu, 19 Jul 2012 17:54:26 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120511 Thunderbird/12.0.1 MIME-Version: 1.0 To: Doug Barton References: <201207191300.q6JD0WTs083280@svn.freebsd.org> <50080F56.1080307@FreeBSD.org> In-Reply-To: <50080F56.1080307@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r238620 - stable/8/usr.sbin/flowctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 13:56:21 -0000 On 19.07.2012 17:44, Doug Barton wrote: > On 07/19/2012 06:00, Alexander V. Chernikov wrote: >> Author: melifaro >> Date: Thu Jul 19 13:00:31 2012 >> New Revision: 238620 >> URL: http://svn.freebsd.org/changeset/base/238620 >> >> Log: >> MFC r223788, r223790, r223824 236808 >> >> Merge netflow v9 support (user side) > > Seems to have broken the build. Did you 'make universe' these changes? New flowctl requires updated netflow headers introduced in r238619. 'cp -p /usr/src/sys/netgraph/netflow/*.h /usr/include/netgraph/netflow' should help. Can you please show exact error messages and arch ? > > Doug > -- WBR, Alexander From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 14:08:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id D57FA106566B; Thu, 19 Jul 2012 14:08:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 591E4155AA9; Thu, 19 Jul 2012 14:08:41 +0000 (UTC) Message-ID: <500814E8.6070107@FreeBSD.org> Date: Thu, 19 Jul 2012 07:08:40 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:13.0) Gecko/20120624 Thunderbird/13.0.1 MIME-Version: 1.0 To: "Alexander V. Chernikov" References: <201207191300.q6JD0WTs083280@svn.freebsd.org> <50080F56.1080307@FreeBSD.org> <50081192.50909@FreeBSD.org> In-Reply-To: <50081192.50909@FreeBSD.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, ae@freebsd.org Subject: Re: svn commit: r238620 - stable/8/usr.sbin/flowctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 14:08:42 -0000 On 07/19/2012 06:54, Alexander V. Chernikov wrote: > On 19.07.2012 17:44, Doug Barton wrote: >> On 07/19/2012 06:00, Alexander V. Chernikov wrote: >>> Author: melifaro >>> Date: Thu Jul 19 13:00:31 2012 >>> New Revision: 238620 >>> URL: http://svn.freebsd.org/changeset/base/238620 >>> >>> Log: >>> MFC r223788, r223790, r223824 236808 >>> >>> Merge netflow v9 support (user side) >> >> Seems to have broken the build. Did you 'make universe' these changes? > New flowctl requires updated netflow headers introduced in r238619. > 'cp -p /usr/src/sys/netgraph/netflow/*.h /usr/include/netgraph/netflow' > should help. So it sounds like the answer to my question is, "No," you did not do a 'make universe'? If so, can you please start one? > Can you please show exact error messages and arch ? You can see for yourself in the freebsd-stable archives, as the tinderboxes have been failing ever since your commit. Doug -- Change is hard. From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 14:43:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8B03106564A; Thu, 19 Jul 2012 14:43:46 +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 935498FC15; Thu, 19 Jul 2012 14:43:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JEhk7h090634; Thu, 19 Jul 2012 14:43:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JEhksd090632; Thu, 19 Jul 2012 14:43:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201207191443.q6JEhksd090632@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Jul 2012 14:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238621 - head/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 14:43:46 -0000 Author: marius Date: Thu Jul 19 14:43:46 2012 New Revision: 238621 URL: http://svn.freebsd.org/changeset/base/238621 Log: Revert the use of BUS_DMA_ALLOCNOW when creating the DMA tag for user data introduced in r236061. Using that flag doesn't make that much sense on this case as the DMA maps using it are also created during sym_pci_attach(). Moreover, due to the maxsegsz parameter used, doing so may exhaust the bounce pages pool on architectures requiring bounce pages. [1] While at it, use a slightly more appropriate maxsegsz parameter. PR: 169526 Submitted by: Mike Watters [1] MFC after: 3 days Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Thu Jul 19 13:00:31 2012 (r238620) +++ head/sys/dev/sym/sym_hipd.c Thu Jul 19 14:43:46 2012 (r238621) @@ -8537,8 +8537,8 @@ sym_pci_attach(device_t dev) */ if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY, - BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { + BUS_SPACE_MAXSIZE_32BIT, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY, + 0, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { device_printf(dev, "failed to create DMA tag.\n"); goto attach_failed; } From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 15:26:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 11A881065673 for ; Thu, 19 Jul 2012 15:26:44 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id A52CC8FC19 for ; Thu, 19 Jul 2012 15:26:43 +0000 (UTC) Received: by yhfs35 with SMTP id s35so3431402yhf.13 for ; Thu, 19 Jul 2012 08:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=rsa; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=g1SKMN/Rb9rfB2Hnoqo5tPudVYg8l/5Q3i8iGd671rU=; b=DlyhijUbFCYlRWvwfg1WGcrwi3/9+WWuNcQChntzpB90eoeOlfo5BO+sfdkDXd5wTl T+772CAKy2kBBfiOV0u7WxyjpcrGqGJFX3hpDI7A+RRTphz7uU89Xu2MmkvRb+QFjmHg 7BJKf7as99CeoC5VMZz6nINpvlTa30IXmKMmY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-gm-message-state; bh=g1SKMN/Rb9rfB2Hnoqo5tPudVYg8l/5Q3i8iGd671rU=; b=jjytTOz9CSqXAm3ed7gc8838LRZv6D+mdDduiST5ksiEH0mmg1mu8E94TFr0MRC7nG cq6Aop8A+ItkVUG2KxTikcJpVTMh+kEN8s+ly7dBBX9F7lFlGBZS29iQgFYupcsnMYZw hqrhZllzMs+oC2qVUig0TlDgy2SpEfOR/McxF45CYfxVBXuwlKrRN4XW6Xa2qZJaw0iv TW3iRH1b4h+sq4i2d7sHFgORJS0muB3to9A5YJDMhweM9KqJkvRCkJg/iFLRMlKKwcwl wKT+LXO0qqTn6QupKGXajmtlIzHUeq3W/23PI25u51N9tEpt+LAc3c2/47PywWk1+hR4 Wkdw== Received: by 10.50.189.135 with SMTP id gi7mr5744710igc.8.1342711603027; Thu, 19 Jul 2012 08:26:43 -0700 (PDT) Received: from DataIX.net (adsl-99-181-146-179.dsl.klmzmi.sbcglobal.net. [99.181.146.179]) by mx.google.com with ESMTPS id mj5sm4502603igc.8.2012.07.19.08.26.41 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jul 2012 08:26:42 -0700 (PDT) Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q6JFQdtV096509 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Jul 2012 11:26:39 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Received: (from jh@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q6JFQdkt096508; Thu, 19 Jul 2012 11:26:39 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Date: Thu, 19 Jul 2012 11:26:39 -0400 From: Jason Hellenthal To: "Alexander V. Chernikov" Message-ID: <20120719152639.GA95444@DataIX.net> References: <201207191300.q6JD0WTs083280@svn.freebsd.org> <50080F56.1080307@FreeBSD.org> <50081192.50909@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50081192.50909@FreeBSD.org> X-Gm-Message-State: ALoCoQnd5zTzhqdrJLvTkwHBhmdLxpnz35KgJ2xOnkrcjKBAZJFx2GFO96TfPr6Qy+r5syANPaFj Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r238620 - stable/8/usr.sbin/flowctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 15:26:44 -0000 On Thu, Jul 19, 2012 at 05:54:26PM +0400, Alexander V. Chernikov wrote: > On 19.07.2012 17:44, Doug Barton wrote: > > On 07/19/2012 06:00, Alexander V. Chernikov wrote: > >> Author: melifaro > >> Date: Thu Jul 19 13:00:31 2012 > >> New Revision: 238620 > >> URL: http://svn.freebsd.org/changeset/base/238620 > >> > >> Log: > >> MFC r223788, r223790, r223824 236808 > >> > >> Merge netflow v9 support (user side) > > > > Seems to have broken the build. Did you 'make universe' these changes? > New flowctl requires updated netflow headers introduced in r238619. > 'cp -p /usr/src/sys/netgraph/netflow/*.h /usr/include/netgraph/netflow' > should help. > > Can you please show exact error messages and arch ? > > > > > Doug > > > Rebuild of includes is neccesary or else a full rebuild of world. > > -- > WBR, Alexander > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" -- - (2^(N-1)) JJH48-ARIN From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 15:36:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D76410656D0; Thu, 19 Jul 2012 15:36:37 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 486C88FC0A; Thu, 19 Jul 2012 15:36:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JFab0Z094469; Thu, 19 Jul 2012 15:36:37 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JFabOR094467; Thu, 19 Jul 2012 15:36:37 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201207191536.q6JFabOR094467@svn.freebsd.org> From: Maksim Yevmenkin Date: Thu, 19 Jul 2012 15:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238622 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 15:36:37 -0000 Author: emax Date: Thu Jul 19 15:36:36 2012 New Revision: 238622 URL: http://svn.freebsd.org/changeset/base/238622 Log: Allow to specify no source-address-selection policy MFC after: 1 week Modified: head/etc/rc.d/ip6addrctl Modified: head/etc/rc.d/ip6addrctl ============================================================================== --- head/etc/rc.d/ip6addrctl Thu Jul 19 14:43:46 2012 (r238621) +++ head/etc/rc.d/ip6addrctl Thu Jul 19 15:36:36 2012 (r238622) @@ -83,6 +83,9 @@ ip6addrctl_start() # Backward compatibility when ipv6_prefer=NO ip6addrctl_prefer_ipv4 ;; + [Nn][Oo][Nn][Ee]) + ip6addrctl flush >/dev/null 2>&1 + ;; *) warn "\$ip6addrctl_policy is invalid: ${ip6addrctl_policy}. " \ " \"ipv4_prefer\" is used instead." From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 15:56:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 4682D106566B; Thu, 19 Jul 2012 15:56:43 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from dhcp170-36-red.yandex.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with ESMTP id 5E6691523BD; Thu, 19 Jul 2012 15:56:40 +0000 (UTC) Message-ID: <50082DC7.9060805@FreeBSD.org> Date: Thu, 19 Jul 2012 19:54:47 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120511 Thunderbird/12.0.1 MIME-Version: 1.0 To: Doug Barton References: <201207191300.q6JD0WTs083280@svn.freebsd.org> <50080F56.1080307@FreeBSD.org> <50081192.50909@FreeBSD.org> <500814E8.6070107@FreeBSD.org> In-Reply-To: <500814E8.6070107@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, ae@freebsd.org Subject: Re: svn commit: r238620 - stable/8/usr.sbin/flowctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 15:56:43 -0000 On 19.07.2012 18:08, Doug Barton wrote: > On 07/19/2012 06:54, Alexander V. Chernikov wrote: >> On 19.07.2012 17:44, Doug Barton wrote: >>> On 07/19/2012 06:00, Alexander V. Chernikov wrote: >>>> Author: melifaro >>>> Date: Thu Jul 19 13:00:31 2012 >>>> New Revision: 238620 >>>> URL: http://svn.freebsd.org/changeset/base/238620 >>>> >>>> Log: >>>> MFC r223788, r223790, r223824 236808 >>>> >>>> Merge netflow v9 support (user side) >>> >>> Seems to have broken the build. Did you 'make universe' these changes? >> New flowctl requires updated netflow headers introduced in r238619. >> 'cp -p /usr/src/sys/netgraph/netflow/*.h /usr/include/netgraph/netflow' >> should help. > > So it sounds like the answer to my question is, "No," you did not do a I've tested this on amd64/i386 with various kernel configs. Additionally, I run the same patches in production on several routers. > 'make universe'? If so, can you please start one? It runs fine. > >> Can you please show exact error messages and arch ? > > You can see for yourself in the freebsd-stable archives, as the > tinderboxes have been failing ever since your commit. This is the result of 1+ hour gap between r238619 and r238620. Tinderbox tries to build old flowctl binary. > > Doug > -- WBR, Alexander From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 19:02:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 97F98106566B; Thu, 19 Jul 2012 19:02:33 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id AABAF14DBF5; Thu, 19 Jul 2012 19:02:32 +0000 (UTC) Message-ID: <500859C8.6080808@FreeBSD.org> Date: Thu, 19 Jul 2012 12:02:32 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:13.0) Gecko/20120624 Thunderbird/13.0.1 MIME-Version: 1.0 To: "Alexander V. Chernikov" References: <201207191300.q6JD0WTs083280@svn.freebsd.org> <50080F56.1080307@FreeBSD.org> <50081192.50909@FreeBSD.org> <500814E8.6070107@FreeBSD.org> <50082DC7.9060805@FreeBSD.org> In-Reply-To: <50082DC7.9060805@FreeBSD.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, ae@freebsd.org Subject: Re: svn commit: r238620 - stable/8/usr.sbin/flowctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 19:02:33 -0000 On 07/19/2012 08:54, Alexander V. Chernikov wrote: >> You can see for yourself in the freebsd-stable archives, as the >> tinderboxes have been failing ever since your commit. > This is the result of 1+ hour gap between r238619 and r238620. Tinderbox > tries to build old flowctl binary. Indeed, this does seem to be the case. Thanks for looking into it. :) -- Change is hard. From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 19:09:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF1C21065673; Thu, 19 Jul 2012 19:09:13 +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 995748FC0A; Thu, 19 Jul 2012 19:09:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JJ9DeO011574; Thu, 19 Jul 2012 19:09:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JJ9D6Z011568; Thu, 19 Jul 2012 19:09:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207191909.q6JJ9D6Z011568@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 19 Jul 2012 19:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238623 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 19:09:13 -0000 Author: kib Date: Thu Jul 19 19:09:12 2012 New Revision: 238623 URL: http://svn.freebsd.org/changeset/base/238623 Log: Introduce curpcb magic variable, similar to curthread, which is MD amd64. It is implemented as __pure2 inline with non-volatile asm read from pcpu, which allows a compiler to cache its results. Convert most PCPU_GET(pcb) and curthread->td_pcb accesses into curpcb. Note that __curthread() uses magic value 0 as an offsetof(struct pcpu, pc_curthread). It seems to be done this way due to machine/pcpu.h needs to be processed before sys/pcpu.h, because machine/pcpu.h contributes machine-depended fields to the struct pcpu definition. As result, machine/pcpu.h cannot use struct pcpu yet. The __curpcb() also uses a magic constant instead of offsetof(struct pcpu, pc_curpcb) for the same reason. The constants are now defined as symbols and CTASSERTs are added to ensure that future KBI changes do not break the code. Requested and reviewed by: bde MFC after: 3 weeks Modified: head/sys/amd64/amd64/fpu.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/include/pcpu.h Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu Jul 19 15:36:36 2012 (r238622) +++ head/sys/amd64/amd64/fpu.c Thu Jul 19 19:09:12 2012 (r238623) @@ -327,7 +327,7 @@ fpuexit(struct thread *td) critical_enter(); if (curthread == PCPU_GET(fpcurthread)) { stop_emulating(); - fpusave(PCPU_GET(curpcb)->pcb_save); + fpusave(curpcb->pcb_save); start_emulating(); PCPU_SET(fpcurthread, 0); } @@ -547,7 +547,7 @@ fputrap_x87(void) * wherever they are. */ if (PCPU_GET(fpcurthread) != curthread) { - pcb_save = PCPU_GET(curpcb)->pcb_save; + pcb_save = curpcb->pcb_save; control = pcb_save->sv_env.en_cw; status = pcb_save->sv_env.en_sw; } else { @@ -567,7 +567,7 @@ fputrap_sse(void) critical_enter(); if (PCPU_GET(fpcurthread) != curthread) - mxcsr = PCPU_GET(curpcb)->pcb_save->sv_env.en_mxcsr; + mxcsr = curpcb->pcb_save->sv_env.en_mxcsr; else stmxcsr(&mxcsr); critical_exit(); @@ -609,7 +609,7 @@ fpudna(void) * Record new context early in case frstor causes a trap. */ PCPU_SET(fpcurthread, curthread); - pcb = PCPU_GET(curpcb); + pcb = curpcb; fpu_clean_state(); @@ -970,7 +970,7 @@ fpu_kern_thread(u_int flags) { struct pcb *pcb; - pcb = PCPU_GET(curpcb); + pcb = curpcb; KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, ("Only kthread may use fpu_kern_thread")); KASSERT(pcb->pcb_save == get_pcb_user_save_pcb(pcb), @@ -987,5 +987,5 @@ is_fpu_kern_thread(u_int flags) if ((curthread->td_pflags & TDP_KTHREAD) == 0) return (0); - return ((PCPU_GET(curpcb)->pcb_flags & PCB_KERNFPU) != 0); + return ((curpcb->pcb_flags & PCB_KERNFPU) != 0); } Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Jul 19 15:36:36 2012 (r238622) +++ head/sys/amd64/amd64/machdep.c Thu Jul 19 19:09:12 2012 (r238623) @@ -996,7 +996,7 @@ exec_setregs(struct thread *td, struct i pcb->pcb_dr3 = 0; pcb->pcb_dr6 = 0; pcb->pcb_dr7 = 0; - if (pcb == PCPU_GET(curpcb)) { + if (pcb == curpcb) { /* * Clear the debug registers on the running * CPU, otherwise they will end up affecting Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Jul 19 15:36:36 2012 (r238622) +++ head/sys/amd64/amd64/trap.c Thu Jul 19 19:09:12 2012 (r238623) @@ -520,9 +520,8 @@ trap(struct trapframe *frame) frame->tf_rip = (long)fsbase_load_fault; goto out; } - if (PCPU_GET(curpcb)->pcb_onfault != NULL) { - frame->tf_rip = - (long)PCPU_GET(curpcb)->pcb_onfault; + if (curpcb->pcb_onfault != NULL) { + frame->tf_rip = (long)curpcb->pcb_onfault; goto out; } break; @@ -708,7 +707,7 @@ trap_pfault(frame, usermode) * it normally, and panic immediately. */ if (!usermode && (td->td_intr_nesting_level != 0 || - PCPU_GET(curpcb)->pcb_onfault == NULL)) { + curpcb->pcb_onfault == NULL)) { trap_fatal(frame, eva); return (-1); } @@ -764,8 +763,8 @@ trap_pfault(frame, usermode) nogo: if (!usermode) { if (td->td_intr_nesting_level == 0 && - PCPU_GET(curpcb)->pcb_onfault != NULL) { - frame->tf_rip = (long)PCPU_GET(curpcb)->pcb_onfault; + curpcb->pcb_onfault != NULL) { + frame->tf_rip = (long)curpcb->pcb_onfault; return (0); } trap_fatal(frame, eva); Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Thu Jul 19 15:36:36 2012 (r238622) +++ head/sys/amd64/amd64/vm_machdep.c Thu Jul 19 19:09:12 2012 (r238623) @@ -90,6 +90,10 @@ static u_int cpu_reset_proxyid; static volatile u_int cpu_reset_proxy_active; #endif +CTASSERT((struct thread **)OFFSETOF_CURTHREAD == + &((struct pcpu *)NULL)->pc_curthread); +CTASSERT((struct pcb **)OFFSETOF_CURPCB == &((struct pcpu *)NULL)->pc_curpcb); + struct savefpu * get_pcb_user_save_td(struct thread *td) { Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Thu Jul 19 15:36:36 2012 (r238622) +++ head/sys/amd64/include/pcpu.h Thu Jul 19 19:09:12 2012 (r238623) @@ -216,16 +216,29 @@ extern struct pcpu *pcpup; #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) +#define OFFSETOF_CURTHREAD 0 static __inline __pure2 struct thread * __curthread(void) { struct thread *td; - __asm("movq %%gs:0,%0" : "=r" (td)); + __asm("movq %%gs:%1,%0" : "=r" (td) + : "m" (*(char *)OFFSETOF_CURTHREAD)); return (td); } #define curthread (__curthread()) +#define OFFSETOF_CURPCB 32 +static __inline __pure2 struct pcb * +__curpcb(void) +{ + struct pcb *pcb; + + __asm("movq %%gs:%1,%0" : "=r" (pcb) : "m" (*(char *)OFFSETOF_CURPCB)); + return (pcb); +} +#define curpcb (__curpcb()) + #define IS_BSP() (PCPU_GET(cpuid) == 0) #else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 19:15:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E833106566B; Thu, 19 Jul 2012 19:15:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 609AE8FC1C; Thu, 19 Jul 2012 19:15:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JJFmXo012062; Thu, 19 Jul 2012 19:15:48 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JJFmLQ012059; Thu, 19 Jul 2012 19:15:48 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207191915.q6JJFmLQ012059@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 19 Jul 2012 19:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238624 - head/lib/libedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 19:15:48 -0000 Author: pfg Date: Thu Jul 19 19:15:47 2012 New Revision: 238624 URL: http://svn.freebsd.org/changeset/base/238624 Log: Merge more cosmetical changes from NetBSD's libedit. makelist: change tr '[a-z]' '[A-Z]' to tr '[:lower:]' '[:upper:]' so that POSIX systems work proerly regardsless of environment variable settings. tokenizer.c: pass lint on _LP64 Obtained from: NetBSD MFC after: 2 weeks Modified: head/lib/libedit/makelist head/lib/libedit/tokenizer.c Modified: head/lib/libedit/makelist ============================================================================== --- head/lib/libedit/makelist Thu Jul 19 19:09:12 2012 (r238623) +++ head/lib/libedit/makelist Thu Jul 19 19:15:47 2012 (r238624) @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: makelist,v 1.10 2005/08/08 14:04:49 christos Exp $ +# $NetBSD: makelist,v 1.11 2005/10/22 16:45:03 christos Exp $ # $FreeBSD$ # # Copyright (c) 1992, 1993 @@ -141,7 +141,7 @@ case $FLAG in # -fh) cat $FILES | $AWK '/el_action_t/ { print $3 }' | \ - sort | LC_ALL=C tr 'a-z' 'A-Z' | $AWK ' + sort | LC_ALL=C tr '[:lower:]' '[:upper:]' | $AWK ' BEGIN { printf("/* Automatically generated file, do not edit */\n"); printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n"); Modified: head/lib/libedit/tokenizer.c ============================================================================== --- head/lib/libedit/tokenizer.c Thu Jul 19 19:09:12 2012 (r238623) +++ head/lib/libedit/tokenizer.c Thu Jul 19 19:15:47 2012 (r238624) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: tokenizer.c,v 1.14 2003/12/05 13:37:48 lukem Exp $ + * $NetBSD: tokenizer.c,v 1.15 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -198,7 +198,7 @@ tok_line(Tokenizer *tok, const LineInfo ptr = ""; if (ptr == line->cursor) { cc = tok->argc; - co = tok->wptr - tok->wstart; + co = (int)(tok->wptr - tok->wstart); } switch (*ptr) { case '\'': @@ -417,7 +417,7 @@ tok_line(Tokenizer *tok, const LineInfo tok_line_outok: if (cc == -1 && co == -1) { cc = tok->argc; - co = tok->wptr - tok->wstart; + co = (int)(tok->wptr - tok->wstart); } if (cursorc != NULL) *cursorc = cc; From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 20:21:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FB36106564A; Thu, 19 Jul 2012 20:21:44 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id E3FF58FC15; Thu, 19 Jul 2012 20:21:43 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 902134AA; Thu, 19 Jul 2012 22:21:33 +0200 (CEST) Date: Thu, 19 Jul 2012 22:19:20 +0200 From: Pawel Jakub Dawidek To: Konstantin Belousov Message-ID: <20120719201920.GF1401@garage.freebsd.pl> References: <201207191022.q6JAMtbw068159@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="udcq9yAoWb9A4FsZ" Content-Disposition: inline In-Reply-To: <201207191022.q6JAMtbw068159@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238614 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 20:21:44 -0000 --udcq9yAoWb9A4FsZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 19, 2012 at 10:22:55AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Thu Jul 19 10:22:54 2012 > New Revision: 238614 > URL: http://svn.freebsd.org/changeset/base/238614 >=20 > Log: > Implement F_DUPFD_CLOEXEC command for fcntl(2), specified by SUSv4. > =20 > PR: standards/169962 > Submitted by: Jukka A. Ukkonen > MFC after: 1 week [...] > + if ((flags & DUP_CLOEXEC) !=3D 0) > + fdp->fd_ofileflags[new] =3D fdp->fd_ofileflags[old] | UF_EXCLOSE; > + else > + fdp->fd_ofileflags[new] =3D fdp->fd_ofileflags[old] & ~UF_EXCLOSE; > fdp->fd_ofileflags[new] =3D fdp->fd_ofileflags[old] &~ UF_EXCLOSE; It seems that you forgot to remove the line above, which results in always removing the UF_EXCLOSE flag. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --udcq9yAoWb9A4FsZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlAIa8cACgkQForvXbEpPzQT+ACff5pFhQ1rCede2YIgNlVFIy+j VTQAoLDRG4Esp9To5eohNFX0bdzNOC1X =RSPm -----END PGP SIGNATURE----- --udcq9yAoWb9A4FsZ-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 20:38:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB722106564A; Thu, 19 Jul 2012 20:38: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 B6E528FC15; Thu, 19 Jul 2012 20:38:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JKc4kh020564; Thu, 19 Jul 2012 20:38:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JKc4VP020562; Thu, 19 Jul 2012 20:38:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207192038.q6JKc4VP020562@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 19 Jul 2012 20:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238627 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 20:38:04 -0000 Author: kib Date: Thu Jul 19 20:38:03 2012 New Revision: 238627 URL: http://svn.freebsd.org/changeset/base/238627 Log: Remove line which was accidentally kept in r238614. Submitted by: pjd Pointy hat to: kib MFC after: 1 week Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Jul 19 20:05:31 2012 (r238626) +++ head/sys/kern/kern_descrip.c Thu Jul 19 20:38:03 2012 (r238627) @@ -906,7 +906,6 @@ do_dup(struct thread *td, int flags, int fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] | UF_EXCLOSE; else fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] & ~UF_EXCLOSE; - fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] &~ UF_EXCLOSE; if (new > fdp->fd_lastfile) fdp->fd_lastfile = new; *retval = new; From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 22:33:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EFBB106564A; Thu, 19 Jul 2012 22:33:14 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19E438FC14; Thu, 19 Jul 2012 22:33:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JMXD7t029245; Thu, 19 Jul 2012 22:33:13 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JMXDvn029242; Thu, 19 Jul 2012 22:33:13 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201207192233.q6JMXDvn029242@svn.freebsd.org> From: Devin Teske Date: Thu, 19 Jul 2012 22:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238628 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 22:33:14 -0000 Author: dteske Date: Thu Jul 19 22:33:13 2012 New Revision: 238628 URL: http://svn.freebsd.org/changeset/base/238628 Log: Fix syntax errors (s/:=/:-/). Reviewed by: emaste (mentor) Approved by: emaste (mentor) MFC after: 3 days Modified: head/etc/rc.d/bgfsck head/etc/rc.d/named Modified: head/etc/rc.d/bgfsck ============================================================================== --- head/etc/rc.d/bgfsck Thu Jul 19 20:38:03 2012 (r238627) +++ head/etc/rc.d/bgfsck Thu Jul 19 22:33:13 2012 (r238628) @@ -17,7 +17,7 @@ stop_cmd=":" bgfsck_start() { if [ -z "${rc_force}" ]; then - background_fsck_delay=${background_fsck_delay:=0} + background_fsck_delay=${background_fsck_delay:-0} else background_fsck_delay=0 fi Modified: head/etc/rc.d/named ============================================================================== --- head/etc/rc.d/named Thu Jul 19 20:38:03 2012 (r238627) +++ head/etc/rc.d/named Thu Jul 19 22:33:13 2012 (r238628) @@ -173,7 +173,7 @@ named_prestart() warn 'named_pidfile: now determined from the conf file' fi - command_args="-u ${named_uid:=root}" + command_args="-u ${named_uid:-root}" if [ ! "$named_conf" = '/etc/namedb/named.conf' ]; then case "$named_flags" in From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 22:41:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E36F2106566B; Thu, 19 Jul 2012 22:41:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEF888FC17; Thu, 19 Jul 2012 22:41:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6JMf0Gu029810; Thu, 19 Jul 2012 22:41:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6JMf0M2029807; Thu, 19 Jul 2012 22:41:00 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201207192241.q6JMf0M2029807@svn.freebsd.org> From: Devin Teske Date: Thu, 19 Jul 2012 22:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238629 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 22:41:01 -0000 Author: dteske Date: Thu Jul 19 22:41:00 2012 New Revision: 238629 URL: http://svn.freebsd.org/changeset/base/238629 Log: Revert SVN r238628 (mistake). Modified: head/etc/rc.d/named Modified: head/etc/rc.d/named ============================================================================== --- head/etc/rc.d/named Thu Jul 19 22:33:13 2012 (r238628) +++ head/etc/rc.d/named Thu Jul 19 22:41:00 2012 (r238629) @@ -173,7 +173,7 @@ named_prestart() warn 'named_pidfile: now determined from the conf file' fi - command_args="-u ${named_uid:-root}" + command_args="-u ${named_uid:=root}" if [ ! "$named_conf" = '/etc/namedb/named.conf' ]; then case "$named_flags" in From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 00:47:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2DC8106566B; Fri, 20 Jul 2012 00:47:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D8428FC15; Fri, 20 Jul 2012 00:47:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K0lOKx039070; Fri, 20 Jul 2012 00:47:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K0lOU3039068; Fri, 20 Jul 2012 00:47:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200047.q6K0lOU3039068@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 00:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238630 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 00:47:24 -0000 Author: adrian Date: Fri Jul 20 00:47:23 2012 New Revision: 238630 URL: http://svn.freebsd.org/changeset/base/238630 Log: Prepare for (re)using this header file in userland. Remove the inlined code from the header file if it's compiled in userland. It's not required and it shouldn't be there in the first place. Modified: head/sys/dev/ath/ath_rate/sample/sample.h Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Thu Jul 19 22:41:00 2012 (r238629) +++ head/sys/dev/ath/ath_rate/sample/sample.h Fri Jul 20 00:47:23 2012 (r238630) @@ -101,6 +101,9 @@ struct sample_node { int packets_since_sample[NUM_PACKET_SIZE_BINS]; unsigned sample_tt[NUM_PACKET_SIZE_BINS]; }; + +#ifdef _KERNEL + #define ATH_NODE_SAMPLE(an) ((struct sample_node *)&(an)[1]) #define IS_RATE_DEFINED(sn, rix) (((sn)->ratemask & (1<<(rix))) != 0) @@ -225,4 +228,7 @@ static unsigned calc_usecs_unicast_packe } return tt; } + +#endif /* _KERNEL */ + #endif /* _DEV_ATH_RATE_SAMPLE_H */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 01:11:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CA3B106564A; Fri, 20 Jul 2012 01:11:54 +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 267348FC0C; Fri, 20 Jul 2012 01:11:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K1Bsjg040757; Fri, 20 Jul 2012 01:11:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K1Brc2040755; Fri, 20 Jul 2012 01:11:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201207200111.q6K1Brc2040755@svn.freebsd.org> From: Xin LI Date: Fri, 20 Jul 2012 01:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238631 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 01:11:54 -0000 Author: delphij Date: Fri Jul 20 01:11:53 2012 New Revision: 238631 URL: http://svn.freebsd.org/changeset/base/238631 Log: Import an updated version of moduli(5) manual page from OpenBSD. MFC after: 1 month Modified: head/share/man/man5/moduli.5 Modified: head/share/man/man5/moduli.5 ============================================================================== --- head/share/man/man5/moduli.5 Fri Jul 20 00:47:23 2012 (r238630) +++ head/share/man/man5/moduli.5 Fri Jul 20 01:11:53 2012 (r238631) @@ -1,159 +1,125 @@ -.\" $OpenBSD: moduli.5,v 1.3 2001/06/24 18:50:52 provos Exp $ +.\" $OpenBSD: moduli.5,v 1.16 2011/11/28 08:46:27 eric Exp $ .\" -.\" Copyright 1997, 2000 William Allen Simpson -.\" All rights reserved. +.\" Copyright (c) 2008 Damien Miller .\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software designed by William Allen Simpson. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" 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. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" $FreeBSD$ .\" -.Dd July 28, 1997 +.Dd July 19, 2012 .Dt MODULI 5 .Os .Sh NAME .Nm moduli -.Nd system moduli file +.Nd Diffie-Hellman moduli .Sh DESCRIPTION The -.Nm -file contains the system-wide Diffie-Hellman prime moduli for the -.Xr photurisd 8 -and +.Pa /etc/ssh/moduli +file contains prime numbers and generators for use by .Xr sshd 8 -programs. +in the Diffie-Hellman Group Exchange key exchange method. .Pp -Each line in this file contains the following fields: -.Va Time , Type , Tests , Tries , Size , Generator , -and -.Va Modulus . -The fields are separated by white space (tab or blank). -.Bl -tag -width indent -.It Va Time Pq Vt yyyymmddhhmmss -Specifies the system time that the line was appended to the file. -The value 00000000000000 means unknown (historic). -.\"The file is sorted in ascending order. -.It Va Type Pq Vt decimal -Specifies the internal structure of the prime modulus. +New moduli may be generated with +.Xr ssh-keygen 1 +using a two-step process. +An initial +.Em candidate generation +pass, using +.Ic ssh-keygen -G , +calculates numbers that are likely to be useful. +A second +.Em primality testing +pass, using +.Ic ssh-keygen -T , +provides a high degree of assurance that the numbers are prime and are +safe for use in Diffie-Hellman operations by +.Xr sshd 8 . +This +.Nm +format is used as the output from each pass. .Pp -.Bl -tag -width indent -compact -.It 0 -unknown; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -unstructured; -a common large number. -.It 2 -safe (p = 2q + 1); -meets basic structural requirements. -.It 3 -Schnorr. -.It 4 -Sophie-Germaine (q = (p-1)/2); -usually generated in the process of testing safe or strong primes. -.It 5 -strong; -useful for RSA public key generation. -.El -.It Xo -.Va Tests Pq Vt decimal -(bit field) -.Xc -Specifies the methods used in checking for primality. -Usually, more than one test is used. +The file consists of newline-separated records, one per modulus, +containing seven space-separated fields. +These fields are as follows: +.Bl -tag -width Description -offset indent +.It timestamp +The time that the modulus was last processed as YYYYMMDDHHMMSS. +.It type +Decimal number specifying the internal structure of the prime modulus. +Supported types are: .Pp -.Bl -tag -width indent -compact +.Bl -tag -width 0x00 -compact .It 0 -not tested; -often learned from peer during protocol operation, -and saved for later analysis. -.It 1 -composite; -failed one or more tests. -In this case, the highest bit specifies the test that failed. +Unknown, not tested. .It 2 -sieve; -checked for division by a range of smaller primes. +"Safe" prime; (p-1)/2 is also prime. .It 4 -Miller-Rabin. -.It 8 -Jacobi. -.It 16 -Elliptic Curve. +Sophie Germain; 2p+1 is also prime. .El -.It Va Tries Pq Vt decimal -Depends on the value of the highest valid Test bit, -where the method specified is: .Pp -.Bl -tag -width indent -compact -.It 0 -not tested -(always zero). -.It 1 -composite -(irrelevant). -.It 2 -sieve; -number of primes sieved. -Commonly on the order of 32,000,000. -.It 4 -Miller-Rabin; -number of M-R iterations. -Commonly on the order of 32 to 64. -.It 8 -Jacobi; -unknown -(always zero). -.It 16 -Elliptic Curve; -unused -(always zero). -.El -.It Va Size Pq Vt decimal -Specifies the number of significant bits. -.It Va Generator Pq Vt "hex string" -Specifies the best generator for a Diffie-Hellman exchange. -0 = unknown or variable, -2, 3, 5, etc. -.It Va Modulus Pq Vt "hex string" -The prime modulus. +Moduli candidates initially produced by +.Xr ssh-keygen 1 +are Sophie Germain primes (type 4). +Further primality testing with +.Xr ssh-keygen 1 +produces safe prime moduli (type 2) that are ready for use in +.Xr sshd 8 . +Other types are not used by OpenSSH. +.It tests +Decimal number indicating the type of primality tests that the number +has been subjected to represented as a bitmask of the following values: +.Pp +.Bl -tag -width 0x00 -compact +.It 0x00 +Not tested. +.It 0x01 +Composite number \(en not prime. +.It 0x02 +Sieve of Eratosthenes. +.It 0x04 +Probabilistic Miller-Rabin primality tests. .El .Pp -The file is searched for moduli that meet the appropriate -.Va Time , Size -and -.Va Generator -criteria. -When more than one meet the criteria, -the selection should be weighted toward newer moduli, -without completely disqualifying older moduli. -.Sh FILES -.Bl -tag -width ".Pa /etc/ssh/moduli" -compact -.It Pa /etc/ssh/moduli +The +.Xr ssh-keygen 1 +moduli candidate generation uses the Sieve of Eratosthenes (flag 0x02). +Subsequent +.Xr ssh-keygen 1 +primality tests are Miller-Rabin tests (flag 0x04). +.It trials +Decimal number indicating the number of primality trials +that have been performed on the modulus. +.It size +Decimal number indicating the size of the prime in bits. +.It generator +The recommended generator for use with this modulus (hexadecimal). +.It modulus +The modulus itself in hexadecimal. .El +.Pp +When performing Diffie-Hellman Group Exchange, +.Xr sshd 8 +first estimates the size of the modulus required to produce enough +Diffie-Hellman output to sufficiently key the selected symmetric cipher. +.Xr sshd 8 +then randomly selects a modulus from +.Fa /etc/ssh/moduli +that best meets the size requirement. .Sh SEE ALSO -.Xr photurisd 8 , +.Xr ssh-keygen 1 , .Xr sshd 8 +.Rs +.%R RFC 4419 +.%T "Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol" +.%D 2006 +.Re From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 01:27:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A463106564A; Fri, 20 Jul 2012 01:27:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F04418FC0C; Fri, 20 Jul 2012 01:27:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K1RKXL041910; Fri, 20 Jul 2012 01:27:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K1RKca041907; Fri, 20 Jul 2012 01:27:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200127.q6K1RKca041907@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 01:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238632 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 01:27:21 -0000 Author: adrian Date: Fri Jul 20 01:27:20 2012 New Revision: 238632 URL: http://svn.freebsd.org/changeset/base/238632 Log: Create an ioctl API for fetching the current rate control information. Modified: head/sys/dev/ath/if_athioctl.h head/sys/dev/ath/if_athrate.h Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Fri Jul 20 01:11:53 2012 (r238631) +++ head/sys/dev/ath/if_athioctl.h Fri Jul 20 01:27:20 2012 (r238632) @@ -186,6 +186,40 @@ struct ath_diag { #define SIOCGATHDIAG _IOWR('i', 138, struct ath_diag) #define SIOCGATHPHYERR _IOWR('i', 140, struct ath_diag) + +/* + * The rate control ioctl has to support multiple potential rate + * control classes. For now, instead of trying to support an + * abstraction for this in the API, let's just use a TLV + * representation for the payload and let userspace sort it out. + */ +struct ath_rateioctl_tlv { + uint16_t tlv_id; + uint16_t tlv_len; /* length excluding TLV header */ +}; + +/* + * This is purely the six byte MAC address. + */ +#define ATH_RATE_TLV_MACADDR 0xaab0 + +/* + * This is the sample node statistics structure. + * More in ath_rate/sample/sample.h. + */ +#define ATH_RATE_TLV_SAMPLENODE 0xaab2 + +struct ath_rateioctl { + char if_name[IFNAMSIZ]; /* if name */ + union { + uint8_t macaddr[IEEE80211_ADDR_LEN]; + uint64_t pad; + } is_u; + uint32_t len; + caddr_t buf; +}; +#define SIOCGATHNODERATESTATS _IOWR('i', 149, struct ath_rateioctl) + /* * Radio capture format. */ Modified: head/sys/dev/ath/if_athrate.h ============================================================================== --- head/sys/dev/ath/if_athrate.h Fri Jul 20 01:11:53 2012 (r238631) +++ head/sys/dev/ath/if_athrate.h Fri Jul 20 01:27:20 2012 (r238632) @@ -150,4 +150,16 @@ struct ath_buf; void ath_rate_tx_complete(struct ath_softc *, struct ath_node *, const struct ath_rc_series *, const struct ath_tx_status *, int pktlen, int nframes, int nbad); + +/* + * Fetch the global rate control statistics. + */ +int ath_rate_fetch_stats(struct ath_softc *sc, struct ath_rateioctl *rs); + +/* + * Fetch the per-node statistics. + */ +int ath_rate_fetch_node_stats(struct ath_softc *sc, struct ath_node *an, + struct ath_rateioctl *rs); + #endif /* _ATH_RATECTRL_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 01:36:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CFECE1065674; Fri, 20 Jul 2012 01:36:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9A898FC14; Fri, 20 Jul 2012 01:36:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K1a3k1042549; Fri, 20 Jul 2012 01:36:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K1a3Yu042544; Fri, 20 Jul 2012 01:36:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200136.q6K1a3Yu042544@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 01:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238633 - in head/sys/dev/ath/ath_rate: amrr onoe sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 01:36:03 -0000 Author: adrian Date: Fri Jul 20 01:36:02 2012 New Revision: 238633 URL: http://svn.freebsd.org/changeset/base/238633 Log: Add a per-node rate control routine for each rate control module. For now, the only module implement is 'sample', and that's only partially implemented. The main issue here with reusing this structure in userland is that it uses 'rix' everywhere, which requires the userland code to have access to the current HAL rate table. For now, this is a very large work in progress. Specific details: * The rate control information is per-node at the moment and wrapped in a TLV, to ease parsing and backwards compatibility. * .. but so I can be slack for now, the userland statistics are just a copy of the kernel-land sample node state. * However, for now use a temporary copy and change the rix entries to dot11rate entries to make it slightly easier to eyeball. Problems: * The actual rate information table is unfortunately indexed by rix and it doesn't contain a rate code. So the userland side of this currently has no way to extract out a mapping. TODO: * Add a TLV payload to dump out the rate control table mapping so 'rix' can be turned into a dot11 / MCS rate. * .. then remove the temporary copy. Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c head/sys/dev/ath/ath_rate/onoe/onoe.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c ============================================================================== --- head/sys/dev/ath/ath_rate/amrr/amrr.c Fri Jul 20 01:27:20 2012 (r238632) +++ head/sys/dev/ath/ath_rate/amrr/amrr.c Fri Jul 20 01:36:02 2012 (r238633) @@ -421,6 +421,14 @@ ath_rate_ctl(void *arg, struct ieee80211 } } +static int +ath_rate_fetch_node_stats(struct ath_softc *sc, struct ath_node *an, + struct ath_rateioctl *re) +{ + + return (EINVAL); +} + static void ath_rate_sysctlattach(struct ath_softc *sc) { Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c ============================================================================== --- head/sys/dev/ath/ath_rate/onoe/onoe.c Fri Jul 20 01:27:20 2012 (r238632) +++ head/sys/dev/ath/ath_rate/onoe/onoe.c Fri Jul 20 01:36:02 2012 (r238633) @@ -407,6 +407,14 @@ ath_rate_sysctlattach(struct ath_softc * "rate control: # good periods before raising rate"); } +static int +ath_rate_fetch_node_stats(struct ath_softc *sc, struct ath_node *an, + struct ath_rateioctl *re) +{ + + return (EINVAL); +} + struct ath_ratectrl * ath_rate_attach(struct ath_softc *sc) { Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Fri Jul 20 01:27:20 2012 (r238632) +++ head/sys/dev/ath/ath_rate/sample/sample.c Fri Jul 20 01:36:02 2012 (r238633) @@ -105,8 +105,6 @@ __FBSDID("$FreeBSD$"); static void ath_rate_ctl_reset(struct ath_softc *, struct ieee80211_node *); -static const int packet_size_bins[NUM_PACKET_SIZE_BINS] = { 250, 1600 }; - static __inline int size_to_bin(int size) { @@ -128,12 +126,6 @@ size_to_bin(int size) return NUM_PACKET_SIZE_BINS-1; } -static __inline int -bin_to_size(int index) -{ - return packet_size_bins[index]; -} - void ath_rate_node_init(struct ath_softc *sc, struct ath_node *an) { @@ -1198,6 +1190,79 @@ ath_rate_ctl_reset(struct ath_softc *sc, #undef DOT11RATE } +/* + * Fetch the statistics for the given node. + * + * The ieee80211 node must be referenced and unlocked, however the ath_node + * must be locked. + * + * The main difference here is that we convert the rate indexes + * to 802.11 rates, or the userland output won't make much sense + * as it has no access to the rix table. + */ +int +ath_rate_fetch_node_stats(struct ath_softc *sc, struct ath_node *an, + struct ath_rateioctl *rs) +{ + struct sample_node *sn = ATH_NODE_SAMPLE(an); + const HAL_RATE_TABLE *rt = sc->sc_currates; + struct ath_rateioctl_tlv av; + struct sample_node *ts; + int y; + + ATH_NODE_LOCK_ASSERT(an); + + /* + * Ensure there's enough space for the statistics. + */ + if (rs->len < + sizeof(struct ath_rateioctl_tlv) + + sizeof(struct sample_node)) + return (EINVAL); + + /* + * Take a temporary copy of the sample node state so we can + * modify it before we copy it. + */ + ts = malloc(sizeof(struct sample_node), M_TEMP, M_WAITOK | M_ZERO); + if (ts == NULL) + return (ENOMEM); + memcpy(ts, sn, sizeof(struct sample_node)); + + /* Convert rix -> 802.11 rate codes */ + ts->static_rix = dot11rate(rt, sn->static_rix); + for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { + /* + * For non-11n rates, clear the high bit - that + * means "basic rate" and will confuse things. + * + * For 11n rates, set the high bit. + */ + ts->current_rix[y] = dot11rate(rt, sn->current_rix[y]); + ts->current_sample_rix[y] = + dot11rate(rt, sn->current_sample_rix[y]); + ts->last_sample_rix[y] = + dot11rate(rt, sn->last_sample_rix[y]); + } + + /* + * Assemble the TLV. + */ + av.tlv_id = ATH_RATE_TLV_SAMPLENODE; + av.tlv_len = sizeof(struct sample_node); + copyout(&av, rs->buf, sizeof(struct ath_rateioctl_tlv)); + + /* + * Copy the statistics over to the provided buffer. + */ + copyout(ts, rs->buf + sizeof(struct ath_rateioctl_tlv), + sizeof(struct sample_node)); + + free(ts, M_TEMP); + + return (0); +} + static void sample_stats(void *arg, struct ieee80211_node *ni) { Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Fri Jul 20 01:27:20 2012 (r238632) +++ head/sys/dev/ath/ath_rate/sample/sample.h Fri Jul 20 01:36:02 2012 (r238633) @@ -79,6 +79,14 @@ struct txschedule { */ #define NUM_PACKET_SIZE_BINS 2 +static const int packet_size_bins[NUM_PACKET_SIZE_BINS] = { 250, 1600 }; + +static inline int +bin_to_size(int index) +{ + return packet_size_bins[index]; +} + /* per-node state */ struct sample_node { int static_rix; /* rate index of fixed tx rate */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 01:36:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E19C4106564A; Fri, 20 Jul 2012 01:36:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCFFC8FC18; Fri, 20 Jul 2012 01:36:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K1akoP042628; Fri, 20 Jul 2012 01:36:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K1ak54042626; Fri, 20 Jul 2012 01:36:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200136.q6K1ak54042626@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 01:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238634 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 01:36:47 -0000 Author: adrian Date: Fri Jul 20 01:36:46 2012 New Revision: 238634 URL: http://svn.freebsd.org/changeset/base/238634 Log: Enable the basic node-based rate control statistics via an ioctl(). Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Jul 20 01:36:02 2012 (r238633) +++ head/sys/dev/ath/if_ath.c Fri Jul 20 01:36:46 2012 (r238634) @@ -4925,6 +4925,43 @@ ath_watchdog(void *arg) callout_schedule(&sc->sc_wd_ch, hz); } +/* + * Fetch the rate control statistics for the given node. + */ +static int +ath_ioctl_ratestats(struct ath_softc *sc, struct ath_rateioctl *rs) +{ + struct ath_node *an; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + struct ieee80211_node *ni; + int error = 0; + + /* Perform a lookup on the given node */ + ni = ieee80211_find_node(&ic->ic_sta, rs->is_u.macaddr); + if (ni == NULL) { + error = EINVAL; + goto bad; + } + + /* Lock the ath_node */ + an = ATH_NODE(ni); + ATH_NODE_LOCK(an); + + /* Fetch the rate control stats for this node */ + error = ath_rate_fetch_node_stats(sc, an, rs); + + /* No matter what happens here, just drop through */ + + /* Unlock the ath_node */ + ATH_NODE_UNLOCK(an); + + /* Unref the node */ + ieee80211_node_decref(ni); + +bad: + return (error); +} + #ifdef ATH_DIAGAPI /* * Diagnostic interface to the HAL. This is used by various @@ -5073,6 +5110,9 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, error = ath_ioctl_phyerr(sc,(struct ath_diag*) ifr); break; #endif + case SIOCGATHNODERATESTATS: + error = ath_ioctl_ratestats(sc, (struct ath_rateioctl *) ifr); + break; case SIOCGIFADDR: error = ether_ioctl(ifp, cmd, data); break; From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 01:38:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD950106566B; Fri, 20 Jul 2012 01:38:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8FDA8FC14; Fri, 20 Jul 2012 01:38:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K1c36n042756; Fri, 20 Jul 2012 01:38:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K1c3eL042754; Fri, 20 Jul 2012 01:38:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200138.q6K1c3eL042754@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 01:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238635 - head/tools/tools/ath/athratestats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 01:38:04 -0000 Author: adrian Date: Fri Jul 20 01:38:03 2012 New Revision: 238635 URL: http://svn.freebsd.org/changeset/base/238635 Log: Implement a first cut of the 'sample' rate statistics userland utility. This outputs almost exactly the same information as the kernel sysctl does, however the rix -> rate mapping isn't yet available as a TLV. Added: head/tools/tools/ath/athratestats/ head/tools/tools/ath/athratestats/Makefile (contents, props changed) head/tools/tools/ath/athratestats/main.c (contents, props changed) Added: head/tools/tools/ath/athratestats/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athratestats/Makefile Fri Jul 20 01:38:03 2012 (r238635) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal +.PATH: ${.CURDIR}/../../../../sys/dev/ath/ + +PROG= athratestats + +SRCS= main.c + +CLEANFILES+= opt_ah.h + +.include <../Makefile.inc> + +CFLAGS+=-DATH_SUPPORT_ANI -g -ggdb +CFLAGS+=-DATH_SUPPORT_TDMA + +opt_ah.h: + echo "#define AH_DEBUG 1" > opt_ah.h + echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h + echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h + +ah_osdep.h: + echo 'typedef void *HAL_SOFTC;' >ah_osdep.h + echo 'typedef int HAL_BUS_TAG;' >>ah_osdep.h + echo 'typedef void *HAL_BUS_HANDLE;' >>ah_osdep.h + +.include Added: head/tools/tools/ath/athratestats/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athratestats/main.c Fri Jul 20 01:38:03 2012 (r238635) @@ -0,0 +1,200 @@ +/*- + * Copyright (c) 2012, Adrian Chadd. + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ + +#include "opt_ah.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "ah.h" +#include "ah_desc.h" +#include "net80211/ieee80211_ioctl.h" +#include "net80211/ieee80211_radiotap.h" +#include "if_athioctl.h" +#include "if_athrate.h" + +#include "ath_rate/sample/sample.h" + +struct ath_ratestats { + int s; + struct ath_rateioctl re; +}; + +static void +ath_sample_stats(struct ath_ratestats *r, uint8_t *buf) +{ + struct sample_node *sn = (void *) buf; + uint32_t mask; + int rix, y; + + printf("static_rix (%d) ratemask 0x%x\n", + sn->static_rix, + sn->ratemask); + + for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { + printf("[%4u] cur rix %d since switch: packets %d ticks %u\n", + bin_to_size(y), + sn->current_rix[y], + sn->packets_since_switch[y], + sn->ticks_since_switch[y]); + + printf("[%4u] last sample (%d) cur sample (%d) " + "packets sent %d\n", + bin_to_size(y), + sn->last_sample_rix[y], + sn->current_sample_rix[y], + sn->packets_sent[y]); + + printf("[%4u] packets since sample %d sample tt %u\n", + bin_to_size(y), + sn->packets_since_sample[y], + sn->sample_tt[y]); + } + for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { + if ((mask & 1) == 0) + continue; + for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { + if (sn->stats[y][rix].total_packets == 0) + continue; + printf("[%2u:%4u] %8ju:%-8ju (%3d%%) " + "(EWMA %3d.%1d%%) T %8ju F %4d avg %5u last %u\n", + rix, + bin_to_size(y), + (uintmax_t) sn->stats[y][rix].total_packets, + (uintmax_t) sn->stats[y][rix].packets_acked, + (int) ((sn->stats[y][rix].packets_acked * 100ULL) / + sn->stats[y][rix].total_packets), + sn->stats[y][rix].ewma_pct / 10, + sn->stats[y][rix].ewma_pct % 10, + (uintmax_t) sn->stats[y][rix].tries, + sn->stats[y][rix].successive_failures, + sn->stats[y][rix].average_tx_time, + sn->stats[y][rix].last_tx); + } + } +} + +static void +ath_setifname(struct ath_ratestats *r, const char *ifname) +{ + + strncpy(r->re.if_name, ifname, sizeof (r->re.if_name)); +} + +static void +ath_setsta(struct ath_ratestats *r, const char *mac) +{ + + memcpy(&r->re.is_u.macaddr, mac, sizeof(r->re.is_u.macaddr)); +} + +static void +ath_rate_ioctl(struct ath_ratestats *r) +{ + printf("ether: %x:%x:%x:%x:%x:%x\n", + r->re.is_u.macaddr[0], + r->re.is_u.macaddr[1], + r->re.is_u.macaddr[2], + r->re.is_u.macaddr[3], + r->re.is_u.macaddr[4], + r->re.is_u.macaddr[5]); + if (ioctl(r->s, SIOCGATHNODERATESTATS, &r->re) < 0) + err(1, "ioctl"); +} + +#define STATS_BUF_SIZE 4096 +int +main(int argc, const char *argv[]) +{ + struct ath_ratestats r; + struct ether_addr *e; + uint8_t *buf; + struct ath_rateioctl_tlv *av; + + buf = calloc(1, STATS_BUF_SIZE); + if (buf == NULL) + err(1, "calloc"); + + bzero(&r, sizeof(r)); + r.s = socket(AF_INET, SOCK_DGRAM, 0); + if (r.s < 0) { + err(1, "socket"); + } + /* XXX error check */ + ath_setifname(&r, "ath0"); + + e = ether_aton(argv[1]); + + /* caddr_t ? */ + r.re.buf = buf; + r.re.len = STATS_BUF_SIZE; + + ath_setsta(&r, e->octet); + ath_rate_ioctl(&r); + + /* + * Ensure the TLV entry in question is actually the sample + * rate TLV. + */ + av = (struct ath_rateioctl_tlv *) buf; + + if (av->tlv_id != ATH_RATE_TLV_SAMPLENODE) { + fprintf(stderr, "unexpected rate control TLV (got 0x%x, " + "expected 0x%x\n", + av->tlv_id, + ATH_RATE_TLV_SAMPLENODE); + exit(127); + } + if (av->tlv_len != sizeof(struct sample_node)) { + fprintf(stderr, "unexpected TLV len (got %d bytes, " + "expected %d bytes\n", + av->tlv_len, + sizeof(struct sample_node)); + exit(127); + } + + ath_sample_stats(&r, buf + sizeof(struct ath_rateioctl_tlv)); +} + From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 01:41:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0026106564A; Fri, 20 Jul 2012 01:41:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB4228FC0A; Fri, 20 Jul 2012 01:41:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K1fIdu043027; Fri, 20 Jul 2012 01:41:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K1fIG2043025; Fri, 20 Jul 2012 01:41:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200141.q6K1fIG2043025@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 01:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238636 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 01:41:19 -0000 Author: adrian Date: Fri Jul 20 01:41:18 2012 New Revision: 238636 URL: http://svn.freebsd.org/changeset/base/238636 Log: Bump this up to match what the HAL is at now. Modified: head/sys/dev/ath/ath_rate/sample/sample.h Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Fri Jul 20 01:38:03 2012 (r238635) +++ head/sys/dev/ath/ath_rate/sample/sample.h Fri Jul 20 01:41:18 2012 (r238636) @@ -90,7 +90,7 @@ bin_to_size(int index) /* per-node state */ struct sample_node { int static_rix; /* rate index of fixed tx rate */ -#define SAMPLE_MAXRATES 32 /* NB: corresponds to hal info[32] */ +#define SAMPLE_MAXRATES 64 /* NB: corresponds to hal info[32] */ uint32_t ratemask; /* bit mask of valid rate indices */ const struct txschedule *sched; /* tx schedule table */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 01:56:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D253106566C; Fri, 20 Jul 2012 01:56:15 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 377BF8FC08; Fri, 20 Jul 2012 01:56:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K1uFYQ044199; Fri, 20 Jul 2012 01:56:15 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K1uEfB044197; Fri, 20 Jul 2012 01:56:15 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207200156.q6K1uEfB044197@svn.freebsd.org> From: David Xu Date: Fri, 20 Jul 2012 01:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238637 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 01:56:15 -0000 Author: davidxu Date: Fri Jul 20 01:56:14 2012 New Revision: 238637 URL: http://svn.freebsd.org/changeset/base/238637 Log: Don't forget to release a thread reference count, replace _thr_ref_add() with _thr_find_thread(), so reference count is no longer needed. MFC after: 3 days Modified: head/lib/libthr/thread/thr_setschedparam.c Modified: head/lib/libthr/thread/thr_setschedparam.c ============================================================================== --- head/lib/libthr/thread/thr_setschedparam.c Fri Jul 20 01:41:18 2012 (r238636) +++ head/lib/libthr/thread/thr_setschedparam.c Fri Jul 20 01:56:14 2012 (r238637) @@ -70,9 +70,8 @@ _pthread_setschedparam(pthread_t pthread curthread->attr.prio = param->sched_priority; } THR_UNLOCK(curthread); - } else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) - == 0) { - THR_THREAD_LOCK(curthread, pthread); + } else if ((ret = _thr_find_thread(curthread, pthread, + /*include dead*/0)) == 0) { if (pthread->attr.sched_policy == policy && (policy == SCHED_OTHER || pthread->attr.prio == param->sched_priority)) { @@ -88,7 +87,6 @@ _pthread_setschedparam(pthread_t pthread pthread->attr.prio = param->sched_priority; } THR_THREAD_UNLOCK(curthread, pthread); - _thr_ref_delete(curthread, pthread); } return (ret); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 02:17:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A3AE106564A; Fri, 20 Jul 2012 02:17:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 748058FC16; Fri, 20 Jul 2012 02:17:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K2HnmP045907; Fri, 20 Jul 2012 02:17:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K2HnaF045904; Fri, 20 Jul 2012 02:17:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200217.q6K2HnaF045904@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 02:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238638 - in head/sys/dev/ath: . ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 02:17:49 -0000 Author: adrian Date: Fri Jul 20 02:17:48 2012 New Revision: 238638 URL: http://svn.freebsd.org/changeset/base/238638 Log: Introduce a rate table TLV so rate table statistics consumers know how to map rix -> rate code. Modified: head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Fri Jul 20 01:56:14 2012 (r238637) +++ head/sys/dev/ath/ath_rate/sample/sample.c Fri Jul 20 02:17:48 2012 (r238638) @@ -1207,8 +1207,9 @@ ath_rate_fetch_node_stats(struct ath_sof struct sample_node *sn = ATH_NODE_SAMPLE(an); const HAL_RATE_TABLE *rt = sc->sc_currates; struct ath_rateioctl_tlv av; - struct sample_node *ts; + struct ath_rateioctl_rt *tv; int y; + int o = 0; ATH_NODE_LOCK_ASSERT(an); @@ -1217,48 +1218,61 @@ ath_rate_fetch_node_stats(struct ath_sof */ if (rs->len < sizeof(struct ath_rateioctl_tlv) + - sizeof(struct sample_node)) + sizeof(struct ath_rateioctl_rt) + + sizeof(struct ath_rateioctl_tlv) + + sizeof(struct sample_node)) { + device_printf(sc->sc_dev, "%s: len=%d, too short\n", + __func__, + rs->len); return (EINVAL); + } /* * Take a temporary copy of the sample node state so we can * modify it before we copy it. */ - ts = malloc(sizeof(struct sample_node), M_TEMP, M_WAITOK | M_ZERO); - if (ts == NULL) + tv = malloc(sizeof(struct ath_rateioctl_rt), M_TEMP, + M_NOWAIT | M_ZERO); + if (tv == NULL) { return (ENOMEM); - memcpy(ts, sn, sizeof(struct sample_node)); + } - /* Convert rix -> 802.11 rate codes */ - ts->static_rix = dot11rate(rt, sn->static_rix); - for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { - /* - * For non-11n rates, clear the high bit - that - * means "basic rate" and will confuse things. - * - * For 11n rates, set the high bit. - */ - ts->current_rix[y] = dot11rate(rt, sn->current_rix[y]); - ts->current_sample_rix[y] = - dot11rate(rt, sn->current_sample_rix[y]); - ts->last_sample_rix[y] = - dot11rate(rt, sn->last_sample_rix[y]); + /* + * Populate the rate table mapping TLV. + */ + tv->nentries = rt->rateCount; + for (y = 0; y < rt->rateCount; y++) { + tv->ratecode[y] = rt->info[y].dot11Rate & IEEE80211_RATE_VAL; + if (rt->info[y].phy == IEEE80211_T_HT) + tv->ratecode[y] |= IEEE80211_RATE_MCS; } + o = 0; + /* + * First TLV - rate code mapping + */ + av.tlv_id = ATH_RATE_TLV_RATETABLE; + av.tlv_len = sizeof(struct ath_rateioctl_rt); + copyout(&av, rs->buf + o, sizeof(struct ath_rateioctl_tlv)); + o += sizeof(struct ath_rateioctl_tlv); + copyout(tv, rs->buf + o, sizeof(struct ath_rateioctl_rt)); + o += sizeof(struct ath_rateioctl_rt); + /* - * Assemble the TLV. + * Second TLV - sample node statistics */ av.tlv_id = ATH_RATE_TLV_SAMPLENODE; av.tlv_len = sizeof(struct sample_node); - copyout(&av, rs->buf, sizeof(struct ath_rateioctl_tlv)); + copyout(&av, rs->buf + o, sizeof(struct ath_rateioctl_tlv)); + o += sizeof(struct ath_rateioctl_tlv); /* * Copy the statistics over to the provided buffer. */ - copyout(ts, rs->buf + sizeof(struct ath_rateioctl_tlv), - sizeof(struct sample_node)); + copyout(sn, rs->buf + o, sizeof(struct sample_node)); + o += sizeof(struct sample_node); - free(ts, M_TEMP); + free(tv, M_TEMP); return (0); } Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Fri Jul 20 01:56:14 2012 (r238637) +++ head/sys/dev/ath/if_athioctl.h Fri Jul 20 02:17:48 2012 (r238638) @@ -204,6 +204,18 @@ struct ath_rateioctl_tlv { #define ATH_RATE_TLV_MACADDR 0xaab0 /* + * The rate control modules may decide to push a mapping table + * of rix -> net80211 ratecode as part of the update. + */ +#define ATH_RATE_TLV_RATETABLE_NENTRIES 64 +struct ath_rateioctl_rt { + uint16_t nentries; + uint16_t pad[1]; + uint8_t ratecode[ATH_RATE_TLV_RATETABLE_NENTRIES]; +}; +#define ATH_RATE_TLV_RATETABLE 0xaab1 + +/* * This is the sample node statistics structure. * More in ath_rate/sample/sample.h. */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 02:18:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C4D21065675; Fri, 20 Jul 2012 02:18:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 464628FC0C; Fri, 20 Jul 2012 02:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K2IlZs046009; Fri, 20 Jul 2012 02:18:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K2Ilf0046007; Fri, 20 Jul 2012 02:18:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200218.q6K2Ilf0046007@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 02:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238639 - head/tools/tools/ath/athratestats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 02:18:48 -0000 Author: adrian Date: Fri Jul 20 02:18:47 2012 New Revision: 238639 URL: http://svn.freebsd.org/changeset/base/238639 Log: Use the rate control table to display the rate rather than the rix, making the output of this program much more meaningful. Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Fri Jul 20 02:17:48 2012 (r238638) +++ head/tools/tools/ath/athratestats/main.c Fri Jul 20 02:18:47 2012 (r238639) @@ -62,10 +62,31 @@ struct ath_ratestats { struct ath_rateioctl re; }; +static inline int +dot11rate(struct ath_rateioctl_rt *rt, int rix) +{ + + if (rt->ratecode[rix] & IEEE80211_RATE_MCS) + return rt->ratecode[rix] & ~(IEEE80211_RATE_MCS); + else + return (rt->ratecode[rix] / 2); +} + +static const char * +dot11str(struct ath_rateioctl_rt *rt, int rix) +{ + if (rix == -1) + return ""; + else if (rt->ratecode[rix] & IEEE80211_RATE_MCS) + return "MCS"; + else + return " Mb"; +} + static void -ath_sample_stats(struct ath_ratestats *r, uint8_t *buf) +ath_sample_stats(struct ath_ratestats *r, struct ath_rateioctl_rt *rt, + struct sample_node *sn) { - struct sample_node *sn = (void *) buf; uint32_t mask; int rix, y; @@ -74,17 +95,21 @@ ath_sample_stats(struct ath_ratestats *r sn->ratemask); for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { - printf("[%4u] cur rix %d since switch: packets %d ticks %u\n", + printf("[%4u] cur rate %d %s since switch: " + "packets %d ticks %u\n", bin_to_size(y), - sn->current_rix[y], + dot11rate(rt, sn->current_rix[y]), + dot11str(rt, sn->current_rix[y]), sn->packets_since_switch[y], sn->ticks_since_switch[y]); - printf("[%4u] last sample (%d) cur sample (%d) " + printf("[%4u] last sample (%d %s) cur sample (%d %s) " "packets sent %d\n", bin_to_size(y), - sn->last_sample_rix[y], - sn->current_sample_rix[y], + dot11rate(rt, sn->last_sample_rix[y]), + dot11str(rt, sn->last_sample_rix[y]), + dot11rate(rt, sn->current_sample_rix[y]), + dot11str(rt, sn->current_sample_rix[y]), sn->packets_sent[y]); printf("[%4u] packets since sample %d sample tt %u\n", @@ -98,9 +123,10 @@ ath_sample_stats(struct ath_ratestats *r for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { if (sn->stats[y][rix].total_packets == 0) continue; - printf("[%2u:%4u] %8ju:%-8ju (%3d%%) " + printf("[%2u %s:%4u] %8ju:%-8ju (%3d%%) " "(EWMA %3d.%1d%%) T %8ju F %4d avg %5u last %u\n", - rix, + dot11rate(rt, rix), + dot11str(rt, rix), bin_to_size(y), (uintmax_t) sn->stats[y][rix].total_packets, (uintmax_t) sn->stats[y][rix].packets_acked, @@ -144,7 +170,7 @@ ath_rate_ioctl(struct ath_ratestats *r) err(1, "ioctl"); } -#define STATS_BUF_SIZE 4096 +#define STATS_BUF_SIZE 8192 int main(int argc, const char *argv[]) { @@ -152,6 +178,8 @@ main(int argc, const char *argv[]) struct ether_addr *e; uint8_t *buf; struct ath_rateioctl_tlv *av; + struct sample_node *sn = NULL; + struct ath_rateioctl_rt *rt = NULL; buf = calloc(1, STATS_BUF_SIZE); if (buf == NULL) @@ -175,11 +203,28 @@ main(int argc, const char *argv[]) ath_rate_ioctl(&r); /* - * Ensure the TLV entry in question is actually the sample - * rate TLV. + * For now, hard-code the TLV order and contents. Ew! */ av = (struct ath_rateioctl_tlv *) buf; + if (av->tlv_id != ATH_RATE_TLV_RATETABLE) { + fprintf(stderr, "unexpected rate control TLV (got 0x%x, " + "expected 0x%x\n", + av->tlv_id, + ATH_RATE_TLV_RATETABLE); + exit(127); + } + if (av->tlv_len != sizeof(struct ath_rateioctl_rt)) { + fprintf(stderr, "unexpected TLV len (got %d bytes, " + "expected %d bytes\n", + av->tlv_len, + sizeof(struct ath_rateioctl_rt)); + exit(127); + } + rt = (void *) (buf + sizeof(struct ath_rateioctl_tlv)); + /* Next */ + av = (void *) (buf + sizeof(struct ath_rateioctl_tlv) + + sizeof(struct ath_rateioctl_rt)); if (av->tlv_id != ATH_RATE_TLV_SAMPLENODE) { fprintf(stderr, "unexpected rate control TLV (got 0x%x, " "expected 0x%x\n", @@ -194,7 +239,10 @@ main(int argc, const char *argv[]) sizeof(struct sample_node)); exit(127); } + sn = (void *) (buf + sizeof(struct ath_rateioctl_tlv) + + sizeof(struct ath_rateioctl_rt) + + sizeof(struct ath_rateioctl_tlv)); - ath_sample_stats(&r, buf + sizeof(struct ath_rateioctl_tlv)); + ath_sample_stats(&r, rt, sn); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 03:00:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19AE7106564A; Fri, 20 Jul 2012 03:00:42 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEB378FC0C; Fri, 20 Jul 2012 03:00:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K30fcH049030; Fri, 20 Jul 2012 03:00:41 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K30f7c049028; Fri, 20 Jul 2012 03:00:41 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207200300.q6K30f7c049028@svn.freebsd.org> From: David Xu Date: Fri, 20 Jul 2012 03:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238640 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 03:00:42 -0000 Author: davidxu Date: Fri Jul 20 03:00:41 2012 New Revision: 238640 URL: http://svn.freebsd.org/changeset/base/238640 Log: Eliminate duplicated code. Modified: head/lib/libthr/thread/thr_setschedparam.c Modified: head/lib/libthr/thread/thr_setschedparam.c ============================================================================== --- head/lib/libthr/thread/thr_setschedparam.c Fri Jul 20 02:18:47 2012 (r238639) +++ head/lib/libthr/thread/thr_setschedparam.c Fri Jul 20 03:00:41 2012 (r238640) @@ -54,39 +54,25 @@ _pthread_setschedparam(pthread_t pthread int ret; if (pthread == curthread) { + pthread = curthread; THR_LOCK(curthread); - if (curthread->attr.sched_policy == policy && - (policy == SCHED_OTHER || - curthread->attr.prio == param->sched_priority)) { - pthread->attr.prio = param->sched_priority; - THR_UNLOCK(curthread); - return (0); - } - ret = _thr_setscheduler(curthread->tid, policy, param); - if (ret == -1) - ret = errno; - else { - curthread->attr.sched_policy = policy; - curthread->attr.prio = param->sched_priority; - } - THR_UNLOCK(curthread); } else if ((ret = _thr_find_thread(curthread, pthread, - /*include dead*/0)) == 0) { - if (pthread->attr.sched_policy == policy && - (policy == SCHED_OTHER || - pthread->attr.prio == param->sched_priority)) { - pthread->attr.prio = param->sched_priority; - THR_THREAD_UNLOCK(curthread, pthread); - return (0); - } - ret = _thr_setscheduler(pthread->tid, policy, param); - if (ret == -1) - ret = errno; - else { - pthread->attr.sched_policy = policy; - pthread->attr.prio = param->sched_priority; - } + /*include dead*/0)) != 0) + return (ret); + if (pthread->attr.sched_policy == policy && + (policy == SCHED_OTHER || + pthread->attr.prio == param->sched_priority)) { + pthread->attr.prio = param->sched_priority; THR_THREAD_UNLOCK(curthread, pthread); + return (0); } + ret = _thr_setscheduler(pthread->tid, policy, param); + if (ret == -1) + ret = errno; + else { + pthread->attr.sched_policy = policy; + pthread->attr.prio = param->sched_priority; + } + THR_THREAD_UNLOCK(curthread, pthread); return (ret); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 03:16:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 642B1106564A; Fri, 20 Jul 2012 03:16:53 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DF3D8FC16; Fri, 20 Jul 2012 03:16:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K3GrcU050710; Fri, 20 Jul 2012 03:16:53 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K3Grn9050708; Fri, 20 Jul 2012 03:16:53 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207200316.q6K3Grn9050708@svn.freebsd.org> From: David Xu Date: Fri, 20 Jul 2012 03:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238641 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 03:16:53 -0000 Author: davidxu Date: Fri Jul 20 03:16:52 2012 New Revision: 238641 URL: http://svn.freebsd.org/changeset/base/238641 Log: Eliminate duplicated code. Modified: head/lib/libthr/thread/thr_setprio.c Modified: head/lib/libthr/thread/thr_setprio.c ============================================================================== --- head/lib/libthr/thread/thr_setprio.c Fri Jul 20 03:00:41 2012 (r238640) +++ head/lib/libthr/thread/thr_setprio.c Fri Jul 20 03:16:52 2012 (r238641) @@ -46,37 +46,22 @@ _pthread_setprio(pthread_t pthread, int param.sched_priority = prio; if (pthread == curthread) { + pthread = curthread; THR_LOCK(curthread); - if (curthread->attr.sched_policy == SCHED_OTHER || - curthread->attr.prio == prio) { - curthread->attr.prio = prio; - ret = 0; - } else { - ret = _thr_setscheduler(curthread->tid, - curthread->attr.sched_policy, ¶m); - if (ret == -1) - ret = errno; - else - curthread->attr.prio = prio; - } - THR_UNLOCK(curthread); - } else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) - == 0) { - THR_THREAD_LOCK(curthread, pthread); - if (pthread->attr.sched_policy == SCHED_OTHER || - pthread->attr.prio == prio) { + } else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0))) + return (ret); + if (pthread->attr.sched_policy == SCHED_OTHER || + pthread->attr.prio == prio) { + pthread->attr.prio = prio; + ret = 0; + } else { + ret = _thr_setscheduler(pthread->tid, + pthread->attr.sched_policy, ¶m); + if (ret == -1) + ret = errno; + else pthread->attr.prio = prio; - ret = 0; - } else { - ret = _thr_setscheduler(pthread->tid, - curthread->attr.sched_policy, ¶m); - if (ret == -1) - ret = errno; - else - pthread->attr.prio = prio; - } - THR_THREAD_UNLOCK(curthread, pthread); - _thr_ref_delete(curthread, pthread); } + THR_THREAD_UNLOCK(curthread, pthread); return (ret); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 03:22:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37550106566B; Fri, 20 Jul 2012 03:22:18 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2159F8FC15; Fri, 20 Jul 2012 03:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K3MHXX051117; Fri, 20 Jul 2012 03:22:17 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K3MHMQ051114; Fri, 20 Jul 2012 03:22:17 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207200322.q6K3MHMQ051114@svn.freebsd.org> From: David Xu Date: Fri, 20 Jul 2012 03:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238642 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 03:22:18 -0000 Author: davidxu Date: Fri Jul 20 03:22:17 2012 New Revision: 238642 URL: http://svn.freebsd.org/changeset/base/238642 Log: Don't assign same value. Modified: head/lib/libthr/thread/thr_setprio.c head/lib/libthr/thread/thr_setschedparam.c Modified: head/lib/libthr/thread/thr_setprio.c ============================================================================== --- head/lib/libthr/thread/thr_setprio.c Fri Jul 20 03:16:52 2012 (r238641) +++ head/lib/libthr/thread/thr_setprio.c Fri Jul 20 03:22:17 2012 (r238642) @@ -45,10 +45,9 @@ _pthread_setprio(pthread_t pthread, int int ret; param.sched_priority = prio; - if (pthread == curthread) { - pthread = curthread; + if (pthread == curthread) THR_LOCK(curthread); - } else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0))) + else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0))) return (ret); if (pthread->attr.sched_policy == SCHED_OTHER || pthread->attr.prio == prio) { Modified: head/lib/libthr/thread/thr_setschedparam.c ============================================================================== --- head/lib/libthr/thread/thr_setschedparam.c Fri Jul 20 03:16:52 2012 (r238641) +++ head/lib/libthr/thread/thr_setschedparam.c Fri Jul 20 03:22:17 2012 (r238642) @@ -53,10 +53,9 @@ _pthread_setschedparam(pthread_t pthread struct pthread *curthread = _get_curthread(); int ret; - if (pthread == curthread) { - pthread = curthread; + if (pthread == curthread) THR_LOCK(curthread); - } else if ((ret = _thr_find_thread(curthread, pthread, + else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)) != 0) return (ret); if (pthread->attr.sched_policy == policy && From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 03:27:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D241B1065670; Fri, 20 Jul 2012 03:27:07 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC4138FC14; Fri, 20 Jul 2012 03:27:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K3R7ob051493; Fri, 20 Jul 2012 03:27:07 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K3R70e051491; Fri, 20 Jul 2012 03:27:07 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207200327.q6K3R70e051491@svn.freebsd.org> From: David Xu Date: Fri, 20 Jul 2012 03:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238643 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 03:27:07 -0000 Author: davidxu Date: Fri Jul 20 03:27:07 2012 New Revision: 238643 URL: http://svn.freebsd.org/changeset/base/238643 Log: Eliminate duplicated code. Modified: head/lib/libthr/thread/thr_getschedparam.c Modified: head/lib/libthr/thread/thr_getschedparam.c ============================================================================== --- head/lib/libthr/thread/thr_getschedparam.c Fri Jul 20 03:22:17 2012 (r238642) +++ head/lib/libthr/thread/thr_getschedparam.c Fri Jul 20 03:27:07 2012 (r238643) @@ -53,25 +53,16 @@ _pthread_getschedparam(pthread_t pthread if (policy == NULL || param == NULL) return (EINVAL); - if (pthread == curthread) { - /* - * Avoid searching the thread list when it is the current - * thread. - */ + /* + * Avoid searching the thread list when it is the current + * thread. + */ + if (pthread == curthread) THR_LOCK(curthread); - *policy = curthread->attr.sched_policy; - param->sched_priority = curthread->attr.prio; - THR_UNLOCK(curthread); - ret = 0; - } - /* Find the thread in the list of active threads. */ - else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) - == 0) { - THR_THREAD_LOCK(curthread, pthread); - *policy = pthread->attr.sched_policy; - param->sched_priority = pthread->attr.prio; - THR_THREAD_UNLOCK(curthread, pthread); - _thr_ref_delete(curthread, pthread); - } + else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0))) + return (ret); + *policy = pthread->attr.sched_policy; + param->sched_priority = pthread->attr.prio; + THR_THREAD_UNLOCK(curthread, pthread); return (ret); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 03:37:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 961AC106566B; Fri, 20 Jul 2012 03:37:20 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 802308FC18; Fri, 20 Jul 2012 03:37:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K3bKUb052231; Fri, 20 Jul 2012 03:37:20 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K3bKN3052229; Fri, 20 Jul 2012 03:37:20 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207200337.q6K3bKN3052229@svn.freebsd.org> From: David Xu Date: Fri, 20 Jul 2012 03:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238644 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 03:37:20 -0000 Author: davidxu Date: Fri Jul 20 03:37:19 2012 New Revision: 238644 URL: http://svn.freebsd.org/changeset/base/238644 Log: Simplify code by replacing _thr_ref_add() with _thr_find_thread(). Modified: head/lib/libthr/thread/thr_info.c Modified: head/lib/libthr/thread/thr_info.c ============================================================================== --- head/lib/libthr/thread/thr_info.c Fri Jul 20 03:27:07 2012 (r238643) +++ head/lib/libthr/thread/thr_info.c Fri Jul 20 03:37:19 2012 (r238644) @@ -51,16 +51,12 @@ _pthread_set_name_np(pthread_t thread, c if (thr_set_name(thread->tid, name)) ret = errno; } else { - if (_thr_ref_add(curthread, thread, 0) == 0) { - THR_THREAD_LOCK(curthread, thread); + if ((ret=_thr_find_thread(curthread, thread, 0)) == 0) { if (thread->state != PS_DEAD) { if (thr_set_name(thread->tid, name)) ret = errno; } THR_THREAD_UNLOCK(curthread, thread); - _thr_ref_delete(curthread, thread); - } else { - ret = ESRCH; } } #if 0 From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 05:47:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3DD4106566C; Fri, 20 Jul 2012 05:47:12 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E7FE8FC0A; Fri, 20 Jul 2012 05:47:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K5lCdc061611; Fri, 20 Jul 2012 05:47:12 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K5lCBJ061608; Fri, 20 Jul 2012 05:47:12 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207200547.q6K5lCBJ061608@svn.freebsd.org> From: David Xu Date: Fri, 20 Jul 2012 05:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238645 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 05:47:12 -0000 Author: davidxu Date: Fri Jul 20 05:47:12 2012 New Revision: 238645 URL: http://svn.freebsd.org/changeset/base/238645 Log: Don't forget to initialize return value. Modified: head/lib/libthr/thread/thr_getschedparam.c Modified: head/lib/libthr/thread/thr_getschedparam.c ============================================================================== --- head/lib/libthr/thread/thr_getschedparam.c Fri Jul 20 03:37:19 2012 (r238644) +++ head/lib/libthr/thread/thr_getschedparam.c Fri Jul 20 05:47:12 2012 (r238645) @@ -48,7 +48,7 @@ _pthread_getschedparam(pthread_t pthread struct sched_param *param) { struct pthread *curthread = _get_curthread(); - int ret; + int ret = 0; if (policy == NULL || param == NULL) return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 06:11:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EE781065673; Fri, 20 Jul 2012 06:11:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8DF8FC08; Fri, 20 Jul 2012 06:11:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K6BRb9063370; Fri, 20 Jul 2012 06:11:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K6BRFk063368; Fri, 20 Jul 2012 06:11:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200611.q6K6BRFk063368@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 06:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238646 - head/tools/tools/ath/athratestats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 06:11:27 -0000 Author: adrian Date: Fri Jul 20 06:11:26 2012 New Revision: 238646 URL: http://svn.freebsd.org/changeset/base/238646 Log: Tidy things up substantially: * remove some debugging; * introduce command line arguments; * introduce support for non-ath0 interfaces. Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Fri Jul 20 05:47:12 2012 (r238645) +++ head/tools/tools/ath/athratestats/main.c Fri Jul 20 06:11:26 2012 (r238646) @@ -57,6 +57,12 @@ #include "ath_rate/sample/sample.h" +/* + * This needs to be big enough to fit the two TLVs, the rate table + * and the rate statistics table for a single node. + */ +#define STATS_BUF_SIZE 8192 + struct ath_ratestats { int s; struct ath_rateioctl re; @@ -159,20 +165,13 @@ ath_setsta(struct ath_ratestats *r, cons static void ath_rate_ioctl(struct ath_ratestats *r) { - printf("ether: %x:%x:%x:%x:%x:%x\n", - r->re.is_u.macaddr[0], - r->re.is_u.macaddr[1], - r->re.is_u.macaddr[2], - r->re.is_u.macaddr[3], - r->re.is_u.macaddr[4], - r->re.is_u.macaddr[5]); + if (ioctl(r->s, SIOCGATHNODERATESTATS, &r->re) < 0) err(1, "ioctl"); } -#define STATS_BUF_SIZE 8192 int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { struct ath_ratestats r; struct ether_addr *e; @@ -180,6 +179,33 @@ main(int argc, const char *argv[]) struct ath_rateioctl_tlv *av; struct sample_node *sn = NULL; struct ath_rateioctl_rt *rt = NULL; + char const *ifname = NULL, *macaddr = NULL; + int c; + int do_all = 0; + + ifname = getenv("ATH"); + if (ifname == NULL) + ifname = "ath0"; + + while ((c = getopt(argc, argv, "ahi:m:")) != -1) { + switch (c) { + case 'a': + do_all = 1; + break; + case 'i': + ifname = optarg; + break; + case 'm': + macaddr = optarg; + break; + + default: + errx(1, + "usage: %s [-h] [-i ifname] [-a] [-m macaddr]\n", + argv[0]); + /* NOTREACHED */ + } + } buf = calloc(1, STATS_BUF_SIZE); if (buf == NULL) @@ -191,11 +217,17 @@ main(int argc, const char *argv[]) err(1, "socket"); } /* XXX error check */ - ath_setifname(&r, "ath0"); + ath_setifname(&r, ifname); - e = ether_aton(argv[1]); + if (macaddr == NULL) { + errx(1, "%s: macaddress wasn't supplied and no -a given\n", + argv[0]); + /* NOTREACHED */ + } + e = ether_aton(macaddr); + if (e == NULL) + err(1, "ether_aton"); - /* caddr_t ? */ r.re.buf = buf; r.re.len = STATS_BUF_SIZE; From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 06:44:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 81BEC106564A; Fri, 20 Jul 2012 06:44:19 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 405A28FC0A; Fri, 20 Jul 2012 06:44:18 +0000 (UTC) Received: by bkcje9 with SMTP id je9so3214038bkc.13 for ; Thu, 19 Jul 2012 23:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=1nODGaEx/2cio5ZYxNW7JXNZyy6EVypPFcc93pGj6FA=; b=IMzNqQql4iV2+M07Fajpe44YV3tshMGNAeUjg0yuuLGHLzpLWTdkd6SrcEhqj/iz5e cAVroRmXyuL25n6pjOTxOBNt80OrPytsKrScj/RMiJjc13S4OmX8BHKZSfb943wWu78B j+mcy/I1VlcWSyH02GQ1luXpZvVFKQ1rqtLdnRjBNz20Ym6i3DaYAI9nesD5ejVi+LKz aGbZ0QbscFE6umiZGN6yizaeNUsV0Haxh1xCbEib6Tq8H2u2jhR9KQiSa1zCxWUxsTJo 9LSZnkPAnNwkghf5xN5L9MK0CNImbiPO7CL6rHNii4U0QyH0cwt5GZ2IRRmy9fIKoa7z dm+A== Received: by 10.204.148.72 with SMTP id o8mr2126164bkv.103.1342766657230; Thu, 19 Jul 2012 23:44:17 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.204.49.87 with HTTP; Thu, 19 Jul 2012 23:43:47 -0700 (PDT) In-Reply-To: <50080D5A.9040807@FreeBSD.org> References: <201207181928.q6IJSMgZ003200@svn.freebsd.org> <50080D5A.9040807@FreeBSD.org> From: Chris Rees Date: Fri, 20 Jul 2012 07:43:47 +0100 X-Google-Sender-Auth: inHq8srAAb8YIR16yWWkwnMygVg Message-ID: To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling Smorgrav Subject: Re: svn commit: r238602 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 06:44:19 -0000 On 19 July 2012 14:36, Dimitry Andric wrote: > On 2012-07-18 21:28, Dag-Erling Smorgrav wrote: >> Author: des >> Date: Wed Jul 18 19:28:22 2012 >> New Revision: 238602 >> URL: http://svn.freebsd.org/changeset/base/238602 >> >> Log: >> Add -g (gigabyte) flag to complement -k (kilobyte) and -m (megabyte). > > Too bad -t is already taken. :) -T is not however-- POLA issue or no big deal? Chris From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 06:50:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B4F3106564A; Fri, 20 Jul 2012 06:50:58 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AB218FC1F; Fri, 20 Jul 2012 06:50:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K6owDv066203; Fri, 20 Jul 2012 06:50:58 GMT (envelope-from pgj@svn.freebsd.org) Received: (from pgj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K6owvO066198; Fri, 20 Jul 2012 06:50:58 GMT (envelope-from pgj@svn.freebsd.org) Message-Id: <201207200650.q6K6owvO066198@svn.freebsd.org> From: Gabor Pali Date: Fri, 20 Jul 2012 06:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238647 - in stable/9: sys/kern sys/sys usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 06:50:58 -0000 Author: pgj (ports committer) Date: Fri Jul 20 06:50:57 2012 New Revision: 238647 URL: http://svn.freebsd.org/changeset/base/238647 Log: MFC r238527: - Add support for displaying process stack memory regions. Approved by: re (kib), rwatson Modified: stable/9/sys/kern/kern_proc.c stable/9/sys/sys/user.h stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat_vm.c Directory Properties: stable/9/sys/ (props changed) stable/9/usr.bin/procstat/ (props changed) Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Fri Jul 20 06:11:26 2012 (r238646) +++ stable/9/sys/kern/kern_proc.c Fri Jul 20 06:50:57 2012 (r238647) @@ -2189,6 +2189,10 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_flags |= KVME_FLAG_NEEDS_COPY; if (entry->eflags & MAP_ENTRY_NOCOREDUMP) kve->kve_flags |= KVME_FLAG_NOCOREDUMP; + if (entry->eflags & MAP_ENTRY_GROWS_UP) + kve->kve_flags |= KVME_FLAG_GROWS_UP; + if (entry->eflags & MAP_ENTRY_GROWS_DOWN) + kve->kve_flags |= KVME_FLAG_GROWS_DOWN; last_timestamp = map->timestamp; vm_map_unlock_read(map); Modified: stable/9/sys/sys/user.h ============================================================================== --- stable/9/sys/sys/user.h Fri Jul 20 06:11:26 2012 (r238646) +++ stable/9/sys/sys/user.h Fri Jul 20 06:50:57 2012 (r238647) @@ -413,6 +413,8 @@ struct kinfo_file { #define KVME_FLAG_NEEDS_COPY 0x00000002 #define KVME_FLAG_NOCOREDUMP 0x00000004 #define KVME_FLAG_SUPER 0x00000008 +#define KVME_FLAG_GROWS_UP 0x00000010 +#define KVME_FLAG_GROWS_DOWN 0x00000020 #if defined(__amd64__) #define KINFO_OVMENTRY_SIZE 1168 Modified: stable/9/usr.bin/procstat/procstat.1 ============================================================================== --- stable/9/usr.bin/procstat/procstat.1 Fri Jul 20 06:11:26 2012 (r238646) +++ stable/9/usr.bin/procstat/procstat.1 Fri Jul 20 06:50:57 2012 (r238647) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2012 +.Dd July 11, 2012 .Dt PROCSTAT 1 .Os .Sh NAME @@ -433,6 +433,10 @@ copy-on-write needs copy .It S one or more superpage mappings are used +.It D +grows down (top-down stack) +.It U +grows up (bottom-up stack) .El .Sh EXIT STATUS .Ex -std Modified: stable/9/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_vm.c Fri Jul 20 06:11:26 2012 (r238646) +++ stable/9/usr.bin/procstat/procstat_vm.c Fri Jul 20 06:50:57 2012 (r238647) @@ -72,7 +72,9 @@ procstat_vm(struct kinfo_proc *kipp) printf("%-1s", kve->kve_flags & KVME_FLAG_COW ? "C" : "-"); printf("%-1s", kve->kve_flags & KVME_FLAG_NEEDS_COPY ? "N" : "-"); - printf("%-1s ", kve->kve_flags & KVME_FLAG_SUPER ? "S" : "-"); + printf("%-1s", kve->kve_flags & KVME_FLAG_SUPER ? "S" : "-"); + printf("%-1s ", kve->kve_flags & KVME_FLAG_GROWS_UP ? "U" : + kve->kve_flags & KVME_FLAG_GROWS_DOWN ? "D" : "-"); switch (kve->kve_type) { case KVME_TYPE_NONE: str = "--"; From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 07:17:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B5CC106564A; Fri, 20 Jul 2012 07:17:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 166728FC1B; Fri, 20 Jul 2012 07:17:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K7HO92068096; Fri, 20 Jul 2012 07:17:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K7HOrC068094; Fri, 20 Jul 2012 07:17:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200717.q6K7HOrC068094@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 07:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238648 - head/tools/tools/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 07:17:25 -0000 Author: adrian Date: Fri Jul 20 07:17:24 2012 New Revision: 238648 URL: http://svn.freebsd.org/changeset/base/238648 Log: Add the new athratestats tool. Modified: head/tools/tools/ath/Makefile Modified: head/tools/tools/ath/Makefile ============================================================================== --- head/tools/tools/ath/Makefile Fri Jul 20 06:50:57 2012 (r238647) +++ head/tools/tools/ath/Makefile Fri Jul 20 07:17:24 2012 (r238648) @@ -3,6 +3,6 @@ SUBDIR= arcode athdebug athdecode athkey athpoke athprom athrd athregs SUBDIR+= athstats ath_prom_read athradar athaggrstats SUBDIR+= ath_ee_v14_print ath_ee_v4k_print ath_ee_9287_print -SUBDIR+= athsurvey +SUBDIR+= athsurvey athratestats .include From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 07:38:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B5A6E1065674; Fri, 20 Jul 2012 07:38:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87B518FC12; Fri, 20 Jul 2012 07:38:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K7cC6c069615; Fri, 20 Jul 2012 07:38:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K7cCJE069613; Fri, 20 Jul 2012 07:38:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200738.q6K7cCJE069613@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 07:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238650 - head/tools/tools/ath/athratestats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 07:38:12 -0000 Author: adrian Date: Fri Jul 20 07:38:11 2012 New Revision: 238650 URL: http://svn.freebsd.org/changeset/base/238650 Log: Add missing SRCS. Modified: head/tools/tools/ath/athratestats/Makefile Modified: head/tools/tools/ath/athratestats/Makefile ============================================================================== --- head/tools/tools/ath/athratestats/Makefile Fri Jul 20 07:22:37 2012 (r238649) +++ head/tools/tools/ath/athratestats/Makefile Fri Jul 20 07:38:11 2012 (r238650) @@ -5,7 +5,7 @@ PROG= athratestats -SRCS= main.c +SRCS= main.c opt_ah.h ah_osdep.h CLEANFILES+= opt_ah.h From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 07:49:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33010106566B; Fri, 20 Jul 2012 07:49:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D7B48FC08; Fri, 20 Jul 2012 07:49:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K7nQlH070554; Fri, 20 Jul 2012 07:49:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K7nQci070552; Fri, 20 Jul 2012 07:49:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207200749.q6K7nQci070552@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jul 2012 07:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238651 - head/tools/tools/ath/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 07:49:27 -0000 Author: adrian Date: Fri Jul 20 07:49:26 2012 New Revision: 238651 URL: http://svn.freebsd.org/changeset/base/238651 Log: Add a needed #include due to my recent change. Modified: head/tools/tools/ath/common/diag.h Modified: head/tools/tools/ath/common/diag.h ============================================================================== --- head/tools/tools/ath/common/diag.h Fri Jul 20 07:38:11 2012 (r238650) +++ head/tools/tools/ath/common/diag.h Fri Jul 20 07:49:26 2012 (r238651) @@ -38,6 +38,7 @@ #include #include +#include #include "if_athioctl.h" struct statshandler { From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 08:31:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9798106564A; Fri, 20 Jul 2012 08:31:37 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C34F8FC0C; Fri, 20 Jul 2012 08:31:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K8Vbev073666; Fri, 20 Jul 2012 08:31:37 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K8Vb9U073664; Fri, 20 Jul 2012 08:31:37 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201207200831.q6K8Vb9U073664@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 20 Jul 2012 08:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238652 - head/bin/cat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 08:31:37 -0000 Author: jh Date: Fri Jul 20 08:31:36 2012 New Revision: 238652 URL: http://svn.freebsd.org/changeset/base/238652 Log: style(9). Modified: head/bin/cat/cat.c Modified: head/bin/cat/cat.c ============================================================================== --- head/bin/cat/cat.c Fri Jul 20 07:49:26 2012 (r238651) +++ head/bin/cat/cat.c Fri Jul 20 08:31:36 2012 (r238652) @@ -58,11 +58,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include static int bflag, eflag, nflag, sflag, tflag, vflag; static int rval; @@ -77,16 +77,20 @@ static void raw_cat(int); static int udom_open(const char *path, int flags); #endif -/* Memory strategy threshold, in pages: if physmem is larger then this, use a - * large buffer */ -#define PHYSPAGES_THRESHOLD (32*1024) - -/* Maximum buffer size in bytes - do not allow it to grow larger than this */ -#define BUFSIZE_MAX (2*1024*1024) - -/* Small (default) buffer size in bytes. It's inefficient for this to be - * smaller than MAXPHYS */ -#define BUFSIZE_SMALL (MAXPHYS) +/* + * Memory strategy threshold, in pages: if physmem is larger than this, + * use a large buffer. + */ +#define PHYSPAGES_THRESHOLD (32 * 1024) + +/* Maximum buffer size in bytes - do not allow it to grow larger than this. */ +#define BUFSIZE_MAX (2 * 1024 * 1024) + +/* + * Small (default) buffer size in bytes. It's inefficient for this to be + * smaller than MAXPHYS. + */ +#define BUFSIZE_SMALL (MAXPHYS) int main(int argc, char *argv[]) @@ -144,13 +148,12 @@ usage(void) static void scanfiles(char *argv[], int cooked) { - int i = 0; + int fd, i; char *path; FILE *fp; + i = 0; while ((path = argv[i]) != NULL || i == 0) { - int fd; - if (path == NULL || strcmp(path, "-") == 0) { filename = "stdin"; fd = STDIN_FILENO; @@ -261,12 +264,12 @@ raw_cat(int rfd) if (S_ISREG(sbuf.st_mode)) { /* If there's plenty of RAM, use a large copy buffer */ if (sysconf(_SC_PHYS_PAGES) > PHYSPAGES_THRESHOLD) - bsize = MIN(BUFSIZE_MAX, MAXPHYS*8); + bsize = MIN(BUFSIZE_MAX, MAXPHYS * 8); else bsize = BUFSIZE_SMALL; } else - bsize = MAX(sbuf.st_blksize, - (blksize_t)sysconf(_SC_PAGESIZE)); + bsize = MAX(sbuf.st_blksize, + (blksize_t)sysconf(_SC_PAGESIZE)); if ((buf = malloc(bsize)) == NULL) err(1, "malloc() failure of IO buffer"); } @@ -327,7 +330,7 @@ udom_open(const char *path, int flags) break; } } - return(fd); + return (fd); } #endif From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 08:33:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 995AE106566B; Fri, 20 Jul 2012 08:33:24 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 847038FC14; Fri, 20 Jul 2012 08:33:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K8XOQw073839; Fri, 20 Jul 2012 08:33:24 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K8XOow073837; Fri, 20 Jul 2012 08:33:24 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201207200833.q6K8XOow073837@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 20 Jul 2012 08:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238653 - head/bin/cat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 08:33:24 -0000 Author: jh Date: Fri Jul 20 08:33:23 2012 New Revision: 238653 URL: http://svn.freebsd.org/changeset/base/238653 Log: Use proper error message when fstat(2) fails on stdout. PR: bin/159746 Submitted by: Alex K. Modified: head/bin/cat/cat.c Modified: head/bin/cat/cat.c ============================================================================== --- head/bin/cat/cat.c Fri Jul 20 08:31:36 2012 (r238652) +++ head/bin/cat/cat.c Fri Jul 20 08:33:23 2012 (r238653) @@ -260,7 +260,7 @@ raw_cat(int rfd) wfd = fileno(stdout); if (buf == NULL) { if (fstat(wfd, &sbuf)) - err(1, "%s", filename); + err(1, "stdout"); if (S_ISREG(sbuf.st_mode)) { /* If there's plenty of RAM, use a large copy buffer */ if (sysconf(_SC_PHYS_PAGES) > PHYSPAGES_THRESHOLD) From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 09:49:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A3A01065677; Fri, 20 Jul 2012 09:49:51 +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 CFC878FC17; Fri, 20 Jul 2012 09:49:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6K9noTM079193; Fri, 20 Jul 2012 09:49:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6K9noBM079190; Fri, 20 Jul 2012 09:49:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207200949.q6K9noBM079190@svn.freebsd.org> From: Michael Tuexen Date: Fri, 20 Jul 2012 09:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238655 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 09:49:51 -0000 Author: tuexen Date: Fri Jul 20 09:49:50 2012 New Revision: 238655 URL: http://svn.freebsd.org/changeset/base/238655 Log: MFC r238550: Fix a refcount bug when freeing an association. While there: Change code to be consistent. Discussed with: rrs Approved by: re (kib) Modified: stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Fri Jul 20 08:36:53 2012 (r238654) +++ stable/9/sys/netinet/sctp_pcb.c Fri Jul 20 09:49:50 2012 (r238655) @@ -4984,6 +4984,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, /* now clean up any chunks here */ TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { TAILQ_REMOVE(&outs->outqueue, sp, next); + sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { if (so) { /* Still an open socket - report */ @@ -4994,19 +4995,14 @@ sctp_free_assoc(struct sctp_inpcb *inp, sctp_m_freem(sp->data); sp->data = NULL; sp->tail_mbuf = NULL; + sp->length = 0; } } if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; } - sctp_free_spbufspace(stcb, asoc, sp); - if (sp->holds_key_ref) - sctp_auth_key_release(stcb, sp->auth_keyid, SCTP_SO_LOCKED); - /* Free the zone stuff */ - SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_strmoq), sp); - SCTP_DECR_STRMOQ_COUNT(); - /* sa_ignore FREED_MEMORY */ + sctp_free_a_strmoq(stcb, sp, SCTP_SO_LOCKED); } } /* sa_ignore FREED_MEMORY */ Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Fri Jul 20 08:36:53 2012 (r238654) +++ stable/9/sys/netinet/sctputil.c Fri Jul 20 09:49:50 2012 (r238655) @@ -3774,6 +3774,8 @@ sctp_report_all_outbound(struct sctp_tcb if (sp->data) { sctp_m_freem(sp->data); sp->data = NULL; + sp->tail_mbuf = NULL; + sp->length = 0; } } if (sp->net) { @@ -4887,7 +4889,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t /* * Pull any data to free up the SB * and allow sender to "add more" - * whilc we will throw away :-) + * while we will throw away :-) */ sctp_free_spbufspace(stcb, &stcb->asoc, sp); @@ -4895,9 +4897,9 @@ sctp_release_pr_sctp_chunk(struct sctp_t do_wakeup_routine = 1; sp->some_taken = 1; sctp_m_freem(sp->data); - sp->length = 0; sp->data = NULL; sp->tail_mbuf = NULL; + sp->length = 0; } break; } From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 10:13:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A77DF1065673; Fri, 20 Jul 2012 10:13:13 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 62D948FC22; Fri, 20 Jul 2012 10:13:13 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id C12DA6422; Fri, 20 Jul 2012 12:13:12 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 91D2E8156; Fri, 20 Jul 2012 12:13:12 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Chris Rees References: <201207181928.q6IJSMgZ003200@svn.freebsd.org> <50080D5A.9040807@FreeBSD.org> Date: Fri, 20 Jul 2012 12:13:12 +0200 In-Reply-To: (Chris Rees's message of "Fri, 20 Jul 2012 07:43:47 +0100") Message-ID: <86k3xyd9l3.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r238602 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 10:13:13 -0000 Chris Rees writes: > Dimitry Andric writes: > > Dag-Erling Smorgrav writes: > > > Log: > > > Add -g (gigabyte) flag to complement -k (kilobyte) and -m (megabyte= ). > > Too bad -t is already taken. :) > -T is not however-- POLA issue or no big deal? I doubt there's much use for it at the moment. Let's talk again in a couple of years' time :) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 16:56:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7627B1065670; Fri, 20 Jul 2012 16:56:35 +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 60D278FC08; Fri, 20 Jul 2012 16:56:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6KGuZlE017265; Fri, 20 Jul 2012 16:56:35 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6KGuZVw017263; Fri, 20 Jul 2012 16:56:35 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207201656.q6KGuZVw017263@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 20 Jul 2012 16:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238656 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 16:56:35 -0000 Author: trasz Date: Fri Jul 20 16:56:34 2012 New Revision: 238656 URL: http://svn.freebsd.org/changeset/base/238656 Log: Make ZVOL resizing ('zfs set volsize') properly resize the GEOM provider. Sponsored by: FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jul 20 09:49:50 2012 (r238655) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Jul 20 16:56:34 2012 (r238656) @@ -177,15 +177,9 @@ zvol_size_changed(zvol_state_t *zv) pp = zv->zv_provider; if (pp == NULL) return; - if (zv->zv_volsize == pp->mediasize) - return; - /* - * Changing provider size is not really supported by GEOM, but it - * should be safe when provider is closed. - */ - if (zv->zv_total_opens > 0) - return; - pp->mediasize = zv->zv_volsize; + g_topology_lock(); + g_resize_provider(pp, zv->zv_volsize); + g_topology_unlock(); #endif /* !sun */ } From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 17:51:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4B42106566C; Fri, 20 Jul 2012 17:51:20 +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 AF2EB8FC1C; Fri, 20 Jul 2012 17:51:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6KHpKXR022212; Fri, 20 Jul 2012 17:51:20 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6KHpKiQ022210; Fri, 20 Jul 2012 17:51:20 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207201751.q6KHpKiQ022210@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 20 Jul 2012 17:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238657 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 17:51:20 -0000 Author: trasz Date: Fri Jul 20 17:51:20 2012 New Revision: 238657 URL: http://svn.freebsd.org/changeset/base/238657 Log: Make it possible to resize opened partitions. Sponsored by: FreeBSD Foundation Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri Jul 20 16:56:34 2012 (r238656) +++ head/sys/geom/part/g_part.c Fri Jul 20 17:51:20 2012 (r238657) @@ -1257,6 +1257,7 @@ g_part_ctl_resize(struct gctl_req *req, struct sbuf *sb; quad_t end; int error; + off_t mediasize; gp = gpp->gpp_geom; G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, gp->name)); @@ -1301,8 +1302,11 @@ g_part_ctl_resize(struct gctl_req *req, pp = entry->gpe_pp; if ((g_debugflags & 16) == 0 && (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) { - gctl_error(req, "%d", EBUSY); - return (EBUSY); + if (entry->gpe_end - entry->gpe_start + 1 > gpp->gpp_size) { + /* Deny shrinking of an opened partition. */ + gctl_error(req, "%d", EBUSY); + return (EBUSY); + } } error = G_PART_RESIZE(table, entry, gpp); @@ -1315,8 +1319,9 @@ g_part_ctl_resize(struct gctl_req *req, entry->gpe_modified = 1; /* update mediasize of changed provider */ - pp->mediasize = (entry->gpe_end - entry->gpe_start + 1) * + mediasize = (entry->gpe_end - entry->gpe_start + 1) * pp->sectorsize; + g_resize_provider(pp, mediasize); /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 19:35:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA8B21065670; Fri, 20 Jul 2012 19:35:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A09538FC1A; Fri, 20 Jul 2012 19:35:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6KJZKF8029665; Fri, 20 Jul 2012 19:35:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6KJZK16029661; Fri, 20 Jul 2012 19:35:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207201935.q6KJZK16029661@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Jul 2012 19:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238658 - in stable/8/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 19:35:20 -0000 Author: mav Date: Fri Jul 20 19:35:20 2012 New Revision: 238658 URL: http://svn.freebsd.org/changeset/base/238658 Log: Partially MFC r212541: Refactor cpu_idle() on x86. Use MONITOR/MWAIT instrunctions (if supported) under high sleep/wakeup rate, as fast alternative to other methods. It allows SMP scheduler to wake up sleeping CPUs much faster without using IPI, significantly increasing performance on some highly task-switching loads. Also on such loads it hides two ACPI timer reads, otherwise done by acpi_cpu_idle(), that are reported to be slow on some systems. MFC r225936 (by attilio): Add some improvements in the idle table callbacks: - Replace instances of manual assembly instruction "hlt" call with halt() function calling. - In cpu_idle_mwait() avoid races in check to sched_runnable() using the same pattern used in cpu_idle_hlt() with the 'hlt' instruction. - Add comments explaining the logic behind the pattern used in cpu_idle_hlt() and other idle callbacks. PR: kern/170021 Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/i386/i386/machdep.c stable/8/sys/pc98/pc98/machdep.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Fri Jul 20 17:51:20 2012 (r238657) +++ stable/8/sys/amd64/amd64/machdep.c Fri Jul 20 19:35:20 2012 (r238658) @@ -629,63 +629,122 @@ void cpu_halt(void) { for (;;) - __asm__ ("hlt"); + halt(); } void (*cpu_idle_hook)(void) = NULL; /* ACPI idle hook. */ +static int cpu_ident_amdc1e = 0; /* AMD C1E supported. */ +static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ +TUNABLE_INT("machdep.idle_mwait", &idle_mwait); +SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait, + 0, "Use MONITOR/MWAIT for short idle"); + +#define STATE_RUNNING 0x0 +#define STATE_MWAIT 0x1 +#define STATE_SLEEPING 0x2 + +static void +cpu_idle_acpi(int busy) +{ + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_SLEEPING; + + /* See comments in cpu_idle_hlt(). */ + disable_intr(); + if (sched_runnable()) + enable_intr(); + else if (cpu_idle_hook) + cpu_idle_hook(); + else + __asm __volatile("sti; hlt"); + *state = STATE_RUNNING; +} static void cpu_idle_hlt(int busy) { + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_SLEEPING; + /* - * we must absolutely guarentee that hlt is the next instruction - * after sti or we introduce a timing window. + * Since we may be in a critical section from cpu_idle(), if + * an interrupt fires during that critical section we may have + * a pending preemption. If the CPU halts, then that thread + * may not execute until a later interrupt awakens the CPU. + * To handle this race, check for a runnable thread after + * disabling interrupts and immediately return if one is + * found. Also, we must absolutely guarentee that hlt is + * the next instruction after sti. This ensures that any + * interrupt that fires after the call to disable_intr() will + * immediately awaken the CPU from hlt. Finally, please note + * that on x86 this works fine because of interrupts enabled only + * after the instruction following sti takes place, while IF is set + * to 1 immediately, allowing hlt instruction to acknowledge the + * interrupt. */ disable_intr(); - if (sched_runnable()) + if (sched_runnable()) enable_intr(); else __asm __volatile("sti; hlt"); + *state = STATE_RUNNING; } +/* + * MWAIT cpu power states. Lower 4 bits are sub-states. + */ +#define MWAIT_C0 0xf0 +#define MWAIT_C1 0x00 +#define MWAIT_C2 0x10 +#define MWAIT_C3 0x20 +#define MWAIT_C4 0x30 + static void -cpu_idle_acpi(int busy) +cpu_idle_mwait(int busy) { + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_MWAIT; + + /* See comments in cpu_idle_hlt(). */ disable_intr(); - if (sched_runnable()) + if (sched_runnable()) { enable_intr(); - else if (cpu_idle_hook) - cpu_idle_hook(); + *state = STATE_RUNNING; + return; + } + cpu_monitor(state, 0, 0); + if (*state == STATE_MWAIT) + __asm __volatile("sti; mwait" : : "a" (MWAIT_C1), "c" (0)); else - __asm __volatile("sti; hlt"); + enable_intr(); + *state = STATE_RUNNING; } -static int cpu_ident_amdc1e = 0; - -static int -cpu_probe_amdc1e(void) +static void +cpu_idle_spin(int busy) { + int *state; int i; - /* - * Forget it, if we're not using local APIC timer. - */ - if (resource_disabled("apic", 0) || - (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0)) - return (0); + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_RUNNING; /* - * Detect the presence of C1E capability mostly on latest - * dual-cores (or future) k8 family. - */ - if (cpu_vendor_id == CPU_VENDOR_AMD && - (cpu_id & 0x00000f00) == 0x00000f00 && - (cpu_id & 0x0fff0000) >= 0x00040000) { - cpu_ident_amdc1e = 1; - return (1); + * The sched_runnable() call is racy but as long as there is + * a loop missing it one time will have just a little impact if any + * (and it is much better than missing the check at all). + */ + for (i = 0; i < 1000; i++) { + if (sched_runnable()) + return; + cpu_spinwait(); } - - return (0); } /* @@ -703,110 +762,66 @@ cpu_probe_amdc1e(void) #define AMDK8_CMPHALT (AMDK8_SMIONCMPHALT | AMDK8_C1EONCMPHALT) static void -cpu_idle_amdc1e(int busy) +cpu_probe_amdc1e(void) { - disable_intr(); - if (sched_runnable()) - enable_intr(); - else { - uint64_t msr; - - msr = rdmsr(MSR_AMDK8_IPM); - if (msr & AMDK8_CMPHALT) - wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); - - if (cpu_idle_hook) - cpu_idle_hook(); - else - __asm __volatile("sti; hlt"); + /* + * Detect the presence of C1E capability mostly on latest + * dual-cores (or future) k8 family. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && + (cpu_id & 0x00000f00) == 0x00000f00 && + (cpu_id & 0x0fff0000) >= 0x00040000) { + cpu_ident_amdc1e = 1; } } -static void -cpu_idle_spin(int busy) -{ - return; -} - void (*cpu_idle_fn)(int) = cpu_idle_acpi; void cpu_idle(int busy) { + uint64_t msr; + #ifdef SMP if (mp_grab_cpu_hlt()) return; #endif - cpu_idle_fn(busy); -} - -/* - * mwait cpu power states. Lower 4 bits are sub-states. - */ -#define MWAIT_C0 0xf0 -#define MWAIT_C1 0x00 -#define MWAIT_C2 0x10 -#define MWAIT_C3 0x20 -#define MWAIT_C4 0x30 - -#define MWAIT_DISABLED 0x0 -#define MWAIT_WOKEN 0x1 -#define MWAIT_WAITING 0x2 - -static void -cpu_idle_mwait(int busy) -{ - int *mwait; - - mwait = (int *)PCPU_PTR(monitorbuf); - *mwait = MWAIT_WAITING; - if (sched_runnable()) - return; - cpu_monitor(mwait, 0, 0); - if (*mwait == MWAIT_WAITING) - cpu_mwait(0, MWAIT_C1); -} - -static void -cpu_idle_mwait_hlt(int busy) -{ - int *mwait; + /* If we are busy - try to use fast methods. */ + if (busy) { + if ((cpu_feature2 & CPUID2_MON) && idle_mwait) { + cpu_idle_mwait(busy); + return; + } + } - mwait = (int *)PCPU_PTR(monitorbuf); - if (busy == 0) { - *mwait = MWAIT_DISABLED; - cpu_idle_hlt(busy); - return; + /* Apply AMD APIC timer C1E workaround. */ + if (cpu_ident_amdc1e) { + msr = rdmsr(MSR_AMDK8_IPM); + if (msr & AMDK8_CMPHALT) + wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); } - *mwait = MWAIT_WAITING; - if (sched_runnable()) - return; - cpu_monitor(mwait, 0, 0); - if (*mwait == MWAIT_WAITING) - cpu_mwait(0, MWAIT_C1); + + /* Call main idle method. */ + cpu_idle_fn(busy); } int cpu_idle_wakeup(int cpu) { struct pcpu *pcpu; - int *mwait; + int *state; - if (cpu_idle_fn == cpu_idle_spin) - return (1); - if (cpu_idle_fn != cpu_idle_mwait && cpu_idle_fn != cpu_idle_mwait_hlt) - return (0); pcpu = pcpu_find(cpu); - mwait = (int *)pcpu->pc_monitorbuf; + state = (int *)pcpu->pc_monitorbuf; /* * This doesn't need to be atomic since missing the race will * simply result in unnecessary IPIs. */ - if (cpu_idle_fn == cpu_idle_mwait_hlt && *mwait == MWAIT_DISABLED) + if (*state == STATE_SLEEPING) return (0); - *mwait = MWAIT_WOKEN; - + if (*state == STATE_MWAIT) + *state = STATE_RUNNING; return (1); } @@ -819,8 +834,6 @@ struct { } idle_tbl[] = { { cpu_idle_spin, "spin" }, { cpu_idle_mwait, "mwait" }, - { cpu_idle_mwait_hlt, "mwait_hlt" }, - { cpu_idle_amdc1e, "amdc1e" }, { cpu_idle_hlt, "hlt" }, { cpu_idle_acpi, "acpi" }, { NULL, NULL } @@ -839,8 +852,8 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; - if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 && - cpu_ident_amdc1e == 0) + if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && + cpu_idle_hook == NULL) continue; p += sprintf(p, "%s, ", idle_tbl[i].id_name); } @@ -849,6 +862,9 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG return (error); } +SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, + 0, 0, idle_sysctl_available, "A", "list of available idle functions"); + static int idle_sysctl(SYSCTL_HANDLER_ARGS) { @@ -872,8 +888,8 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; - if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 && - cpu_ident_amdc1e == 0) + if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && + cpu_idle_hook == NULL) continue; if (strcmp(idle_tbl[i].id_name, buf)) continue; @@ -883,9 +899,6 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); } -SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, idle_sysctl_available, "A", "list of available idle functions"); - SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, idle_sysctl, "A", "currently selected idle function"); @@ -1819,8 +1832,7 @@ hammer_time(u_int64_t modulep, u_int64_t } #endif - if (cpu_probe_amdc1e()) - cpu_idle_fn = cpu_idle_amdc1e; + cpu_probe_amdc1e(); /* Location of kernel stack for locore */ return ((u_int64_t)thread0.td_pcb); Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Fri Jul 20 17:51:20 2012 (r238657) +++ stable/8/sys/i386/i386/machdep.c Fri Jul 20 19:35:20 2012 (r238658) @@ -1177,9 +1177,6 @@ cpu_est_clockrate(int cpu_id, uint64_t * return (0); } - -void (*cpu_idle_hook)(void) = NULL; /* ACPI idle hook. */ - #ifdef XEN void @@ -1207,66 +1204,127 @@ void cpu_halt(void) { for (;;) - __asm__ ("hlt"); + halt(); } +#endif + +void (*cpu_idle_hook)(void) = NULL; /* ACPI idle hook. */ +static int cpu_ident_amdc1e = 0; /* AMD C1E supported. */ +static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ +TUNABLE_INT("machdep.idle_mwait", &idle_mwait); +SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait, + 0, "Use MONITOR/MWAIT for short idle"); + +#define STATE_RUNNING 0x0 +#define STATE_MWAIT 0x1 +#define STATE_SLEEPING 0x2 + +static void +cpu_idle_acpi(int busy) +{ + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_SLEEPING; + + /* See comments in cpu_idle_hlt(). */ + disable_intr(); + if (sched_runnable()) + enable_intr(); + else if (cpu_idle_hook) + cpu_idle_hook(); + else + __asm __volatile("sti; hlt"); + *state = STATE_RUNNING; +} + +#ifndef XEN static void cpu_idle_hlt(int busy) { + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_SLEEPING; + /* - * we must absolutely guarentee that hlt is the next instruction - * after sti or we introduce a timing window. + * Since we may be in a critical section from cpu_idle(), if + * an interrupt fires during that critical section we may have + * a pending preemption. If the CPU halts, then that thread + * may not execute until a later interrupt awakens the CPU. + * To handle this race, check for a runnable thread after + * disabling interrupts and immediately return if one is + * found. Also, we must absolutely guarentee that hlt is + * the next instruction after sti. This ensures that any + * interrupt that fires after the call to disable_intr() will + * immediately awaken the CPU from hlt. Finally, please note + * that on x86 this works fine because of interrupts enabled only + * after the instruction following sti takes place, while IF is set + * to 1 immediately, allowing hlt instruction to acknowledge the + * interrupt. */ disable_intr(); - if (sched_runnable()) + if (sched_runnable()) enable_intr(); else __asm __volatile("sti; hlt"); + *state = STATE_RUNNING; } #endif +/* + * MWAIT cpu power states. Lower 4 bits are sub-states. + */ +#define MWAIT_C0 0xf0 +#define MWAIT_C1 0x00 +#define MWAIT_C2 0x10 +#define MWAIT_C3 0x20 +#define MWAIT_C4 0x30 + static void -cpu_idle_acpi(int busy) +cpu_idle_mwait(int busy) { + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_MWAIT; + + /* See comments in cpu_idle_hlt(). */ disable_intr(); - if (sched_runnable()) + if (sched_runnable()) { enable_intr(); - else if (cpu_idle_hook) - cpu_idle_hook(); + *state = STATE_RUNNING; + return; + } + cpu_monitor(state, 0, 0); + if (*state == STATE_MWAIT) + __asm __volatile("sti; mwait" : : "a" (MWAIT_C1), "c" (0)); else - __asm __volatile("sti; hlt"); + enable_intr(); + *state = STATE_RUNNING; } -static int cpu_ident_amdc1e = 0; - -#if !defined(XEN) || defined(XEN_PRIVILEGED) -static int -cpu_probe_amdc1e(void) -{ -#ifdef DEV_APIC +static void +cpu_idle_spin(int busy) +{ + int *state; int i; - /* - * Forget it, if we're not using local APIC timer. - */ - if (resource_disabled("apic", 0) || - (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0)) - return (0); + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_RUNNING; /* - * Detect the presence of C1E capability mostly on latest - * dual-cores (or future) k8 family. - */ - if (cpu_vendor_id == CPU_VENDOR_AMD && - (cpu_id & 0x00000f00) == 0x00000f00 && - (cpu_id & 0x0fff0000) >= 0x00040000) { - cpu_ident_amdc1e = 1; - return (1); + * The sched_runnable() call is racy but as long as there is + * a loop missing it one time will have just a little impact if any + * (and it is much better than missing the check at all). + */ + for (i = 0; i < 1000; i++) { + if (sched_runnable()) + return; + cpu_spinwait(); } -#endif - return (0); } -#endif /* * C1E renders the local APIC timer dead, so we disable it by @@ -1283,32 +1341,20 @@ cpu_probe_amdc1e(void) #define AMDK8_CMPHALT (AMDK8_SMIONCMPHALT | AMDK8_C1EONCMPHALT) static void -cpu_idle_amdc1e(int busy) +cpu_probe_amdc1e(void) { - disable_intr(); - if (sched_runnable()) - enable_intr(); - else { - uint64_t msr; - - msr = rdmsr(MSR_AMDK8_IPM); - if (msr & AMDK8_CMPHALT) - wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); - - if (cpu_idle_hook) - cpu_idle_hook(); - else - __asm __volatile("sti; hlt"); + /* + * Detect the presence of C1E capability mostly on latest + * dual-cores (or future) k8 family. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && + (cpu_id & 0x00000f00) == 0x00000f00 && + (cpu_id & 0x0fff0000) >= 0x00040000) { + cpu_ident_amdc1e = 1; } } -static void -cpu_idle_spin(int busy) -{ - return; -} - #ifdef XEN void (*cpu_idle_fn)(int) = cpu_idle_hlt; #else @@ -1318,79 +1364,51 @@ void (*cpu_idle_fn)(int) = cpu_idle_acpi void cpu_idle(int busy) { +#ifndef XEN + uint64_t msr; +#endif + #if defined(SMP) && !defined(XEN) if (mp_grab_cpu_hlt()) return; #endif - cpu_idle_fn(busy); -} - -/* - * mwait cpu power states. Lower 4 bits are sub-states. - */ -#define MWAIT_C0 0xf0 -#define MWAIT_C1 0x00 -#define MWAIT_C2 0x10 -#define MWAIT_C3 0x20 -#define MWAIT_C4 0x30 - -#define MWAIT_DISABLED 0x0 -#define MWAIT_WOKEN 0x1 -#define MWAIT_WAITING 0x2 - -static void -cpu_idle_mwait(int busy) -{ - int *mwait; - - mwait = (int *)PCPU_PTR(monitorbuf); - *mwait = MWAIT_WAITING; - if (sched_runnable()) - return; - cpu_monitor(mwait, 0, 0); - if (*mwait == MWAIT_WAITING) - cpu_mwait(0, MWAIT_C1); -} - -static void -cpu_idle_mwait_hlt(int busy) -{ - int *mwait; +#ifndef XEN + /* If we are busy - try to use fast methods. */ + if (busy) { + if ((cpu_feature2 & CPUID2_MON) && idle_mwait) { + cpu_idle_mwait(busy); + return; + } + } - mwait = (int *)PCPU_PTR(monitorbuf); - if (busy == 0) { - *mwait = MWAIT_DISABLED; - cpu_idle_hlt(busy); - return; + /* Apply AMD APIC timer C1E workaround. */ + if (cpu_ident_amdc1e) { + msr = rdmsr(MSR_AMDK8_IPM); + if (msr & AMDK8_CMPHALT) + wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); } - *mwait = MWAIT_WAITING; - if (sched_runnable()) - return; - cpu_monitor(mwait, 0, 0); - if (*mwait == MWAIT_WAITING) - cpu_mwait(0, MWAIT_C1); +#endif + + /* Call main idle method. */ + cpu_idle_fn(busy); } int cpu_idle_wakeup(int cpu) { struct pcpu *pcpu; - int *mwait; + int *state; - if (cpu_idle_fn == cpu_idle_spin) - return (1); - if (cpu_idle_fn != cpu_idle_mwait && cpu_idle_fn != cpu_idle_mwait_hlt) - return (0); pcpu = pcpu_find(cpu); - mwait = (int *)pcpu->pc_monitorbuf; + state = (int *)pcpu->pc_monitorbuf; /* * This doesn't need to be atomic since missing the race will * simply result in unnecessary IPIs. */ - if (cpu_idle_fn == cpu_idle_mwait_hlt && *mwait == MWAIT_DISABLED) + if (*state == STATE_SLEEPING) return (0); - *mwait = MWAIT_WOKEN; - + if (*state == STATE_MWAIT) + *state = STATE_RUNNING; return (1); } @@ -1403,8 +1421,6 @@ struct { } idle_tbl[] = { { cpu_idle_spin, "spin" }, { cpu_idle_mwait, "mwait" }, - { cpu_idle_mwait_hlt, "mwait_hlt" }, - { cpu_idle_amdc1e, "amdc1e" }, { cpu_idle_hlt, "hlt" }, { cpu_idle_acpi, "acpi" }, { NULL, NULL } @@ -1423,8 +1439,8 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; - if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 && - cpu_ident_amdc1e == 0) + if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && + cpu_idle_hook == NULL) continue; p += sprintf(p, "%s, ", idle_tbl[i].id_name); } @@ -1433,6 +1449,9 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG return (error); } +SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, + 0, 0, idle_sysctl_available, "A", "list of available idle functions"); + static int idle_sysctl(SYSCTL_HANDLER_ARGS) { @@ -1456,8 +1475,8 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; - if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 && - cpu_ident_amdc1e == 0) + if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && + cpu_idle_hook == NULL) continue; if (strcmp(idle_tbl[i].id_name, buf)) continue; @@ -1467,9 +1486,6 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); } -SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, idle_sysctl_available, "A", "list of available idle functions"); - SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, idle_sysctl, "A", "currently selected idle function"); @@ -2723,8 +2739,7 @@ init386(first) thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1]; #if defined(XEN_PRIVILEGED) - if (cpu_probe_amdc1e()) - cpu_idle_fn = cpu_idle_amdc1e; + cpu_probe_amdc1e(); #endif } @@ -3001,8 +3016,7 @@ init386(first) thread0.td_pcb->pcb_ext = 0; thread0.td_frame = &proc0_tf; - if (cpu_probe_amdc1e()) - cpu_idle_fn = cpu_idle_amdc1e; + cpu_probe_amdc1e(); } #endif Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Fri Jul 20 17:51:20 2012 (r238657) +++ stable/8/sys/pc98/pc98/machdep.c Fri Jul 20 19:35:20 2012 (r238658) @@ -1122,40 +1122,36 @@ cpu_halt(void) __asm__ ("hlt"); } +static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ +TUNABLE_INT("machdep.idle_mwait", &idle_mwait); +SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait, + 0, "Use MONITOR/MWAIT for short idle"); + +#define STATE_RUNNING 0x0 +#define STATE_MWAIT 0x1 +#define STATE_SLEEPING 0x2 + static void cpu_idle_hlt(int busy) { + int *state; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_SLEEPING; /* - * we must absolutely guarentee that hlt is the next instruction + * We must absolutely guarentee that hlt is the next instruction * after sti or we introduce a timing window. */ disable_intr(); - if (sched_runnable()) + if (sched_runnable()) enable_intr(); else __asm __volatile("sti; hlt"); -} - -static void -cpu_idle_spin(int busy) -{ - return; -} - -void (*cpu_idle_fn)(int) = cpu_idle_hlt; - -void -cpu_idle(int busy) -{ -#if defined(SMP) - if (mp_grab_cpu_hlt()) - return; -#endif - cpu_idle_fn(busy); + *state = STATE_RUNNING; } /* - * mwait cpu power states. Lower 4 bits are sub-states. + * MWAIT cpu power states. Lower 4 bits are sub-states. */ #define MWAIT_C0 0xf0 #define MWAIT_C1 0x00 @@ -1163,63 +1159,74 @@ cpu_idle(int busy) #define MWAIT_C3 0x20 #define MWAIT_C4 0x30 -#define MWAIT_DISABLED 0x0 -#define MWAIT_WOKEN 0x1 -#define MWAIT_WAITING 0x2 - static void cpu_idle_mwait(int busy) { - int *mwait; + int *state; - mwait = (int *)PCPU_PTR(monitorbuf); - *mwait = MWAIT_WAITING; - if (sched_runnable()) - return; - cpu_monitor(mwait, 0, 0); - if (*mwait == MWAIT_WAITING) - cpu_mwait(0, MWAIT_C1); + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_MWAIT; + if (!sched_runnable()) { + cpu_monitor(state, 0, 0); + if (*state == STATE_MWAIT) + cpu_mwait(0, MWAIT_C1); + } + *state = STATE_RUNNING; } static void -cpu_idle_mwait_hlt(int busy) +cpu_idle_spin(int busy) +{ + int *state; + int i; + + state = (int *)PCPU_PTR(monitorbuf); + *state = STATE_RUNNING; + for (i = 0; i < 1000; i++) { + if (sched_runnable()) + return; + cpu_spinwait(); + } +} + +void (*cpu_idle_fn)(int) = cpu_idle_hlt; + +void +cpu_idle(int busy) { - int *mwait; - mwait = (int *)PCPU_PTR(monitorbuf); - if (busy == 0) { - *mwait = MWAIT_DISABLED; - cpu_idle_hlt(busy); +#ifdef SMP + if (mp_grab_cpu_hlt()) return; +#endif + /* If we are busy - try to use fast methods. */ + if (busy) { + if ((cpu_feature2 & CPUID2_MON) && idle_mwait) { + cpu_idle_mwait(busy); + return; + } } - *mwait = MWAIT_WAITING; - if (sched_runnable()) - return; - cpu_monitor(mwait, 0, 0); - if (*mwait == MWAIT_WAITING) - cpu_mwait(0, MWAIT_C1); + + /* Call main idle method. */ + cpu_idle_fn(busy); } int cpu_idle_wakeup(int cpu) { struct pcpu *pcpu; - int *mwait; + int *state; - if (cpu_idle_fn == cpu_idle_spin) - return (1); - if (cpu_idle_fn != cpu_idle_mwait && cpu_idle_fn != cpu_idle_mwait_hlt) - return (0); pcpu = pcpu_find(cpu); - mwait = (int *)pcpu->pc_monitorbuf; + state = (int *)pcpu->pc_monitorbuf; /* * This doesn't need to be atomic since missing the race will * simply result in unnecessary IPIs. */ - if (cpu_idle_fn == cpu_idle_mwait_hlt && *mwait == MWAIT_DISABLED) + if (*state == STATE_SLEEPING) return (0); - *mwait = MWAIT_WOKEN; - + if (*state == STATE_MWAIT) + *state = STATE_RUNNING; return (1); } @@ -1232,7 +1239,6 @@ struct { } idle_tbl[] = { { cpu_idle_spin, "spin" }, { cpu_idle_mwait, "mwait" }, - { cpu_idle_mwait_hlt, "mwait_hlt" }, { cpu_idle_hlt, "hlt" }, { NULL, NULL } }; @@ -1257,6 +1263,9 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG return (error); } +SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, + 0, 0, idle_sysctl_available, "A", "list of available idle functions"); + static int idle_sysctl(SYSCTL_HANDLER_ARGS) { @@ -1288,9 +1297,6 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); } -SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, idle_sysctl_available, "A", "list of available idle functions"); - SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, idle_sysctl, "A", "currently selected idle function"); From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 21:09:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 761181065670; Fri, 20 Jul 2012 21:09:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 611EA8FC21; Fri, 20 Jul 2012 21:09:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6KL9bSh037213; Fri, 20 Jul 2012 21:09:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6KL9b0L037211; Fri, 20 Jul 2012 21:09:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207202109.q6KL9b0L037211@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Jul 2012 21:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238659 - stable/8/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 21:09:37 -0000 Author: mav Date: Fri Jul 20 21:09:36 2012 New Revision: 238659 URL: http://svn.freebsd.org/changeset/base/238659 Log: Fix XEN build after r238658. Modified: stable/8/sys/i386/i386/machdep.c Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Fri Jul 20 19:35:20 2012 (r238658) +++ stable/8/sys/i386/i386/machdep.c Fri Jul 20 21:09:36 2012 (r238659) @@ -2738,9 +2738,7 @@ init386(first) thread0.td_pcb->pcb_fsd = PCPU_GET(fsgs_gdt)[0]; thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1]; -#if defined(XEN_PRIVILEGED) cpu_probe_amdc1e(); -#endif } #else From owner-svn-src-all@FreeBSD.ORG Fri Jul 20 23:56:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A44E5106566B; Fri, 20 Jul 2012 23:56:24 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 850248FC16; Fri, 20 Jul 2012 23:56:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6KNuOf8054917; Fri, 20 Jul 2012 23:56:24 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6KNuOpq054914; Fri, 20 Jul 2012 23:56:24 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201207202356.q6KNuOpq054914@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 20 Jul 2012 23:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238660 - head/share/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 23:56:24 -0000 Author: gnn Date: Fri Jul 20 23:56:23 2012 New Revision: 238660 URL: http://svn.freebsd.org/changeset/base/238660 Log: Add a new script, hotopen, which shows what uid is opening files on a per second basis. While here clean up the Makefile as well. MFC after: 1 week Added: head/share/dtrace/hotopen (contents, props changed) Modified: head/share/dtrace/Makefile Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Fri Jul 20 21:09:36 2012 (r238659) +++ head/share/dtrace/Makefile Fri Jul 20 23:56:23 2012 (r238660) @@ -12,9 +12,9 @@ SUBDIR= ${_toolkit} _toolkit= toolkit .endif -SCRIPTS= nfsclienttime +SCRIPTS= nfsclienttime hotopen -SCRIPTSDIR= ${SHAREDIR}/dtrace/ +SCRIPTSDIR= ${SHAREDIR}/dtrace NO_OBJ= Added: head/share/dtrace/hotopen ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/hotopen Fri Jul 20 23:56:23 2012 (r238660) @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Copyright (c) 2012 George V. Neville-Neil +# All rights reserved. +# +# This software was developed at the University of Cambridge Computer +# Laboratory with support from a grant from Google, Inc. +# +# 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$ +# +# The hotopen D script periodically outputs table of which UIDs +# are opening files. This is a very quick way to find out if +# a paritcular user is thrashing a system with rapid calls to +# open/close. +# +# Usage: hotopen +# + +/usr/sbin/dtrace -n ' +#pragma D option quiet +BEGIN +{ + printf("Files opened per UID in the last second.\n"); +} + +syscall::open:entry +{ + @files[uid] = count(); + output = 1; +} + +tick-1sec +/output != 0/ +{ + printf("%-20Y \n", walltimestamp); + printa("uid %d\tcount %@d\n", @files, @files); + trunc(@files); + output = 0; +} +' From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 01:07:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54CBB106564A; Sat, 21 Jul 2012 01:07:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E89A8FC14; Sat, 21 Jul 2012 01:07:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6L176dK062299; Sat, 21 Jul 2012 01:07:06 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6L176Cl062297; Sat, 21 Jul 2012 01:07:06 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201207210107.q6L176Cl062297@svn.freebsd.org> From: Glen Barber Date: Sat, 21 Jul 2012 01:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238662 - stable/9/usr.sbin/wpa/hostapd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 01:07:06 -0000 Author: gjb (doc,ports committer) Date: Sat Jul 21 01:07:05 2012 New Revision: 238662 URL: http://svn.freebsd.org/changeset/base/238662 Log: MFC r231257, r238606: r231257 (kevlo): Mention run(4) r238606: Xref mwl(4) and rum(4) in hostapd(8). Approved by: re (kib) Modified: stable/9/usr.sbin/wpa/hostapd/hostapd.8 Directory Properties: stable/9/usr.sbin/wpa/hostapd/ (props changed) Modified: stable/9/usr.sbin/wpa/hostapd/hostapd.8 ============================================================================== --- stable/9/usr.sbin/wpa/hostapd/hostapd.8 Sat Jul 21 00:28:11 2012 (r238661) +++ stable/9/usr.sbin/wpa/hostapd/hostapd.8 Sat Jul 21 01:07:05 2012 (r238662) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2007 +.Dd July 18, 2012 .Dt HOSTAPD 8 .Os .Sh NAME @@ -111,7 +111,10 @@ Store PID in .Xr ath 4 , .Xr ipw 4 , .Xr iwi 4 , +.Xr mwl 4 , .Xr ral 4 , +.Xr rum 4 , +.Xr run 4 , .Xr ural 4 , .Xr wi 4 , .Xr hostapd.conf 5 , From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 01:13:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19A121065670; Sat, 21 Jul 2012 01:13:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04DB18FC1F; Sat, 21 Jul 2012 01:13:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6L1DjPe063057; Sat, 21 Jul 2012 01:13:45 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6L1DjKS063054; Sat, 21 Jul 2012 01:13:45 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201207210113.q6L1DjKS063054@svn.freebsd.org> From: Glen Barber Date: Sat, 21 Jul 2012 01:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238663 - stable/8/usr.sbin/wpa/hostapd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 01:13:46 -0000 Author: gjb (doc,ports committer) Date: Sat Jul 21 01:13:45 2012 New Revision: 238663 URL: http://svn.freebsd.org/changeset/base/238663 Log: MFC r231257, r238606: r231257 (kevlo): Mention run(4) r238606: Xref mwl(4) and rum(4) in hostapd(8). Modified: stable/8/usr.sbin/wpa/hostapd/hostapd.8 Directory Properties: stable/8/usr.sbin/wpa/hostapd/ (props changed) Modified: stable/8/usr.sbin/wpa/hostapd/hostapd.8 ============================================================================== --- stable/8/usr.sbin/wpa/hostapd/hostapd.8 Sat Jul 21 01:07:05 2012 (r238662) +++ stable/8/usr.sbin/wpa/hostapd/hostapd.8 Sat Jul 21 01:13:45 2012 (r238663) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2007 +.Dd July 18, 2012 .Dt HOSTAPD 8 .Os .Sh NAME @@ -111,7 +111,10 @@ Store PID in .Xr ath 4 , .Xr ipw 4 , .Xr iwi 4 , +.Xr mwl 4 , .Xr ral 4 , +.Xr rum 4 , +.Xr run 4 , .Xr ural 4 , .Xr wi 4 , .Xr hostapd.conf 5 , From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 07:14:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49B3A1065672; Sat, 21 Jul 2012 07:14:53 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 350698FC18; Sat, 21 Jul 2012 07:14:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6L7ErT7098851; Sat, 21 Jul 2012 07:14:53 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6L7ErGs098849; Sat, 21 Jul 2012 07:14:53 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201207210714.q6L7ErGs098849@svn.freebsd.org> From: "George V. Neville-Neil" Date: Sat, 21 Jul 2012 07:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238665 - head/share/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 07:14:53 -0000 Author: gnn Date: Sat Jul 21 07:14:52 2012 New Revision: 238665 URL: http://svn.freebsd.org/changeset/base/238665 Log: Remove copy/pasteo in the copyright notice. Modified: head/share/dtrace/hotopen Modified: head/share/dtrace/hotopen ============================================================================== --- head/share/dtrace/hotopen Sat Jul 21 04:15:38 2012 (r238664) +++ head/share/dtrace/hotopen Sat Jul 21 07:14:52 2012 (r238665) @@ -3,9 +3,6 @@ # Copyright (c) 2012 George V. Neville-Neil # All rights reserved. # -# This software was developed at the University of Cambridge Computer -# Laboratory with support from a grant from Google, Inc. -# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 08:19:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FC771065679; Sat, 21 Jul 2012 08:19:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A2078FC1E; Sat, 21 Jul 2012 08:19:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6L8JhBj005314; Sat, 21 Jul 2012 08:19:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6L8JhLe005312; Sat, 21 Jul 2012 08:19:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207210819.q6L8JhLe005312@svn.freebsd.org> From: Alexander Motin Date: Sat, 21 Jul 2012 08:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238666 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 08:19:44 -0000 Author: mav Date: Sat Jul 21 08:19:43 2012 New Revision: 238666 URL: http://svn.freebsd.org/changeset/base/238666 Log: Fix typo in bzero length argument during sense fetching. For me it at least fixed CD burning in PIO mode. MFC after: 3 days Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sat Jul 21 07:14:52 2012 (r238665) +++ head/sys/dev/ata/ata-all.c Sat Jul 21 08:19:43 2012 (r238666) @@ -1532,7 +1532,7 @@ ata_cam_request_sense(device_t dev, stru ch->requestsense = 1; - bzero(request, sizeof(&request)); + bzero(request, sizeof(*request)); request->dev = NULL; request->parent = dev; request->unit = ccb->ccb_h.target_id; From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 12:22:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 646C4106566C; Sat, 21 Jul 2012 12:22:36 +0000 (UTC) (envelope-from Daan@vitsch.nl) Received: from VM01.VEHosting.nl (VM016.VEHosting.nl [IPv6:2001:1af8:2100:b020::140]) by mx1.freebsd.org (Postfix) with ESMTP id 001598FC0A; Sat, 21 Jul 2012 12:22:35 +0000 (UTC) Received: from [2001:470:d233:2:224:8cff:fe82:66cd] ([IPv6:2001:470:d233:2:224:8cff:fe82:66cd]) (authenticated bits=0) by VM01.VEHosting.nl (8.14.3/8.13.8) with ESMTP id q6LCMamd063737; Sat, 21 Jul 2012 14:22:36 +0200 (CEST) (envelope-from Daan@vitsch.nl) From: Daan Vreeken Organization: Vitsch Electronics To: Gleb Smirnoff Date: Sat, 21 Jul 2012 14:22:33 +0200 User-Agent: KMail/1.9.10 References: <201206181056.q5IAuUwX075136@svn.freebsd.org> In-Reply-To: <201206181056.q5IAuUwX075136@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201207211422.33791.Daan@vitsch.nl> x-ve-auth-version: mi-1.1.5 2011-02-07 - Copyright (c) 2008, 2011 - Daan Vreeken - VEHosting x-ve-auth: authenticated as 'pa4dan' on VM01.VEHosting.nl Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r237224 - stable/9/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 12:22:36 -0000 Hi Gleb, On Monday 18 June 2012 12:56:30 Gleb Smirnoff wrote: > Author: glebius > Date: Mon Jun 18 10:56:29 2012 > New Revision: 237224 > URL: http://svn.freebsd.org/changeset/base/237224 > > Log: > Merge 231266 from head: > Add support for RICOH R5CE823 card reader, that can be found in > some Lenovo laptops. > > The conroller needs a quirk to lower its frequency, and after > that it operates normally. ... > Modified: stable/9/sys/dev/sdhci/sdhci.c > =========================================================================== >=== --- stable/9/sys/dev/sdhci/sdhci.c Mon Jun 18 07:54:10 2012 (r237223) > +++ stable/9/sys/dev/sdhci/sdhci.c Mon Jun 18 10:56:29 2012 (r237224) @@ > -74,6 +74,8 @@ __FBSDID("$FreeBSD$"); > #define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<7) > /* Controller has broken read timings */ > #define SDHCI_QUIRK_BROKEN_TIMINGS (1<<8) > +/* Controller needs lowered frequency */ > +#define SDHCI_QUIRK_LOWER_FREQUENCY (1<<9) > > static const struct sdhci_device { > uint32_t model; > @@ -85,6 +87,8 @@ static const struct sdhci_device { > SDHCI_QUIRK_FORCE_DMA }, > { 0xe8221180, 0xffff, "RICOH SD", > SDHCI_QUIRK_FORCE_DMA }, > + { 0xe8231180, 0xffff, "RICOH R5CE823 SD", > + SDHCI_QUIRK_LOWER_FREQUENCY }, > { 0x8034104c, 0xffff, "TI XX21/XX11 SD", > SDHCI_QUIRK_FORCE_DMA }, > { 0x05501524, 0xffff, "ENE CB712 SD", > @@ -350,6 +354,24 @@ sdhci_init(struct sdhci_slot *slot) > } > > static void > +sdhci_lower_frequency(device_t dev) > +{ > + > + /* Enable SD2.0 mode. */ > + pci_write_config(dev, SDHC_PCI_MODE_KEY, 0xfc, 1); > + pci_write_config(dev, SDHC_PCI_MODE, SDHC_PCI_MODE_SD20, 1); > + pci_write_config(dev, SDHC_PCI_MODE_KEY, 0x00, 1); > + > + /* > + * Some SD/MMC cards don't work with the default base > + * clock frequency of 200MHz. Lower it to 50Hz. Are you sure the comment shouldn't have read '50MHz'? > + */ > + pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x01, 1); > + pci_write_config(dev, SDHC_PCI_BASE_FREQ, 50, 1); > + pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x00, 1); > +} > + > +static void > sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock) > { > uint32_t res; Regards, -- Daan Vreeken Vitsch Electronics http://VitschVPN.nl/ http://Vitsch.nl/ tel: +31-(0)40-7113051 KvK nr: 17174380 From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 13:02:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9641106566C; Sat, 21 Jul 2012 13:02:12 +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 A398B8FC0A; Sat, 21 Jul 2012 13:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LD2CPb035570; Sat, 21 Jul 2012 13:02:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LD2Crb035566; Sat, 21 Jul 2012 13:02:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207211302.q6LD2Crb035566@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jul 2012 13:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238667 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 13:02:12 -0000 Author: kib Date: Sat Jul 21 13:02:11 2012 New Revision: 238667 URL: http://svn.freebsd.org/changeset/base/238667 Log: (Incomplete) fixes for symbols visibility issues and style in fcntl.h. Append '__' prefix to the tag of struct oflock, and put it under BSD namespace. Structure is needed both by libc and kernel, thus cannot be hidden under #ifdef _KERNEL. Move a set of non-standard F_* and O_* constants into BSD namespace. SUSv4 explicitely allows implemenation to pollute F_* and O_* names after fcntl.h is included, but it costs us nothing to adhere to the specification if exact POSIX compliance level is requested by user code. Change some spaces after #define to tabs. Noted by and discussed with: bde MFC after: 1 week Modified: head/lib/libc/sys/fcntl.c head/sys/kern/kern_descrip.c head/sys/sys/fcntl.h Modified: head/lib/libc/sys/fcntl.c ============================================================================== --- head/lib/libc/sys/fcntl.c Sat Jul 21 08:19:43 2012 (r238666) +++ head/lib/libc/sys/fcntl.c Sat Jul 21 13:02:11 2012 (r238667) @@ -41,7 +41,7 @@ __fcntl_compat(int fd, int cmd, ...) { va_list args; long arg; - struct oflock ofl; + struct __oflock ofl; struct flock *flp; int res; Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Jul 21 08:19:43 2012 (r238666) +++ head/sys/kern/kern_descrip.c Sat Jul 21 13:02:11 2012 (r238667) @@ -367,7 +367,7 @@ int sys_fcntl(struct thread *td, struct fcntl_args *uap) { struct flock fl; - struct oflock ofl; + struct __oflock ofl; intptr_t arg; int error; int cmd; Modified: head/sys/sys/fcntl.h ============================================================================== --- head/sys/sys/fcntl.h Sat Jul 21 08:19:43 2012 (r238666) +++ head/sys/sys/fcntl.h Sat Jul 21 13:02:11 2012 (r238667) @@ -111,7 +111,7 @@ typedef __pid_t pid_t; #if __BSD_VISIBLE /* Attempt to bypass buffer cache */ -#define O_DIRECT 0x00010000 +#define O_DIRECT 0x00010000 #endif /* Defined by POSIX Extended API Set Part 2 */ @@ -213,18 +213,22 @@ typedef __pid_t pid_t; #define F_SETFL 4 /* set file status flags */ #if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 #define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */ -#define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */ +#define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */ #endif +#if __BSD_VISIBLE #define F_OGETLK 7 /* get record locking information */ #define F_OSETLK 8 /* set record locking information */ #define F_OSETLKW 9 /* F_SETLK; wait if blocked */ #define F_DUP2FD 10 /* duplicate file descriptor to arg */ +#endif #define F_GETLK 11 /* get record locking information */ #define F_SETLK 12 /* set record locking information */ #define F_SETLKW 13 /* F_SETLK; wait if blocked */ +#if __BSD_VISIBLE #define F_SETLK_REMOTE 14 /* debugging support for remote locks */ #define F_READAHEAD 15 /* read ahead */ #define F_RDAHEAD 16 /* Darwin compatible read ahead */ +#endif #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 #define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ #endif @@ -236,14 +240,16 @@ typedef __pid_t pid_t; #define F_RDLCK 1 /* shared or read lock */ #define F_UNLCK 2 /* unlock */ #define F_WRLCK 3 /* exclusive or write lock */ +#if __BSD_VISIBLE #define F_UNLCKSYS 4 /* purge locks for a given system ID */ #define F_CANCEL 5 /* cancel an async lock request */ +#endif #ifdef _KERNEL #define F_WAIT 0x010 /* Wait until lock is granted */ #define F_FLOCK 0x020 /* Use flock(2) semantics for lock */ #define F_POSIX 0x040 /* Use POSIX semantics for lock */ #define F_REMOTE 0x080 /* Lock owner is remote NFS client */ -#define F_NOINTR 0x100 /* Ignore signals when waiting */ +#define F_NOINTR 0x100 /* Ignore signals when waiting */ #endif /* @@ -259,18 +265,19 @@ struct flock { int l_sysid; /* remote system id or zero for local */ }; +#if __BSD_VISIBLE /* * Old advisory file segment locking data type, * before adding l_sysid. */ -struct oflock { +struct __oflock { off_t l_start; /* starting offset */ off_t l_len; /* len = 0 means until end of file */ pid_t l_pid; /* lock owner */ short l_type; /* lock type: read/write, etc. */ short l_whence; /* type of l_start */ }; - +#endif #if __BSD_VISIBLE /* lock operations for flock(2) */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 13:05:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D622106566B; Sat, 21 Jul 2012 13:05: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 2D8778FC14; Sat, 21 Jul 2012 13:05:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LD5ZIn035938; Sat, 21 Jul 2012 13:05:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LD5YiC035936; Sat, 21 Jul 2012 13:05:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207211305.q6LD5YiC035936@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jul 2012 13:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238668 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 13:05:35 -0000 Author: kib Date: Sat Jul 21 13:05:34 2012 New Revision: 238668 URL: http://svn.freebsd.org/changeset/base/238668 Log: Stop clearing x87 exceptions in the #MF handler on amd64. If user code understands FPU hardware enough to catch SIGFPE and unmask exceptions in control word, then it may as well properly handle return from SIGFPE without causing an infinite loop of #MF exceptions due to faulting instruction restart, when needed. Clearing exceptions causes information loss for handlers which do understand FPU hardware, and struct siginfo si_code member cannot be considered adequate replacement for en_sw content due to translation. Supposed reason for clearing the exceptions, which is IRQ13 handling oddities, were never applicable to amd64. Note: this change will be merged to i386 kernel as well, since we do not support IRQ13 delivery of #MF notifications for some time. Requested by: bde MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sat Jul 21 13:02:11 2012 (r238667) +++ head/sys/amd64/amd64/fpu.c Sat Jul 21 13:05:34 2012 (r238668) @@ -513,25 +513,21 @@ static char fpetable[128] = { }; /* - * Preserve the FP status word, clear FP exceptions for x87, then - * generate a SIGFPE. + * Read the FP status and control words, then generate si_code value + * for SIGFPE. The error code chosen will be one of the + * FPE_... macros. It will be sent as the second argument to old + * BSD-style signal handlers and as "siginfo_t->si_code" (second + * argument) to SA_SIGINFO signal handlers. * - * Clearing exceptions was necessary mainly to avoid IRQ13 bugs and is - * engraved in our i386 ABI. We now depend on longjmp() restoring a - * usable state. Restoring the state or examining it might fail if we - * didn't clear exceptions. + * Some time ago, we cleared the x87 exceptions with FNCLEX there. + * Clearing exceptions was necessary mainly to avoid IRQ13 bugs. The + * usermode code which understands the FPU hardware enough to enable + * the exceptions, can also handle clearing the exception state in the + * handler. The only consequence of not clearing the exception is the + * rethrow of the SIGFPE on return from the signal handler and + * reexecution of the corresponding instruction. * - * For SSE exceptions, the exceptions are not cleared. - * - * The error code chosen will be one of the FPE_... macros. It will be - * sent as the second argument to old BSD-style signal handlers and as - * "siginfo_t->si_code" (second argument) to SA_SIGINFO signal handlers. - * - * XXX the FP state is not preserved across signal handlers. So signal - * handlers cannot afford to do FP unless they preserve the state or - * longjmp() out. Both preserving the state and longjmp()ing may be - * destroyed by IRQ13 bugs. Clearing FP exceptions is not an acceptable - * solution for signals other than SIGFPE. + * For XMM traps, the exceptions were never cleared. */ int fputrap_x87(void) @@ -553,7 +549,6 @@ fputrap_x87(void) } else { fnstcw(&control); fnstsw(&status); - fnclex(); } critical_exit(); From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 13:06:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 244261065673; Sat, 21 Jul 2012 13:06:38 +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 E9DE58FC17; Sat, 21 Jul 2012 13:06:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LD6bTT036081; Sat, 21 Jul 2012 13:06:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LD6bn1036079; Sat, 21 Jul 2012 13:06:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207211306.q6LD6bn1036079@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jul 2012 13:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238669 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 13:06:38 -0000 Author: kib Date: Sat Jul 21 13:06:37 2012 New Revision: 238669 URL: http://svn.freebsd.org/changeset/base/238669 Log: The PT_I386_{GET,SET}XMMREGS and PT_{GET,SET}XSTATE operate on the stopped threads. Implementation assumes that the thread's FPU context is spilled into the PCB due to stop. This is mostly true, except when FPU state for the thread is not initialized. Then the requests operate on the garbage state which is currently left in the PCB, causing confusion. The situation is indeed observed after a signal delivery and before #NM fault on execution of any FPU instruction in the signal handler, since sendsig(9) drops FPU state for current thread, clearing PCB_FPUINITDONE. When inspecting context state for the signal handler, debugger sees the FPU state of the main program context instead of the clear state supposed to be provided to handler. Fix this by forcing clean FPU state in PCB user FPU save area by performing getfpuregs(9) before accessing user FPU save area in ptrace_machdep.c. Note: this change will be merged to i386 kernel as well, where it is much more important, since e.g. gdb on i386 uses PT_I386_GETXMMREGS to inspect FPU context on CPUs that support SSE. Amd64 version of gdb uses PT_GETFPREGS to inspect both 64 and 32 bit processes, which does not exhibit the bug. Reported by: bde MFC after: 1 week Modified: head/sys/amd64/amd64/ptrace_machdep.c Modified: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- head/sys/amd64/amd64/ptrace_machdep.c Sat Jul 21 13:05:34 2012 (r238668) +++ head/sys/amd64/amd64/ptrace_machdep.c Sat Jul 21 13:06:37 2012 (r238669) @@ -50,6 +50,7 @@ cpu_ptrace_xstate(struct thread *td, int switch (req) { case PT_GETXSTATE: + fpugetregs(td); savefpu = (char *)(get_pcb_user_save_td(td) + 1); error = copyout(savefpu, addr, cpu_max_ext_state_size - sizeof(struct savefpu)); @@ -62,8 +63,10 @@ cpu_ptrace_xstate(struct thread *td, int } savefpu = malloc(data, M_TEMP, M_WAITOK); error = copyin(addr, savefpu, data); - if (error == 0) + if (error == 0) { + fpugetregs(td); error = fpusetxstate(td, savefpu, data); + } free(savefpu, M_TEMP); break; @@ -89,11 +92,13 @@ cpu32_ptrace(struct thread *td, int req, switch (req) { case PT_I386_GETXMMREGS: + fpugetregs(td); error = copyout(get_pcb_user_save_td(td), addr, sizeof(*fpstate)); break; case PT_I386_SETXMMREGS: + fpugetregs(td); fpstate = get_pcb_user_save_td(td); error = copyin(addr, fpstate, sizeof(*fpstate)); fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 13:29:20 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D417C106566B; Sat, 21 Jul 2012 13:29:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2B38FC0C; Sat, 21 Jul 2012 13:29:20 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6LDTHTb002264 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 Jul 2012 23:29:18 +1000 Date: Sat, 21 Jul 2012 23:29:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <201207211305.q6LD5YiC035936@svn.freebsd.org> Message-ID: <20120721232459.J2515@besplex.bde.org> References: <201207211305.q6LD5YiC035936@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238668 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 13:29:20 -0000 On Sat, 21 Jul 2012, Konstantin Belousov wrote: > Log: > Stop clearing x87 exceptions in the #MF handler on amd64. If user code > understands FPU hardware enough to catch SIGFPE and unmask exceptions > in control word, then it may as well properly handle return from > SIGFPE without causing an infinite loop of #MF exceptions due to > faulting instruction restart, when needed. > > Clearing exceptions causes information loss for handlers which do > understand FPU hardware, and struct siginfo si_code member cannot be > considered adequate replacement for en_sw content due to translation. > > Supposed reason for clearing the exceptions, which is IRQ13 handling > oddities, were never applicable to amd64. > > Note: this change will be merged to i386 kernel as well, since we do > not support IRQ13 delivery of #MF notifications for some time. > > Requested by: bde > MFC after: 1 week Thanks. The comment formatting has lost its constent 2-space sentence breaks. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 13:47:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E38F106566B; Sat, 21 Jul 2012 13:47:38 +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 D47DC8FC14; Sat, 21 Jul 2012 13:47:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LDlbrT040176; Sat, 21 Jul 2012 13:47:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LDlbBr040173; Sat, 21 Jul 2012 13:47:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207211347.q6LDlbBr040173@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jul 2012 13:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238670 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 13:47:38 -0000 Author: kib Date: Sat Jul 21 13:47:37 2012 New Revision: 238670 URL: http://svn.freebsd.org/changeset/base/238670 Log: Stop caching curpcb in the local variable. Requested by: bde MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sat Jul 21 13:06:37 2012 (r238669) +++ head/sys/amd64/amd64/fpu.c Sat Jul 21 13:47:37 2012 (r238670) @@ -582,7 +582,6 @@ static int err_count = 0; void fpudna(void) { - struct pcb *pcb; critical_enter(); if (PCPU_GET(fpcurthread) == curthread) { @@ -604,11 +603,10 @@ fpudna(void) * Record new context early in case frstor causes a trap. */ PCPU_SET(fpcurthread, curthread); - pcb = curpcb; fpu_clean_state(); - if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { + if ((curpcb->pcb_flags & PCB_FPUINITDONE) == 0) { /* * This is the first time this thread has used the FPU or * the PCB doesn't contain a clean FPU state. Explicitly @@ -619,17 +617,17 @@ fpudna(void) * fpu_initialstate, to ignite the XSAVEOPT * tracking engine. */ - bcopy(fpu_initialstate, pcb->pcb_save, cpu_max_ext_state_size); - fpurestore(pcb->pcb_save); - if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) - fldcw(pcb->pcb_initial_fpucw); - if (PCB_USER_FPU(pcb)) - set_pcb_flags(pcb, + bcopy(fpu_initialstate, curpcb->pcb_save, cpu_max_ext_state_size); + fpurestore(curpcb->pcb_save); + if (curpcb->pcb_initial_fpucw != __INITIAL_FPUCW__) + fldcw(curpcb->pcb_initial_fpucw); + if (PCB_USER_FPU(curpcb)) + set_pcb_flags(curpcb, PCB_FPUINITDONE | PCB_USERFPUINITDONE); else - set_pcb_flags(pcb, PCB_FPUINITDONE); + set_pcb_flags(curpcb, PCB_FPUINITDONE); } else - fpurestore(pcb->pcb_save); + fpurestore(curpcb->pcb_save); critical_exit(); } @@ -963,16 +961,14 @@ fpu_kern_leave(struct thread *td, struct int fpu_kern_thread(u_int flags) { - struct pcb *pcb; - pcb = curpcb; KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, ("Only kthread may use fpu_kern_thread")); - KASSERT(pcb->pcb_save == get_pcb_user_save_pcb(pcb), + KASSERT(curpcb->pcb_save == get_pcb_user_save_pcb(curpcb), ("mangled pcb_save")); - KASSERT(PCB_USER_FPU(pcb), ("recursive call")); + KASSERT(PCB_USER_FPU(curpcb), ("recursive call")); - set_pcb_flags(pcb, PCB_KERNFPU); + set_pcb_flags(curpcb, PCB_KERNFPU); return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 13:53:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 632461065673; Sat, 21 Jul 2012 13:53:01 +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 4E4DB8FC16; Sat, 21 Jul 2012 13:53:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LDr1u4040821; Sat, 21 Jul 2012 13:53:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LDr1AK040819; Sat, 21 Jul 2012 13:53:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207211353.q6LDr1AK040819@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jul 2012 13:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238671 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 13:53:01 -0000 Author: kib Date: Sat Jul 21 13:53:00 2012 New Revision: 238671 URL: http://svn.freebsd.org/changeset/base/238671 Log: Constently use 2-space sentence breaks. Submitted by: bde MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sat Jul 21 13:47:37 2012 (r238670) +++ head/sys/amd64/amd64/fpu.c Sat Jul 21 13:53:00 2012 (r238671) @@ -515,7 +515,7 @@ static char fpetable[128] = { /* * Read the FP status and control words, then generate si_code value * for SIGFPE. The error code chosen will be one of the - * FPE_... macros. It will be sent as the second argument to old + * FPE_... macros. It will be sent as the second argument to old * BSD-style signal handlers and as "siginfo_t->si_code" (second * argument) to SA_SIGINFO signal handlers. * @@ -523,7 +523,7 @@ static char fpetable[128] = { * Clearing exceptions was necessary mainly to avoid IRQ13 bugs. The * usermode code which understands the FPU hardware enough to enable * the exceptions, can also handle clearing the exception state in the - * handler. The only consequence of not clearing the exception is the + * handler. The only consequence of not clearing the exception is the * rethrow of the SIGFPE on return from the signal handler and * reexecution of the corresponding instruction. * From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 14:07:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C268C106566C; Sat, 21 Jul 2012 14:07:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC4F68FC12; Sat, 21 Jul 2012 14:07:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LE7hFh042320; Sat, 21 Jul 2012 14:07:43 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LE7h9P042318; Sat, 21 Jul 2012 14:07:43 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207211407.q6LE7h9P042318@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 21 Jul 2012 14:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238672 - head/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 14:07:43 -0000 Author: glebius Date: Sat Jul 21 14:07:43 2012 New Revision: 238672 URL: http://svn.freebsd.org/changeset/base/238672 Log: Fix typo in comment, should be MHz here. Submitted by: Daan Vreeken Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Jul 21 13:53:00 2012 (r238671) +++ head/sys/dev/sdhci/sdhci.c Sat Jul 21 14:07:43 2012 (r238672) @@ -364,7 +364,7 @@ sdhci_lower_frequency(device_t dev) /* * Some SD/MMC cards don't work with the default base - * clock frequency of 200MHz. Lower it to 50Hz. + * clock frequency of 200MHz. Lower it to 50MHz. */ pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x01, 1); pci_write_config(dev, SDHC_PCI_BASE_FREQ, 50, 1); From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 14:59:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7ADCE1065678; Sat, 21 Jul 2012 14:59:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CAE98FC14; Sat, 21 Jul 2012 14:59:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LExixc047651; Sat, 21 Jul 2012 14:59:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LExiNl047649; Sat, 21 Jul 2012 14:59:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207211459.q6LExiNl047649@svn.freebsd.org> From: Alexander Motin Date: Sat, 21 Jul 2012 14:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238673 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 14:59:44 -0000 Author: mav Date: Sat Jul 21 14:59:43 2012 New Revision: 238673 URL: http://svn.freebsd.org/changeset/base/238673 Log: Use 16bit PIO instead of 32bit in case of misaligned buffer. It fixes kernel panic during CD write with cdrecord on sparc64. Modified: head/sys/dev/ata/ata-lowlevel.c Modified: head/sys/dev/ata/ata-lowlevel.c ============================================================================== --- head/sys/dev/ata/ata-lowlevel.c Sat Jul 21 14:07:43 2012 (r238672) +++ head/sys/dev/ata/ata-lowlevel.c Sat Jul 21 14:59:43 2012 (r238673) @@ -836,23 +836,21 @@ static void ata_pio_read(struct ata_request *request, int length) { struct ata_channel *ch = device_get_softc(request->parent); + uint8_t *addr; int size = min(request->transfersize, length); int resid; uint8_t buf[2]; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) { - ATA_IDX_INSW_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int16_t)); + addr = (uint8_t *)request->data + request->donecount; + if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || + ((uintptr_t)addr % sizeof(int32_t))) { + ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); if (size & 1) { ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)buf, 1); - ((uint8_t *)request->data + request->donecount + - (size & ~1))[0] = buf[0]; + (addr + (size & ~1))[0] = buf[0]; } } else - ATA_IDX_INSL_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int32_t)); + ATA_IDX_INSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); if (request->transfersize < length) { device_printf(request->parent, "WARNING - %s read data overrun %d>%d\n", @@ -867,23 +865,21 @@ static void ata_pio_write(struct ata_request *request, int length) { struct ata_channel *ch = device_get_softc(request->parent); + uint8_t *addr; int size = min(request->transfersize, length); int resid; uint8_t buf[2]; - if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) { - ATA_IDX_OUTSW_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int16_t)); + addr = (uint8_t *)request->data + request->donecount; + if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) || + ((uintptr_t)addr % sizeof(int32_t))) { + ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t)); if (size & 1) { - buf[0] = ((uint8_t *)request->data + request->donecount + - (size & ~1))[0]; + buf[0] = (addr + (size & ~1))[0]; ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)buf, 1); } } else - ATA_IDX_OUTSL_STRM(ch, ATA_DATA, - (void*)((uintptr_t)request->data+request->donecount), - size / sizeof(int32_t)); + ATA_IDX_OUTSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t)); if (request->transfersize < length) { device_printf(request->parent, "WARNING - %s write data underrun %d>%d\n", From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 15:30:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 177311065672; Sat, 21 Jul 2012 15:30:26 +0000 (UTC) Date: Sat, 21 Jul 2012 15:30:26 +0000 From: Alexey Dokuchaev To: Gleb Smirnoff Message-ID: <20120721153026.GA8640@FreeBSD.org> References: <201207211407.q6LE7h9P042318@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201207211407.q6LE7h9P042318@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238672 - head/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 15:30:26 -0000 On Sat, Jul 21, 2012 at 02:07:43PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Sat Jul 21 14:07:43 2012 > New Revision: 238672 > URL: http://svn.freebsd.org/changeset/base/238672 > > Log: > Fix typo in comment, should be MHz here. That's nice, but... > @@ -364,7 +364,7 @@ sdhci_lower_frequency(device_t dev) > > /* > * Some SD/MMC cards don't work with the default base > - * clock frequency of 200MHz. Lower it to 50Hz. > + * clock frequency of 200MHz. Lower it to 50MHz. ... Why losing 2-space break after a sentence (per what we are generally adhering and AFAIR is suggested by Chicago Style Guide)? ./danfe From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 17:59:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A847106564A; Sat, 21 Jul 2012 17:59:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1FFD68FC14; Sat, 21 Jul 2012 17:59:53 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so8832554pbb.13 for ; Sat, 21 Jul 2012 10:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=5Rj8miJwL4JcaBA3ApCQVsRgAubuT7LzAgMv/PGKnQ0=; b=UI9GT6FeFLXs26f77AykOBDxH1fv6F27eiJkeUnf7oRiP+K0FZibyiGEfu67ekzMBp aAG0ClwTVxKxKHVl6DjAbBU6M/k3zWBQY92107V/WnO5Ll4tcjLCTtok626KpJo2Z+c5 nnJ4QKe6G+gkVBut4IS2mBcngVpKUoClwn7uBrGk2oKo5RNOsA7GkNslqOw54V9EzmVD a9c7wPiHgxNLsmIXClGdHQAtinVDGhh+Bdlh4tkRtYp3K1NqmVmJrZsEQA4slgd32Vi/ qcCoh1JkzbilTf3UuYiP2RC17uCNE/QDlOx8gka+gclS4pnWlIHW4ZmYEYJef5v2I3vu BI0g== MIME-Version: 1.0 Received: by 10.68.220.193 with SMTP id py1mr23705061pbc.4.1342893592888; Sat, 21 Jul 2012 10:59:52 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.191.138 with HTTP; Sat, 21 Jul 2012 10:59:52 -0700 (PDT) In-Reply-To: References: <201207121211.q6CCBWTD006484@svn.freebsd.org> Date: Sat, 21 Jul 2012 10:59:52 -0700 X-Google-Sender-Auth: Mn87foCZw9K8vbQzbeCK8DS-VHs Message-ID: From: Adrian Chadd To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , src-committers@freebsd.org Subject: Re: svn commit: r238396 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 17:59:53 -0000 On 12 July 2012 21:39, Eitan Adler wrote: > On 12 July 2012 05:11, Gavin Atkinson wrote: >> Author: gavin >> Date: Thu Jul 12 12:11:32 2012 >> New Revision: 238396 >> URL: http://svn.freebsd.org/changeset/base/238396 >> >> Log: >> Update for new core team. Looks like this file was not updated two years >> ago for the last core team. > > Perhaps we can make a wiki page of "pages that need to change on core > team change?" ? Anything like that should likely be turned into a small shell script and automated. :) Adrian From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 18:16:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B287106566B; Sat, 21 Jul 2012 18:16:58 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id BD2568FC16; Sat, 21 Jul 2012 18:16:57 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so8850423pbb.13 for ; Sat, 21 Jul 2012 11:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=ogsL4OVVXRBv1EoSOsiCXytc2ct0xf8+D7OLFJjzIZA=; b=h4AEAUWJEftNzRSV0a3+t8qOBbtXmtnQsQ0cNKq1j8YQM5JAEU/vcXJE5EchvaL0td yWDS60ii1Obo45Pv76dDzp62VLFE4vfBU0qxioy5YyfdHdfqSf3DBeL9JtfCtgU5h9yo oUxmr0+QVD7JZD6RMqJ12QlUq+QDOGITaQU5420E6XSxeicGKBNvII19QTitATFBJtg2 oQ5iWXpISmrTaEJ9BBqUtTkq7hkFAzLLFQrv2/p7Xx6kkqYlytyHeuwWnGYkuVSLEBcl BOyKInVFYk37UWntyM2nFsNsfkQijH62au3agsH7KqSYzOKh5cb1IC49ggv+eX5Vt9mC CUhw== Received: by 10.68.196.228 with SMTP id ip4mr23007228pbc.82.1342894617560; Sat, 21 Jul 2012 11:16:57 -0700 (PDT) Received: from fuji-wireless.local (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id rg10sm6418132pbc.54.2012.07.21.11.16.54 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 Jul 2012 11:16:55 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Garrett Cooper In-Reply-To: Date: Sat, 21 Jul 2012 11:17:22 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201207121211.q6CCBWTD006484@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , Eitan Adler , src-committers@freebsd.org Subject: Re: svn commit: r238396 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 18:16:58 -0000 On Jul 21, 2012, at 10:59 AM, Adrian Chadd wrote: > On 12 July 2012 21:39, Eitan Adler wrote: >> On 12 July 2012 05:11, Gavin Atkinson wrote: >>> Author: gavin >>> Date: Thu Jul 12 12:11:32 2012 >>> New Revision: 238396 >>> URL: http://svn.freebsd.org/changeset/base/238396 >>>=20 >>> Log: >>> Update for new core team. Looks like this file was not updated two = years >>> ago for the last core team. >>=20 >> Perhaps we can make a wiki page of "pages that need to change on core >> team change?" ? >=20 > Anything like that should likely be turned into a small shell script > and automated. :) It happens so infrequently that writing up a process document = and having it be part of the "new core inauguration" should be enough I = would think. My 2 cents, -Garrett= From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 19:46:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FB3106564A; Sat, 21 Jul 2012 19:46:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA5068FC08; Sat, 21 Jul 2012 19:46:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LJkEJg076780; Sat, 21 Jul 2012 19:46:14 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LJkEwi076778; Sat, 21 Jul 2012 19:46:14 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207211946.q6LJkEwi076778@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 21 Jul 2012 19:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238674 - stable/8/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 19:46:14 -0000 Author: pfg Date: Sat Jul 21 19:46:14 2012 New Revision: 238674 URL: http://svn.freebsd.org/changeset/base/238674 Log: MFC 233362: Don't cast a bus address to a uint8_t pointer just to add an offset to it. Instead, add the offset directly to the bus address. This permits linking emu10k to an i386 PAE kernel. Modified: stable/8/sys/dev/sound/pci/emu10kx.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/emu10kx.c ============================================================================== --- stable/8/sys/dev/sound/pci/emu10kx.c Sat Jul 21 14:59:43 2012 (r238673) +++ stable/8/sys/dev/sound/pci/emu10kx.c Sat Jul 21 19:46:14 2012 (r238674) @@ -1137,7 +1137,7 @@ emu_memalloc(struct emu_mem *mem, uint32 ofs = 0; for (idx = start; idx < start + blksz; idx++) { mem->bmap[idx >> 3] |= 1 << (idx & 7); - tmp = (uint32_t) (u_long) ((uint8_t *) blk->buf_addr + ofs); + tmp = (uint32_t) (blk->buf_addr + ofs); mem->ptb_pages[idx] = (tmp << 1) | idx; ofs += EMUPAGESIZE; } From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 21:39:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C36561065670; Sat, 21 Jul 2012 21:39:02 +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 AE3298FC14; Sat, 21 Jul 2012 21:39:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LLd2M8088260; Sat, 21 Jul 2012 21:39:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LLd2Z7088258; Sat, 21 Jul 2012 21:39:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207212139.q6LLd2Z7088258@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jul 2012 21:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238675 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 21:39:02 -0000 Author: kib Date: Sat Jul 21 21:39:02 2012 New Revision: 238675 URL: http://svn.freebsd.org/changeset/base/238675 Log: MFamd64 r238669: Force clean FPU state in PCB user FPU save area for PT_I386_{GET,SET}XMMREGS. Reported by: bde MFC after: 1 week Modified: head/sys/i386/i386/ptrace_machdep.c Modified: head/sys/i386/i386/ptrace_machdep.c ============================================================================== --- head/sys/i386/i386/ptrace_machdep.c Sat Jul 21 19:46:14 2012 (r238674) +++ head/sys/i386/i386/ptrace_machdep.c Sat Jul 21 21:39:02 2012 (r238675) @@ -54,10 +54,12 @@ cpu_ptrace(struct thread *td, int req, v fpstate = &td->td_pcb->pcb_user_save.sv_xmm; switch (req) { case PT_GETXMMREGS: + npxgetregs(td); error = copyout(fpstate, addr, sizeof(*fpstate)); break; case PT_SETXMMREGS: + npxgetregs(td); error = copyin(addr, fpstate, sizeof(*fpstate)); fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; break; From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 21:39:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3C7F1065780; Sat, 21 Jul 2012 21:39:23 +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 CFDB58FC17; Sat, 21 Jul 2012 21:39:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LLdNlD088327; Sat, 21 Jul 2012 21:39:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LLdN8U088325; Sat, 21 Jul 2012 21:39:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207212139.q6LLdN8U088325@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jul 2012 21:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238676 - head/sys/i386/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 21:39:24 -0000 Author: kib Date: Sat Jul 21 21:39:23 2012 New Revision: 238676 URL: http://svn.freebsd.org/changeset/base/238676 Log: MFamd64 r238597: Add stmxcsr. MFC after: 3 weeks Modified: head/sys/i386/isa/npx.c Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Sat Jul 21 21:39:02 2012 (r238675) +++ head/sys/i386/isa/npx.c Sat Jul 21 21:39:23 2012 (r238676) @@ -99,6 +99,7 @@ __FBSDID("$FreeBSD$"); #ifdef CPU_ENABLE_SSE #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) +#define stmxcsr(addr) __asm __volatile("stmxcsr %0" : : "m" (*(addr))) #endif #else /* !(__GNUCLIKE_ASM && !lint) */ @@ -113,6 +114,7 @@ void frstor(caddr_t addr); #ifdef CPU_ENABLE_SSE void fxsave(caddr_t addr); void fxrstor(caddr_t addr); +void stmxcsr(u_int csr); #endif #endif /* __GNUCLIKE_ASM && !lint */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 21:49:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 589E5106564A; Sat, 21 Jul 2012 21:49:06 +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 29CDC8FC12; Sat, 21 Jul 2012 21:49:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LLn6Jq089384; Sat, 21 Jul 2012 21:49:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LLn5HA089382; Sat, 21 Jul 2012 21:49:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207212149.q6LLn5HA089382@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jul 2012 21:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238677 - head/sys/i386/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 21:49:06 -0000 Author: kib Date: Sat Jul 21 21:49:05 2012 New Revision: 238677 URL: http://svn.freebsd.org/changeset/base/238677 Log: MFamd64 r238668: Stop clearing x87 exceptions in the #MF handler. Requested by: bde MFC after: 1 week Modified: head/sys/i386/isa/npx.c Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Sat Jul 21 21:39:23 2012 (r238676) +++ head/sys/i386/isa/npx.c Sat Jul 21 21:49:05 2012 (r238677) @@ -583,21 +583,21 @@ static char fpetable[128] = { }; /* - * Preserve the FP status word, clear FP exceptions, then generate a SIGFPE. + * Read the FP status and control words, then generate si_code value + * for SIGFPE. The error code chosen will be one of the + * FPE_... macros. It will be sent as the second argument to old + * BSD-style signal handlers and as "siginfo_t->si_code" (second + * argument) to SA_SIGINFO signal handlers. * - * Clearing exceptions is necessary mainly to avoid IRQ13 bugs. We now - * depend on longjmp() restoring a usable state. Restoring the state - * or examining it might fail if we didn't clear exceptions. + * Some time ago, we cleared the x87 exceptions with FNCLEX there. + * Clearing exceptions was necessary mainly to avoid IRQ13 bugs. The + * usermode code which understands the FPU hardware enough to enable + * the exceptions, can also handle clearing the exception state in the + * handler. The only consequence of not clearing the exception is the + * rethrow of the SIGFPE on return from the signal handler and + * reexecution of the corresponding instruction. * - * The error code chosen will be one of the FPE_... macros. It will be - * sent as the second argument to old BSD-style signal handlers and as - * "siginfo_t->si_code" (second argument) to SA_SIGINFO signal handlers. - * - * XXX the FP state is not preserved across signal handlers. So signal - * handlers cannot afford to do FP unless they preserve the state or - * longjmp() out. Both preserving the state and longjmp()ing may be - * destroyed by IRQ13 bugs. Clearing FP exceptions is not an acceptable - * solution for signals other than SIGFPE. + * For XMM traps, the exceptions were never cleared. */ int npxtrap() @@ -623,9 +623,6 @@ npxtrap() fnstcw(&control); fnstsw(&status); } - - if (PCPU_GET(fpcurthread) == curthread) - fnclex(); critical_exit(); return (fpetable[status & ((~control & 0x3f) | 0x40)]); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 21 21:52:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8294A1065670; Sat, 21 Jul 2012 21:52:49 +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 645D38FC1F; Sat, 21 Jul 2012 21:52:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6LLqn7l089840; Sat, 21 Jul 2012 21:52:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6LLqnIn089836; Sat, 21 Jul 2012 21:52:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207212152.q6LLqnIn089836@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jul 2012 21:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238678 - in head/sys/i386: i386 include isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2012 21:52:49 -0000 Author: kib Date: Sat Jul 21 21:52:48 2012 New Revision: 238678 URL: http://svn.freebsd.org/changeset/base/238678 Log: MFCamd64 r238598: Provide siginfo.si_code for floating point errors when error occurs using the SSE math processor. MFC after: 3 weeks Modified: head/sys/i386/i386/trap.c head/sys/i386/include/npx.h head/sys/i386/isa/npx.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sat Jul 21 21:49:05 2012 (r238677) +++ head/sys/i386/i386/trap.c Sat Jul 21 21:52:48 2012 (r238678) @@ -369,7 +369,7 @@ trap(struct trapframe *frame) case T_ARITHTRAP: /* arithmetic trap */ #ifdef DEV_NPX - ucode = npxtrap(); + ucode = npxtrap_x87(); if (ucode == -1) goto userout; #else @@ -532,7 +532,13 @@ trap(struct trapframe *frame) break; case T_XMMFLT: /* SIMD floating-point exception */ - ucode = 0; /* XXX */ +#if defined(DEV_NPX) && !defined(CPU_DISABLE_SSE) && defined(I686_CPU) + ucode = npxtrap_sse(); + if (ucode == -1) + goto userout; +#else + ucode = 0; +#endif i = SIGFPE; break; } Modified: head/sys/i386/include/npx.h ============================================================================== --- head/sys/i386/include/npx.h Sat Jul 21 21:49:05 2012 (r238677) +++ head/sys/i386/include/npx.h Sat Jul 21 21:52:48 2012 (r238678) @@ -55,7 +55,8 @@ int npxgetregs(struct thread *td); void npxinit(void); void npxsave(union savefpu *addr); void npxsetregs(struct thread *td, union savefpu *addr); -int npxtrap(void); +int npxtrap_x87(void); +int npxtrap_sse(void); void npxuserinited(struct thread *); struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int flags); void fpu_kern_free_ctx(struct fpu_kern_ctx *ctx); Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Sat Jul 21 21:49:05 2012 (r238677) +++ head/sys/i386/isa/npx.c Sat Jul 21 21:52:48 2012 (r238678) @@ -600,12 +600,13 @@ static char fpetable[128] = { * For XMM traps, the exceptions were never cleared. */ int -npxtrap() +npxtrap_x87(void) { u_short control, status; if (!hw_float) { - printf("npxtrap: fpcurthread = %p, curthread = %p, hw_float = %d\n", + printf( + "npxtrap_x87: fpcurthread = %p, curthread = %p, hw_float = %d\n", PCPU_GET(fpcurthread), curthread, hw_float); panic("npxtrap from nowhere"); } @@ -627,6 +628,28 @@ npxtrap() return (fpetable[status & ((~control & 0x3f) | 0x40)]); } +#ifdef CPU_ENABLE_SSE +int +npxtrap_sse(void) +{ + u_int mxcsr; + + if (!hw_float) { + printf( + "npxtrap_sse: fpcurthread = %p, curthread = %p, hw_float = %d\n", + PCPU_GET(fpcurthread), curthread, hw_float); + panic("npxtrap from nowhere"); + } + critical_enter(); + if (PCPU_GET(fpcurthread) != curthread) + mxcsr = curthread->td_pcb->pcb_save->sv_xmm.sv_env.en_mxcsr; + else + stmxcsr(&mxcsr); + critical_exit(); + return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); +} +#endif + /* * Implement device not available (DNA) exception *