From owner-svn-src-stable-9@FreeBSD.ORG Mon Nov 14 00:45:25 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA1D5106566C; Mon, 14 Nov 2011 00:45:25 +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 A9AD18FC16; Mon, 14 Nov 2011 00:45: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 pAE0jP0j015842; Mon, 14 Nov 2011 00:45:25 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAE0jPIV015840; Mon, 14 Nov 2011 00:45:25 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201111140045.pAE0jPIV015840@svn.freebsd.org> From: Ken Smith Date: Mon, 14 Nov 2011 00:45:25 +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: r227495 - stable/9/sys/conf X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 00:45:25 -0000 Author: kensmith Date: Mon Nov 14 00:45:25 2011 New Revision: 227495 URL: http://svn.freebsd.org/changeset/base/227495 Log: The releng/9.0 release branch has been created so convert stable/9 over to our standard "Politically Correct" name for the balance of the 9.0-RELEASE 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 Mon Nov 14 00:10:11 2011 (r227494) +++ stable/9/sys/conf/newvers.sh Mon Nov 14 00:45:25 2011 (r227495) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.0" -BRANCH="RC2" +BRANCH="PRERELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable-9@FreeBSD.ORG Tue Nov 15 17:30:04 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EBB0106566C; Tue, 15 Nov 2011 17:30:04 +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 08A428FC15; Tue, 15 Nov 2011 17:30: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 pAFHU3jr009963; Tue, 15 Nov 2011 17:30:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFHU3ij009961; Tue, 15 Nov 2011 17:30:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111151730.pAFHU3ij009961@svn.freebsd.org> From: Xin LI Date: Tue, 15 Nov 2011 17:30:03 +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: r227533 - stable/9/sys/dev/mfi X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 17:30:04 -0000 Author: delphij Date: Tue Nov 15 17:30:03 2011 New Revision: 227533 URL: http://svn.freebsd.org/changeset/base/227533 Log: MFC r227409: Do a dummy read to flush the interrupt ACK that we just performed, ensuring that everything is really, truly consistent. This fixes certain cases where one will see various: mfi0: COMMAND 0xffffffXXXXXXXXXX TIMEOUT AFTER XX SECONDS Submitted by: scottl Ok'ed by: jhb Approved by: re (kib) Modified: stable/9/sys/dev/mfi/mfi.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Tue Nov 15 17:15:09 2011 (r227532) +++ stable/9/sys/dev/mfi/mfi.c Tue Nov 15 17:30:03 2011 (r227533) @@ -932,6 +932,12 @@ mfi_intr(void *arg) if (sc->mfi_check_clear_intr(sc)) return; + /* + * Do a dummy read to flush the interrupt ACK that we just performed, + * ensuring that everything is really, truly consistent. + */ + (void)sc->mfi_read_fw_status(sc); + pi = sc->mfi_comms->hw_pi; ci = sc->mfi_comms->hw_ci; mtx_lock(&sc->mfi_io_lock); From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 16 15:23:19 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A0B106566C; Wed, 16 Nov 2011 15:23:19 +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 A87D38FC12; Wed, 16 Nov 2011 15:23: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 pAGFNJUB054404; Wed, 16 Nov 2011 15:23:19 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFNJZa054402; Wed, 16 Nov 2011 15:23:19 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161523.pAGFNJZa054402@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:23:19 +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: r227553 - stable/9/usr.sbin/boot0cfg X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:23:19 -0000 Author: ae Date: Wed Nov 16 15:23:19 2011 New Revision: 227553 URL: http://svn.freebsd.org/changeset/base/227553 Log: MFC r227274: Add reference to gpart(8). MFC r227298: Remove a note about disabling of GEOM protection mechanism. boot0cfg should work without such hack. Approved by: re (kib) Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8 Directory Properties: stable/9/usr.sbin/boot0cfg/ (props changed) Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/9/usr.sbin/boot0cfg/boot0cfg.8 Wed Nov 16 14:37:47 2011 (r227552) +++ stable/9/usr.sbin/boot0cfg/boot0cfg.8 Wed Nov 16 15:23:19 2011 (r227553) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 13, 2009 +.Dd November 7, 2011 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -153,21 +153,6 @@ Set the timeout value to .It Fl v Verbose: display information about the slices defined, etc. .El -.Sh NOTE -Protection mechanisms in the -.Xr geom 4 -subsystem might prevent -.Nm -from being able to update the MBR on a mounted disk. -Instructions for temporarily disabling these protection mechanisms -can be found in the -.Xr geom 4 -manpage. Specifically, do a -.Pp -.Dl sysctl kern.geom.debugflags=0x10 -.Pp -to allow writing to the MBR, and restore it to 0 afterwards. -.Pp .Sh FILES .Bl -tag -width /boot/boot0sio -compact .It Pa /boot/boot0 @@ -197,7 +182,8 @@ to install the default MBR: .Sh SEE ALSO .Xr geom 4 , .Xr boot 8 , -.Xr fdisk 8 +.Xr fdisk 8 , +.Xr gpart 8 .Sh AUTHORS .An Robert Nordier Aq rnordier@FreeBSD.org . .Sh BUGS From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 16 15:32:32 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9838B1065675; Wed, 16 Nov 2011 15:32:32 +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 8707A8FC19; Wed, 16 Nov 2011 15:32: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 pAGFWWU2054790; Wed, 16 Nov 2011 15:32:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFWWbH054788; Wed, 16 Nov 2011 15:32:32 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161532.pAGFWWbH054788@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:32: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: r227556 - stable/9/sbin/bsdlabel X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:32:32 -0000 Author: ae Date: Wed Nov 16 15:32:32 2011 New Revision: 227556 URL: http://svn.freebsd.org/changeset/base/227556 Log: MFC r227231: To be in sync with GEOM_PART_BSD limit the maximum number of supported partitions to 20. MFC r227248: bsdlabel(8) could automatically fill many of disklabel's deprecated fields, but user could specify some of those fields when edits disklabel with `bsdlabel -e`. But without -A flag these fields might be overwritten with default values from the virgin disklabel. So, don't overwrite such fields if they are not zero. Also add checks to prevent creating disklabel with less than DEFPARTITIONS and more than MAXPARTITIONS partitions. PR: bin/162332 Tested by: Eugene Grosbein MFC r227262: Remove unneeded checks. MFC r227270: Add recommendation to use gpart(8) when user tries write disklabel or bootcode to already opened provider. MFC r227296: Fix multi-line comment formatting. Approved by: re (kib) Modified: stable/9/sbin/bsdlabel/bsdlabel.c Directory Properties: stable/9/sbin/bsdlabel/ (props changed) Modified: stable/9/sbin/bsdlabel/bsdlabel.c ============================================================================== --- stable/9/sbin/bsdlabel/bsdlabel.c Wed Nov 16 15:25:12 2011 (r227555) +++ stable/9/sbin/bsdlabel/bsdlabel.c Wed Nov 16 15:32:32 2011 (r227556) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #define DKTYPENAMES #define FSTYPENAMES -#define MAXPARTITIONS 26 +#define MAXPARTITIONS 20 #include #include @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include "pathnames.h" static void makelabel(const char *, struct disklabel *); -static int geom_bsd_available(void); +static int geom_class_available(const char *); static int writelabel(void); static int readlabel(int flag); static void display(FILE *, const struct disklabel *); @@ -355,7 +355,7 @@ readboot(void) } static int -geom_bsd_available(void) +geom_class_available(const char *name) { struct gclass *class; struct gmesh mesh; @@ -366,7 +366,7 @@ geom_bsd_available(void) errc(1, error, "Cannot get GEOM tree"); LIST_FOREACH(class, &mesh.lg_class, lg_class) { - if (strcmp(class->lg_name, "BSD") == 0) { + if (strcmp(class->lg_name, name) == 0) { geom_deletetree(&mesh); return (1); } @@ -411,8 +411,20 @@ writelabel(void) } else serrno = errno; + if (geom_class_available("PART") != 0) { + /* + * Since we weren't able open provider for + * writing, then recommend user to use gpart(8). + */ + warnc(serrno, + "cannot open provider %s for writing label", + specname); + warnx("Try to use gpart(8)."); + return (1); + } + /* Give up if GEOM_BSD is not available. */ - if (geom_bsd_available() == 0) { + if (geom_class_available("BSD") == 0) { warnc(serrno, "%s", specname); return (1); } @@ -831,11 +843,16 @@ getasciilabel(FILE *f, struct disklabel continue; } if (sscanf(cp, "%lu partitions", &v) == 1) { - if (v == 0 || v > MAXPARTITIONS) { + if (v > MAXPARTITIONS) { fprintf(stderr, "line %d: bad # of partitions\n", lineno); lp->d_npartitions = MAXPARTITIONS; errors++; + } else if (v < DEFPARTITIONS) { + fprintf(stderr, + "line %d: bad # of partitions\n", lineno); + lp->d_npartitions = DEFPARTITIONS; + errors++; } else lp->d_npartitions = v; continue; @@ -1149,23 +1166,41 @@ checklabel(struct disklabel *lp) errors++; } else if (lp->d_bbsize % lp->d_secsize) warnx("boot block size %% sector-size != 0"); - if (lp->d_npartitions > MAXPARTITIONS) + if (lp->d_npartitions > MAXPARTITIONS) { warnx("number of partitions (%lu) > MAXPARTITIONS (%d)", (u_long)lp->d_npartitions, MAXPARTITIONS); + errors++; + } + if (lp->d_npartitions < DEFPARTITIONS) { + warnx("number of partitions (%lu) < DEFPARTITIONS (%d)", + (u_long)lp->d_npartitions, DEFPARTITIONS); + errors++; + } } else { struct disklabel *vl; vl = getvirginlabel(); - lp->d_secsize = vl->d_secsize; - lp->d_nsectors = vl->d_nsectors; - lp->d_ntracks = vl->d_ntracks; - lp->d_ncylinders = vl->d_ncylinders; - lp->d_rpm = vl->d_rpm; - lp->d_interleave = vl->d_interleave; - lp->d_secpercyl = vl->d_secpercyl; - lp->d_secperunit = vl->d_secperunit; - lp->d_bbsize = vl->d_bbsize; - lp->d_npartitions = vl->d_npartitions; + if (lp->d_secsize == 0) + lp->d_secsize = vl->d_secsize; + if (lp->d_nsectors == 0) + lp->d_nsectors = vl->d_nsectors; + if (lp->d_ntracks == 0) + lp->d_ntracks = vl->d_ntracks; + if (lp->d_ncylinders == 0) + lp->d_ncylinders = vl->d_ncylinders; + if (lp->d_rpm == 0) + lp->d_rpm = vl->d_rpm; + if (lp->d_interleave == 0) + lp->d_interleave = vl->d_interleave; + if (lp->d_secpercyl == 0) + lp->d_secpercyl = vl->d_secpercyl; + if (lp->d_secperunit == 0) + lp->d_secperunit = vl->d_secperunit; + if (lp->d_bbsize == 0) + lp->d_bbsize = vl->d_bbsize; + if (lp->d_npartitions < DEFPARTITIONS || + lp->d_npartitions > MAXPARTITIONS) + lp->d_npartitions = vl->d_npartitions; } From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 16 15:35:05 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA2541065670; Wed, 16 Nov 2011 15:35:05 +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 B95998FC1C; Wed, 16 Nov 2011 15:35: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 pAGFZ57C054956; Wed, 16 Nov 2011 15:35:05 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFZ5lk054954; Wed, 16 Nov 2011 15:35:05 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161535.pAGFZ5lk054954@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:35:05 +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: r227558 - stable/9/sbin/fdisk_pc98 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:35:05 -0000 Author: ae Date: Wed Nov 16 15:35:05 2011 New Revision: 227558 URL: http://svn.freebsd.org/changeset/base/227558 Log: MFC rr227273: Add reference to gpart(8). Approved by: re (kib) Modified: stable/9/sbin/fdisk_pc98/fdisk.8 Directory Properties: stable/9/sbin/fdisk_pc98/ (props changed) Modified: stable/9/sbin/fdisk_pc98/fdisk.8 ============================================================================== --- stable/9/sbin/fdisk_pc98/fdisk.8 Wed Nov 16 15:32:52 2011 (r227557) +++ stable/9/sbin/fdisk_pc98/fdisk.8 Wed Nov 16 15:35:05 2011 (r227558) @@ -446,6 +446,7 @@ Example: to make slice 1 the active slic .Sh SEE ALSO .Xr boot98cfg 8 , .Xr bsdlabel 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh BUGS The default boot code will not necessarily handle all slice types From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 16 15:36:53 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D888D106566C; Wed, 16 Nov 2011 15:36:53 +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 C75738FC1D; Wed, 16 Nov 2011 15:36: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 pAGFarU3055090; Wed, 16 Nov 2011 15:36:53 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFarLF055087; Wed, 16 Nov 2011 15:36:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161536.pAGFarLF055087@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:36:53 +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: r227560 - stable/9/sbin/fdisk X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:36:54 -0000 Author: ae Date: Wed Nov 16 15:36:53 2011 New Revision: 227560 URL: http://svn.freebsd.org/changeset/base/227560 Log: MFC r227272: Add reference to gpart(8). MFC r227280: Initialize "acc" value inside the loop to reset failed attempts. PR: misc/162262 MFC r227292: Improve error reporting when MBR can not be written. Remove obsolete code which uses DIOCSMBR ioctl. When writing MBR first check that GEOM_MBR is available, if it is not available, then try write MBR directly to provider. If both are failed, then recommend to use gpart(8). MFC r227295: Fix multi-line comment formatting. Pointed by: jh Approved by: re (kib) Modified: stable/9/sbin/fdisk/fdisk.8 stable/9/sbin/fdisk/fdisk.c Directory Properties: stable/9/sbin/fdisk/ (props changed) Modified: stable/9/sbin/fdisk/fdisk.8 ============================================================================== --- stable/9/sbin/fdisk/fdisk.8 Wed Nov 16 15:35:22 2011 (r227559) +++ stable/9/sbin/fdisk/fdisk.8 Wed Nov 16 15:36:53 2011 (r227560) @@ -476,6 +476,7 @@ The default boot code. .Sh SEE ALSO .Xr boot0cfg 8 , .Xr bsdlabel 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh BUGS The default boot code will not necessarily handle all slice types Modified: stable/9/sbin/fdisk/fdisk.c ============================================================================== --- stable/9/sbin/fdisk/fdisk.c Wed Nov 16 15:35:22 2011 (r227559) +++ stable/9/sbin/fdisk/fdisk.c Wed Nov 16 15:36:53 2011 (r227560) @@ -232,6 +232,7 @@ get_type(int t) } +static int geom_class_available(const char *); static void print_s0(void); static void print_part(const struct dos_partition *); static void init_sector0(unsigned long start); @@ -767,49 +768,76 @@ read_disk(off_t sector, void *buf) } static int -write_disk(off_t sector, void *buf) +geom_class_available(const char *name) { + struct gclass *class; + struct gmesh mesh; int error; + + error = geom_gettree(&mesh); + if (error != 0) + errc(1, error, "Cannot get GEOM tree"); + + LIST_FOREACH(class, &mesh.lg_class, lg_class) { + if (strcmp(class->lg_name, name) == 0) { + geom_deletetree(&mesh); + return (1); + } + } + + geom_deletetree(&mesh); + + return (0); +} + +static int +write_disk(off_t sector, void *buf) +{ struct gctl_req *grq; const char *errmsg; - char fbuf[BUFSIZ], *pname; - int i, fdw; + char *pname; + int error; - grq = gctl_get_handle(); - gctl_ro_param(grq, "verb", -1, "write MBR"); - gctl_ro_param(grq, "class", -1, "MBR"); - pname = g_providername(fd); - if (pname == NULL) { - warn("Error getting providername for %s", disk); - return (-1); - } - gctl_ro_param(grq, "geom", -1, pname); - gctl_ro_param(grq, "data", secsize, buf); - errmsg = gctl_issue(grq); - free(pname); - if (errmsg == NULL) { + /* Check that GEOM_MBR is available */ + if (geom_class_available("MBR") != 0) { + grq = gctl_get_handle(); + gctl_ro_param(grq, "verb", -1, "write MBR"); + gctl_ro_param(grq, "class", -1, "MBR"); + pname = g_providername(fd); + if (pname == NULL) { + warn("Error getting providername for %s", disk); + return (-1); + } + gctl_ro_param(grq, "geom", -1, pname); + gctl_ro_param(grq, "data", secsize, buf); + errmsg = gctl_issue(grq); + free(pname); + if (errmsg == NULL) { + gctl_free(grq); + return(0); + } + if (!q_flag) + warnx("GEOM_MBR: %s", errmsg); gctl_free(grq); - return(0); - } - if (!q_flag) /* GEOM errors are benign, not all devices supported */ - warnx("%s", errmsg); - gctl_free(grq); - - error = pwrite(fd, buf, secsize, (sector * 512)); - if (error == secsize) - return (0); - - for (i = 1; i < 5; i++) { - sprintf(fbuf, "%ss%d", disk, i); - fdw = open(fbuf, O_RDWR, 0); - if (fdw < 0) - continue; - error = ioctl(fdw, DIOCSMBR, buf); - close(fdw); - if (error == 0) + } else { + /* + * Try to write MBR directly. This may help when disk + * is not in use. + * XXX: hardcoded sectorsize + */ + error = pwrite(fd, buf, secsize, (sector * 512)); + if (error == secsize) return (0); } - warnx("Failed to write sector zero"); + + /* + * GEOM_MBR is not available or failed to write MBR. + * Now check that we have GEOM_PART and recommend to use gpart (8). + */ + if (geom_class_available("PART") != 0) + warnx("Failed to write MBR. Try to use gpart(8)."); + else + warnx("Failed to write sector zero"); return(EINVAL); } @@ -920,11 +948,12 @@ ok(const char *str) static int decimal(const char *str, int *num, int deflt, uint32_t maxval) { - long long acc = 0; + long long acc; int c; char *cp; while (1) { + acc = 0; printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); fflush(stdout); if (fgets(lbuf, LBUF, stdin) == NULL) @@ -960,7 +989,6 @@ decimal(const char *str, int *num, int d printf("%s is an invalid decimal number. Try again.\n", lbuf); } - } From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 16 16:27:54 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C52A1065676; Wed, 16 Nov 2011 16:27:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31C928FC15; Wed, 16 Nov 2011 16:27: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 pAGGRsCF057068; Wed, 16 Nov 2011 16:27:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGGRs3q057066; Wed, 16 Nov 2011 16:27:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111161627.pAGGRs3q057066@svn.freebsd.org> From: Eitan Adler Date: Wed, 16 Nov 2011 16:27:54 +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: r227565 - stable/9/sys/dev/puc X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 16:27:54 -0000 Author: eadler (ports committer) Date: Wed Nov 16 16:27:53 2011 New Revision: 227565 URL: http://svn.freebsd.org/changeset/base/227565 Log: MFC r226404: - add support for I-O DATA RSA-PCI2/R PR: kern/142999 Submitted by: Takefu Kenji Approved by: jhb Approved by: re (kib) Modified: stable/9/sys/dev/puc/pucdata.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/puc/pucdata.c ============================================================================== --- stable/9/sys/dev/puc/pucdata.c Wed Nov 16 16:24:36 2011 (r227564) +++ stable/9/sys/dev/puc/pucdata.c Wed Nov 16 16:27:53 2011 (r227565) @@ -51,6 +51,7 @@ static puc_config_f puc_config_amc; static puc_config_f puc_config_diva; static puc_config_f puc_config_exar; static puc_config_f puc_config_icbook; +static puc_config_f puc_config_moxa; static puc_config_f puc_config_oxford_pcie; static puc_config_f puc_config_quatech; static puc_config_f puc_config_syba; @@ -518,12 +519,25 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1042, 0xffff, 0, + "Moxa Technologies, Smartio CP-104JU/PCI", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x18, 0, 8, + }, + { 0x1393, 0x1043, 0xffff, 0, "Moxa Technologies, Smartio CP-104EL/PCIe", DEFAULT_RCLK * 8, PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1045, 0xffff, 0, + "Moxa Technologies, Smartio CP-104EL-A/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x14, 0, -1, + .config_function = puc_config_moxa + }, + { 0x1393, 0x1120, 0xffff, 0, "Moxa Technologies, CP-112UL", DEFAULT_RCLK * 8, @@ -645,6 +659,12 @@ const struct puc_cfg puc_pci_devices[] = * As sold by Kouwell . * I/O Flex PCI I/O Card Model-223 with 4 serial and 1 parallel ports. */ + { + 0x1415, 0x9501, 0x10fc ,0xc070, + "I-O DATA RSA-PCI2/R", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, { 0x1415, 0x9501, 0x131f, 0x2050, "SIIG Cyber 4 PCI 16550", @@ -1080,6 +1100,19 @@ puc_config_icbook(struct puc_softc *sc, } static int +puc_config_moxa(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, + intptr_t *res) +{ + const struct puc_cfg *cfg = sc->sc_cfg; + + if (cmd == PUC_CFG_GET_OFS && cfg->device == 0x1045) { + *res = ((port == 3) ? 7 : port) * 0x200; + return 0; + } + return (ENXIO); +} + +static int puc_config_quatech(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { From owner-svn-src-stable-9@FreeBSD.ORG Wed Nov 16 17:40:00 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37CFE106566C; Wed, 16 Nov 2011 17:40:00 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 265DE8FC1B; Wed, 16 Nov 2011 17:40: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 pAGHe0SK059540; Wed, 16 Nov 2011 17:40:00 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGHe0gj059538; Wed, 16 Nov 2011 17:40:00 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201111161740.pAGHe0gj059538@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 16 Nov 2011 17:40: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: r227570 - stable/9/sys/dev/iwn X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 17:40:00 -0000 Author: bschmidt Date: Wed Nov 16 17:39:59 2011 New Revision: 227570 URL: http://svn.freebsd.org/changeset/base/227570 Log: MFC r226679: Let net80211 also know about stopped BA sessions. This fixes some issues where the driver assumed that BA resources are still available due to net80211 saying so. PR: 161407, 159768 Tested by: cperciva, rene Approved by: re (kib) Modified: stable/9/sys/dev/iwn/if_iwn.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/9/sys/dev/iwn/if_iwn.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/iwn/if_iwn.c Wed Nov 16 17:39:59 2011 (r227570) @@ -5641,6 +5641,7 @@ iwn_ampdu_tx_stop(struct ieee80211_node sc->qid2tap[qid] = NULL; free(tap->txa_private, M_DEVBUF); tap->txa_private = NULL; + sc->sc_addba_stop(ni, tap); } static void From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 17 08:07:17 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 509B61065670; Thu, 17 Nov 2011 08:07:17 +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 3FC198FC1A; Thu, 17 Nov 2011 08:07: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 pAH87HNg088116; Thu, 17 Nov 2011 08:07:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH87H8m088114; Thu, 17 Nov 2011 08:07:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111170807.pAH87H8m088114@svn.freebsd.org> From: Dimitry Andric Date: Thu, 17 Nov 2011 08:07:17 +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: r227607 - stable/9/etc/rc.d X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 08:07:17 -0000 Author: dim Date: Thu Nov 17 08:07:16 2011 New Revision: 227607 URL: http://svn.freebsd.org/changeset/base/227607 Log: MFC r227112: Whenever you boot with nfsv4_server_enable=NO (the default) in rc.conf, the /etc/rc.d/nfsd script sets vfs.nfsd.server_max_nfsvers to 3. Then, when you set nfsv4_server_enable=YES in rc.conf, and restart nfsd via the rc.d script, without rebooting, the sysctl does *not* get reset to max version 4, so NFSv4 still doesn't work. Fix this by explicitly setting vfs.nfsd.server_max_nfsvers to 4 when NFSv4 is requested. I also added resetting of the nfs_privport sysctls, since this has the same issue: nfs_reserved_port_only=YES in rc.conf sets the nfs_privport sysctl to 1, but in the other case, the sysctl doesn't get reset to 0. Reviewed by: rmacklem Silence from: rc@ Approved by: re (kib) Modified: stable/9/etc/rc.d/nfsd Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/nfsd ============================================================================== --- stable/9/etc/rc.d/nfsd Thu Nov 17 06:54:49 2011 (r227606) +++ stable/9/etc/rc.d/nfsd Thu Nov 17 08:07:16 2011 (r227607) @@ -29,6 +29,8 @@ nfsd_precmd() if checkyesno nfs_reserved_port_only; then echo 'NFS on reserved port only=YES' sysctl vfs.nfsrv.nfs_privport=1 > /dev/null + else + sysctl vfs.nfsrv.nfs_privport=0 > /dev/null fi else rc_flags="${nfs_server_flags}" @@ -40,9 +42,12 @@ nfsd_precmd() if checkyesno nfs_reserved_port_only; then echo 'NFS on reserved port only=YES' sysctl vfs.nfsd.nfs_privport=1 > /dev/null + else + sysctl vfs.nfsd.nfs_privport=0 > /dev/null fi if checkyesno nfsv4_server_enable; then + sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null if ! checkyesno nfsuserd_enable && \ ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1 then From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 17 12:22:09 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC28A106566B; Thu, 17 Nov 2011 12:22:09 +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 AB2B28FC15; Thu, 17 Nov 2011 12:22: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 pAHCM9HS006094; Thu, 17 Nov 2011 12:22:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCM96j006091; Thu, 17 Nov 2011 12:22:09 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171222.pAHCM96j006091@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:22: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: r227615 - stable/9/share/man/man4 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:22:09 -0000 Author: brueffer Date: Thu Nov 17 12:22:09 2011 New Revision: 227615 URL: http://svn.freebsd.org/changeset/base/227615 Log: MFC: r227271 Write QLogic consistently. Approved by: re (kib) Modified: stable/9/share/man/man4/qlxgb.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/qlxgb.4 ============================================================================== --- stable/9/share/man/man4/qlxgb.4 Thu Nov 17 12:17:39 2011 (r227614) +++ stable/9/share/man/man4/qlxgb.4 Thu Nov 17 12:22:09 2011 (r227615) @@ -90,4 +90,4 @@ The .Nm driver was written by .An David C Somayajulu -at Qlogic Corporation. +at QLogic Corporation. From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 17 12:25:16 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3097A1065670; Thu, 17 Nov 2011 12:25:16 +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 1FAB28FC08; Thu, 17 Nov 2011 12:25: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 pAHCPFxj006397; Thu, 17 Nov 2011 12:25:15 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCPF8N006395; Thu, 17 Nov 2011 12:25:15 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171225.pAHCPF8N006395@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:25: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: r227617 - stable/9/share/man/man4 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:25:16 -0000 Author: brueffer Date: Thu Nov 17 12:25:15 2011 New Revision: 227617 URL: http://svn.freebsd.org/changeset/base/227617 Log: MFC: r227276 Add qlxgb(4). Approved by: re (kib) Modified: stable/9/share/man/man4/altq.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/altq.4 ============================================================================== --- stable/9/share/man/man4/altq.4 Thu Nov 17 12:23:24 2011 (r227616) +++ stable/9/share/man/man4/altq.4 Thu Nov 17 12:25:15 2011 (r227617) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 30, 2010 +.Dd November 6, 2011 .Dt ALTQ 4 .Os .Sh NAME @@ -150,6 +150,7 @@ They have been applied to the following .Xr nge 4 , .Xr npe 4 , .Xr nve 4 , +.Xr qlxgb 4 , .Xr ral 4 , .Xr re 4 , .Xr rl 4 , From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 17 12:27:20 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A98EF106564A; Thu, 17 Nov 2011 12:27:20 +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 988DD8FC0A; Thu, 17 Nov 2011 12: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 pAHCRKcW006583; Thu, 17 Nov 2011 12:27:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCRKGo006581; Thu, 17 Nov 2011 12:27:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171227.pAHCRKGo006581@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:27: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: r227619 - stable/9/share/man/man4 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:27:20 -0000 Author: brueffer Date: Thu Nov 17 12:27:20 2011 New Revision: 227619 URL: http://svn.freebsd.org/changeset/base/227619 Log: MFC: r227448 Reword a sentence in the HARDWARE section a little to make it more suitable for automatic hardware notes generation. Approved by: re (kib) Modified: stable/9/share/man/man4/mps.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/mps.4 ============================================================================== --- stable/9/share/man/man4/mps.4 Thu Nov 17 12:25:38 2011 (r227618) +++ stable/9/share/man/man4/mps.4 Thu Nov 17 12:27:20 2011 (r227619) @@ -60,9 +60,9 @@ driver provides support for LSI Logic Fu .Tn SAS controllers. .Sh HARDWARE -The following controllers are supported by the +The .Nm -driver +driver supports the following controllers: .Pp .Bl -bullet -compact .It From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 17 14:05:59 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0E03106566B; Thu, 17 Nov 2011 14:05:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD95C8FC08; Thu, 17 Nov 2011 14: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 pAHE5xxI011033; Thu, 17 Nov 2011 14:05:59 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHE5xJ9011032; Thu, 17 Nov 2011 14:05:59 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111171405.pAHE5xJ9011032@svn.freebsd.org> From: Eitan Adler Date: Thu, 17 Nov 2011 14:05:59 +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: r227624 - in stable/9/sys: . amd64/include/xen boot boot/i386/efi boot/ia64/efi boot/ia64/ski boot/powerpc/boot1.chrp boot/powerpc/ofw cddl/contrib/opensolaris conf contrib/dev/acpica c... X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 14:06:00 -0000 Author: eadler (ports committer) Date: Thu Nov 17 14:05:59 2011 New Revision: 227624 URL: http://svn.freebsd.org/changeset/base/227624 Log: Record the merge of r227457, which was done as part of r227565 but not mentioned in the commit log PR: kern/142999 PR: kern/151365 Submitted by: Takefu Kenji Submitted by: Joerg Niendorf Approved by: re (kib) Modified: Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) From owner-svn-src-stable-9@FreeBSD.ORG Thu Nov 17 16:08:47 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170361065672; Thu, 17 Nov 2011 16:08:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0CA08FC13; Thu, 17 Nov 2011 16:08: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 pAHG8kLZ016905; Thu, 17 Nov 2011 16:08:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHG8kDU016903; Thu, 17 Nov 2011 16:08:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111171608.pAHG8kDU016903@svn.freebsd.org> From: Rick Macklem Date: Thu, 17 Nov 2011 16:08:46 +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: r227630 - stable/9/sys/rpc X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 16:08:47 -0000 Author: rmacklem Date: Thu Nov 17 16:08:46 2011 New Revision: 227630 URL: http://svn.freebsd.org/changeset/base/227630 Log: MFC: r227059 Both a crash reported on freebsd-current on Oct. 18 under the subject heading "mtx_lock() of destroyed mutex on NFS" and PR# 156168 appear to be caused by clnt_dg_destroy() closing down the socket prematurely. When to close down the socket is controlled by a reference count (cs_refs), but clnt_dg_create() checks for sb_upcall being non-NULL to decide if a new socket is needed. I believe the crashes were caused by the following race: clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket clnt_dg_destroy() then loses race with clnt_dg_create() for acquisition of the SOCKBUF_LOCK() clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1 clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to NULL and destroys socket This patch fixes the above race by changing clnt_dg_destroy() so that it acquires SOCKBUF_LOCK() before testing cs_refs. Tested by: bz Reviewed by: dfr Approved by: re (kib) Modified: stable/9/sys/rpc/clnt_dg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/rpc/clnt_dg.c ============================================================================== --- stable/9/sys/rpc/clnt_dg.c Thu Nov 17 15:51:03 2011 (r227629) +++ stable/9/sys/rpc/clnt_dg.c Thu Nov 17 16:08:46 2011 (r227630) @@ -1001,12 +1001,12 @@ clnt_dg_destroy(CLIENT *cl) cs = cu->cu_socket->so_rcv.sb_upcallarg; clnt_dg_close(cl); + SOCKBUF_LOCK(&cu->cu_socket->so_rcv); mtx_lock(&cs->cs_lock); cs->cs_refs--; if (cs->cs_refs == 0) { mtx_unlock(&cs->cs_lock); - SOCKBUF_LOCK(&cu->cu_socket->so_rcv); soupcall_clear(cu->cu_socket, SO_RCV); clnt_dg_upcallsdone(cu->cu_socket, cs); SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); @@ -1015,6 +1015,7 @@ clnt_dg_destroy(CLIENT *cl) lastsocketref = TRUE; } else { mtx_unlock(&cs->cs_lock); + SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); lastsocketref = FALSE; } From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 18 14:41:48 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84DBE106564A; Fri, 18 Nov 2011 14:41:48 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 731248FC15; Fri, 18 Nov 2011 14:41: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 pAIEfmPV080258; Fri, 18 Nov 2011 14:41:48 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIEfm7O080256; Fri, 18 Nov 2011 14:41:48 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201111181441.pAIEfm7O080256@svn.freebsd.org> From: Fabien Thomas Date: Fri, 18 Nov 2011 14:41: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: r227664 - stable/9/contrib/gcc/config/arm X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 14:41:48 -0000 Author: fabient Date: Fri Nov 18 14:41:48 2011 New Revision: 227664 URL: http://svn.freebsd.org/changeset/base/227664 Log: MFC r227391: Import gcc fix for -fstack-protector that produces segfaulting binaries on arm/armel. Related gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35965 Author kindly accepted that all of his patches can be use as GPLv2. PR: 161128 Approved by: re (kib) Modified: stable/9/contrib/gcc/config/arm/arm.c Directory Properties: stable/9/contrib/gcc/ (props changed) Modified: stable/9/contrib/gcc/config/arm/arm.c ============================================================================== --- stable/9/contrib/gcc/config/arm/arm.c Fri Nov 18 11:18:59 2011 (r227663) +++ stable/9/contrib/gcc/config/arm/arm.c Fri Nov 18 14:41:48 2011 (r227664) @@ -3217,7 +3217,8 @@ legitimize_pic_address (rtx orig, enum m gcc_assert (!no_new_pseudos); if (arm_pic_register != INVALID_REGNUM) { - cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation @@ -3229,7 +3230,8 @@ legitimize_pic_address (rtx orig, enum m { rtx seq; - cfun->machine->pic_reg = gen_reg_rtx (Pmode); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_reg_rtx (Pmode); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 18 20:47:14 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6301C106566C; Fri, 18 Nov 2011 20:47:14 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51DE18FC19; Fri, 18 Nov 2011 20:47: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 pAIKlEi9097453; Fri, 18 Nov 2011 20:47:14 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIKlEIN097451; Fri, 18 Nov 2011 20:47:14 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182047.pAIKlEIN097451@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 20:47:14 +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: r227677 - stable/9/sys/conf X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 20:47:14 -0000 Author: dougb Date: Fri Nov 18 20:47:14 2011 New Revision: 227677 URL: http://svn.freebsd.org/changeset/base/227677 Log: MFC r226863: Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR} (since it no longer exists). Instead, run svnversion if we can find the binary and test that the output looks like a version string. Approved by: re (kib) Modified: stable/9/sys/conf/newvers.sh Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/conf/newvers.sh ============================================================================== --- stable/9/sys/conf/newvers.sh Fri Nov 18 19:43:02 2011 (r227676) +++ stable/9/sys/conf/newvers.sh Fri Nov 18 20:47:14 2011 (r227677) @@ -88,7 +88,7 @@ v=`cat version` u=${USER:-root} d=`pwd` i=`${MAKE:-make} -V KERN_IDENT` for dir in /bin /usr/bin /usr/local/bin; do - if [ -d "${SYSDIR}/.svn" -a -x "${dir}/svnversion" ] ; then + if [ -x "${dir}/svnversion" ] ; then svnversion=${dir}/svnversion break fi @@ -99,8 +99,12 @@ for dir in /bin /usr/bin /usr/local/bin; done if [ -n "$svnversion" ] ; then - echo "$svnversion" - svn=" r`cd ${SYSDIR} && $svnversion`" + echo "$svnversion" + svn=`cd ${SYSDIR} && $svnversion` + case "$svn" in + [0-9]*) svn=" r${svn}" ;; + *) unset svn ;; + esac fi if [ -n "$git_cmd" ] ; then From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 18 21:10:13 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74095106567A; Fri, 18 Nov 2011 21:10:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62D668FC16; Fri, 18 Nov 2011 21:10: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 pAILADaj098807; Fri, 18 Nov 2011 21:10:13 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAILADoc098805; Fri, 18 Nov 2011 21:10:13 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182110.pAILADoc098805@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 21:10:13 +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: r227681 - stable/9/lib/libc/sys X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:10:13 -0000 Author: dougb Date: Fri Nov 18 21:10:13 2011 New Revision: 227681 URL: http://svn.freebsd.org/changeset/base/227681 Log: MFC r227416: Document that flock can return ENOLCK Approved by: re (kib) Modified: stable/9/lib/libc/sys/flock.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) Modified: stable/9/lib/libc/sys/flock.2 ============================================================================== --- stable/9/lib/libc/sys/flock.2 Fri Nov 18 21:09:03 2011 (r227680) +++ stable/9/lib/libc/sys/flock.2 Fri Nov 18 21:10:13 2011 (r227681) @@ -28,7 +28,7 @@ .\" @(#)flock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 22, 2008 +.Dd November 9, 2011 .Dt FLOCK 2 .Os .Sh NAME @@ -154,6 +154,8 @@ refers to an object other than a file. The argument .Fa fd refers to an object that does not support file locking. +.It Bq Er ENOLCK +A lock was requested, but no locks are available. .El .Sh SEE ALSO .Xr close 2 , From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 19 10:24:47 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C79B106566B; Sat, 19 Nov 2011 10:24:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3138D8FC15; Sat, 19 Nov 2011 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 pAJAOlNw038088; Sat, 19 Nov 2011 10:24:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJAOlOE038085; Sat, 19 Nov 2011 10:24:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191024.pAJAOlOE038085@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 10:24: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: r227702 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 10:24:47 -0000 Author: pjd Date: Sat Nov 19 10:24:46 2011 New Revision: 227702 URL: http://svn.freebsd.org/changeset/base/227702 Log: MFC r226620: Update per-thread I/O statistics collection in ZFS. This allows to see processes I/O activity in 'top -m io' output. PR kern/156218 Reported by: Marcus Reid Patch by: avg Approved by: re (kib) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Nov 19 10:11:50 2011 (r227701) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Nov 19 10:24:46 2011 (r227702) @@ -627,6 +627,10 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio } else if (db->db_state == DB_UNCACHED) { spa_t *spa = dn->dn_objset->os_spa; +#ifdef _KERNEL + curthread->td_ru.ru_inblock++; +#endif + if (zio == NULL) zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL); dbuf_read_impl(db, zio, &flags); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Nov 19 10:11:50 2011 (r227701) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Nov 19 10:24:46 2011 (r227702) @@ -397,9 +397,12 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, return (EIO); } /* initiate async i/o */ - if (read) { + if (read) (void) dbuf_read(db, zio, dbuf_flags); - } +#ifdef _KERNEL + else + curthread->td_ru.ru_oublock++; +#endif dbp[i] = &db->db; } rw_exit(&dn->dn_struct_rwlock); From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 19 10:26:35 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69533106564A; Sat, 19 Nov 2011 10:26:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F32F8FC15; Sat, 19 Nov 2011 10:26: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 pAJAQZna038204; Sat, 19 Nov 2011 10:26:35 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJAQZIP038200; Sat, 19 Nov 2011 10:26:35 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191026.pAJAQZIP038200@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 10:26: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: r227703 - in stable/9/cddl/contrib/opensolaris: cmd/zdb head lib/libzpool/common X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 10:26:35 -0000 Author: pjd Date: Sat Nov 19 10:26:34 2011 New Revision: 227703 URL: http://svn.freebsd.org/changeset/base/227703 Log: MFC r226613,r226615,r226616: r226613: libzpool task_alloc: pass only valid flags to kmem_alloc tqflags may contain other flags besided those that are suitable for kmem_alloc == umem_alloc Submitted by: avg r226615: thr_create: new_thread_ID may be NULL Submitted by: avg r226616: zdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS Submitted by: avg Approved by: re (kib) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/cddl/contrib/opensolaris/head/thread.h stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 19 10:24:46 2011 (r227702) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 19 10:26:34 2011 (r227703) @@ -2190,8 +2190,10 @@ dump_block_stats(spa_t *spa) */ (void) bpobj_iterate_nofree(&spa->spa_deferred_bpobj, count_block_cb, &zcb, NULL); - (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, - count_block_cb, &zcb, NULL); + if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { + (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, + count_block_cb, &zcb, NULL); + } if (dump_opt['c'] > 1) flags |= TRAVERSE_PREFETCH_DATA; Modified: stable/9/cddl/contrib/opensolaris/head/thread.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/head/thread.h Sat Nov 19 10:24:46 2011 (r227702) +++ stable/9/cddl/contrib/opensolaris/head/thread.h Sat Nov 19 10:26:34 2011 (r227703) @@ -76,6 +76,7 @@ static __inline int thr_create(void *stack_base, size_t stack_size, void *(*start_func) (void*), void *arg, long flags, thread_t *new_thread_ID) { + pthread_t dummy; int ret; assert(stack_base == NULL); @@ -85,9 +86,12 @@ thr_create(void *stack_base, size_t stac pthread_attr_t attr; pthread_attr_init(&attr); - if(flags & THR_DETACHED) + if (flags & THR_DETACHED) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + if (new_thread_ID == NULL) + new_thread_ID = &dummy; + /* This function ignores the THR_BOUND flag, since NPTL doesn't seem to support PTHREAD_SCOPE_PROCESS */ ret = pthread_create(new_thread_ID, &attr, start_func, arg); Modified: stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sat Nov 19 10:24:46 2011 (r227702) +++ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sat Nov 19 10:26:34 2011 (r227703) @@ -87,7 +87,7 @@ again: if ((t = tq->tq_freelist) != NULL } mutex_exit(&tq->tq_lock); - t = kmem_alloc(sizeof (task_t), tqflags); + t = kmem_alloc(sizeof (task_t), tqflags & KM_SLEEP); mutex_enter(&tq->tq_lock); if (t != NULL) From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 19 10:28:07 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF52C1065673; Sat, 19 Nov 2011 10:28:07 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E3AF8FC0C; Sat, 19 Nov 2011 10:28: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 pAJAS71E038298; Sat, 19 Nov 2011 10:28:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJAS7qx038296; Sat, 19 Nov 2011 10:28:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191028.pAJAS7qx038296@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 10:28:07 +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: r227704 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 10:28:08 -0000 Author: pjd Date: Sat Nov 19 10:28:06 2011 New Revision: 227704 URL: http://svn.freebsd.org/changeset/base/227704 Log: MFC r226617: zfs vdev_file_io_start: validate vdev before using vdev_tsd vdev_tsd can be NULL for certain vdev states. At least in userland testing with ztest. Submitted by: avg Approved by: re (kib) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sat Nov 19 10:26:34 2011 (r227703) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sat Nov 19 10:28:06 2011 (r227704) @@ -153,17 +153,19 @@ static int vdev_file_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; - vdev_file_t *vf = vd->vdev_tsd; - vnode_t *vp = vf->vf_vnode; + vdev_file_t *vf; + vnode_t *vp; ssize_t resid; - if (zio->io_type == ZIO_TYPE_IOCTL) { - /* XXPOLICY */ - if (!vdev_readable(vd)) { - zio->io_error = ENXIO; - return (ZIO_PIPELINE_CONTINUE); - } + if (!vdev_readable(vd)) { + zio->io_error = ENXIO; + return (ZIO_PIPELINE_CONTINUE); + } + + vf = vd->vdev_tsd; + vp = vf->vf_vnode; + if (zio->io_type == ZIO_TYPE_IOCTL) { switch (zio->io_cmd) { case DKIOCFLUSHWRITECACHE: zio->io_error = VOP_FSYNC(vp, FSYNC | FDSYNC, From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 19 10:49:04 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 344F81065670; Sat, 19 Nov 2011 10:49:04 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20CEC8FC13; Sat, 19 Nov 2011 10:49: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 pAJAn4gA039011; Sat, 19 Nov 2011 10:49:04 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJAn3Nu039004; Sat, 19 Nov 2011 10:49:03 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191049.pAJAn3Nu039004@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 10:49:03 +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: r227705 - in stable/9: sys/boot/common sys/boot/zfs sys/cddl/boot/zfs tools/tools/zfsboottest X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 10:49:04 -0000 Author: pjd Date: Sat Nov 19 10:49:03 2011 New Revision: 227705 URL: http://svn.freebsd.org/changeset/base/227705 Log: MFC r226549,r226550,r226551,r226552,r226553,r226554,r226568,r226569,r226611, r226612: r226549: Remove redundant size calculation. r226550: Initialize 'rc' properly before using it. This error could lead to infinite loop when data reconstruction was needed. r226551: Don't mark vdev as healthy too soon, so we won't try to use invalid vdevs. r226552: Never pass NULL block pointer when reading. This is neither expected nor handled by lower layers like vdev_raidz, which uses bp for checksum verification. This bug could lead to NULL pointer reference and resets during boot. r226553: Always pass data size for checksum verification function, as using physical block size declared in bp may not always be what we want. For example in case of gang block header physical block size declared in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum calculation failed. This bug could lead to accessing unallocated memory and resets/failures during boot. r226554: Fix missing return when LOADER_GPT_SUPPORT is defined, but LOADER_MBR_SUPPORT is not. r226568: - Correctly read gang header from raidz. - Decompress assembled gang block data if compressed. - Verify checksum of a gang header. - Verify checksum of assembled gang block data. - Verify checksum of uber block. Submitted by: avg r226569: With LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would never call disk_openmbr(). Submitted by: avg r226611: - Allow to specify multiple files to check, eg. zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel /boot/zfsloader - Instead of printing file's content calculate MD5 hash of the file, so it can be easly compared to the hash calculated via file system. - Some other minor improvements. r226612: Because ZFS boot code was very fragile in the past and real PITA to debug, introduce zfsboottest.sh script that will verify if it will be possible to boot from the given pool. # zfsboottest.sh system Where "system" is pool name of the pool we want to boot from. What is being verified by the script: - Does the pool exist? - Does it have bootfs property configured? - Is mountpoint property of the boot dataset set to 'legacy'? Dataset configured in bootfs property has to be mounted to perform more checks: - Does the /boot directory in boot dataset exist? - Is this dataset configured as root file system in /etc/fstab or set in vfs.root.mountfrom variable in /boot/loader.conf? By using zfsboottest tool the script will read all the files in /boot directory using ZFS boot code and calculate their checksums. Then, it will walk /boot directory using find(1) though regular file sytem and also read all the files in /boot directory and calculate their checksums. If any of the files cannot be looked up, read or checksum is invalid it will be reported and booting off of this pool is probably not possible. Some additional checks may be interesting as well. For example if the disks contain proper pmbr and gptzfsboot code or if all expected files in /boot/ are present. When upgrading FreeBSD, one should snapshot datasets that contain operating system, upgrade (install new world and kernel) and use zfsboottest.sh to verify if it will be possible to boot from new configuration. If all is good one should upgrade boot blocks, by eg.: # gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1 If something is wrong, one should rollback datasets and report the problems. Approved by: re (kib) Added: stable/9/tools/tools/zfsboottest/zfsboottest.sh - copied unchanged from r226612, head/tools/tools/zfsboottest/zfsboottest.sh Modified: stable/9/sys/boot/common/disk.c stable/9/sys/boot/zfs/zfsimpl.c stable/9/sys/cddl/boot/zfs/zfssubr.c stable/9/tools/tools/zfsboottest/Makefile stable/9/tools/tools/zfsboottest/zfsboottest.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/tools/tools/zfsboottest/ (props changed) Modified: stable/9/sys/boot/common/disk.c ============================================================================== --- stable/9/sys/boot/common/disk.c Sat Nov 19 10:28:06 2011 (r227704) +++ stable/9/sys/boot/common/disk.c Sat Nov 19 10:49:03 2011 (r227705) @@ -776,10 +776,11 @@ disk_open(struct disk_devdesc *dev) #ifdef LOADER_GPT_SUPPORT rc = disk_opengpt(dev); - if (rc) + if (rc == 0) + return (0); #endif #ifdef LOADER_MBR_SUPPORT - rc = disk_openmbr(dev); + rc = disk_openmbr(dev); #endif return (rc); Modified: stable/9/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/9/sys/boot/zfs/zfsimpl.c Sat Nov 19 10:28:06 2011 (r227704) +++ stable/9/sys/boot/zfs/zfsimpl.c Sat Nov 19 10:49:03 2011 (r227705) @@ -347,7 +347,7 @@ vdev_read_phys(vdev_t *vdev, const blkpt rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); - if (bp && zio_checksum_error(bp, buf, offset)) + if (bp && zio_checksum_verify(bp, buf)) return (EIO); return (0); @@ -543,8 +543,6 @@ vdev_init_from_nvlist(const unsigned cha vdev->v_state = VDEV_STATE_DEGRADED; else if (isnt_present) vdev->v_state = VDEV_STATE_CANT_OPEN; - else - vdev->v_state = VDEV_STATE_HEALTHY; } rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, @@ -800,6 +798,7 @@ vdev_probe(vdev_phys_read_t *read, void BP_SET_PSIZE(&bp, sizeof(vdev_phys_t)); BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL); BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); + DVA_SET_OFFSET(BP_IDENTITY(&bp), off); ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); if (vdev_read_phys(&vtmp, &bp, vdev_label, off, 0)) return (EIO); @@ -912,6 +911,7 @@ vdev_probe(vdev_phys_read_t *read, void if (vdev) { vdev->v_phys_read = read; vdev->v_read_priv = read_priv; + vdev->v_state = VDEV_STATE_HEALTHY; } else { printf("ZFS: inconsistent nvlist contents\n"); return (EIO); @@ -941,7 +941,7 @@ vdev_probe(vdev_phys_read_t *read, void BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); - if (vdev_read_phys(vdev, NULL, upbuf, off, VDEV_UBERBLOCK_SIZE(vdev))) + if (vdev_read_phys(vdev, &bp, upbuf, off, 0)) continue; if (up->ub_magic != UBERBLOCK_MAGIC) @@ -974,34 +974,39 @@ ilog2(int n) } static int -zio_read_gang(spa_t *spa, const blkptr_t *bp, const dva_t *dva, void *buf) +zio_read_gang(spa_t *spa, const blkptr_t *bp, void *buf) { + blkptr_t gbh_bp; zio_gbh_phys_t zio_gb; - vdev_t *vdev; - int vdevid; - off_t offset; + char *pbuf; int i; - vdevid = DVA_GET_VDEV(dva); - offset = DVA_GET_OFFSET(dva); - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) - if (vdev->v_id == vdevid) - break; - if (!vdev || !vdev->v_read) - return (EIO); - if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + /* Artificial BP for gang block header. */ + gbh_bp = *bp; + BP_SET_PSIZE(&gbh_bp, SPA_GANGBLOCKSIZE); + BP_SET_LSIZE(&gbh_bp, SPA_GANGBLOCKSIZE); + BP_SET_CHECKSUM(&gbh_bp, ZIO_CHECKSUM_GANG_HEADER); + BP_SET_COMPRESS(&gbh_bp, ZIO_COMPRESS_OFF); + for (i = 0; i < SPA_DVAS_PER_BP; i++) + DVA_SET_GANG(&gbh_bp.blk_dva[i], 0); + + /* Read gang header block using the artificial BP. */ + if (zio_read(spa, &gbh_bp, &zio_gb)) return (EIO); + pbuf = buf; for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { blkptr_t *gbp = &zio_gb.zg_blkptr[i]; if (BP_IS_HOLE(gbp)) continue; - if (zio_read(spa, gbp, buf)) + if (zio_read(spa, gbp, pbuf)) return (EIO); - buf = (char*)buf + BP_GET_PSIZE(gbp); + pbuf += BP_GET_PSIZE(gbp); } - + + if (zio_checksum_verify(bp, buf)) + return (EIO); return (0); } @@ -1024,46 +1029,41 @@ zio_read(spa_t *spa, const blkptr_t *bp, if (!dva->dva_word[0] && !dva->dva_word[1]) continue; - if (DVA_GET_GANG(dva)) { - error = zio_read_gang(spa, bp, dva, buf); - if (error != 0) - continue; - } else { - vdevid = DVA_GET_VDEV(dva); - offset = DVA_GET_OFFSET(dva); - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) { - if (vdev->v_id == vdevid) - break; - } - if (!vdev || !vdev->v_read) - continue; + vdevid = DVA_GET_VDEV(dva); + offset = DVA_GET_OFFSET(dva); + STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) { + if (vdev->v_id == vdevid) + break; + } + if (!vdev || !vdev->v_read) + continue; - size = BP_GET_PSIZE(bp); + size = BP_GET_PSIZE(bp); + if (vdev->v_read == vdev_raidz_read) { align = 1ULL << vdev->v_top->v_ashift; if (P2PHASE(size, align) != 0) size = P2ROUNDUP(size, align); - if (size != BP_GET_PSIZE(bp) || cpfunc != ZIO_COMPRESS_OFF) - pbuf = zfs_alloc(size); - else - pbuf = buf; + } + if (size != BP_GET_PSIZE(bp) || cpfunc != ZIO_COMPRESS_OFF) + pbuf = zfs_alloc(size); + else + pbuf = buf; + if (DVA_GET_GANG(dva)) + error = zio_read_gang(spa, bp, pbuf); + else error = vdev->v_read(vdev, bp, pbuf, offset, size); - if (error == 0) { - if (cpfunc != ZIO_COMPRESS_OFF) { - error = zio_decompress_data(cpfunc, - pbuf, BP_GET_PSIZE(bp), buf, - BP_GET_LSIZE(bp)); - } else if (size != BP_GET_PSIZE(bp)) { - bcopy(pbuf, buf, BP_GET_PSIZE(bp)); - } - } - if (buf != pbuf) - zfs_free(pbuf, size); - if (error != 0) - continue; + if (error == 0) { + if (cpfunc != ZIO_COMPRESS_OFF) + error = zio_decompress_data(cpfunc, pbuf, + BP_GET_PSIZE(bp), buf, BP_GET_LSIZE(bp)); + else if (size != BP_GET_PSIZE(bp)) + bcopy(pbuf, buf, BP_GET_PSIZE(bp)); } - error = 0; - break; + if (buf != pbuf) + zfs_free(pbuf, size); + if (error == 0) + break; } if (error != 0) printf("ZFS: i/o error - all block copies unavailable\n"); Modified: stable/9/sys/cddl/boot/zfs/zfssubr.c ============================================================================== --- stable/9/sys/cddl/boot/zfs/zfssubr.c Sat Nov 19 10:28:06 2011 (r227704) +++ stable/9/sys/cddl/boot/zfs/zfssubr.c Sat Nov 19 10:49:03 2011 (r227705) @@ -181,14 +181,17 @@ zio_checksum_label_verifier(zio_cksum_t } static int -zio_checksum_error(const blkptr_t *bp, void *data, uint64_t offset) +zio_checksum_verify(const blkptr_t *bp, void *data) { - unsigned int checksum = BP_IS_GANG(bp) ? ZIO_CHECKSUM_GANG_HEADER : BP_GET_CHECKSUM(bp); - uint64_t size = BP_GET_PSIZE(bp); + uint64_t size; + unsigned int checksum; zio_checksum_info_t *ci; zio_cksum_t actual_cksum, expected_cksum, verifier; int byteswap; + checksum = BP_GET_CHECKSUM(bp); + size = BP_GET_PSIZE(bp); + if (checksum >= ZIO_CHECKSUM_FUNCTIONS) return (EINVAL); ci = &zio_checksum_table[checksum]; @@ -206,7 +209,8 @@ zio_checksum_error(const blkptr_t *bp, v if (checksum == ZIO_CHECKSUM_GANG_HEADER) zio_checksum_gang_verifier(&verifier, bp); else if (checksum == ZIO_CHECKSUM_LABEL) - zio_checksum_label_verifier(&verifier, offset); + zio_checksum_label_verifier(&verifier, + DVA_GET_OFFSET(BP_IDENTITY(bp))); else verifier = bp->blk_cksum; @@ -224,7 +228,6 @@ zio_checksum_error(const blkptr_t *bp, v byteswap_uint64_array(&expected_cksum, sizeof (zio_cksum_t)); } else { - ASSERT(!BP_IS_GANG(bp)); expected_cksum = bp->blk_cksum; ci->ci_func[0](data, size, &actual_cksum); } @@ -1215,15 +1218,10 @@ static void vdev_raidz_map_free(raidz_map_t *rm) { int c; - size_t size; for (c = rm->rm_firstdatacol - 1; c >= 0; c--) zfs_free(rm->rm_col[c].rc_data, rm->rm_col[c].rc_size); - size = 0; - for (c = rm->rm_firstdatacol; c < rm->rm_cols; c++) - size += rm->rm_col[c].rc_size; - zfs_free(rm, offsetof(raidz_map_t, rm_col[rm->rm_scols])); } @@ -1245,10 +1243,10 @@ vdev_child(vdev_t *pvd, uint64_t devidx) * any ereports we generate can note it. */ static int -raidz_checksum_verify(const blkptr_t *bp, void *data) +raidz_checksum_verify(const blkptr_t *bp, void *data, uint64_t size) { - return (zio_checksum_error(bp, data, 0)); + return (zio_checksum_verify(bp, data)); } /* @@ -1298,7 +1296,7 @@ raidz_parity_verify(raidz_map_t *rm) */ static int vdev_raidz_combrec(raidz_map_t *rm, const blkptr_t *bp, void *data, - off_t offset, int total_errors, int data_errors) + off_t offset, uint64_t bytes, int total_errors, int data_errors) { raidz_col_t *rc; void *orig[VDEV_RAIDZ_MAXPARITY]; @@ -1377,7 +1375,7 @@ vdev_raidz_combrec(raidz_map_t *rm, cons * success. */ code = vdev_raidz_reconstruct(rm, tgts, n); - if (raidz_checksum_verify(bp, data) == 0) { + if (raidz_checksum_verify(bp, data, bytes) == 0) { for (i = 0; i < n; i++) { c = tgts[i]; rc = &rm->rm_col[c]; @@ -1548,7 +1546,7 @@ reconstruct: */ if (total_errors <= rm->rm_firstdatacol - parity_untried) { if (data_errors == 0) { - if (raidz_checksum_verify(bp, data) == 0) { + if (raidz_checksum_verify(bp, data, bytes) == 0) { /* * If we read parity information (unnecessarily * as it happens since no reconstruction was @@ -1593,7 +1591,7 @@ reconstruct: code = vdev_raidz_reconstruct(rm, tgts, n); - if (raidz_checksum_verify(bp, data) == 0) { + if (raidz_checksum_verify(bp, data, bytes) == 0) { /* * If we read more parity disks than were used * for reconstruction, confirm that the other @@ -1633,7 +1631,9 @@ reconstruct: n = 0; for (c = 0; c < rm->rm_cols; c++) { - if (rm->rm_col[c].rc_tried) + rc = &rm->rm_col[c]; + + if (rc->rc_tried) continue; cvd = vdev_child(vd, rc->rc_devidx); @@ -1665,8 +1665,8 @@ reconstruct: if (total_errors > rm->rm_firstdatacol) { error = EIO; } else if (total_errors < rm->rm_firstdatacol && - (code = vdev_raidz_combrec(rm, bp, data, offset, total_errors, - data_errors)) != 0) { + (code = vdev_raidz_combrec(rm, bp, data, offset, bytes, + total_errors, data_errors)) != 0) { /* * If we didn't use all the available parity for the * combinatorial reconstruction, verify that the remaining Modified: stable/9/tools/tools/zfsboottest/Makefile ============================================================================== --- stable/9/tools/tools/zfsboottest/Makefile Sat Nov 19 10:28:06 2011 (r227704) +++ stable/9/tools/tools/zfsboottest/Makefile Sat Nov 19 10:49:03 2011 (r227705) @@ -2,7 +2,12 @@ .PATH: ${.CURDIR}/../../../sys/boot/zfs ${.CURDIR}/../../../sys/cddl/boot/zfs +BINDIR?= /usr/bin +SCRIPTSDIR?= /usr/bin + PROG= zfsboottest +SCRIPTS= zfsboottest.sh +SCRIPTSNAME= zfsboottest.sh NO_MAN= CFLAGS= -O1 \ @@ -12,6 +17,7 @@ CFLAGS= -O1 \ -fdiagnostics-show-option \ -W -Wextra -Wno-sign-compare -Wno-unused-parameter \ -Werror +LDFLAGS+=-lmd .if ${MACHINE_CPUARCH} == "amd64" beforedepend zfsboottest.o: machine Modified: stable/9/tools/tools/zfsboottest/zfsboottest.c ============================================================================== --- stable/9/tools/tools/zfsboottest/zfsboottest.c Sat Nov 19 10:28:06 2011 (r227704) +++ stable/9/tools/tools/zfsboottest/zfsboottest.c Sat Nov 19 10:49:03 2011 (r227705) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2010 Doug Rabson * Copyright (c) 2011 Andriy Gapon + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,8 +29,10 @@ #include #include +#include #include #include +#include #include #include #include @@ -43,6 +46,7 @@ void pager_output(const char *line) { + fprintf(stderr, "%s", line); } @@ -54,7 +58,7 @@ pager_output(const char *line) static int vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) { - int fd = *(int *) priv; + int fd = *(int *)priv; if (pread(fd, buf, bytes, off) != bytes) return (-1); @@ -73,7 +77,7 @@ zfs_read(spa_t *spa, dnode_phys_t *dn, v n = zp->zp_size - off; rc = dnode_read(spa, dn, off, buf, n); - if (rc) + if (rc != 0) return (-rc); return (n); @@ -82,31 +86,49 @@ zfs_read(spa_t *spa, dnode_phys_t *dn, v int main(int argc, char** argv) { - char buf[512]; - int fd[100]; + char buf[512], hash[33]; + MD5_CTX ctx; struct stat sb; dnode_phys_t dn; spa_t *spa; off_t off; ssize_t n; - int i; + int i, failures, *fd; zfs_init(); if (argc == 1) { static char *av[] = { - "zfstest", "COPYRIGHT", - "/dev/da0p2", "/dev/da1p2", "/dev/da2p2", + "zfsboottest", + "/dev/gpt/system0", + "/dev/gpt/system1", + "-", + "/boot/zfsloader", + "/boot/support.4th", + "/boot/kernel/kernel", NULL, }; - argc = 5; + argc = sizeof(av) / sizeof(av[0]) - 1; argv = av; } - for (i = 2; i < argc; i++) { - fd[i] = open(argv[i], O_RDONLY); - if (fd[i] < 0) + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-") == 0) + break; + } + fd = malloc(sizeof(fd[0]) * (i - 1)); + if (fd == NULL) + errx(1, "Unable to allocate memory."); + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-") == 0) + break; + fd[i - 1] = open(argv[i], O_RDONLY); + if (fd[i - 1] == -1) { + warn("open(%s) failed", argv[i]); continue; - if (vdev_probe(vdev_read, &fd[i], NULL) != 0) - close(fd[i]); + } + if (vdev_probe(vdev_read, &fd[i - 1], NULL) != 0) { + warnx("vdev_probe(%s) failed", argv[i]); + close(fd[i - 1]); + } } spa_all_status(); @@ -121,29 +143,40 @@ main(int argc, char** argv) exit(1); } - if (zfs_lookup(spa, argv[1], &dn)) { - fprintf(stderr, "can't lookup\n"); - exit(1); - } - - if (zfs_dnode_stat(spa, &dn, &sb)) { - fprintf(stderr, "can't stat\n"); - exit(1); - } - + printf("\n"); + for (++i, failures = 0; i < argc; i++) { + if (zfs_lookup(spa, argv[i], &dn)) { + fprintf(stderr, "%s: can't lookup\n", argv[i]); + failures++; + continue; + } - off = 0; - do { - n = sb.st_size - off; - n = n > sizeof(buf) ? sizeof(buf) : n; - n = zfs_read(spa, &dn, buf, n, off); - if (n < 0) { - fprintf(stderr, "zfs_read failed\n"); - exit(1); + if (zfs_dnode_stat(spa, &dn, &sb)) { + fprintf(stderr, "%s: can't stat\n", argv[i]); + failures++; + continue; } - write(1, buf, n); - off += n; - } while (off < sb.st_size); - return (0); + off = 0; + MD5Init(&ctx); + do { + n = sb.st_size - off; + n = n > sizeof(buf) ? sizeof(buf) : n; + n = zfs_read(spa, &dn, buf, n, off); + if (n < 0) { + fprintf(stderr, "%s: zfs_read failed\n", + argv[i]); + failures++; + break; + } + MD5Update(&ctx, buf, n); + off += n; + } while (off < sb.st_size); + if (off < sb.st_size) + continue; + MD5End(&ctx, hash); + printf("%s %s\n", hash, argv[i]); + } + + return (failures == 0 ? 0 : 1); } Copied: stable/9/tools/tools/zfsboottest/zfsboottest.sh (from r226612, head/tools/tools/zfsboottest/zfsboottest.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/tools/zfsboottest/zfsboottest.sh Sat Nov 19 10:49:03 2011 (r227705, copy of r226612, head/tools/tools/zfsboottest/zfsboottest.sh) @@ -0,0 +1,130 @@ +#!/bin/sh +# +# Copyright (c) 2011 Pawel Jakub Dawidek +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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$ + +if [ $# -ne 1 ]; then + echo "usage: zfsboottest.sh " >&2 + exit 1 +fi + +which -s zfsboottest +if [ $? -eq 0 ]; then + zfsboottest="zfsboottest" +else + if [ ! -x "/usr/src/tools/tools/zfsboottest/zfsboottest" ]; then + echo "Unable to find \"zfsboottest\" utility." >&2 + exit 1 + fi + zfsboottest="/usr/src/tools/tools/zfsboottest/zfsboottest" +fi + +startdir="/boot" + +pool="${1}" +zpool list "${pool}" >/dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "No such pool \"${pool}\"." >&2 + exit 1 +fi +bootfs=`zpool get bootfs "${pool}" | tail -1 | awk '{print $3}'` +if [ "${bootfs}" = "-" ]; then + echo "The \"bootfs\" property is not configured for pool \"${pool}\"." >&2 + exit 1 +fi +# Dataset's mountpoint property should be set to 'legacy'. +if [ "`zfs get -H -o value mountpoint ${bootfs}`" != "legacy" ]; then + echo "The \"mountpoint\" property of dataset \"${bootfs}\" should be set to \"legacy\"." >&2 + exit 1 +fi +mountpoint=`df -t zfs "${bootfs}" 2>/dev/null | tail -1 | awk '{print $6}'` +if [ -z "${mountpoint}" ]; then + echo "The \"${bootfs}\" dataset is not mounted." >&2 + exit 1 +fi +if [ ! -d "${mountpoint}${startdir}" ]; then + echo "The \"${mountpoint}${startdir}\" directory doesn't exist." >&2 + exit 1 +fi +# To be able to mount root ZFS file system we need either /etc/fstab entry +# or vfs.root.mountfrom variable set in /boot/loader.conf. +egrep -q '^'"${bootfs}"'[[:space:]]+/[[:space:]]+zfs[[:space:]]+' "${mountpoint}/etc/fstab" 2>/dev/null +if [ $? -ne 0 ]; then + egrep -q 'vfs.root.mountfrom="?'"${bootfs}"'"?[[:space:]]*$' "${mountpoint}/boot/loader.conf" 2>/dev/null + if [ $? -ne 0 ]; then + echo "To be able to boot from \"${bootfs}\", you need to declare" >&2 + echo "\"${bootfs}\" as being root file system in ${mountpoint}/etc/fstab" >&2 + echo "or add \"vfs.root.mountfrom\" variable set to \"${bootfs}\" to" >&2 + echo "${mountpoint}/boot/loader.conf." >&2 + exit 1 + fi +fi +vdevs="" +for vdev in `zpool status "${pool}" | grep ONLINE | awk '{print $1}'`; do + vdev="/dev/${vdev#/dev/}" + if [ -c "${vdev}" ]; then + if [ -z "${vdevs}" ]; then + vdevs="${vdev}" + else + vdevs="${vdevs} ${vdev}" + fi + fi +done + +list0=`mktemp /tmp/zfsboottest.XXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to create temporary file." >&2 + exit 1 +fi +list1=`mktemp /tmp/zfsboottest.XXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to create temporary file." >&2 + rm -f "${list0}" + exit 1 +fi + +echo "zfsboottest.sh is reading all the files in ${mountpoint}${startdir} using" +echo "boot code and using file system code." +echo "It calculates MD5 checksums for all the files and will compare them." +echo "If all files can be properly read using boot code, it is very likely you" +echo "will be able to boot from \"${pool}\" pool>:> Good luck!" +echo + +"${zfsboottest}" ${vdevs} - `find "${mountpoint}${startdir}" -type f | sed "s@^${mountpoint}@@"` | egrep '^[0-9a-z]{32} /' | sort -k 2 >"${list0}" +find "${mountpoint}${startdir}" -type f | xargs md5 -r | sed "s@ ${mountpoint}@ @" | egrep '^[0-9a-z]{32} /' | sort -k 2 >"${list1}" + +diff -u "${list0}" "${list1}" +ec=$? + +rm -f "${list0}" "${list1}" + +if [ $? -ne 0 ]; then + echo >&2 + echo "You may not be able to boot." >&2 + exit 1 +fi + +echo "OK" From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 19 12:55:33 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80208106566B; Sat, 19 Nov 2011 12:55:33 +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 656818FC13; Sat, 19 Nov 2011 12:55: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 pAJCtXHb043718; Sat, 19 Nov 2011 12:55:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJCtX6E043710; Sat, 19 Nov 2011 12:55:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191255.pAJCtX6E043710@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 12:55:33 +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: r227711 - in stable/9: share/man/man9 sys/dev/ofw sys/kern sys/powerpc/powerpc sys/sys X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 12:55:33 -0000 Author: marius Date: Sat Nov 19 12:55:32 2011 New Revision: 227711 URL: http://svn.freebsd.org/changeset/base/227711 Log: MFC: r227537 As it turns out, r186347 actually is insufficient to avoid the use of the curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style curthread implementation on sparc64, crashing the kernel in its early cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the things we need for that, which leads to a chicken-and-egg problem). What happens is that due to the fact that the idea of r210623 actually is to allow the compiler to cache invocations of curthread, it factors out obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to before the branch based on kobj_mutex_inited when compiling the kernel without the debugging options. So change kobj_class_compile_static(9) to just never acquire kobj_mtx, effectively restricting it to its documented use, and add a kobj_init_static(9) for initializing objects using a class compiled with the former and that also avoids using mutex(9) (and malloc(9)). Also assert in both of these functions that they are used in their intended way only. While at it, inline kobj_register_method() and kobj_unregister_method() as there wasn't much point for factoring them out in the first place and so that a reader of the code has to figure out the locking for fewer functions missing a KOBJ_ASSERT. Tested on powerpc{,64} by andreast. Reviewed by: nwhitehorn (earlier version), jhb Approved by: re (kib) Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/kobj.9 stable/9/sys/dev/ofw/openfirm.c stable/9/sys/kern/subr_kobj.c stable/9/sys/powerpc/powerpc/platform.c stable/9/sys/powerpc/powerpc/pmap_dispatch.c stable/9/sys/sys/kobj.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/share/man/man9/Makefile Sat Nov 19 12:55:32 2011 (r227711) @@ -724,7 +724,8 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \ kobj.9 kobj_class_free.9 \ kobj.9 kobj_create.9 \ kobj.9 kobj_delete.9 \ - kobj.9 kobj_init.9 + kobj.9 kobj_init.9 \ + kobj.9 kobj_init_static.9 MLINKS+=kproc.9 kproc_create.9 \ kproc.9 kproc_exit.9 \ kproc.9 kproc_resume.9 \ Modified: stable/9/share/man/man9/kobj.9 ============================================================================== --- stable/9/share/man/man9/kobj.9 Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/share/man/man9/kobj.9 Sat Nov 19 12:55:32 2011 (r227711) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2000 +.Dd November 14, 2011 .Dt KOBJ 9 .Os .Sh NAME @@ -48,6 +48,8 @@ .Ft void .Fn kobj_init "kobj_t obj" "kobj_class_t cls" .Ft void +.Fn kobj_init_static "kobj_t obj" "kobj_class_t cls" +.Ft void .Fn kobj_delete "kobj_t obj" "struct malloc_type *mtype" .Fn DEFINE_CLASS name "kobj_method_t *methods" "size_t size" .Sh DESCRIPTION @@ -88,10 +90,14 @@ Objects created in this way should be fr Clients which would like to manage the allocation of memory themselves should call .Fn kobj_init +or +.Fn kobj_init_static with a pointer to the memory for the object and the class which implements it. It is also possible to use .Fn kobj_init +and +.Fn kobj_init_static to change the class for an object. This should be done with care as the classes must agree on the layout of the object. @@ -109,13 +115,19 @@ A client should not normally need to cal will automatically be compiled the first time it is used. If a class is to be used before .Xr malloc 9 -is initialised, +and +.Xr mutex 9 +are initialised, then .Fn kobj_class_compile_static should be called with the class and a pointer to a statically allocated .Vt kobj_ops structure before the class is used to initialise any objects. +In that case, also +.Fn kobj_init_static +should be used instead of +.Fn kobj_init . .Pp To define a class, first define a simple array of .Vt kobj_method_t . Modified: stable/9/sys/dev/ofw/openfirm.c ============================================================================== --- stable/9/sys/dev/ofw/openfirm.c Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/sys/dev/ofw/openfirm.c Sat Nov 19 12:55:32 2011 (r227711) @@ -127,7 +127,7 @@ OF_init(void *cookie) * then statically initialize the OFW object. */ kobj_class_compile_static(ofw_def_impl, &ofw_kernel_kops); - kobj_init((kobj_t)ofw_obj, ofw_def_impl); + kobj_init_static((kobj_t)ofw_obj, ofw_def_impl); rv = OFW_INIT(ofw_obj, cookie); Modified: stable/9/sys/kern/subr_kobj.c ============================================================================== --- stable/9/sys/kern/subr_kobj.c Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/sys/kern/subr_kobj.c Sat Nov 19 12:55:32 2011 (r227711) @@ -60,18 +60,9 @@ static struct mtx kobj_mtx; static int kobj_mutex_inited; static int kobj_next_id = 1; -/* - * In the event that kobj_mtx has not been initialized yet, - * we will ignore it, and run without locks in order to support - * use of KOBJ before mutexes are available. This early in the boot - * process, everything is single threaded and so races should not - * happen. This is used to provide the PMAP layer on PowerPC, as well - * as board support. - */ - -#define KOBJ_LOCK() if (kobj_mutex_inited) mtx_lock(&kobj_mtx); -#define KOBJ_UNLOCK() if (kobj_mutex_inited) mtx_unlock(&kobj_mtx); -#define KOBJ_ASSERT(what) if (kobj_mutex_inited) mtx_assert(&kobj_mtx,what); +#define KOBJ_LOCK() mtx_lock(&kobj_mtx) +#define KOBJ_UNLOCK() mtx_unlock(&kobj_mtx) +#define KOBJ_ASSERT(what) mtx_assert(&kobj_mtx, what); SYSCTL_INT(_kern, OID_AUTO, kobj_methodcount, CTLFLAG_RD, &kobj_next_id, 0, ""); @@ -104,28 +95,11 @@ kobj_error_method(void) } static void -kobj_register_method(struct kobjop_desc *desc) -{ - KOBJ_ASSERT(MA_OWNED); - - if (desc->id == 0) { - desc->id = kobj_next_id++; - } -} - -static void -kobj_unregister_method(struct kobjop_desc *desc) -{ -} - -static void kobj_class_compile_common(kobj_class_t cls, kobj_ops_t ops) { kobj_method_t *m; int i; - KOBJ_ASSERT(MA_OWNED); - /* * Don't do anything if we are already compiled. */ @@ -135,8 +109,10 @@ kobj_class_compile_common(kobj_class_t c /* * First register any methods which need it. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_register_method(m->desc); + for (i = 0, m = cls->methods; m->desc; i++, m++) { + if (m->desc->id == 0) + m->desc->id = kobj_next_id++; + } /* * Then initialise the ops table. @@ -159,7 +135,7 @@ kobj_class_compile(kobj_class_t cls) */ ops = malloc(sizeof(struct kobj_ops), M_KOBJ, M_NOWAIT); if (!ops) - panic("kobj_compile_methods: out of memory"); + panic("%s: out of memory", __func__); KOBJ_LOCK(); @@ -182,17 +158,14 @@ void kobj_class_compile_static(kobj_class_t cls, kobj_ops_t ops) { - KOBJ_ASSERT(MA_NOTOWNED); + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); /* * Increment refs to make sure that the ops table is not freed. */ - KOBJ_LOCK(); - cls->refs++; kobj_class_compile_common(cls, ops); - - KOBJ_UNLOCK(); } static kobj_method_t* @@ -259,8 +232,6 @@ kobj_lookup_method(kobj_class_t cls, void kobj_class_free(kobj_class_t cls) { - int i; - kobj_method_t *m; void* ops = NULL; KOBJ_ASSERT(MA_NOTOWNED); @@ -272,10 +243,9 @@ kobj_class_free(kobj_class_t cls) */ if (cls->refs == 0) { /* - * Unregister any methods which are no longer used. + * For now we don't do anything to unregister any methods + * which are no longer used. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_unregister_method(m->desc); /* * Free memory and clean up. @@ -308,6 +278,14 @@ kobj_create(kobj_class_t cls, return obj; } +static void +kobj_init_common(kobj_t obj, kobj_class_t cls) +{ + + obj->ops = cls->ops; + cls->refs++; +} + void kobj_init(kobj_t obj, kobj_class_t cls) { @@ -329,13 +307,22 @@ kobj_init(kobj_t obj, kobj_class_t cls) goto retry; } - obj->ops = cls->ops; - cls->refs++; + kobj_init_common(obj, cls); KOBJ_UNLOCK(); } void +kobj_init_static(kobj_t obj, kobj_class_t cls) +{ + + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); + + kobj_init_common(obj, cls); +} + +void kobj_delete(kobj_t obj, struct malloc_type *mtype) { kobj_class_t cls = obj->ops->cls; Modified: stable/9/sys/powerpc/powerpc/platform.c ============================================================================== --- stable/9/sys/powerpc/powerpc/platform.c Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/sys/powerpc/powerpc/platform.c Sat Nov 19 12:55:32 2011 (r227711) @@ -184,7 +184,7 @@ platform_probe_and_attach() * then statically initialise the MMU object */ kobj_class_compile_static(platp, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, platp); + kobj_init_static((kobj_t)plat_obj, platp); prio = PLATFORM_PROBE(plat_obj); @@ -223,7 +223,7 @@ platform_probe_and_attach() */ kobj_class_compile_static(plat_def_impl, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, plat_def_impl); + kobj_init_static((kobj_t)plat_obj, plat_def_impl); strlcpy(plat_name,plat_def_impl->name,sizeof(plat_name)); Modified: stable/9/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- stable/9/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 19 12:55:32 2011 (r227711) @@ -410,7 +410,7 @@ pmap_bootstrap(vm_offset_t start, vm_off * then statically initialise the MMU object */ kobj_class_compile_static(mmu_def_impl, &mmu_kernel_kops); - kobj_init((kobj_t)mmu_obj, mmu_def_impl); + kobj_init_static((kobj_t)mmu_obj, mmu_def_impl); MMU_BOOTSTRAP(mmu_obj, start, end); } Modified: stable/9/sys/sys/kobj.h ============================================================================== --- stable/9/sys/sys/kobj.h Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/sys/sys/kobj.h Sat Nov 19 12:55:32 2011 (r227711) @@ -201,6 +201,7 @@ kobj_t kobj_create(kobj_class_t cls, * Initialise a pre-allocated object. */ void kobj_init(kobj_t obj, kobj_class_t cls); +void kobj_init_static(kobj_t obj, kobj_class_t cls); /* * Delete an object. If mtype is non-zero, free the memory. From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 19 13:03:59 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A78B1106564A; Sat, 19 Nov 2011 13:03:59 +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 965748FC13; Sat, 19 Nov 2011 13:03: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 pAJD3xBI044140; Sat, 19 Nov 2011 13:03:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJD3xtR044138; Sat, 19 Nov 2011 13:03:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191303.pAJD3xtR044138@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:03:59 +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: r227714 - stable/9/sys/sparc64/include X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:03:59 -0000 Author: marius Date: Sat Nov 19 13:03:59 2011 New Revision: 227714 URL: http://svn.freebsd.org/changeset/base/227714 Log: MFC: r227539 Define curthread as an inline function that loads the thread pointer directly from g7, the pcpu pointer. This guarantees correct behavior when the thread migrates to a different CPU. Commit message stolen from r205431. Additional testing by Peter Jeremy. Approved by: re (kib) Modified: stable/9/sys/sparc64/include/pcpu.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/pcpu.h ============================================================================== --- stable/9/sys/sparc64/include/pcpu.h Sat Nov 19 13:03:14 2011 (r227713) +++ stable/9/sys/sparc64/include/pcpu.h Sat Nov 19 13:03:59 2011 (r227714) @@ -74,6 +74,16 @@ register struct pcpu *pcpup __asm__(__XS #define PCPU_GET(member) (pcpup->pc_ ## member) +static __inline __pure2 struct thread * +__curthread(void) +{ + struct thread *td; + + __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td)); + return (td); +} +#define curthread (__curthread()) + /* * XXX The implementation of this operation should be made atomic * with respect to preemption. From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 19 13:33:22 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 507191065670; Sat, 19 Nov 2011 13:33:22 +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 3F3408FC0A; Sat, 19 Nov 2011 13:33: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 pAJDXMrj045300; Sat, 19 Nov 2011 13:33:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJDXM7N045297; Sat, 19 Nov 2011 13:33:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191333.pAJDXM7N045297@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:33:22 +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: r227718 - stable/9/sys/sparc64/sbus X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:33:22 -0000 Author: marius Date: Sat Nov 19 13:33:21 2011 New Revision: 227718 URL: http://svn.freebsd.org/changeset/base/227718 Log: MFC: r227578 Fix compilation with DEBUG defined. Approved by: re (kib) Modified: stable/9/sys/sparc64/sbus/lsi64854.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/sbus/lsi64854.c ============================================================================== --- stable/9/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:30:12 2011 (r227717) +++ stable/9/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:33:21 2011 (r227718) @@ -561,7 +561,7 @@ lsi64854_scsi_intr(void *arg) DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM), - (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ? + (nsc->sc_features & NCR_F_LARGEXFER) != 0 ? NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid)); if (dmasize != 0) { From owner-svn-src-stable-9@FreeBSD.ORG Sat Nov 19 16:54:58 2011 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9538C106566C; Sat, 19 Nov 2011 16:54:58 +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 69A828FC1A; Sat, 19 Nov 2011 16:54: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 pAJGswda052114; Sat, 19 Nov 2011 16:54:58 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJGswSY052112; Sat, 19 Nov 2011 16:54:58 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111191654.pAJGswSY052112@svn.freebsd.org> From: Christian Brueffer Date: Sat, 19 Nov 2011 16:54: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: r227732 - stable/9/share/man/man4 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 16:54:58 -0000 Author: brueffer Date: Sat Nov 19 16:54:58 2011 New Revision: 227732 URL: http://svn.freebsd.org/changeset/base/227732 Log: MFC: r227465, r227515 - Grammar and mdoc cleanup. - Remove list nesting in the hardware notes section, thus making it compatible with the hardware notes generation script. Approved by: re (kib) Modified: stable/9/share/man/man4/mvs.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/mvs.4 ============================================================================== --- stable/9/share/man/man4/mvs.4 Sat Nov 19 16:47:26 2011 (r227731) +++ stable/9/share/man/man4/mvs.4 Sat Nov 19 16:54:58 2011 (r227732) @@ -109,7 +109,8 @@ hardware command queues (up to 31 comman Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. .Pp -Same hardware is also supported by atamarvell and ataadaptec drivers from +The same hardware is also supported by the atamarvell and ataadaptec +drivers from the .Xr ata 4 subsystem. If both drivers are loaded at the same time, this one will be @@ -118,9 +119,9 @@ given precedence as the more functional The .Nm driver supports the following controllers: -.Bl -tag -compact -.It Gen-I (SATA 1.5Gbps): -.Bl -bullet -compact +.Pp +Gen-I (SATA 1.5Gbps): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX5040 .It @@ -130,8 +131,9 @@ driver supports the following controller .It 88SX5081 .El -.It Gen-II (SATA 3Gbps, NCQ, PMP): -.Bl -bullet -compact +.Pp +Gen-II (SATA 3Gbps, NCQ, PMP): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6040 .It @@ -141,8 +143,9 @@ driver supports the following controller .It 88SX6081 .El -.It Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): -.Bl -bullet -compact +.Pp +Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6042 .It @@ -154,11 +157,10 @@ driver supports the following controller .It MV78100 SoC .El -.El -Note, that this hardware supports command queueing and FIS-based switching -only for ATA DMA commands. ATAPI and non-DMA ATA commands executed one by one -for each port. .Pp +Note, that this hardware supports command queueing and FIS-based switching +only for ATA DMA commands. +ATAPI and non-DMA ATA commands executed one by one for each port. .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , @@ -172,4 +174,4 @@ The driver first appeared in .Fx 8.1 . .Sh AUTHORS -.An Alexander Motin Aq mav@FreeBSD.org . +.An Alexander Motin Aq mav@FreeBSD.org