From owner-svn-src-stable-7@FreeBSD.ORG Mon Jun 7 13:44:05 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33776106564A; Mon, 7 Jun 2010 13:44:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22FBB8FC0C; Mon, 7 Jun 2010 13:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o57Di5Ys094989; Mon, 7 Jun 2010 13:44:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o57Di58f094987; Mon, 7 Jun 2010 13:44:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006071344.o57Di58f094987@svn.freebsd.org> From: Andriy Gapon Date: Mon, 7 Jun 2010 13:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208893 - stable/7/sys/boot/zfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 13:44:05 -0000 Author: avg Date: Mon Jun 7 13:44:04 2010 New Revision: 208893 URL: http://svn.freebsd.org/changeset/base/208893 Log: MFC r208610: boot/zfs: fix gang block reading code - use correct size (512) while reading a gang block - skip holes while reading child blocks - advance buffer pointer while reading child blocks PR: 144214 Modified: stable/7/sys/boot/zfs/zfsimpl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/7/sys/boot/zfs/zfsimpl.c Mon Jun 7 13:37:13 2010 (r208892) +++ stable/7/sys/boot/zfs/zfsimpl.c Mon Jun 7 13:44:04 2010 (r208893) @@ -914,12 +914,17 @@ zio_read_gang(spa_t *spa, const blkptr_t break; if (!vdev || !vdev->v_read) return (EIO); - if (vdev->v_read(vdev, bp, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE)) return (EIO); for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { - if (zio_read(spa, &zio_gb.zg_blkptr[i], buf)) + blkptr_t *gbp = &zio_gb.zg_blkptr[i]; + + if (BP_IS_HOLE(gbp)) + continue; + if (zio_read(spa, gbp, buf)) return (EIO); + buf = (char*)buf + BP_GET_PSIZE(gbp); } return (0); @@ -950,9 +955,8 @@ zio_read(spa_t *spa, const blkptr_t *bp, continue; if (DVA_GET_GANG(dva)) { - printf("ZFS: gang block detected!\n"); if (zio_read_gang(spa, bp, dva, buf)) - return (EIO); + continue; } else { vdevid = DVA_GET_VDEV(dva); offset = DVA_GET_OFFSET(dva); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 8 04:48:36 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9734C1065670; Tue, 8 Jun 2010 04:48:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85BC08FC18; Tue, 8 Jun 2010 04:48:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o584maXv094400; Tue, 8 Jun 2010 04:48:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o584maU6094398; Tue, 8 Jun 2010 04:48:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006080448.o584maU6094398@svn.freebsd.org> From: Alan Cox Date: Tue, 8 Jun 2010 04:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208904 - stable/7/sys/i386/i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 04:48:36 -0000 Author: alc Date: Tue Jun 8 04:48:36 2010 New Revision: 208904 URL: http://svn.freebsd.org/changeset/base/208904 Log: MFC r208765 In the unlikely event that pmap_ts_referenced() demoted five superpage mappings to the same underlying physical page, the calling thread would be left forever pinned to the same processor. Modified: stable/7/sys/i386/i386/pmap.c Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Tue Jun 8 04:41:31 2010 (r208903) +++ stable/7/sys/i386/i386/pmap.c Tue Jun 8 04:48:36 2010 (r208904) @@ -4408,7 +4408,7 @@ pmap_ts_referenced(vm_page_t m) rtval++; if (rtval > 4) { PMAP_UNLOCK(pmap); - return (rtval); + goto out; } } } @@ -4437,6 +4437,7 @@ pmap_ts_referenced(vm_page_t m) PMAP_UNLOCK(pmap); } while ((pv = pvn) != NULL && pv != pvf); } +out: sched_unpin(); return (rtval); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jun 8 19:36:41 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFEB91065675; Tue, 8 Jun 2010 19:36:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE1F98FC15; Tue, 8 Jun 2010 19:36:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o58Jaft9094342; Tue, 8 Jun 2010 19:36:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o58Jafdi094340; Tue, 8 Jun 2010 19:36:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201006081936.o58Jafdi094340@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Jun 2010 19:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208924 - stable/7/sys/dev/sge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 19:36:41 -0000 Author: yongari Date: Tue Jun 8 19:36:41 2010 New Revision: 208924 URL: http://svn.freebsd.org/changeset/base/208924 Log: MFC r208806: Don't blindly set IFF_DRV_OACTIVE when sge_encap() fails. If there is no queued frame, IFF_DRV_OACTIVE would never be cleared. Submitted by: Nikolay Denev < ndenev <> gmail at com > Modified: stable/7/sys/dev/sge/if_sge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sge/if_sge.c ============================================================================== --- stable/7/sys/dev/sge/if_sge.c Tue Jun 8 19:26:22 2010 (r208923) +++ stable/7/sys/dev/sge/if_sge.c Tue Jun 8 19:36:41 2010 (r208924) @@ -1588,8 +1588,9 @@ sge_start_locked(struct ifnet *ifp) if (m_head == NULL) break; if (sge_encap(sc, &m_head)) { - if (m_head != NULL) - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (m_head == NULL) + break; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } From owner-svn-src-stable-7@FreeBSD.ORG Wed Jun 9 07:36:35 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7D5A106566B; Wed, 9 Jun 2010 07:36:35 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A58BB8FC0C; Wed, 9 Jun 2010 07:36:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o597aZpw052901; Wed, 9 Jun 2010 07:36:35 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o597aZUk052899; Wed, 9 Jun 2010 07:36:35 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006090736.o597aZUk052899@svn.freebsd.org> From: Brian Somers Date: Wed, 9 Jun 2010 07:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208937 - stable/7/lib/libthr/thread X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 07:36:35 -0000 Author: brian Date: Wed Jun 9 07:36:35 2010 New Revision: 208937 URL: http://svn.freebsd.org/changeset/base/208937 Log: MFC r197477 - clean up keys deleted via pthread_key_delete() PR: 135462 Modified: stable/7/lib/libthr/thread/thr_spec.c Directory Properties: stable/7/lib/libthr/ (props changed) Modified: stable/7/lib/libthr/thread/thr_spec.c ============================================================================== --- stable/7/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:41 2010 (r208936) +++ stable/7/lib/libthr/thread/thr_spec.c Wed Jun 9 07:36:35 2010 (r208937) @@ -131,9 +131,19 @@ _thread_cleanupspecific(void) curthread->specific[key].data = NULL; curthread->specific_data_count--; } + else if (curthread->specific[key].data != NULL) { + /* + * This can happen if the key is deleted via + * pthread_key_delete without first setting the value + * to NULL in all threads. POSIX says that the + * destructor is not invoked in this case. + */ + curthread->specific[key].data = NULL; + curthread->specific_data_count--; + } /* - * If there is a destructore, call it + * If there is a destructor, call it * with the key table entry unlocked: */ if (destructor != NULL) { From owner-svn-src-stable-7@FreeBSD.ORG Wed Jun 9 09:51:16 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9635E106564A; Wed, 9 Jun 2010 09:51:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 857808FC0C; Wed, 9 Jun 2010 09:51:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o599pGWr083311; Wed, 9 Jun 2010 09:51:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o599pGmn083309; Wed, 9 Jun 2010 09:51:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006090951.o599pGmn083309@svn.freebsd.org> From: Andriy Gapon Date: Wed, 9 Jun 2010 09:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208940 - stable/7/sys/cam/scsi X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 09:51:16 -0000 Author: avg Date: Wed Jun 9 09:51:16 2010 New Revision: 208940 URL: http://svn.freebsd.org/changeset/base/208940 Log: MFC r208800: scsi_cd: pass correct pointer to free() Modified: stable/7/sys/cam/scsi/scsi_cd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_cd.c Wed Jun 9 09:44:05 2010 (r208939) +++ stable/7/sys/cam/scsi/scsi_cd.c Wed Jun 9 09:51:16 2010 (r208940) @@ -2523,7 +2523,7 @@ cdioctl(struct disk *dp, u_long cmd, voi error = cdgetmode(periph, ¶ms, AUDIO_PAGE); if (error) { - free(¶ms, M_SCSICD); + free(params.mode_buf, M_SCSICD); cam_periph_unlock(periph); break; } From owner-svn-src-stable-7@FreeBSD.ORG Wed Jun 9 10:14:44 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03DDA106568B; Wed, 9 Jun 2010 10:14:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E75E88FC0C; Wed, 9 Jun 2010 10:14:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o59AEhI9091418; Wed, 9 Jun 2010 10:14:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o59AEhuV091416; Wed, 9 Jun 2010 10:14:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006091014.o59AEhuV091416@svn.freebsd.org> From: Andriy Gapon Date: Wed, 9 Jun 2010 10:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208942 - stable/7/sys/fs/udf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 10:14:44 -0000 Author: avg Date: Wed Jun 9 10:14:43 2010 New Revision: 208942 URL: http://svn.freebsd.org/changeset/base/208942 Log: MFC r208671: udf_readlink: fix malloc call with uninitialized size parameter Found by: clang static analyzer Modified: stable/7/sys/fs/udf/udf_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Wed Jun 9 10:13:59 2010 (r208941) +++ stable/7/sys/fs/udf/udf_vnops.c Wed Jun 9 10:14:43 2010 (r208942) @@ -903,9 +903,9 @@ udf_readlink(struct vop_readlink_args *a vp = ap->a_vp; node = VTON(vp); len = le64toh(node->fentry->inf_len); + iov[0].iov_len = len; buf = malloc(iov[0].iov_len, M_DEVBUF, M_WAITOK); iov[0].iov_base = buf; - iov[0].iov_len = len; uio.uio_iov = iov; uio.uio_iovcnt = 1; uio.uio_offset = 0; From owner-svn-src-stable-7@FreeBSD.ORG Thu Jun 10 18:04:25 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB9141065676; Thu, 10 Jun 2010 18:04:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99DD48FC1A; Thu, 10 Jun 2010 18:04:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AI4Poi024262; Thu, 10 Jun 2010 18:04:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AI4PEX024259; Thu, 10 Jun 2010 18:04:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201006101804.o5AI4PEX024259@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 10 Jun 2010 18:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208995 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 18:04:25 -0000 Author: yongari Date: Thu Jun 10 18:04:25 2010 New Revision: 208995 URL: http://svn.freebsd.org/changeset/base/208995 Log: MFC r208862: Fix a bug introduced in r199011. When bge(4) reuses loaded RX buffers it should also reinitialize RX descriptors otherwise some stale data could be passed to controller. This could end up with mbuf double free or unexpected NULL pointer dereference in upper stack. To fix the issue, save loaded buffer's length and reinitialize RX descriptors with the saved value whenever bge(4) reuses the loaded RX buffers. While I'm here, increase the number of RX buffers to 512 from 256. This simplifies RX buffer handling as well as giving more RX buffers. Controller supports just fixed number of RX buffers (i.e. 512) and bge(4) used to rely on hope that our CPU is fast enough to keep up with the controller. With this change, bge(4) will use 1MB for RX buffers but I don't think it would cause problems in these days. Reported by: marcel Tested by: marcel Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jun 10 17:59:47 2010 (r208994) +++ stable/7/sys/dev/bge/if_bge.c Thu Jun 10 18:04:25 2010 (r208995) @@ -400,6 +400,8 @@ static void bge_setpromisc(struct bge_so static void bge_setmulti(struct bge_softc *); static void bge_setvlan(struct bge_softc *); +static __inline void bge_rxreuse_std(struct bge_softc *, int); +static __inline void bge_rxreuse_jumbo(struct bge_softc *, int); static int bge_newbuf_std(struct bge_softc *, int); static int bge_newbuf_jumbo(struct bge_softc *, int); static int bge_init_rx_ring_std(struct bge_softc *); @@ -949,6 +951,7 @@ bge_newbuf_std(struct bge_softc *sc, int sc->bge_cdata.bge_rx_std_dmamap[i] = sc->bge_cdata.bge_rx_std_sparemap; sc->bge_cdata.bge_rx_std_sparemap = map; sc->bge_cdata.bge_rx_std_chain[i] = m; + sc->bge_cdata.bge_rx_std_seglen[i] = segs[0].ds_len; r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; r->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); @@ -1006,6 +1009,11 @@ bge_newbuf_jumbo(struct bge_softc *sc, i sc->bge_cdata.bge_rx_jumbo_sparemap; sc->bge_cdata.bge_rx_jumbo_sparemap = map; sc->bge_cdata.bge_rx_jumbo_chain[i] = m; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = 0; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = 0; + /* * Fill in the extended RX buffer descriptor. */ @@ -1018,18 +1026,22 @@ bge_newbuf_jumbo(struct bge_softc *sc, i r->bge_addr3.bge_addr_lo = BGE_ADDR_LO(segs[3].ds_addr); r->bge_addr3.bge_addr_hi = BGE_ADDR_HI(segs[3].ds_addr); r->bge_len3 = segs[3].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][3] = segs[3].ds_len; case 3: r->bge_addr2.bge_addr_lo = BGE_ADDR_LO(segs[2].ds_addr); r->bge_addr2.bge_addr_hi = BGE_ADDR_HI(segs[2].ds_addr); r->bge_len2 = segs[2].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][2] = segs[2].ds_len; case 2: r->bge_addr1.bge_addr_lo = BGE_ADDR_LO(segs[1].ds_addr); r->bge_addr1.bge_addr_hi = BGE_ADDR_HI(segs[1].ds_addr); r->bge_len1 = segs[1].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][1] = segs[1].ds_len; case 1: r->bge_addr0.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr0.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); r->bge_len0 = segs[0].ds_len; + sc->bge_cdata.bge_rx_jumbo_seglen[i][0] = segs[0].ds_len; break; default: panic("%s: %d segments\n", __func__, nsegs); @@ -1041,12 +1053,6 @@ bge_newbuf_jumbo(struct bge_softc *sc, i return (0); } -/* - * The standard receive ring has 512 entries in it. At 2K per mbuf cluster, - * that's 1MB or memory, which is a lot. For now, we fill only the first - * 256 ring entries and hope that our CPU is fast enough to keep up with - * the NIC. - */ static int bge_init_rx_ring_std(struct bge_softc *sc) { @@ -1054,7 +1060,7 @@ bge_init_rx_ring_std(struct bge_softc *s bzero(sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ); sc->bge_std = 0; - for (i = 0; i < BGE_SSLOTS; i++) { + for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { if ((error = bge_newbuf_std(sc, i)) != 0) return (error); BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); @@ -1063,8 +1069,8 @@ bge_init_rx_ring_std(struct bge_softc *s bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_std = i - 1; - bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); + sc->bge_std = 0; + bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, BGE_STD_RX_RING_CNT - 1); return (0); } @@ -1106,14 +1112,14 @@ bge_init_rx_ring_jumbo(struct bge_softc bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); - sc->bge_jumbo = i - 1; + sc->bge_jumbo = 0; rcb = &sc->bge_ldata.bge_info.bge_jumbo_rx_rcb; rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_MAXLEN_FLAGS, rcb->bge_maxlen_flags); - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, BGE_JUMBO_RX_RING_CNT - 1); return (0); } @@ -3299,6 +3305,33 @@ bge_reset(struct bge_softc *sc) return(0); } +static __inline void +bge_rxreuse_std(struct bge_softc *sc, int i) +{ + struct bge_rx_bd *r; + + r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; + r->bge_flags = BGE_RXBDFLAG_END; + r->bge_len = sc->bge_cdata.bge_rx_std_seglen[i]; + r->bge_idx = i; + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); +} + +static __inline void +bge_rxreuse_jumbo(struct bge_softc *sc, int i) +{ + struct bge_extrx_bd *r; + + r = &sc->bge_ldata.bge_rx_jumbo_ring[sc->bge_jumbo]; + r->bge_flags = BGE_RXBDFLAG_JUMBO_RING | BGE_RXBDFLAG_END; + r->bge_len0 = sc->bge_cdata.bge_rx_jumbo_seglen[i][0]; + r->bge_len1 = sc->bge_cdata.bge_rx_jumbo_seglen[i][1]; + r->bge_len2 = sc->bge_cdata.bge_rx_jumbo_seglen[i][2]; + r->bge_len3 = sc->bge_cdata.bge_rx_jumbo_seglen[i][3]; + r->bge_idx = i; + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); +} + /* * Frame reception handling. This is called if there's a frame * on the receive return list. @@ -3362,24 +3395,24 @@ bge_rxeof(struct bge_softc *sc, uint16_t jumbocnt++; m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); continue; } if (bge_newbuf_jumbo(sc, rxidx) != 0) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + bge_rxreuse_jumbo(sc, rxidx); ifp->if_iqdrops++; continue; } BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); } else { stdcnt++; + m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); continue; } - m = sc->bge_cdata.bge_rx_std_chain[rxidx]; if (bge_newbuf_std(sc, rxidx) != 0) { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + bge_rxreuse_std(sc, rxidx); ifp->if_iqdrops++; continue; } Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Thu Jun 10 17:59:47 2010 (r208994) +++ stable/7/sys/dev/bge/if_bgereg.h Thu Jun 10 18:04:25 2010 (r208995) @@ -2561,6 +2561,8 @@ struct bge_chain_data { struct mbuf *bge_tx_chain[BGE_TX_RING_CNT]; struct mbuf *bge_rx_std_chain[BGE_STD_RX_RING_CNT]; struct mbuf *bge_rx_jumbo_chain[BGE_JUMBO_RX_RING_CNT]; + int bge_rx_std_seglen[BGE_STD_RX_RING_CNT]; + int bge_rx_jumbo_seglen[BGE_JUMBO_RX_RING_CNT][4]; }; struct bge_dmamap_arg { From owner-svn-src-stable-7@FreeBSD.ORG Thu Jun 10 20:02:13 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6222C1065678; Thu, 10 Jun 2010 20:02:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50D358FC1B; Thu, 10 Jun 2010 20:02:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AK2DMF050459; Thu, 10 Jun 2010 20:02:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AK2D3V050457; Thu, 10 Jun 2010 20:02:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006102002.o5AK2D3V050457@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Jun 2010 20:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209001 - stable/7/sys/dev/acpica X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:02:13 -0000 Author: jhb Date: Thu Jun 10 20:02:13 2010 New Revision: 209001 URL: http://svn.freebsd.org/changeset/base/209001 Log: MFC 208925: The lock associated with the /dev/apm knote is already held, so use KNOTE_LOCKED() instead of KNOTE_UNLOCKED(). Modified: stable/7/sys/dev/acpica/acpi.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/acpica/acpi.c ============================================================================== --- stable/7/sys/dev/acpica/acpi.c Thu Jun 10 20:01:33 2010 (r209000) +++ stable/7/sys/dev/acpica/acpi.c Thu Jun 10 20:02:13 2010 (r209001) @@ -2258,7 +2258,7 @@ acpi_ReqSleepState(struct acpi_softc *sc clone->notify_status = APM_EV_NONE; if ((clone->flags & ACPI_EVF_DEVD) == 0) { selwakeuppri(&clone->sel_read, PZERO); - KNOTE_UNLOCKED(&clone->sel_read.si_note, 0); + KNOTE_LOCKED(&clone->sel_read.si_note, 0); } } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jun 10 20:13:23 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A1CE1065674; Thu, 10 Jun 2010 20:13:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E6BD8FC13; Thu, 10 Jun 2010 20:13:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AKDNrs053159; Thu, 10 Jun 2010 20:13:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AKDNGY053157; Thu, 10 Jun 2010 20:13:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006102013.o5AKDNGY053157@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Jun 2010 20:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209005 - stable/7/sys/nfsclient X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 20:13:23 -0000 Author: jhb Date: Thu Jun 10 20:13:23 2010 New Revision: 209005 URL: http://svn.freebsd.org/changeset/base/209005 Log: MFC 208603: More gracefully handle stale file handles and attributes when opening a file via NFS. Specifically, to satisfy close-to-open-consistency, the NFS client always performs at least one RPC on a file during an open(2) to see if the file has changed. Normally this RPC is an ACCESS or GETATTR RPC that is forced by flushing a file's attribute cache during nfs_open() and then requesting new attributes. However, if the file is noticed to be stale during nfs_open(), the only recourse is to fail the open(2) call with ESTALE. On the other hand, if the ACCESS or GETATTR RPC is sent during nfs_lookup(), then the NFS client can fall back to a LOOKUP RPC to obtain the new file handle in the case that a file has been replaced. This change causes the NFS client to flush the attribute cache during nfs_lookup() when validating a name cache hit if the attributes fetched during nfs_lookup() can be reused in nfs_open(). This allows the client to open a replaced file via the new file handle the first time that it notices a replaced file rather than failing with ESTALE in some cases. Modified: stable/7/sys/nfsclient/nfs_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/7/sys/nfsclient/nfs_vnops.c Thu Jun 10 20:13:10 2010 (r209004) +++ stable/7/sys/nfsclient/nfs_vnops.c Thu Jun 10 20:13:23 2010 (r209005) @@ -875,7 +875,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct mbuf *mreq, *mrep, *md, *mb; long len; nfsfh_t *fhp; - struct nfsnode *np; + struct nfsnode *np, *newnp; int error = 0, attrflag, fhsize; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; @@ -901,10 +901,26 @@ nfs_lookup(struct vop_lookup_args *ap) * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback * to doing a lookup RPC. + * + * To better handle stale file handles and attributes, + * clear the attribute cache of this node if it is a + * leaf component, part of an open() call, and not + * locally modified before fetching the attributes. + * This should allow stale file handles to be detected + * here where we can fall back to a LOOKUP RPC to + * recover rather than having nfs_open() detect the + * stale file handle and failing open(2) with ESTALE. */ newvp = *vpp; - if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, td) - && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { + newnp = VTONFS(newvp); + if ((cnp->cn_flags & (ISLASTCN | ISOPEN)) == + (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { + mtx_lock(&newnp->n_mtx); + newnp->n_attrstamp = 0; + mtx_unlock(&newnp->n_mtx); + } + if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred, td) == 0 && + vattr.va_ctime.tv_sec == newnp->n_ctime) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) From owner-svn-src-stable-7@FreeBSD.ORG Thu Jun 10 22:46:13 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 090DF1065672; Thu, 10 Jun 2010 22:46:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB9A68FC1E; Thu, 10 Jun 2010 22:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5AMkC8V087949; Thu, 10 Jun 2010 22:46:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5AMkCMp087947; Thu, 10 Jun 2010 22:46:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006102246.o5AMkCMp087947@svn.freebsd.org> From: Xin LI Date: Thu, 10 Jun 2010 22:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209020 - stable/7/bin/pax X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 22:46:13 -0000 Author: delphij Date: Thu Jun 10 22:46:12 2010 New Revision: 209020 URL: http://svn.freebsd.org/changeset/base/209020 Log: MFC r205940: Remove unused files. PR: bin/38256 Deleted: stable/7/bin/pax/cpio.1 stable/7/bin/pax/tar.1 Modified: stable/7/bin/pax/Makefile Directory Properties: stable/7/bin/pax/ (props changed) Modified: stable/7/bin/pax/Makefile ============================================================================== --- stable/7/bin/pax/Makefile Thu Jun 10 21:56:14 2010 (r209019) +++ stable/7/bin/pax/Makefile Thu Jun 10 22:46:12 2010 (r209020) @@ -29,9 +29,6 @@ PROG= pax SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \ gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \ tables.c tar.c tty_subs.c -#XXX NOTYET -#MAN= pax.1 tar.1 cpio.1 -#LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio .if ${MACHINE_ARCH} == "arm" WARNS?= 3 From owner-svn-src-stable-7@FreeBSD.ORG Fri Jun 11 21:54:07 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A8D61065677; Fri, 11 Jun 2010 21:54:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0947D8FC14; Fri, 11 Jun 2010 21:54:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BLs6j5000787; Fri, 11 Jun 2010 21:54:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BLs6sX000784; Fri, 11 Jun 2010 21:54:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112154.o5BLs6sX000784@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 21:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209074 - stable/7/sys/geom/part X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 21:54:07 -0000 Author: marius Date: Fri Jun 11 21:54:06 2010 New Revision: 209074 URL: http://svn.freebsd.org/changeset/base/209074 Log: MFC: r208746 Don't leak memory on destruction. Reviewed by: marcel Approved by: re (kib) Modified: stable/7/sys/geom/part/g_part_bsd.c stable/7/sys/geom/part/g_part_gpt.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/7/sys/geom/part/g_part_bsd.c Fri Jun 11 21:54:04 2010 (r209073) +++ stable/7/sys/geom/part/g_part_bsd.c Fri Jun 11 21:54:06 2010 (r209074) @@ -240,6 +240,12 @@ g_part_bsd_create(struct g_part_table *b static int g_part_bsd_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { + struct g_part_bsd_table *table; + + table = (struct g_part_bsd_table *)basetable; + if (table->bbarea != NULL) + g_free(table->bbarea); + table->bbarea = NULL; /* Wipe the second sector to clear the partitioning. */ basetable->gpt_smhead |= 2; Modified: stable/7/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/7/sys/geom/part/g_part_gpt.c Fri Jun 11 21:54:04 2010 (r209073) +++ stable/7/sys/geom/part/g_part_gpt.c Fri Jun 11 21:54:06 2010 (r209074) @@ -454,6 +454,12 @@ g_part_gpt_create(struct g_part_table *b static int g_part_gpt_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { + struct g_part_gpt_table *table; + + table = (struct g_part_gpt_table *)basetable; + if (table->hdr != NULL) + g_free(table->hdr); + table->hdr = NULL; /* * Wipe the first 2 sectors as well as the last to clear the From owner-svn-src-stable-7@FreeBSD.ORG Fri Jun 11 22:01:59 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43AFD1065677; Fri, 11 Jun 2010 22:01:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18F118FC1F; Fri, 11 Jun 2010 22:01:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BM1xMe002769; Fri, 11 Jun 2010 22:01:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BM1whF002767; Fri, 11 Jun 2010 22:01:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112201.o5BM1whF002767@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209076 - stable/7/sys/dev/cas X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 22:01:59 -0000 Author: marius Date: Fri Jun 11 22:01:58 2010 New Revision: 209076 URL: http://svn.freebsd.org/changeset/base/209076 Log: MFC: r208776 Avoid possible NULL-dereferences. Found with: Coverity Prevent(tm) CID: 3428 Modified: stable/7/sys/dev/cas/if_cas.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cas/if_cas.c ============================================================================== --- stable/7/sys/dev/cas/if_cas.c Fri Jun 11 22:01:58 2010 (r209075) +++ stable/7/sys/dev/cas/if_cas.c Fri Jun 11 22:01:58 2010 (r209076) @@ -1787,6 +1787,7 @@ cas_rint(struct cas_softc *sc) } } idx2 = 0; + m2 = NULL; rxds2 = NULL; if ((word1 & CAS_RC1_SPLIT_PKT) != 0) { KASSERT((word1 & CAS_RC1_RELEASE_NEXT) != 0, @@ -1799,32 +1800,39 @@ cas_rint(struct cas_softc *sc) __func__, idx2); #endif rxds2 = &sc->sc_rxdsoft[idx2]; - MGET(m2, M_DONTWAIT, MT_DATA); - if (m2 != NULL) { - refcount_acquire( - &rxds2->rxds_refcount); - m2->m_len = len - m->m_len; - bus_dmamap_sync(sc->sc_rdmatag, - rxds2->rxds_dmamap, - BUS_DMASYNC_POSTREAD); + if (m != NULL) { + MGET(m2, M_DONTWAIT, MT_DATA); + if (m2 != NULL) { + refcount_acquire( + &rxds2->rxds_refcount); + m2->m_len = len - m->m_len; + bus_dmamap_sync( + sc->sc_rdmatag, + rxds2->rxds_dmamap, + BUS_DMASYNC_POSTREAD); #if __FreeBSD_version < 800016 - MEXTADD(m2, (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, rxds2, - M_RDONLY, EXT_NET_DRV); + MEXTADD(m2, + (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, + rxds2, M_RDONLY, + EXT_NET_DRV); #else - MEXTADD(m2, (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, - sc, (void *)(uintptr_t)idx2, - M_RDONLY, EXT_NET_DRV); + MEXTADD(m2, + (caddr_t)rxds2->rxds_buf, + m2->m_len, cas_free, sc, + (void *)(uintptr_t)idx2, + M_RDONLY, EXT_NET_DRV); #endif - if ((m2->m_flags & M_EXT) == 0) { - m_freem(m2); - m2 = NULL; + if ((m2->m_flags & M_EXT) == + 0) { + m_freem(m2); + m2 = NULL; + } } } if (m2 != NULL) m->m_next = m2; - else { + else if (m != NULL) { m_freem(m); m = NULL; } From owner-svn-src-stable-7@FreeBSD.ORG Fri Jun 11 22:35:43 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 701D5106566C; Fri, 11 Jun 2010 22:35:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF518FC13; Fri, 11 Jun 2010 22:35:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BMZh9K010552; Fri, 11 Jun 2010 22:35:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BMZhU0010549; Fri, 11 Jun 2010 22:35:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112235.o5BMZhU0010549@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209079 - in stable/7: sbin/geom/class/part sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 22:35:43 -0000 Author: marius Date: Fri Jun 11 22:35:43 2010 New Revision: 209079 URL: http://svn.freebsd.org/changeset/base/209079 Log: MFC: r208777 - In gpart_bootfile_read() fix an off-by-one error preventing the bootstrap file to be of maximum size. - Add special handling required for SMI/VTOC8 disklabel partcode, i.e. avoid overwriting the label when writing the bootstrap code to the partition starting at 0 and install it to all partitions when the -i option is omitted just like geom_sunlabel(4) and sunlabel(8) do by default. - Add missing prototypes. - Add const where applicable. Reviewed by: marcel Modified: stable/7/sbin/geom/class/part/geom_part.c stable/7/sys/sys/vtoc.h Directory Properties: stable/7/sbin/geom/class/part/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/7/sbin/geom/class/part/geom_part.c Fri Jun 11 22:29:49 2010 (r209078) +++ stable/7/sbin/geom/class/part/geom_part.c Fri Jun 11 22:35:43 2010 (r209079) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -58,13 +59,27 @@ uint32_t PUBSYM(version) = 0; static char optional[] = ""; static char flags[] = "C"; -static char bootcode_param[] = "bootcode"; -static char index_param[] = "index"; -static char partcode_param[] = "partcode"; - +static const char const bootcode_param[] = "bootcode"; +static const char const index_param[] = "index"; +static const char const partcode_param[] = "partcode"; + +static struct gclass *find_class(struct gmesh *, const char *); +static struct ggeom * find_geom(struct gclass *, const char *); +static const char *find_geomcfg(struct ggeom *, const char *); +static const char *find_provcfg(struct gprovider *, const char *); +static struct gprovider *find_provider(struct ggeom *, + unsigned long long); +static const char *fmtsize(int64_t); +static int gpart_autofill(struct gctl_req *); +static int gpart_autofill_resize(struct gctl_req *); static void gpart_bootcode(struct gctl_req *, unsigned int); +static void *gpart_bootfile_read(const char *, ssize_t *); static void gpart_issue(struct gctl_req *, unsigned int); static void gpart_show(struct gctl_req *, unsigned int); +static void gpart_show_geom(struct ggeom *, const char *); +static int gpart_show_hasopt(struct gctl_req *, const char *, const char *); +static void gpart_write_partcode(struct ggeom *, int, void *, ssize_t); +static void gpart_write_partcode_vtoc8(struct ggeom *, int, void *); struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { @@ -131,7 +146,7 @@ struct g_command PUBSYM(class_commands)[ { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL - }, + }, G_CMD_SENTINEL }; @@ -376,7 +391,7 @@ gpart_bootfile_read(const char *bootfile errx(EXIT_FAILURE, "%s: not a regular file", bootfile); if (sb.st_size == 0) errx(EXIT_FAILURE, "%s: empty file", bootfile); - if (*size > 0 && sb.st_size >= *size) + if (*size > 0 && sb.st_size > *size) errx(EXIT_FAILURE, "%s: file too big (%zu limit)", bootfile, *size); @@ -396,33 +411,14 @@ gpart_bootfile_read(const char *bootfile } static void -gpart_write_partcode(struct gctl_req *req, int idx, void *code, ssize_t size) +gpart_write_partcode(struct ggeom *gp, int idx, void *code, ssize_t size) { char dsf[128]; - struct gmesh mesh; - struct gclass *classp; - struct ggeom *gp; struct gprovider *pp; const char *s; char *buf; off_t bsize; - int error, fd; - - s = gctl_get_ascii(req, "class"); - if (s == NULL) - abort(); - error = geom_gettree(&mesh); - if (error != 0) - errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); - classp = find_class(&mesh, s); - if (classp == NULL) { - geom_deletetree(&mesh); - errx(EXIT_FAILURE, "Class %s not found.", s); - } - s = gctl_get_ascii(req, "geom"); - gp = find_geom(classp, s); - if (gp == NULL) - errx(EXIT_FAILURE, "No such geom: %s.", s); + int fd; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); @@ -459,18 +455,63 @@ gpart_write_partcode(struct gctl_req *re close(fd); } else errx(EXIT_FAILURE, "invalid partition index"); +} - geom_deletetree(&mesh); +static void +gpart_write_partcode_vtoc8(struct ggeom *gp, int idx, void *code) +{ + char dsf[128]; + struct gprovider *pp; + const char *s; + int installed, fd; + + installed = 0; + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + s = find_provcfg(pp, "index"); + if (s == NULL) + continue; + if (idx != 0 && atoi(s) != idx) + continue; + snprintf(dsf, sizeof(dsf), "/dev/%s", pp->lg_name); + if (pp->lg_sectorsize != sizeof(struct vtoc8)) + errx(EXIT_FAILURE, "%s: unexpected sector " + "size (%d)\n", dsf, pp->lg_sectorsize); + fd = open(dsf, O_WRONLY); + if (fd == -1) + err(EXIT_FAILURE, "%s", dsf); + if (lseek(fd, VTOC_BOOTSIZE, SEEK_SET) != VTOC_BOOTSIZE) + continue; + /* + * We ignore the first VTOC_BOOTSIZE bytes of boot code in + * order to avoid overwriting the label. + */ + if (lseek(fd, sizeof(struct vtoc8), SEEK_SET) != + sizeof(struct vtoc8)) + err(EXIT_FAILURE, "%s", dsf); + if (write(fd, (caddr_t)code + sizeof(struct vtoc8), + VTOC_BOOTSIZE - sizeof(struct vtoc8)) != VTOC_BOOTSIZE - + sizeof(struct vtoc8)) + err(EXIT_FAILURE, "%s", dsf); + installed++; + close(fd); + if (idx != 0 && atoi(s) == idx) + break; + } + if (installed == 0) + errx(EXIT_FAILURE, "%s: no partitions", gp->lg_name); } static void gpart_bootcode(struct gctl_req *req, unsigned int fl) { + struct gmesh mesh; + struct gclass *classp; + struct ggeom *gp; const char *s; char *sp; void *bootcode, *partcode; size_t bootsize, partsize; - int error, idx; + int error, idx, vtoc8; if (gctl_has_param(req, bootcode_param)) { s = gctl_get_ascii(req, bootcode_param); @@ -485,9 +526,31 @@ gpart_bootcode(struct gctl_req *req, uns bootsize = 0; } + s = gctl_get_ascii(req, "class"); + if (s == NULL) + abort(); + error = geom_gettree(&mesh); + if (error != 0) + errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); + classp = find_class(&mesh, s); + if (classp == NULL) { + geom_deletetree(&mesh); + errx(EXIT_FAILURE, "Class %s not found.", s); + } + s = gctl_get_ascii(req, "geom"); + if (s == NULL) + abort(); + gp = find_geom(classp, s); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", s); + s = find_geomcfg(gp, "scheme"); + vtoc8 = 0; + if (strcmp(s, "VTOC8") == 0) + vtoc8 = 1; + if (gctl_has_param(req, partcode_param)) { s = gctl_get_ascii(req, partcode_param); - partsize = bootsize * 1024; + partsize = vtoc8 != 0 ? VTOC_BOOTSIZE : bootsize * 1024; partcode = gpart_bootfile_read(s, &partsize); error = gctl_delete_param(req, partcode_param); if (error) @@ -511,16 +574,20 @@ gpart_bootcode(struct gctl_req *req, uns idx = 0; if (partcode != NULL) { - if (idx == 0) - errx(EXIT_FAILURE, "missing -i option"); - gpart_write_partcode(req, idx, partcode, partsize); - } else { + if (vtoc8 == 0) { + if (idx == 0) + errx(EXIT_FAILURE, "missing -i option"); + gpart_write_partcode(gp, idx, partcode, partsize); + } else + gpart_write_partcode_vtoc8(gp, idx, partcode); + } else if (bootcode == NULL) errx(EXIT_FAILURE, "no -b nor -p"); - } if (bootcode != NULL) gpart_issue(req, fl); + + geom_deletetree(&mesh); } static void Modified: stable/7/sys/sys/vtoc.h ============================================================================== --- stable/7/sys/sys/vtoc.h Fri Jun 11 22:29:49 2010 (r209078) +++ stable/7/sys/sys/vtoc.h Fri Jun 11 22:35:43 2010 (r209079) @@ -53,9 +53,10 @@ #define VTOC_TAG_FREEBSD_ZFS 0x0904 #define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ -#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ +#define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ #define VTOC_ASCII_LEN 128 +#define VTOC_BOOTSIZE 8192 /* 16 sectors */ #define VTOC_MAGIC 0xdabe #define VTOC_RAW_PART 2 #define VTOC_SANITY 0x600ddeee From owner-svn-src-stable-7@FreeBSD.ORG Fri Jun 11 22:53:41 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 826DD106566C; Fri, 11 Jun 2010 22:53:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7083E8FC28; Fri, 11 Jun 2010 22:53:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5BMrftG014589; Fri, 11 Jun 2010 22:53:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5BMrfmU014587; Fri, 11 Jun 2010 22:53:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006112253.o5BMrfmU014587@svn.freebsd.org> From: Marius Strobl Date: Fri, 11 Jun 2010 22:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209080 - stable/7/sbin/geom/class/part X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 22:53:41 -0000 Author: marius Date: Fri Jun 11 22:53:41 2010 New Revision: 209080 URL: http://svn.freebsd.org/changeset/base/209080 Log: Revert part of r209079 which shouldn't have been MFC'ed, yet. Modified: stable/7/sbin/geom/class/part/geom_part.c Modified: stable/7/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/7/sbin/geom/class/part/geom_part.c Fri Jun 11 22:35:43 2010 (r209079) +++ stable/7/sbin/geom/class/part/geom_part.c Fri Jun 11 22:53:41 2010 (r209080) @@ -70,8 +70,6 @@ static const char *find_provcfg(struct g static struct gprovider *find_provider(struct ggeom *, unsigned long long); static const char *fmtsize(int64_t); -static int gpart_autofill(struct gctl_req *); -static int gpart_autofill_resize(struct gctl_req *); static void gpart_bootcode(struct gctl_req *, unsigned int); static void *gpart_bootfile_read(const char *, ssize_t *); static void gpart_issue(struct gctl_req *, unsigned int); From owner-svn-src-stable-7@FreeBSD.ORG Sat Jun 12 00:28:53 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFAD81065674; Sat, 12 Jun 2010 00:28:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD8E28FC13; Sat, 12 Jun 2010 00:28:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5C0SrwF035694; Sat, 12 Jun 2010 00:28:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5C0SrTO035692; Sat, 12 Jun 2010 00:28:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006120028.o5C0SrTO035692@svn.freebsd.org> From: Marius Strobl Date: Sat, 12 Jun 2010 00:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209084 - stable/7/sbin/geom/class/part X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 00:28:54 -0000 Author: marius Date: Sat Jun 12 00:28:53 2010 New Revision: 209084 URL: http://svn.freebsd.org/changeset/base/209084 Log: MFC: r208778 - Mention that VTOC8 labels are found in Fujitsu SPARC64 machines as well. - Add information regarding VTOC8 bootrstrap code and how it's handled with r208777 in place. - Document the mapping of partition types to VTOC8 tags. - Add examples for VTOC8 to the respective section. - Eliminated hard sentence breaks. Reviewed by: marcel (slightly buggy version) Modified: stable/7/sbin/geom/class/part/gpart.8 Directory Properties: stable/7/sbin/geom/class/part/ (props changed) Modified: stable/7/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/7/sbin/geom/class/part/gpart.8 Sat Jun 12 00:28:41 2010 (r209083) +++ stable/7/sbin/geom/class/part/gpart.8 Sat Jun 12 00:28:53 2010 (r209084) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 18, 2008 +.Dd June 3, 2010 .Dt GPART 8 .Os .Sh NAME @@ -53,7 +53,10 @@ found on PCs and used on many removable The GEOM_PART_PC98 option adds support for the MBR variant as used on NEC PC-98 computers. The GEOM_PART_VTOC8 option adds support for Sun's SMI VTOC8 label as -found on UltraSPARC-based computers. +found on computers based on +.Tn SPARC64 +and +.Tn UltraSPARC. .Pp Usage of the .Xr gpart 8 @@ -191,9 +194,15 @@ The .Fl p Ar partcode option specifies a file that contains the bootstrap code intended to be written to a partition. +For the VTOC8 scheme, it is a 8192 byte file of which the last 7680 bytes +are installed as bootstrap code. The partition is specified by the .Fl i Ar index option. +For the VTOC8 scheme, if the +.Fl i Ar index +option is omitted, the bootstrap code is written to all sufficiently large +partitions. The size of the file must be smaller than the size of the partition. .Pp Addition options include: @@ -362,20 +371,20 @@ A FreeBSD partition dedicated to bootstr The scheme-specific type is "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" for GPT. .It freebsd-swap A FreeBSD partition dedicated to swap space. -The scheme-specific types are "!FreeBSD-swap" for APM, and -"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-swap" for APM, +"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0901 for VTOC8. .It freebsd-ufs A FreeBSD partition that contains a UFS or UFS2 file system. -the scheme-specific types are "!FreeBSD-UFS" for APM, and -"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT. +the scheme-specific types are "!FreeBSD-UFS" for APM, +"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0902 for VTOC8. .It freebsd-vinum A FreeBSD partition that contains a Vinum volume. -The scheme-specific types are "!FreeBSD-Vinum" for APM, and -"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-Vinum" for APM, +"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0903 for VTOC8. .It freebsd-zfs A FreeBSD partition that contains a ZFS volume. -The scheme-specific types are "!FreeBSD-ZFS" for APM, and -"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT. +The scheme-specific types are "!FreeBSD-ZFS" for APM, +"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and 0x0904 for VTOC8. .It mbr A partition that is sub-partitioned by a master boot record (MBR). This type is known as "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. @@ -435,10 +444,28 @@ future need (e.g. from a ZFS partition). .Pp Create a 512MB-sized .Pa freebsd-ufs -partition that would contain UFS where the system boot from. +partition that would contain UFS where the system boots from. .Bd -literal -offset indent /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 .Ed +.Pp +Create VTOC8 scheme on +.Pa da0 . +.Bd -literal -offset indent +/sbin/gpart create -s VTOC8 da0 +.Ed +.Pp +Create a 512MB-sized +.Cm freebsd-ufs +partition that would contain UFS where the system boots from. +.Bd -literal -offset indent +/sbin/gpart add -b 0 -s 1048576 -t freebsd-ufs da0 +.Ed +.Pp +After having created all required partitions, embed bootstrap code into them. +.Bd -literal -offset indent +/sbin/gpart bootcode -p /boot/boot1 da0 +.Ed .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 , From owner-svn-src-stable-7@FreeBSD.ORG Sat Jun 12 15:42:54 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 640F4106566B; Sat, 12 Jun 2010 15:42:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 533478FC08; Sat, 12 Jun 2010 15:42:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5CFgsfl041674; Sat, 12 Jun 2010 15:42:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5CFgsKB041672; Sat, 12 Jun 2010 15:42:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201006121542.o5CFgsKB041672@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 12 Jun 2010 15:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209108 - stable/7/sys/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 15:42:54 -0000 Author: bz Date: Sat Jun 12 15:42:54 2010 New Revision: 209108 URL: http://svn.freebsd.org/changeset/base/209108 Log: "MFC" (parts of) r185849: Fix a locking issue triggering an assertion in rt_setgate() via arp_rtrequest() due to no radix node head (rnh) lock held in case of a route change. The previous MFC in r189026 left out this hunk. Reported by: Haven Hash (haven.hash isilon.com) Tested by: Haven Hash (haven.hash isilon.com) PR: kern/147767 Modified: stable/7/sys/net/rtsock.c Modified: stable/7/sys/net/rtsock.c ============================================================================== --- stable/7/sys/net/rtsock.c Sat Jun 12 15:13:36 2010 (r209107) +++ stable/7/sys/net/rtsock.c Sat Jun 12 15:42:54 2010 (r209108) @@ -672,8 +672,13 @@ route_output(struct mbuf *m, struct sock rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx, &rt->rt_rmx); rtm->rtm_index = rt->rt_ifp->if_index; - if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest) - rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, &info); + if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest) { + RT_UNLOCK(rt); + RADIX_NODE_HEAD_LOCK(rnh); + RT_LOCK(rt); + rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, &info); + RADIX_NODE_HEAD_UNLOCK(rnh); + } if (info.rti_info[RTAX_GENMASK]) rt->rt_genmask = info.rti_info[RTAX_GENMASK]; /* FALLTHROUGH */