From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 15 11:43:29 2009 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 452DF1065692; Sun, 15 Nov 2009 11:43:29 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 318D58FC08; Sun, 15 Nov 2009 11:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAFBhTrm036624; Sun, 15 Nov 2009 11:43:29 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAFBhTSD036619; Sun, 15 Nov 2009 11:43:29 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200911151143.nAFBhTSD036619@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 15 Nov 2009 11:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199289 - in stable/7/sys: conf dev/bce X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2009 11:43:29 -0000 Author: stas Date: Sun Nov 15 11:43:28 2009 New Revision: 199289 URL: http://svn.freebsd.org/changeset/base/199289 Log: - MFC r198320: Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable header in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not into if_bce.c anyway. It is disabled by default. > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. _M 7/sys M 7/sys/conf/NOTES M 7/sys/conf/options M 7/sys/dev/bce/if_bce.c M 7/sys/dev/bce/if_bcereg.h _M 7/sys/contrib/pf Modified: stable/7/sys/conf/NOTES stable/7/sys/conf/options stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/bce/if_bcereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/NOTES ============================================================================== --- stable/7/sys/conf/NOTES Sun Nov 15 11:30:59 2009 (r199288) +++ stable/7/sys/conf/NOTES Sun Nov 15 11:43:28 2009 (r199289) @@ -1929,6 +1929,12 @@ device lmc # only works for Tigon II chips, and has no effect for Tigon I chips. options TI_JUMBO_HDRSPLIT +# +# Use header splitting feature on bce(4) adapters. +# This may help to reduce the amount of jumbo-sized memory buffers used. +# +options BCE_JUMBO_HDRSPLIT + # These two options allow manipulating the mbuf cluster size and mbuf size, # respectively. Be very careful with NIC driver modules when changing # these from their default values, because that can potentially cause a Modified: stable/7/sys/conf/options ============================================================================== --- stable/7/sys/conf/options Sun Nov 15 11:30:59 2009 (r199288) +++ stable/7/sys/conf/options Sun Nov 15 11:43:28 2009 (r199289) @@ -493,6 +493,7 @@ DRM_DEBUG opt_drm.h ZERO_COPY_SOCKETS opt_zero.h TI_PRIVATE_JUMBOS opt_ti.h TI_JUMBO_HDRSPLIT opt_ti.h +BCE_JUMBO_HDRSPLIT opt_bce.h # XXX Conflict: # of devices vs network protocol (Native ATM). # This makes "atm.h" unusable. Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Sun Nov 15 11:30:59 2009 (r199288) +++ stable/7/sys/dev/bce/if_bce.c Sun Nov 15 11:43:28 2009 (r199289) @@ -293,12 +293,12 @@ static void bce_dump_enet (str static void bce_dump_mbuf (struct bce_softc *, struct mbuf *); static void bce_dump_tx_mbuf_chain (struct bce_softc *, u16, int); static void bce_dump_rx_mbuf_chain (struct bce_softc *, u16, int); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT static void bce_dump_pg_mbuf_chain (struct bce_softc *, u16, int); #endif static void bce_dump_txbd (struct bce_softc *, int, struct tx_bd *); static void bce_dump_rxbd (struct bce_softc *, int, struct rx_bd *); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT static void bce_dump_pgbd (struct bce_softc *, int, struct rx_bd *); #endif static void bce_dump_l2fhdr (struct bce_softc *, int, struct l2_fhdr *); @@ -306,7 +306,7 @@ static void bce_dump_ctx (struct bce_s static void bce_dump_ftqs (struct bce_softc *); static void bce_dump_tx_chain (struct bce_softc *, u16, int); static void bce_dump_rx_chain (struct bce_softc *, u16, int); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT static void bce_dump_pg_chain (struct bce_softc *, u16, int); #endif static void bce_dump_status_block (struct bce_softc *); @@ -391,7 +391,7 @@ static int bce_init_rx_chain (struct b static void bce_fill_rx_chain (struct bce_softc *); static void bce_free_rx_chain (struct bce_softc *); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT static int bce_get_pg_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *); static int bce_init_pg_chain (struct bce_softc *); static void bce_fill_pg_chain (struct bce_softc *); @@ -597,7 +597,7 @@ bce_print_adapter_info(struct bce_softc /* Firmware version and device features. */ printf("B/C (0x%08X); Flags( ", sc->bce_bc_ver); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT printf("SPLT "); #endif if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) @@ -1013,7 +1013,7 @@ bce_attach(device_t dev) * This may change later if the MTU size is set to * something other than 1500. */ -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT sc->rx_bd_mbuf_alloc_size = MHLEN; /* Make sure offset is 16 byte aligned for hardware. */ sc->rx_bd_mbuf_align_pad = roundup2((MSIZE - MHLEN), 16) - @@ -2753,7 +2753,7 @@ bce_dma_free(struct bce_softc *sc) } -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /* Free, unmap and destroy all page buffer descriptor chain pages. */ for (i = 0; i < PG_PAGES; i++ ) { if (sc->pg_bd_chain[i] != NULL) { @@ -2817,7 +2817,7 @@ bce_dma_free(struct bce_softc *sc) sc->rx_mbuf_tag = NULL; } -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /* Unload and destroy the page mbuf maps. */ for (i = 0; i < TOTAL_PG_BD; i++) { if (sc->pg_mbuf_map[i] != NULL) { @@ -3263,7 +3263,7 @@ bce_dma_alloc(device_t dev) /* * Create a DMA tag for RX mbufs. */ -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? MCLBYTES : sc->rx_bd_mbuf_alloc_size); #else @@ -3304,7 +3304,7 @@ bce_dma_alloc(device_t dev) } } -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /* * Create a DMA tag for the page buffer descriptor chain, * allocate and clear the memory, and fetch the physical @@ -4393,7 +4393,7 @@ bce_stop(struct bce_softc *sc) bce_disable_intr(sc); /* Free RX buffers. */ -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT bce_free_pg_chain(sc); #endif bce_free_rx_chain(sc); @@ -4831,7 +4831,7 @@ bce_get_rx_buf(struct bce_softc *sc, str goto bce_get_rx_buf_exit); /* This is a new mbuf allocation. */ -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT MGETHDR(m_new, M_DONTWAIT, MT_DATA); #else if (sc->rx_bd_mbuf_alloc_size <= MCLBYTES) @@ -4912,7 +4912,7 @@ bce_get_rx_buf_exit: } -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /****************************************************************************/ /* Encapsulate an mbuf cluster into the page chain. */ /* */ @@ -5021,7 +5021,7 @@ bce_get_pg_buf_exit: return(rc); } -#endif /* ZERO_COPY_SOCKETS */ +#endif /* BCE_JUMBO_HDRSPLIT */ /****************************************************************************/ /* Initialize the TX context memory. */ @@ -5377,7 +5377,7 @@ bce_free_rx_chain(struct bce_softc *sc) } -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /****************************************************************************/ /* Allocate memory and initialize the page data structures. */ /* Assumes that bce_init_rx_chain() has not already been called. */ @@ -5541,7 +5541,7 @@ bce_free_pg_chain(struct bce_softc *sc) DBEXIT(BCE_VERBOSE_RESET | BCE_VERBOSE_RECV | BCE_VERBOSE_UNLOAD); } -#endif /* ZERO_COPY_SOCKETS */ +#endif /* BCE_JUMBO_HDRSPLIT */ /****************************************************************************/ @@ -5714,7 +5714,7 @@ bce_rx_intr(struct bce_softc *sc) unsigned int pkt_len; u16 sw_rx_cons, sw_rx_cons_idx, hw_rx_cons; u32 status; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT unsigned int rem_len; u16 sw_pg_cons, sw_pg_cons_idx; #endif @@ -5730,7 +5730,7 @@ bce_rx_intr(struct bce_softc *sc) bus_dmamap_sync(sc->rx_bd_chain_tag, sc->rx_bd_chain_map[i], BUS_DMASYNC_POSTREAD); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /* Prepare the page chain pages to be accessed by the host CPU. */ for (int i = 0; i < PG_PAGES; i++) bus_dmamap_sync(sc->pg_bd_chain_tag, @@ -5742,7 +5742,7 @@ bce_rx_intr(struct bce_softc *sc) /* Get working copies of the driver's view of the consumer indices. */ sw_rx_cons = sc->rx_cons; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT sw_pg_cons = sc->pg_cons; #endif @@ -5803,7 +5803,7 @@ bce_rx_intr(struct bce_softc *sc) */ m_adj(m0, sizeof(struct l2_fhdr) + ETHER_ALIGN); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /* * Check whether the received frame fits in a single * mbuf or not (i.e. packet data + FCS <= @@ -5977,7 +5977,7 @@ bce_rx_int_next_rx: if (m0) { /* Make sure we don't lose our place when we release the lock. */ sc->rx_cons = sw_rx_cons; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT sc->pg_cons = sw_pg_cons; #endif @@ -5987,7 +5987,7 @@ bce_rx_int_next_rx: /* Recover our place. */ sw_rx_cons = sc->rx_cons; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT sw_pg_cons = sc->pg_cons; #endif } @@ -5998,7 +5998,7 @@ bce_rx_int_next_rx: } /* No new packets to process. Refill the RX and page chains and exit. */ -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT sc->pg_cons = sw_pg_cons; bce_fill_pg_chain(sc); #endif @@ -6011,7 +6011,7 @@ bce_rx_int_next_rx: bus_dmamap_sync(sc->rx_bd_chain_tag, sc->rx_bd_chain_map[i], BUS_DMASYNC_PREWRITE); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT for (int i = 0; i < PG_PAGES; i++) bus_dmamap_sync(sc->pg_bd_chain_tag, sc->pg_bd_chain_map[i], BUS_DMASYNC_PREWRITE); @@ -6257,7 +6257,7 @@ bce_init_locked(struct bce_softc *sc) * Calculate and program the hardware Ethernet MTU * size. Be generous on the receive if we have room. */ -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT if (ifp->if_mtu <= (sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size)) ether_mtu = sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size; #else @@ -6289,7 +6289,7 @@ bce_init_locked(struct bce_softc *sc) /* Program appropriate promiscuous/multicast filtering. */ bce_set_rx_mode(sc); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT DBPRINT(sc, BCE_INFO_LOAD, "%s(): pg_bd_mbuf_alloc_size = %d\n", __FUNCTION__, sc->pg_bd_mbuf_alloc_size); @@ -6802,7 +6802,7 @@ bce_ioctl(struct ifnet *ifp, u_long comm BCE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /* No buffer allocation size changes are necessary. */ #else /* Recalculate our buffer allocation sizes. */ @@ -7505,7 +7505,7 @@ bce_tick(void *xsc) bce_stats_update(sc); /* Top off the receive and page chains. */ -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT bce_fill_pg_chain(sc); #endif bce_fill_rx_chain(sc); @@ -7685,7 +7685,7 @@ bce_sysctl_dump_tx_chain(SYSCTL_HANDLER_ } -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /****************************************************************************/ /* Provides a sysctl interface to allow dumping the page chain. */ /* */ @@ -8313,7 +8313,7 @@ bce_add_sysctls(struct bce_softc *sc) (void *)sc, 0, bce_sysctl_dump_tx_chain, "I", "Dump tx_bd chain"); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dump_pg_chain", CTLTYPE_INT | CTLFLAG_RW, (void *)sc, 0, @@ -8608,7 +8608,7 @@ bce_dump_rx_mbuf_chain(struct bce_softc } -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /****************************************************************************/ /* Prints out the mbufs in the mbuf page chain. */ /* */ @@ -8732,7 +8732,7 @@ bce_dump_rxbd(struct bce_softc *sc, int } -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /****************************************************************************/ /* Prints out a rx_bd structure in the page chain. */ /* */ @@ -9219,7 +9219,7 @@ bce_dump_rx_chain(struct bce_softc *sc, } -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /****************************************************************************/ /* Prints out the page chain. */ /* */ @@ -9700,7 +9700,7 @@ bce_dump_driver_state(struct bce_softc * "0x%08X:%08X - (sc->rx_bd_chain) rx_bd chain virtual address\n", val_hi, val_lo); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT val_hi = BCE_ADDR_HI(sc->pg_bd_chain); val_lo = BCE_ADDR_LO(sc->pg_bd_chain); BCE_PRINTF( @@ -9720,7 +9720,7 @@ bce_dump_driver_state(struct bce_softc * "0x%08X:%08X - (sc->rx_mbuf_ptr) rx mbuf chain virtual address\n", val_hi, val_lo); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT val_hi = BCE_ADDR_HI(sc->pg_mbuf_ptr); val_lo = BCE_ADDR_LO(sc->pg_mbuf_ptr); BCE_PRINTF( @@ -9773,7 +9773,7 @@ bce_dump_driver_state(struct bce_softc * BCE_PRINTF(" 0x%08X - (sc->free_rx_bd) free rx_bd's\n", sc->free_rx_bd); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT BCE_PRINTF(" 0x%04X(0x%04X) - (sc->pg_prod) page producer index\n", sc->pg_prod, (u16) PG_CHAIN_IDX(sc->pg_prod)); @@ -10279,7 +10279,7 @@ bce_breakpoint(struct bce_softc *sc) bce_dump_tpat_state(sc, 0); bce_dump_cp_state(sc, 0); bce_dump_com_state(sc, 0); -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT bce_dump_pgbd(sc, 0, NULL); bce_dump_pg_mbuf_chain(sc, 0, USABLE_PG_BD); bce_dump_pg_chain(sc, 0, USABLE_PG_BD); Modified: stable/7/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/7/sys/dev/bce/if_bcereg.h Sun Nov 15 11:30:59 2009 (r199288) +++ stable/7/sys/dev/bce/if_bcereg.h Sun Nov 15 11:43:28 2009 (r199289) @@ -6205,7 +6205,7 @@ struct l2_fhdr { #define RX_PAGE(x) (((x) & ~USABLE_RX_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4)) #define RX_IDX(x) ((x) & USABLE_RX_BD_PER_PAGE) -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /* * To accomodate jumbo frames, the page chain should * be 4 times larger than the receive chain. @@ -6227,7 +6227,7 @@ struct l2_fhdr { #define PG_PAGE(x) (((x) & ~USABLE_PG_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4)) #define PG_IDX(x) ((x) & USABLE_PG_BD_PER_PAGE) -#endif /* ZERO_COPY_SOCKETS */ +#endif /* BCE_JUMBO_HDRSPLIT */ #define CTX_INIT_RETRY_COUNT 10 @@ -6505,7 +6505,7 @@ struct bce_softc u16 tx_cons; u32 tx_prod_bseq; /* Counts the bytes used. */ -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT u16 pg_prod; u16 pg_cons; #endif @@ -6522,7 +6522,7 @@ struct bce_softc int rx_bd_mbuf_data_len; int rx_bd_mbuf_align_pad; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT int pg_bd_mbuf_alloc_size; #endif @@ -6544,7 +6544,7 @@ struct bce_softc struct rx_bd *rx_bd_chain[RX_PAGES]; bus_addr_t rx_bd_chain_paddr[RX_PAGES]; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /* H/W maintained page buffer descriptor chain structure. */ bus_dma_tag_t pg_bd_chain_tag; bus_dmamap_t pg_bd_chain_map[PG_PAGES]; @@ -6581,7 +6581,7 @@ struct bce_softc bus_dma_tag_t rx_mbuf_tag; bus_dma_tag_t tx_mbuf_tag; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT bus_dma_tag_t pg_mbuf_tag; #endif @@ -6593,7 +6593,7 @@ struct bce_softc bus_dmamap_t rx_mbuf_map[TOTAL_RX_BD]; struct mbuf *rx_mbuf_ptr[TOTAL_RX_BD]; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT /* S/W maintained mbuf page chain structure. */ bus_dmamap_t pg_mbuf_map[TOTAL_PG_BD]; struct mbuf *pg_mbuf_ptr[TOTAL_PG_BD]; @@ -6605,7 +6605,7 @@ struct bce_softc u16 used_tx_bd; u16 max_tx_bd; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT u16 free_pg_bd; u16 max_pg_bd; #endif @@ -6693,7 +6693,7 @@ struct bce_softc int debug_tx_mbuf_alloc; int debug_rx_mbuf_alloc; -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT int debug_pg_mbuf_alloc; #endif @@ -6710,7 +6710,7 @@ struct bce_softc u32 rx_low_watermark; /* Lowest number of rx_bd's free. */ u32 rx_empty_count; /* Number of times the RX chain was empty. */ -#ifdef ZERO_COPY_SOCKETS +#ifdef BCE_JUMBO_HDRSPLIT u32 pg_low_watermark; /* Lowest number of pages free. */ u32 pg_empty_count; /* Number of times the page chain was empty. */ #endif From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 15 23:51:59 2009 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 BC4F110656A9; Sun, 15 Nov 2009 23:51:59 +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 AA9CB8FC20; Sun, 15 Nov 2009 23:51: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 nAFNpxYl051571; Sun, 15 Nov 2009 23:51:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAFNpxWb051569; Sun, 15 Nov 2009 23:51:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200911152351.nAFNpxWb051569@svn.freebsd.org> From: Doug Barton Date: Sun, 15 Nov 2009 23:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199302 - stable/7/share/man/man5 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2009 23:51:59 -0000 Author: dougb Date: Sun Nov 15 23:51:59 2009 New Revision: 199302 URL: http://svn.freebsd.org/changeset/base/199302 Log: MFC r199127: Add a note about no hostname leading to "Amnesiac" on the console The text is inspired by the PR, but more in line with the existing text PR: docs/140434 Submitted by: Jason Helfman MFC r199152: s/a default/the default/ Submitted by: remko MFC r199299: In r199127/r199152 I forgot to bump .Dd Modified: stable/7/share/man/man5/rc.conf.5 (contents, props changed) Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/rc.conf.5 ============================================================================== --- stable/7/share/man/man5/rc.conf.5 Sun Nov 15 23:49:28 2009 (r199301) +++ stable/7/share/man/man5/rc.conf.5 Sun Nov 15 23:51:59 2009 (r199302) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2009 +.Dd November 11, 2009 .Dt RC.CONF 5 .Os .Sh NAME @@ -344,6 +344,9 @@ If .Xr dhclient 8 is used to set the hostname via DHCP, this variable should be set to an empty string. +If this value remains unset when the system is done booting +your console login will display the default hostname of +.Dq Amnesiac. .It Va ipv6_enable .Pq Vt bool Enable support for IPv6 networking. From owner-svn-src-stable-7@FreeBSD.ORG Mon Nov 16 08:27:55 2009 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 011171065693; Mon, 16 Nov 2009 08:27:55 +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 E40058FC15; Mon, 16 Nov 2009 08:27: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 nAG8RsO3062656; Mon, 16 Nov 2009 08:27:54 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAG8RsRM062654; Mon, 16 Nov 2009 08:27:54 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911160827.nAG8RsRM062654@svn.freebsd.org> From: Christian Brueffer Date: Mon, 16 Nov 2009 08:27: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: r199315 - stable/7/lib/libc/gen 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, 16 Nov 2009 08:27:55 -0000 Author: brueffer Date: Mon Nov 16 08:27:54 2009 New Revision: 199315 URL: http://svn.freebsd.org/changeset/base/199315 Log: MFC: r199046 Fix a copy+paste error by checking the correct variable against MM_NULLACT. Modified: stable/7/lib/libc/gen/fmtmsg.c Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/gen/fmtmsg.c ============================================================================== --- stable/7/lib/libc/gen/fmtmsg.c Mon Nov 16 08:26:56 2009 (r199314) +++ stable/7/lib/libc/gen/fmtmsg.c Mon Nov 16 08:27:54 2009 (r199315) @@ -128,7 +128,7 @@ printfmt(char *msgverb, long class, cons size += strlen(sevname); if (text != MM_NULLTXT) size += strlen(text); - if (text != MM_NULLACT) + if (act != MM_NULLACT) size += strlen(act); if (tag != MM_NULLTAG) size += strlen(tag); From owner-svn-src-stable-7@FreeBSD.ORG Mon Nov 16 20:34:54 2009 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 12187106568F; Mon, 16 Nov 2009 20:34:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAE8F8FC16; Mon, 16 Nov 2009 20:34: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 nAGKYrk1080686; Mon, 16 Nov 2009 20:34:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAGKYrJW080684; Mon, 16 Nov 2009 20:34:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911162034.nAGKYrJW080684@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 16 Nov 2009 20:34: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: r199330 - stable/7/sys/compat/pecoff 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, 16 Nov 2009 20:34:54 -0000 Author: bz Date: Mon Nov 16 20:34:53 2009 New Revision: 199330 URL: http://svn.freebsd.org/changeset/base/199330 Log: As we pass the 'offset' unvalidated to vn_rdwr() make sure that it is unsigned rather than possibly set to something negative by a malicious binary. This is just the immediate fix to the problem mentioned in PR kern/80742 and by http://milw0rm.com/exploits/9206 but does not fix all possible problems imgact_pecoff has. As this feature does not work and is not compiled in by default, the security team considers this vulnerability to be of low risk to the user population and will not be issuing an advisory. Note that this is a direct commit to stable/7 as pecoff support has been removed from head and stable/8 already. PR: kern/80742 Reported by: Oliver Pinter (oliver.pntr gmail.com) via freebsd-security Help reproducing and testing by: Damian Weber (dweber htw-saarland.de) MFC After: 3 days Modified: stable/7/sys/compat/pecoff/imgact_pecoff.c Modified: stable/7/sys/compat/pecoff/imgact_pecoff.c ============================================================================== --- stable/7/sys/compat/pecoff/imgact_pecoff.c Mon Nov 16 19:10:09 2009 (r199329) +++ stable/7/sys/compat/pecoff/imgact_pecoff.c Mon Nov 16 20:34:53 2009 (r199330) @@ -136,7 +136,7 @@ exec_pecoff_coff_makecmds(struct image_p struct coff_filehdr *, int); static int pecoff_signature(struct thread *, struct vnode *, const struct pecoff_dos_filehdr *); -static int pecoff_read_from(struct thread *, struct vnode *, int, caddr_t, int); +static int pecoff_read_from(struct thread *, struct vnode *, unsigned int, caddr_t, int); static int pecoff_load_section(struct thread * td, struct vmspace * vmspace, struct vnode * vp, @@ -292,7 +292,7 @@ pecoff_load_file(struct thread * td, con struct vmspace *vmspace = td->td_proc->p_vmspace; struct vattr attr; struct image_params image_params, *imgp; - int peofs; + unsigned int peofs; int error, i, scnsiz; imgp = &image_params; @@ -554,7 +554,7 @@ int pecoff_read_from(td, vp, pos, buf, siz) struct thread *td; struct vnode *vp; - int pos; + unsigned int pos; caddr_t buf; int siz; { From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 17 09:37:44 2009 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 0D603106566C; Tue, 17 Nov 2009 09:37:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFC338FC1B; Tue, 17 Nov 2009 09:37: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 nAH9bh7G098774; Tue, 17 Nov 2009 09:37:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAH9bhUW098771; Tue, 17 Nov 2009 09:37:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200911170937.nAH9bhUW098771@svn.freebsd.org> From: Andriy Gapon Date: Tue, 17 Nov 2009 09:37: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: r199353 - in stable/7/sys: dev/ichwd modules/ichwd 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, 17 Nov 2009 09:37:44 -0000 Author: avg Date: Tue Nov 17 09:37:43 2009 New Revision: 199353 URL: http://svn.freebsd.org/changeset/base/199353 Log: MFC r199015: ichwd: don't attach to isa pnp device(s) by accident Modified: stable/7/sys/dev/ichwd/ichwd.c stable/7/sys/modules/ichwd/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/7/sys/dev/ichwd/ichwd.c Tue Nov 17 09:35:13 2009 (r199352) +++ stable/7/sys/dev/ichwd/ichwd.c Tue Nov 17 09:37:43 2009 (r199353) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -393,7 +394,9 @@ static int ichwd_probe(device_t dev) { - (void)dev; + /* Do not claim some ISA PnP device by accident. */ + if (isa_get_logicalid(dev) != 0) + return (ENXIO); return (0); } Modified: stable/7/sys/modules/ichwd/Makefile ============================================================================== --- stable/7/sys/modules/ichwd/Makefile Tue Nov 17 09:35:13 2009 (r199352) +++ stable/7/sys/modules/ichwd/Makefile Tue Nov 17 09:37:43 2009 (r199353) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/ichwd KMOD= ichwd -SRCS= ichwd.c device_if.h bus_if.h pci_if.h +SRCS= ichwd.c device_if.h bus_if.h pci_if.h isa_if.h .include From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 17 12:09:22 2009 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 3C4111065672; Tue, 17 Nov 2009 12:09:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B2EC8FC15; Tue, 17 Nov 2009 12:09:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAHC9LaF006113; Tue, 17 Nov 2009 12:09:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHC9Lm7006111; Tue, 17 Nov 2009 12:09:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911171209.nAHC9Lm7006111@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Nov 2009 12:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199358 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2009 12:09:22 -0000 Author: kib Date: Tue Nov 17 12:09:21 2009 New Revision: 199358 URL: http://svn.freebsd.org/changeset/base/199358 Log: MFC r198853: If socket buffer space appears to be lower then sum of count of already prepared bytes and next portion of transfer, inner loop of kern_sendfile() aborts, not preparing next mbuf for socket buffer, and not modifying any outer loop invariants. The thread loops in the outer loop forever. Instead of breaking from inner loop, prepare only bytes that fit into the socket buffer space. Modified: stable/7/sys/kern/uipc_syscalls.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/uipc_syscalls.c ============================================================================== --- stable/7/sys/kern/uipc_syscalls.c Tue Nov 17 11:46:55 2009 (r199357) +++ stable/7/sys/kern/uipc_syscalls.c Tue Nov 17 12:09:21 2009 (r199358) @@ -2027,20 +2027,12 @@ retry_space: rem = obj->un_pager.vnp.vnp_size - uap->offset - fsbytes - loopbytes; xfsize = omin(rem, xfsize); + xfsize = omin(space - loopbytes, xfsize); if (xfsize <= 0) { VM_OBJECT_UNLOCK(obj); done = 1; /* all data sent */ break; } - /* - * Don't overflow the send buffer. - * Stop here and send out what we've - * already got. - */ - if (space < loopbytes + xfsize) { - VM_OBJECT_UNLOCK(obj); - break; - } /* * Attempt to look up the page. Allocate From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 17 12:11:12 2009 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 DC6AE106566C; Tue, 17 Nov 2009 12:11:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBA0D8FC08; Tue, 17 Nov 2009 12:11: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 nAHCBCLa006218; Tue, 17 Nov 2009 12:11:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHCBCxB006216; Tue, 17 Nov 2009 12:11:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911171211.nAHCBCxB006216@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Nov 2009 12:11: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: r199359 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2009 12:11:13 -0000 Author: kib Date: Tue Nov 17 12:11:12 2009 New Revision: 199359 URL: http://svn.freebsd.org/changeset/base/199359 Log: MFC r199137: Detect the slashdot lookup for RENAME or REMOVE in lookup(), and return EINVAL. Modified: stable/7/sys/kern/vfs_lookup.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_lookup.c ============================================================================== --- stable/7/sys/kern/vfs_lookup.c Tue Nov 17 12:09:21 2009 (r199358) +++ stable/7/sys/kern/vfs_lookup.c Tue Nov 17 12:11:12 2009 (r199359) @@ -464,6 +464,12 @@ dirloop: else cnp->cn_flags &= ~ISLASTCN; + if ((cnp->cn_flags & ISLASTCN) != 0 && + cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.' && + (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) { + error = EINVAL; + goto bad; + } /* * Check for degenerate name (e.g. / or "") From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 17 15:28:25 2009 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 B00F710656A9; Tue, 17 Nov 2009 15:28:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E3198FC14; Tue, 17 Nov 2009 15:28:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAHFSPIp017362; Tue, 17 Nov 2009 15:28:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHFSPkP017360; Tue, 17 Nov 2009 15:28:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911171528.nAHFSPkP017360@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Nov 2009 15:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199392 - stable/7/sbin/ddb 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, 17 Nov 2009 15:28:25 -0000 Author: jhb Date: Tue Nov 17 15:28:25 2009 New Revision: 199392 URL: http://svn.freebsd.org/changeset/base/199392 Log: MFC 198820: Ensure 'kvm' is always initialized. If "-M" was not specified and the garbage value on the stack was not zero, then 'ddb capture' would try to use the garbage value as a kvm_t pointer. Modified: stable/7/sbin/ddb/ddb_capture.c Directory Properties: stable/7/sbin/ddb/ (props changed) Modified: stable/7/sbin/ddb/ddb_capture.c ============================================================================== --- stable/7/sbin/ddb/ddb_capture.c Tue Nov 17 15:28:14 2009 (r199391) +++ stable/7/sbin/ddb/ddb_capture.c Tue Nov 17 15:28:25 2009 (r199392) @@ -204,6 +204,7 @@ ddb_capture(int argc, char *argv[]) mflag = NULL; nflag = NULL; + kvm = NULL; while ((ch = getopt(argc, argv, "M:N:")) != -1) { switch (ch) { case 'M': From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 17 15:30:23 2009 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 9A7C11065769; Tue, 17 Nov 2009 15:30:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC9EE8FC14; Tue, 17 Nov 2009 15:30:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAHFUMej017602; Tue, 17 Nov 2009 15:30:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHFUMux017600; Tue, 17 Nov 2009 15:30:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911171530.nAHFUMux017600@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Nov 2009 15:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199394 - stable/7/secure/usr.bin/bdes 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, 17 Nov 2009 15:30:23 -0000 Author: jhb Date: Tue Nov 17 15:30:22 2009 New Revision: 199394 URL: http://svn.freebsd.org/changeset/base/199394 Log: MFC 198856: Fix a couple of comment typos. Modified: stable/7/secure/usr.bin/bdes/bdes.c Directory Properties: stable/7/secure/usr.bin/bdes/ (props changed) Modified: stable/7/secure/usr.bin/bdes/bdes.c ============================================================================== --- stable/7/secure/usr.bin/bdes/bdes.c Tue Nov 17 15:30:16 2009 (r199393) +++ stable/7/secure/usr.bin/bdes/bdes.c Tue Nov 17 15:30:22 2009 (r199394) @@ -170,11 +170,11 @@ main(int argc, char *argv[]) int i; /* counter in a for loop */ char *p; /* used to obtain the key */ DES_cblock msgbuf; /* I/O buffer */ - int kflag; /* command-line encryptiooon key */ + int kflag; /* command-line encryption key */ setproctitle("-"); /* Hide command-line arguments */ - /* initialize the initialization vctor */ + /* initialize the initialization vector */ MEMZERO(ivec, 8); /* process the argument list */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 17 15:59:27 2009 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 675291065698; Tue, 17 Nov 2009 15:59:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1958FC1D; Tue, 17 Nov 2009 15:59:27 +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 nAHFxRWD019577; Tue, 17 Nov 2009 15:59:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHFxRjO019573; Tue, 17 Nov 2009 15:59:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911171559.nAHFxRjO019573@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Nov 2009 15:59:27 +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: r199397 - in stable/7/sys: amd64/conf i386/conf pc98/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2009 15:59:27 -0000 Author: jhb Date: Tue Nov 17 15:59:26 2009 New Revision: 199397 URL: http://svn.freebsd.org/changeset/base/199397 Log: MFC 198043: Move the USB wireless drivers down into their own section next to the USB ethernet drivers. Modified: stable/7/sys/amd64/conf/GENERIC stable/7/sys/i386/conf/GENERIC stable/7/sys/pc98/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/conf/GENERIC ============================================================================== --- stable/7/sys/amd64/conf/GENERIC Tue Nov 17 15:56:45 2009 (r199396) +++ stable/7/sys/amd64/conf/GENERIC Tue Nov 17 15:59:26 2009 (r199397) @@ -280,7 +280,6 @@ device ukbd # Keyboard device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da device ums # Mouse -device ural # Ralink Technology RT2500USB wireless NICs device urio # Diamond Rio 500 MP3 player device uscanner # Scanners # USB Serial devices @@ -301,6 +300,9 @@ device cdce # Generic USB over Etherne device cue # CATC USB Ethernet device kue # Kawasaki LSI USB Ethernet device rue # RealTek RTL8150 USB Ethernet +# USB Wireless +device rum # Ralink Technology RT2501USB wireless NICs +device ural # Ralink Technology RT2500USB wireless NICs # FireWire support device firewire # FireWire bus code Modified: stable/7/sys/i386/conf/GENERIC ============================================================================== --- stable/7/sys/i386/conf/GENERIC Tue Nov 17 15:56:45 2009 (r199396) +++ stable/7/sys/i386/conf/GENERIC Tue Nov 17 15:59:26 2009 (r199397) @@ -294,8 +294,6 @@ device ukbd # Keyboard device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da device ums # Mouse -device ural # Ralink Technology RT2500USB wireless NICs -device rum # Ralink Technology RT2501USB wireless NICs device urio # Diamond Rio 500 MP3 player device uscanner # Scanners # USB Serial devices @@ -316,6 +314,9 @@ device cdce # Generic USB over Etherne device cue # CATC USB Ethernet device kue # Kawasaki LSI USB Ethernet device rue # RealTek RTL8150 USB Ethernet +# USB Wireless +device rum # Ralink Technology RT2501USB wireless NICs +device ural # Ralink Technology RT2500USB wireless NICs # FireWire support device firewire # FireWire bus code Modified: stable/7/sys/pc98/conf/GENERIC ============================================================================== --- stable/7/sys/pc98/conf/GENERIC Tue Nov 17 15:56:45 2009 (r199396) +++ stable/7/sys/pc98/conf/GENERIC Tue Nov 17 15:59:26 2009 (r199397) @@ -248,7 +248,6 @@ device bpf # Berkeley packet filter #device ulpt # Printer #device umass # Disks/Mass storage - Requires scbus and da #device ums # Mouse -#device ural # Ralink Technology RT2500USB wireless NICs #device urio # Diamond Rio 500 MP3 player #device uscanner # Scanners # USB Serial devices @@ -269,6 +268,9 @@ device bpf # Berkeley packet filter #device cue # CATC USB Ethernet #device kue # Kawasaki LSI USB Ethernet #device rue # RealTek RTL8150 USB Ethernet +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs +#device ural # Ralink Technology RT2500USB wireless NICs # FireWire support #device firewire # FireWire bus code From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 17 16:17:40 2009 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 BF9081065679; Tue, 17 Nov 2009 16:17:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 238398FC2F; Tue, 17 Nov 2009 16:17:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAHGHeNd020888; Tue, 17 Nov 2009 16:17:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHGHeCM020886; Tue, 17 Nov 2009 16:17:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911171617.nAHGHeCM020886@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Nov 2009 16:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199401 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2009 16:17:40 -0000 Author: jhb Date: Tue Nov 17 16:17:39 2009 New Revision: 199401 URL: http://svn.freebsd.org/changeset/base/199401 Log: MFC 198990: Several years ago a feature was added to TCP that casued soreceive() to send an ACK right away if data was drained from a TCP socket that had previously advertised a zero-sized window. The current code requires the receive window to be exactly zero for this to kick in. If window scaling is enabled and the window is smaller than the scale, then the effective window that is advertised is zero. However, in that case the zero-sized window handling is not enabled because the window is not exactly zero. The fix changes the code to check the raw window value against zero. Modified: stable/7/sys/netinet/tcp_output.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_output.c ============================================================================== --- stable/7/sys/netinet/tcp_output.c Tue Nov 17 16:17:11 2009 (r199400) +++ stable/7/sys/netinet/tcp_output.c Tue Nov 17 16:17:39 2009 (r199401) @@ -939,7 +939,7 @@ send: * to read more data then can be buffered prior to transmitting on * the connection. */ - if (recwin == 0) + if (th->th_win == 0) tp->t_flags |= TF_RXWIN0SENT; else tp->t_flags &= ~TF_RXWIN0SENT; From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 17 16:51:39 2009 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 0B28C106566C; Tue, 17 Nov 2009 16:51:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED3B18FC1D; Tue, 17 Nov 2009 16:51:38 +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 nAHGpcG5023260; Tue, 17 Nov 2009 16:51:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHGpcLf023258; Tue, 17 Nov 2009 16:51:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911171651.nAHGpcLf023258@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Nov 2009 16:51:38 +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: r199409 - stable/7/lib/libkvm 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, 17 Nov 2009 16:51:39 -0000 Author: jhb Date: Tue Nov 17 16:51:38 2009 New Revision: 199409 URL: http://svn.freebsd.org/changeset/base/199409 Log: MFC 198986: Fix a copy-paste bug when reading data from the last 3 (7 for PAE) bytes of a page mapped by a large page in the kernel. Modified: stable/7/lib/libkvm/kvm_i386.c Directory Properties: stable/7/lib/libkvm/ (props changed) Modified: stable/7/lib/libkvm/kvm_i386.c ============================================================================== --- stable/7/lib/libkvm/kvm_i386.c Tue Nov 17 16:50:57 2009 (r199408) +++ stable/7/lib/libkvm/kvm_i386.c Tue Nov 17 16:51:38 2009 (r199409) @@ -294,9 +294,9 @@ _kvm_vatop(kvm_t *kd, u_long va, off_t * #define PG_FRAME4M (~PAGE4M_MASK) pde_pa = ((u_long)pde & PG_FRAME4M) + (va & PAGE4M_MASK); s = _kvm_pa2off(kd, pde_pa, &ofs); - if (s < sizeof pde) { - _kvm_syserr(kd, kd->program, - "_kvm_vatop: pde_pa not found"); + if (s == 0) { + _kvm_err(kd, kd->program, + "_kvm_vatop: 4MB page address not in dump"); goto invalid; } *pa = ofs; @@ -390,9 +390,9 @@ _kvm_vatop_pae(kvm_t *kd, u_long va, off #define PG_FRAME2M (~PAGE2M_MASK) pde_pa = ((u_long)pde & PG_FRAME2M) + (va & PAGE2M_MASK); s = _kvm_pa2off(kd, pde_pa, &ofs); - if (s < sizeof pde) { - _kvm_syserr(kd, kd->program, - "_kvm_vatop_pae: pde_pa not found"); + if (s == 0) { + _kvm_err(kd, kd->program, + "_kvm_vatop: 2MB page address not in dump"); goto invalid; } *pa = ofs; From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 17 20:48:33 2009 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 19B87106566C; Tue, 17 Nov 2009 20:48:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0917B8FC18; Tue, 17 Nov 2009 20:48:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAHKmW4g037550; Tue, 17 Nov 2009 20:48:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHKmWPP037548; Tue, 17 Nov 2009 20:48:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911172048.nAHKmWPP037548@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 17 Nov 2009 20:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199433 - 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: Tue, 17 Nov 2009 20:48:33 -0000 Author: bz Date: Tue Nov 17 20:48:32 2009 New Revision: 199433 URL: http://svn.freebsd.org/changeset/base/199433 Log: MFC r198049: Immediately after clearing a pending callout that didn't make it due to the lock we hold, disable interrupts, and announce to the firmware that we are shutting down. Especially do this before disabling blocks. This makes some types of machines with asf enabled no longer hang upon boot, when we start configuring the interface. PR: i386/96382, kern/100410, kern/122252, kern/116328 Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (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 Tue Nov 17 20:45:49 2009 (r199432) +++ stable/7/sys/dev/bge/if_bge.c Tue Nov 17 20:48:32 2009 (r199433) @@ -4213,6 +4213,16 @@ bge_stop(struct bge_softc *sc) callout_stop(&sc->bge_stat_ch); + /* Disable host interrupts. */ + BGE_SETBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR); + bge_writembx(sc, BGE_MBX_IRQ0_LO, 1); + + /* + * Tell firmware we're shutting down. + */ + bge_stop_fw(sc); + bge_sig_pre_reset(sc, BGE_RESET_STOP); + /* * Disable all of the receiver blocks. */ @@ -4252,16 +4262,6 @@ bge_stop(struct bge_softc *sc) BGE_CLRBIT(sc, BGE_MARB_MODE, BGE_MARBMODE_ENABLE); } - /* Disable host interrupts. */ - BGE_SETBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR); - bge_writembx(sc, BGE_MBX_IRQ0_LO, 1); - - /* - * Tell firmware we're shutting down. - */ - - bge_stop_fw(sc); - bge_sig_pre_reset(sc, BGE_RESET_STOP); bge_reset(sc); bge_sig_legacy(sc, BGE_RESET_STOP); bge_sig_post_reset(sc, BGE_RESET_STOP); From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 19 12:08:17 2009 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 00C08106566B; Thu, 19 Nov 2009 12:08:17 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E39788FC25; Thu, 19 Nov 2009 12:08: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 nAJC8G1I005936; Thu, 19 Nov 2009 12:08:16 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAJC8GeS005934; Thu, 19 Nov 2009 12:08:16 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200911191208.nAJC8GeS005934@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 19 Nov 2009 12:08: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: r199520 - 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: Thu, 19 Nov 2009 12:08:17 -0000 Author: nyan Date: Thu Nov 19 12:08:16 2009 New Revision: 199520 URL: http://svn.freebsd.org/changeset/base/199520 Log: MFC: revision 199219 Fix cpu model for PODP5V83. It is P24T, not P54T. Also remove redundant 'Overdrive' word. Modified: stable/7/sys/i386/i386/identcpu.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/i386/i386/identcpu.c ============================================================================== --- stable/7/sys/i386/i386/identcpu.c Thu Nov 19 12:07:00 2009 (r199519) +++ stable/7/sys/i386/i386/identcpu.c Thu Nov 19 12:08:16 2009 (r199520) @@ -265,7 +265,7 @@ printcpuinfo(void) strcat(cpu_model, "/P54C"); break; case 0x30: - strcat(cpu_model, "/P54T Overdrive"); + strcat(cpu_model, "/P24T"); break; case 0x40: strcat(cpu_model, "/P55C"); From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 19 20:30:18 2009 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 D88551065679; Thu, 19 Nov 2009 20:30:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C669B8FC0A; Thu, 19 Nov 2009 20:30:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAJKUImo018123; Thu, 19 Nov 2009 20:30:18 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAJKUIdc018121; Thu, 19 Nov 2009 20:30:18 GMT (envelope-from np@svn.freebsd.org) Message-Id: <200911192030.nAJKUIdc018121@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 19 Nov 2009 20:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199544 - stable/7/sys/dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2009 20:30:19 -0000 Author: np Date: Thu Nov 19 20:30:18 2009 New Revision: 199544 URL: http://svn.freebsd.org/changeset/base/199544 Log: Fix cxgb(4)'s LRO in stable/7 Submitted by: matthew.fleming at isilon.com Reviewed by: gnn Modified: stable/7/sys/dev/cxgb/cxgb_main.c Modified: stable/7/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_main.c Thu Nov 19 19:35:15 2009 (r199543) +++ stable/7/sys/dev/cxgb/cxgb_main.c Thu Nov 19 20:30:18 2009 (r199544) @@ -981,13 +981,6 @@ cxgb_makedev(struct port_info *pi) return (0); } -#ifndef LRO_SUPPORTED -#ifdef IFCAP_LRO -#undef IFCAP_LRO -#endif -#define IFCAP_LRO 0x0 -#endif - #ifdef TSO_SUPPORTED #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO) /* Don't enable TSO6 yet */ @@ -1994,7 +1987,6 @@ cxgb_set_mtu(struct port_info *p, int mt return (error); } -#ifdef LRO_SUPPORTED /* * Mark lro enabled or disabled in all qsets for this port */ @@ -2012,7 +2004,6 @@ cxgb_set_lro(struct port_info *p, int en } return (0); } -#endif static int cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data) @@ -2105,14 +2096,14 @@ cxgb_ioctl(struct ifnet *ifp, unsigned l error = EINVAL; } } -#ifdef LRO_SUPPORTED + if (mask & IFCAP_LRO) { ifp->if_capenable ^= IFCAP_LRO; /* Safe to do this even if cxgb_up not called yet */ cxgb_set_lro(p, ifp->if_capenable & IFCAP_LRO); } -#endif + if (mask & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; reinit = ifp->if_drv_flags & IFF_DRV_RUNNING; From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 19 20:40:52 2009 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 A1B9F1065695; Thu, 19 Nov 2009 20:40:52 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 756568FC21; Thu, 19 Nov 2009 20:40:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAJKeqQ0018510; Thu, 19 Nov 2009 20:40:52 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAJKeqN8018507; Thu, 19 Nov 2009 20:40:52 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200911192040.nAJKeqN8018507@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 19 Nov 2009 20:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199546 - stable/7/share/zoneinfo 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, 19 Nov 2009 20:40:52 -0000 Author: edwin Date: Thu Nov 19 20:40:52 2009 New Revision: 199546 URL: http://svn.freebsd.org/changeset/base/199546 Log: MFC of r199336 MFV of tzdata2009s, r199334 - Fix (harmless) typo in the definitions of Antarctica/David - Fiji will go into DST from 29 November 2009 to 25 April 2010. Modified: stable/7/share/zoneinfo/antarctica stable/7/share/zoneinfo/australasia Directory Properties: stable/7/share/zoneinfo/ (props changed) Modified: stable/7/share/zoneinfo/antarctica ============================================================================== --- stable/7/share/zoneinfo/antarctica Thu Nov 19 20:40:11 2009 (r199545) +++ stable/7/share/zoneinfo/antarctica Thu Nov 19 20:40:52 2009 (r199546) @@ -1,5 +1,5 @@ #
-# @(#)antarctica	8.6
+# @(#)antarctica	8.7
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -106,7 +106,7 @@ Zone Antarctica/Casey	0	-	zzz	1969
 Zone Antarctica/Davis	0	-	zzz	1957 Jan 13
 			7:00	-	DAVT	1964 Nov # Davis Time
 			0	-	zzz	1969 Feb
-			7:00	-	DAVT	2009 Oct 18 2:0
+			7:00	-	DAVT	2009 Oct 18 2:00
 			5:00	-	DAVT
 Zone Antarctica/Mawson	0	-	zzz	1954 Feb 13
 			6:00	-	MAWT	2009 Oct 18 2:00

Modified: stable/7/share/zoneinfo/australasia
==============================================================================
--- stable/7/share/zoneinfo/australasia	Thu Nov 19 20:40:11 2009	(r199545)
+++ stable/7/share/zoneinfo/australasia	Thu Nov 19 20:40:52 2009	(r199546)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.14
+# @(#)australasia	8.15
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -248,9 +248,30 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
 			6:30	-	CCT	# Cocos Islands Time
 
 # Fiji
+# From Alexander Krivenyshev (2009-11-10):
+# According to Fiji Broadcasting Corporation,  Fiji plans to re-introduce DST
+# from November 29th 2009  to April 25th 2010.
+#
+# "Daylight savings to commence this month"
+# 
+# http://www.radiofiji.com.fj/fullstory.php?id=23719
+# 
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_fiji01.html
+# 
+
+# From Steffen Thorsen (2009-11-10):
+# The Fiji Government has posted some more details about the approved
+# amendments:
+# 
+# http://www.fiji.gov.fj/publish/page_16198.shtml
+# 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
+Rule	Fiji	2009	only	-	Nov	29	2:00	1:00	S
+Rule	Fiji	2010	only	-	Apr	25	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
 			12:00	Fiji	FJ%sT	# Fiji Time

From owner-svn-src-stable-7@FreeBSD.ORG  Thu Nov 19 22:59:35 2009
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 C86011065676;
	Thu, 19 Nov 2009 22:59:35 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B57D78FC0C;
	Thu, 19 Nov 2009 22:59: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 nAJMxZHK022615;
	Thu, 19 Nov 2009 22:59:35 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAJMxZBc022613;
	Thu, 19 Nov 2009 22:59:35 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <200911192259.nAJMxZBc022613@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 19 Nov 2009 22:59: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: r199562 - stable/7/sys/netinet
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 19 Nov 2009 22:59:35 -0000

Author: tuexen
Date: Thu Nov 19 22:59:35 2009
New Revision: 199562
URL: http://svn.freebsd.org/changeset/base/199562

Log:
  MFC 199477
  Fix a bug where the system panics when a SHUTDOWN is received with an
  illegal TSN.
  This bug was reported by Irene Ruengeler.
  
  Approved by: rrs (mentor)

Modified:
  stable/7/sys/netinet/sctp_input.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/netinet/sctp_input.c
==============================================================================
--- stable/7/sys/netinet/sctp_input.c	Thu Nov 19 22:53:41 2009	(r199561)
+++ stable/7/sys/netinet/sctp_input.c	Thu Nov 19 22:59:35 2009	(r199562)
@@ -816,6 +816,9 @@ sctp_handle_shutdown(struct sctp_shutdow
 		return;
 	} else {
 		sctp_update_acked(stcb, cp, net, abort_flag);
+		if (*abort_flag) {
+			return;
+		}
 	}
 	if (asoc->control_pdapi) {
 		/*

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Nov 20 07:00:41 2009
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 35EEB106566C;
	Fri, 20 Nov 2009 07:00:41 +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 244CE8FC1A;
	Fri, 20 Nov 2009 07:00: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 nAK70fR2032316;
	Fri, 20 Nov 2009 07:00:41 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAK70f1v032314;
	Fri, 20 Nov 2009 07:00:41 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200911200700.nAK70f1v032314@svn.freebsd.org>
From: Christian Brueffer 
Date: Fri, 20 Nov 2009 07:00: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: r199569 - stable/7/lib/libc/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, 20 Nov 2009 07:00:41 -0000

Author: brueffer
Date: Fri Nov 20 07:00:40 2009
New Revision: 199569
URL: http://svn.freebsd.org/changeset/base/199569

Log:
  MFC: r199255, r199257
  
  Improved the manpage description.  The committed wording
  was provided by jhb.
  
  Remove a note about vfork(4) going to be eliminated, it's here to stay.

Modified:
  stable/7/lib/libc/sys/vfork.2
Directory Properties:
  stable/7/lib/libc/   (props changed)

Modified: stable/7/lib/libc/sys/vfork.2
==============================================================================
--- stable/7/lib/libc/sys/vfork.2	Fri Nov 20 06:55:35 2009	(r199568)
+++ stable/7/lib/libc/sys/vfork.2	Fri Nov 20 07:00:40 2009	(r199569)
@@ -28,12 +28,12 @@
 .\"     @(#)vfork.2	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd November 13, 2009
 .Dt VFORK 2
 .Os
 .Sh NAME
 .Nm vfork
-.Nd spawn new process in a virtual memory efficient way
+.Nd create a new process without copying the address space
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
@@ -113,14 +113,6 @@ The
 system call appeared in
 .Bx 2.9 .
 .Sh BUGS
-This system call will be eliminated when proper system sharing
-mechanisms are implemented.
-Users should not depend on the memory
-sharing semantics of
-.Fn vfork
-as it will, in that case, be made synonymous to
-.Xr fork 2 .
-.Pp
 To avoid a possible deadlock situation,
 processes that are children in the middle
 of a

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Nov 20 07:19:46 2009
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 E159810656A3;
	Fri, 20 Nov 2009 07:19:46 +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 D031E8FC24;
	Fri, 20 Nov 2009 07:19:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAK7Jk4j032862;
	Fri, 20 Nov 2009 07:19:46 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAK7JkpQ032860;
	Fri, 20 Nov 2009 07:19:46 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200911200719.nAK7JkpQ032860@svn.freebsd.org>
From: Christian Brueffer 
Date: Fri, 20 Nov 2009 07:19:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199572 - stable/7/share/man/man3
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 20 Nov 2009 07:19:47 -0000

Author: brueffer
Date: Fri Nov 20 07:19:46 2009
New Revision: 199572
URL: http://svn.freebsd.org/changeset/base/199572

Log:
  MFC: r199349
  
  Fix typo.

Modified:
  stable/7/share/man/man3/queue.3
Directory Properties:
  stable/7/share/man/man3/   (props changed)

Modified: stable/7/share/man/man3/queue.3
==============================================================================
--- stable/7/share/man/man3/queue.3	Fri Nov 20 07:19:09 2009	(r199571)
+++ stable/7/share/man/man3/queue.3	Fri Nov 20 07:19:46 2009	(r199572)
@@ -229,7 +229,7 @@ O(1) removal of any entry in the list.
 However:
 .Bl -enum -compact -offset indent
 .It
-Each elements requires two pointers rather than one.
+Each element requires two pointers rather than one.
 .It
 Code size and execution time of operations (except for removal) is about
 twice that of the singly-linked data-structures.

From owner-svn-src-stable-7@FreeBSD.ORG  Sat Nov 21 14:54:46 2009
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 31BBC106566C;
	Sat, 21 Nov 2009 14:54:46 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F2A28FC0A;
	Sat, 21 Nov 2009 14:54:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nALEskTQ082760;
	Sat, 21 Nov 2009 14:54:46 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nALEsk8n082758;
	Sat, 21 Nov 2009 14:54:46 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200911211454.nALEsk8n082758@svn.freebsd.org>
From: Robert Noland 
Date: Sat, 21 Nov 2009 14:54:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199633 - 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: Sat, 21 Nov 2009 14:54:46 -0000

Author: rnoland
Date: Sat Nov 21 14:54:45 2009
New Revision: 199633
URL: http://svn.freebsd.org/changeset/base/199633

Log:
  MFC r199017,199228
  
  Fix handling of GPT headers when size is > 92 bytes.
  
  This should address reading GPT headers written by opensolaris.

Modified:
  stable/7/sys/geom/part/g_part_gpt.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/geom/part/g_part_gpt.c
==============================================================================
--- stable/7/sys/geom/part/g_part_gpt.c	Sat Nov 21 14:54:35 2009	(r199632)
+++ stable/7/sys/geom/part/g_part_gpt.c	Sat Nov 21 14:54:45 2009	(r199633)
@@ -73,7 +73,7 @@ enum gpt_state {
 struct g_part_gpt_table {
 	struct g_part_table	base;
 	u_char			mbr[MBRSIZE];
-	struct gpt_hdr		hdr;
+	struct gpt_hdr		*hdr;
 	quad_t			lba[GPT_ELT_COUNT];
 	enum gpt_state		state[GPT_ELT_COUNT];
 };
@@ -142,13 +142,12 @@ static struct uuid gpt_uuid_linux_swap =
 static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR;
 static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED;
 
-static void
+static struct gpt_hdr *
 gpt_read_hdr(struct g_part_gpt_table *table, struct g_consumer *cp,
-    enum gpt_elt elt, struct gpt_hdr *hdr)
+    enum gpt_elt elt)
 {
-	struct uuid uuid;
+	struct gpt_hdr *buf, *hdr;
 	struct g_provider *pp;
-	char *buf;
 	quad_t lba, last;
 	int error;
 	uint32_t crc, sz;
@@ -160,63 +159,75 @@ gpt_read_hdr(struct g_part_gpt_table *ta
 	buf = g_read_data(cp, table->lba[elt] * pp->sectorsize, pp->sectorsize,
 	    &error);
 	if (buf == NULL)
-		return;
-	bcopy(buf, hdr, sizeof(*hdr));
-	if (memcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0)
-		return;
+		return (NULL);
+	hdr = NULL;
+	if (memcmp(buf->hdr_sig, GPT_HDR_SIG, sizeof(buf->hdr_sig)) != 0)
+		goto fail;
 
 	table->state[elt] = GPT_STATE_CORRUPT;
-	sz = le32toh(hdr->hdr_size);
+	sz = le32toh(buf->hdr_size);
 	if (sz < 92 || sz > pp->sectorsize)
-		return;
-	crc = le32toh(hdr->hdr_crc_self);
-	hdr->hdr_crc_self = 0;
-	if (crc32(hdr, sz) != crc)
-		return;
+		goto fail;
+
+	hdr = g_malloc(sz, M_WAITOK | M_ZERO);
+	bcopy(buf, hdr, sz);
 	hdr->hdr_size = sz;
+
+	crc = le32toh(buf->hdr_crc_self);
+	buf->hdr_crc_self = 0;
+	if (crc32(buf, sz) != crc)
+		goto fail;
 	hdr->hdr_crc_self = crc;
 
 	table->state[elt] = GPT_STATE_INVALID;
-	hdr->hdr_revision = le32toh(hdr->hdr_revision);
+	hdr->hdr_revision = le32toh(buf->hdr_revision);
 	if (hdr->hdr_revision < 0x00010000)
-		return;
-	hdr->hdr_lba_self = le64toh(hdr->hdr_lba_self);
+		goto fail;
+	hdr->hdr_lba_self = le64toh(buf->hdr_lba_self);
 	if (hdr->hdr_lba_self != table->lba[elt])
-		return;
-	hdr->hdr_lba_alt = le64toh(hdr->hdr_lba_alt);
+		goto fail;
+	hdr->hdr_lba_alt = le64toh(buf->hdr_lba_alt);
 
 	/* Check the managed area. */
-	hdr->hdr_lba_start = le64toh(hdr->hdr_lba_start);
+	hdr->hdr_lba_start = le64toh(buf->hdr_lba_start);
 	if (hdr->hdr_lba_start < 2 || hdr->hdr_lba_start >= last)
-		return;
-	hdr->hdr_lba_end = le64toh(hdr->hdr_lba_end);
+		goto fail;
+	hdr->hdr_lba_end = le64toh(buf->hdr_lba_end);
 	if (hdr->hdr_lba_end < hdr->hdr_lba_start || hdr->hdr_lba_end >= last)
-		return;
+		goto fail;
 
 	/* Check the table location and size of the table. */
-	hdr->hdr_entries = le32toh(hdr->hdr_entries);
-	hdr->hdr_entsz = le32toh(hdr->hdr_entsz);
+	hdr->hdr_entries = le32toh(buf->hdr_entries);
+	hdr->hdr_entsz = le32toh(buf->hdr_entsz);
 	if (hdr->hdr_entries == 0 || hdr->hdr_entsz < 128 ||
 	    (hdr->hdr_entsz & 7) != 0)
-		return;
-	hdr->hdr_lba_table = le64toh(hdr->hdr_lba_table);
+		goto fail;
+	hdr->hdr_lba_table = le64toh(buf->hdr_lba_table);
 	if (hdr->hdr_lba_table < 2 || hdr->hdr_lba_table >= last)
-		return;
+		goto fail;
 	if (hdr->hdr_lba_table >= hdr->hdr_lba_start &&
 	    hdr->hdr_lba_table <= hdr->hdr_lba_end)
-		return;
+		goto fail;
 	lba = hdr->hdr_lba_table +
 	    (hdr->hdr_entries * hdr->hdr_entsz + pp->sectorsize - 1) /
 	    pp->sectorsize - 1;
 	if (lba >= last)
-		return;
+		goto fail;
 	if (lba >= hdr->hdr_lba_start && lba <= hdr->hdr_lba_end)
-		return;
+		goto fail;
 
 	table->state[elt] = GPT_STATE_OK;
-	le_uuid_dec(&hdr->hdr_uuid, &uuid);
-	hdr->hdr_uuid = uuid;
-	hdr->hdr_crc_table = le32toh(hdr->hdr_crc_table);
+	le_uuid_dec(&buf->hdr_uuid, &hdr->hdr_uuid);
+	hdr->hdr_crc_table = le32toh(buf->hdr_crc_table);
+
+	g_free(buf);
+	return (hdr);
+
+ fail:
+	if (hdr != NULL)
+		g_free(hdr);
+	g_free(buf);
+	return (NULL);
 }
 
 static struct gpt_ent *
@@ -229,6 +240,9 @@ gpt_read_tbl(struct g_part_gpt_table *ta
 	unsigned int idx, sectors, tblsz;
 	int error;
 
+	if (hdr == NULL)
+		return (NULL);
+
 	pp = cp->provider;
 	table->lba[elt] = hdr->hdr_lba_table;
 
@@ -270,6 +284,9 @@ static int
 gpt_matched_hdrs(struct gpt_hdr *pri, struct gpt_hdr *sec)
 {
 
+	if (pri == NULL || sec == NULL)
+		return (0);
+
 	if (!EQUUID(&pri->hdr_uuid, &sec->hdr_uuid))
 		return (0);
 	return ((pri->hdr_revision == sec->hdr_revision &&
@@ -417,17 +434,20 @@ g_part_gpt_create(struct g_part_table *b
 	table->lba[GPT_ELT_SECHDR] = last;
 	table->lba[GPT_ELT_SECTBL] = last - tblsz;
 
-	bcopy(GPT_HDR_SIG, table->hdr.hdr_sig, sizeof(table->hdr.hdr_sig));
-	table->hdr.hdr_revision = GPT_HDR_REVISION;
-	table->hdr.hdr_size = offsetof(struct gpt_hdr, padding);
-	table->hdr.hdr_lba_start = 2 + tblsz;
-	table->hdr.hdr_lba_end = last - tblsz - 1;
-	kern_uuidgen(&table->hdr.hdr_uuid, 1);
-	table->hdr.hdr_entries = basetable->gpt_entries;
-	table->hdr.hdr_entsz = sizeof(struct gpt_ent);
+	/* Allocate space for the header */
+	table->hdr = g_malloc(sizeof(struct gpt_hdr), M_WAITOK | M_ZERO);
+
+	bcopy(GPT_HDR_SIG, table->hdr->hdr_sig, sizeof(table->hdr->hdr_sig));
+	table->hdr->hdr_revision = GPT_HDR_REVISION;
+	table->hdr->hdr_size = offsetof(struct gpt_hdr, padding);
+	table->hdr->hdr_lba_start = 2 + tblsz;
+	table->hdr->hdr_lba_end = last - tblsz - 1;
+	kern_uuidgen(&table->hdr->hdr_uuid, 1);
+	table->hdr->hdr_entries = basetable->gpt_entries;
+	table->hdr->hdr_entsz = sizeof(struct gpt_ent);
 
-	basetable->gpt_first = table->hdr.hdr_lba_start;
-	basetable->gpt_last = table->hdr.hdr_lba_end;
+	basetable->gpt_first = table->hdr->hdr_lba_start;
+	basetable->gpt_last = table->hdr->hdr_lba_end;
 	return (0);
 }
 
@@ -572,7 +592,7 @@ g_part_gpt_probe(struct g_part_table *ta
 static int
 g_part_gpt_read(struct g_part_table *basetable, struct g_consumer *cp)
 {
-	struct gpt_hdr prihdr, sechdr;
+	struct gpt_hdr *prihdr, *sechdr;
 	struct gpt_ent *tbl, *pritbl, *sectbl;
 	struct g_provider *pp;
 	struct g_part_gpt_table *table;
@@ -591,18 +611,18 @@ g_part_gpt_read(struct g_part_table *bas
 	g_free(buf);
 
 	/* Read the primary header and table. */
-	gpt_read_hdr(table, cp, GPT_ELT_PRIHDR, &prihdr);
+	prihdr = gpt_read_hdr(table, cp, GPT_ELT_PRIHDR);
 	if (table->state[GPT_ELT_PRIHDR] == GPT_STATE_OK) {
-		pritbl = gpt_read_tbl(table, cp, GPT_ELT_PRITBL, &prihdr);
+		pritbl = gpt_read_tbl(table, cp, GPT_ELT_PRITBL, prihdr);
 	} else {
 		table->state[GPT_ELT_PRITBL] = GPT_STATE_MISSING;
 		pritbl = NULL;
 	}
 
 	/* Read the secondary header and table. */
-	gpt_read_hdr(table, cp, GPT_ELT_SECHDR, &sechdr);
+	sechdr = gpt_read_hdr(table, cp, GPT_ELT_SECHDR);
 	if (table->state[GPT_ELT_SECHDR] == GPT_STATE_OK) {
-		sectbl = gpt_read_tbl(table, cp, GPT_ELT_SECTBL, &sechdr);
+		sectbl = gpt_read_tbl(table, cp, GPT_ELT_SECTBL, sechdr);
 	} else {
 		table->state[GPT_ELT_SECTBL] = GPT_STATE_MISSING;
 		sectbl = NULL;
@@ -625,13 +645,17 @@ g_part_gpt_read(struct g_part_table *bas
 	 */
 	if (table->state[GPT_ELT_PRIHDR] == GPT_STATE_OK &&
 	    table->state[GPT_ELT_SECHDR] == GPT_STATE_OK &&
-	    !gpt_matched_hdrs(&prihdr, &sechdr)) {
+	    !gpt_matched_hdrs(prihdr, sechdr)) {
 		if (table->state[GPT_ELT_PRITBL] == GPT_STATE_OK) {
 			table->state[GPT_ELT_SECHDR] = GPT_STATE_INVALID;
 			table->state[GPT_ELT_SECTBL] = GPT_STATE_MISSING;
+			g_free(sechdr);
+			sechdr = NULL;
 		} else {
 			table->state[GPT_ELT_PRIHDR] = GPT_STATE_INVALID;
 			table->state[GPT_ELT_PRITBL] = GPT_STATE_MISSING;
+			g_free(prihdr);
+			prihdr = NULL;
 		}
 	}
 
@@ -641,6 +665,8 @@ g_part_gpt_read(struct g_part_table *bas
 		printf("GEOM: %s: using the secondary instead -- recovery "
 		    "strongly advised.\n", pp->name);
 		table->hdr = sechdr;
+		if (prihdr != NULL)
+			g_free(prihdr);
 		tbl = sectbl;
 		if (pritbl != NULL)
 			g_free(pritbl);
@@ -652,14 +678,16 @@ g_part_gpt_read(struct g_part_table *bas
 			    "suggested.\n", pp->name);
 		}
 		table->hdr = prihdr;
+		if (sechdr != NULL)
+			g_free(sechdr);
 		tbl = pritbl;
 		if (sectbl != NULL)
 			g_free(sectbl);
 	}
 
-	basetable->gpt_first = table->hdr.hdr_lba_start;
-	basetable->gpt_last = table->hdr.hdr_lba_end;
-	basetable->gpt_entries = table->hdr.hdr_entries;
+	basetable->gpt_first = table->hdr->hdr_lba_start;
+	basetable->gpt_last = table->hdr->hdr_lba_end;
+	basetable->gpt_entries = table->hdr->hdr_entries;
 
 	for (index = basetable->gpt_entries - 1; index >= 0; index--) {
 		if (EQUUID(&tbl[index].ent_type, &gpt_uuid_unused))
@@ -717,7 +745,7 @@ g_part_gpt_write(struct g_part_table *ba
 
 	pp = cp->provider;
 	table = (struct g_part_gpt_table *)basetable;
-	tlbsz = (table->hdr.hdr_entries * table->hdr.hdr_entsz +
+	tlbsz = (table->hdr->hdr_entries * table->hdr->hdr_entsz +
 	    pp->sectorsize - 1) / pp->sectorsize;
 
 	/* Write the PMBR */
@@ -731,21 +759,21 @@ g_part_gpt_write(struct g_part_table *ba
 	/* Allocate space for the header and entries. */
 	buf = g_malloc((tlbsz + 1) * pp->sectorsize, M_WAITOK | M_ZERO);
 
-	memcpy(buf, table->hdr.hdr_sig, sizeof(table->hdr.hdr_sig));
-	le32enc(buf + 8, table->hdr.hdr_revision);
-	le32enc(buf + 12, table->hdr.hdr_size);
-	le64enc(buf + 40, table->hdr.hdr_lba_start);
-	le64enc(buf + 48, table->hdr.hdr_lba_end);
-	le_uuid_enc(buf + 56, &table->hdr.hdr_uuid);
-	le32enc(buf + 80, table->hdr.hdr_entries);
-	le32enc(buf + 84, table->hdr.hdr_entsz);
+	memcpy(buf, table->hdr->hdr_sig, sizeof(table->hdr->hdr_sig));
+	le32enc(buf + 8, table->hdr->hdr_revision);
+	le32enc(buf + 12, table->hdr->hdr_size);
+	le64enc(buf + 40, table->hdr->hdr_lba_start);
+	le64enc(buf + 48, table->hdr->hdr_lba_end);
+	le_uuid_enc(buf + 56, &table->hdr->hdr_uuid);
+	le32enc(buf + 80, table->hdr->hdr_entries);
+	le32enc(buf + 84, table->hdr->hdr_entsz);
 
 	LIST_FOREACH(baseentry, &basetable->gpt_entry, gpe_entry) {
 		if (baseentry->gpe_deleted)
 			continue;
 		entry = (struct g_part_gpt_entry *)baseentry;
 		index = baseentry->gpe_index - 1;
-		bp = buf + pp->sectorsize + table->hdr.hdr_entsz * index;
+		bp = buf + pp->sectorsize + table->hdr->hdr_entsz * index;
 		le_uuid_enc(bp, &entry->ent.ent_type);
 		le_uuid_enc(bp + 16, &entry->ent.ent_uuid);
 		le64enc(bp + 32, entry->ent.ent_lba_start);
@@ -756,7 +784,7 @@ g_part_gpt_write(struct g_part_table *ba
 	}
 
 	crc = crc32(buf + pp->sectorsize,
-	    table->hdr.hdr_entries * table->hdr.hdr_entsz);
+	    table->hdr->hdr_entries * table->hdr->hdr_entsz);
 	le32enc(buf + 88, crc);
 
 	/* Write primary meta-data. */
@@ -764,7 +792,7 @@ g_part_gpt_write(struct g_part_table *ba
 	le64enc(buf + 24, table->lba[GPT_ELT_PRIHDR]);	/* hdr_lba_self. */
 	le64enc(buf + 32, table->lba[GPT_ELT_SECHDR]);	/* hdr_lba_alt. */
 	le64enc(buf + 72, table->lba[GPT_ELT_PRITBL]);	/* hdr_lba_table. */
-	crc = crc32(buf, table->hdr.hdr_size);
+	crc = crc32(buf, table->hdr->hdr_size);
 	le32enc(buf + 16, crc);
 
 	error = g_write_data(cp, table->lba[GPT_ELT_PRITBL] * pp->sectorsize,
@@ -781,7 +809,7 @@ g_part_gpt_write(struct g_part_table *ba
 	le64enc(buf + 24, table->lba[GPT_ELT_SECHDR]);	/* hdr_lba_self. */
 	le64enc(buf + 32, table->lba[GPT_ELT_PRIHDR]);	/* hdr_lba_alt. */
 	le64enc(buf + 72, table->lba[GPT_ELT_SECTBL]);	/* hdr_lba_table. */
-	crc = crc32(buf, table->hdr.hdr_size);
+	crc = crc32(buf, table->hdr->hdr_size);
 	le32enc(buf + 16, crc);
 
 	error = g_write_data(cp, table->lba[GPT_ELT_SECTBL] * pp->sectorsize,

From owner-svn-src-stable-7@FreeBSD.ORG  Sat Nov 21 15:04:02 2009
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 F0358106566B;
	Sat, 21 Nov 2009 15:04:01 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DD6258FC1A;
	Sat, 21 Nov 2009 15:04:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nALF41mb083153;
	Sat, 21 Nov 2009 15:04:01 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id nALF41Xa083148;
	Sat, 21 Nov 2009 15:04:01 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200911211504.nALF41Xa083148@svn.freebsd.org>
From: Robert Noland 
Date: Sat, 21 Nov 2009 15:04:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r199635 - in stable/7/sys: boot/i386/zfsboot boot/zfs
	cddl/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: Sat, 21 Nov 2009 15:04:02 -0000

Author: rnoland
Date: Sat Nov 21 15:04:01 2009
New Revision: 199635
URL: http://svn.freebsd.org/changeset/base/199635

Log:
  MFC 198420
  
    Correct some issues with zfs boot.
  
     - Teach it to read gang blocks. (essentially untested)
       If you see "ZFS: gang block detected!", please let
       me know, so we can either remove the printf if it
       works, or fix it if it doesn't.
  
     - If multiple partitions exist on a disk, probe them all.
       We also need to reset dsk->start to 0 to read the right
       sector here.
  
     - With GPT, we can have 128 partitions.
  
     - If the bootfs property has ever been set on a pool
       it seems that it never goes away.  zpool won't allow
       you to add to the pool with the bootfs property set.
       However, if you clear the property back to default
       we end up getting 0 for the object number and read
       a bogus block pointer and fail to boot.
  
     - Fix some error printfs. The printf in the loader is
       only capable of c,s and u formats.
  
     - Teach printf how to display %llu

Modified:
  stable/7/sys/boot/i386/zfsboot/zfsboot.c
  stable/7/sys/boot/zfs/zfs.c
  stable/7/sys/boot/zfs/zfsimpl.c
  stable/7/sys/cddl/boot/zfs/zfsimpl.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c
==============================================================================
--- stable/7/sys/boot/i386/zfsboot/zfsboot.c	Sat Nov 21 15:02:35 2009	(r199634)
+++ stable/7/sys/boot/i386/zfsboot/zfsboot.c	Sat Nov 21 15:04:01 2009	(r199635)
@@ -474,6 +474,7 @@ probe_drive(struct dsk *dsk, spa_t **spa
     slba = hdr.hdr_lba_table;
     elba = slba + hdr.hdr_entries / entries_per_sec;
     while (slba < elba) {
+	dsk->start = 0;
 	if (drvread(dsk, sec, slba, 1))
 	    return;
 	for (part = 0; part < entries_per_sec; part++) {
@@ -494,7 +495,6 @@ probe_drive(struct dsk *dsk, spa_t **spa
 		     */
 		    dsk = copy_dsk(dsk);
 		}
-		break;
 	    }
 	}
 	slba++;
@@ -857,12 +857,13 @@ static void
 printf(const char *fmt,...)
 {
     va_list ap;
-    char buf[10];
+    char buf[20];
     char *s;
-    unsigned u;
+    unsigned long long u;
     int c;
     int minus;
     int prec;
+    int l;
     int len;
     int pad;
 
@@ -871,6 +872,7 @@ printf(const char *fmt,...)
 	if (c == '%') {
 	    minus = 0;
 	    prec = 0;
+	    l = 0;
 	nextfmt:
 	    c = *fmt++;
 	    switch (c) {
@@ -892,6 +894,9 @@ printf(const char *fmt,...)
 	    case 'c':
 		putchar(va_arg(ap, int));
 		continue;
+	    case 'l':
+		l++;
+		goto nextfmt;
 	    case 's':
 		s = va_arg(ap, char *);
 		if (prec) {
@@ -914,7 +919,17 @@ printf(const char *fmt,...)
 		}
 		continue;
 	    case 'u':
-		u = va_arg(ap, unsigned);
+		switch (l) {
+		case 2:
+		    u = va_arg(ap, unsigned long long);
+		    break;
+		case 1:
+		    u = va_arg(ap, unsigned long);
+		    break;
+		default:
+		    u = va_arg(ap, unsigned);
+		    break;
+		}
 		s = buf;
 		do
 		    *s++ = '0' + u % 10U;

Modified: stable/7/sys/boot/zfs/zfs.c
==============================================================================
--- stable/7/sys/boot/zfs/zfs.c	Sat Nov 21 15:02:35 2009	(r199634)
+++ stable/7/sys/boot/zfs/zfs.c	Sat Nov 21 15:04:01 2009	(r199635)
@@ -100,7 +100,7 @@ zfs_open(const char *upath, struct open_
 	f->f_fsdata = (void *)fp;
 
 	if (spa->spa_root_objset.os_type != DMU_OST_ZFS) {
-		printf("Unexpected object set type %lld\n",
+		printf("Unexpected object set type %llu\n",
 		    spa->spa_root_objset.os_type);
 		rc = EIO;
 		goto out;
@@ -413,7 +413,7 @@ zfs_dev_init(void) 
 		if (vdev_probe(vdev_read, (void*) (uintptr_t) fd, 0))
 			close(fd);
 
-		for (slice = 1; slice <= 4; slice++) {
+		for (slice = 1; slice <= 128; slice++) {
 			sprintf(devname, "disk%dp%d:", unit, slice);
 			fd = open(devname, O_RDONLY);
 			if (fd == -1) {

Modified: stable/7/sys/boot/zfs/zfsimpl.c
==============================================================================
--- stable/7/sys/boot/zfs/zfsimpl.c	Sat Nov 21 15:02:35 2009	(r199634)
+++ stable/7/sys/boot/zfs/zfsimpl.c	Sat Nov 21 15:04:01 2009	(r199635)
@@ -53,6 +53,8 @@ static char *zfs_temp_buf, *zfs_temp_end
 
 #define TEMP_SIZE	(1*SPA_MAXBLOCKSIZE)
 
+static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf);
+
 static void
 zfs_init(void)
 {
@@ -897,6 +899,33 @@ ilog2(int n)
 }
 
 static int
+zio_read_gang(spa_t *spa, const blkptr_t *bp, const dva_t *dva, void *buf)
+{
+	zio_gbh_phys_t zio_gb;
+	vdev_t *vdev;
+	int vdevid;
+	off_t offset;
+	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, bp, &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))
+			return (EIO);
+	}
+ 
+	return (0);
+}
+
+static int
 zio_read(spa_t *spa, const blkptr_t *bp, void *buf)
 {
 	int cpfunc = BP_GET_COMPRESS(bp);
@@ -920,20 +949,27 @@ zio_read(spa_t *spa, const blkptr_t *bp,
 		if (!dva->dva_word[0] && !dva->dva_word[1])
 			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;
-		if (vdev->v_read(vdev, bp, pbuf, offset, psize))
-			continue;
+		if (DVA_GET_GANG(dva)) {
+			printf("ZFS: gang block detected!\n");
+			if (zio_read_gang(spa, bp, dva, buf))
+				return (EIO); 
+		} 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;
+			}
+			if (vdev->v_read(vdev, bp, pbuf, offset, psize))
+				continue;
 
-		if (cpfunc != ZIO_COMPRESS_OFF) {
-			if (zio_decompress_data(cpfunc, pbuf, psize,
-				buf, lsize))
-				return (EIO);
+			if (cpfunc != ZIO_COMPRESS_OFF) {
+				if (zio_decompress_data(cpfunc, pbuf, psize,
+				    buf, lsize))
+					return (EIO);
+			}
 		}
 
 		return (0);
@@ -1331,13 +1367,13 @@ zfs_mount_dataset(spa_t *spa, uint64_t o
 	dsl_dataset_phys_t *ds;
 
 	if (objset_get_dnode(spa, &spa->spa_mos, objnum, &dataset)) {
-		printf("ZFS: can't find dataset %lld\n", objnum);
+		printf("ZFS: can't find dataset %llu\n", objnum);
 		return (EIO);
 	}
 
 	ds = (dsl_dataset_phys_t *) &dataset.dn_bonus;
 	if (zio_read(spa, &ds->ds_bp, objset)) {
-		printf("ZFS: can't read object set for dataset %lld\n", objnum);
+		printf("ZFS: can't read object set for dataset %llu\n", objnum);
 		return (EIO);
 	}
 
@@ -1367,7 +1403,8 @@ zfs_mount_root(spa_t *spa, objset_phys_t
 	 */
 	if (zap_lookup(spa, &dir, DMU_POOL_PROPS, &props) == 0
 	     && objset_get_dnode(spa, &spa->spa_mos, props, &propdir) == 0
-	     && zap_lookup(spa, &propdir, "bootfs", &bootfs) == 0)
+	     && zap_lookup(spa, &propdir, "bootfs", &bootfs) == 0
+	     && bootfs != 0)
 		return zfs_mount_dataset(spa, bootfs, objset);
 
 	/*
@@ -1425,7 +1462,7 @@ zfs_lookup(spa_t *spa, const char *upath
 	int symlinks_followed = 0;
 
 	if (spa->spa_root_objset.os_type != DMU_OST_ZFS) {
-		printf("ZFS: unexpected object set type %lld\n",
+		printf("ZFS: unexpected object set type %llu\n",
 		       spa->spa_root_objset.os_type);
 		return (EIO);
 	}

Modified: stable/7/sys/cddl/boot/zfs/zfsimpl.h
==============================================================================
--- stable/7/sys/cddl/boot/zfs/zfsimpl.h	Sat Nov 21 15:02:35 2009	(r199634)
+++ stable/7/sys/cddl/boot/zfs/zfsimpl.h	Sat Nov 21 15:04:01 2009	(r199635)
@@ -374,6 +374,24 @@ typedef struct vdev_label {
 #define	VDEV_LABEL_END_SIZE	(2 * sizeof (vdev_label_t))
 #define	VDEV_LABELS		4
 
+/*
+ * Gang block headers are self-checksumming and contain an array
+ * of block pointers.
+ */
+#define SPA_GANGBLOCKSIZE	SPA_MINBLOCKSIZE
+#define SPA_GBH_NBLKPTRS	((SPA_GANGBLOCKSIZE - \
+	sizeof (zio_block_tail_t)) / sizeof (blkptr_t))
+#define SPA_GBH_FILLER		((SPA_GANGBLOCKSIZE - \
+	sizeof (zio_block_tail_t) - \
+	(SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\
+	sizeof (uint64_t))
+
+typedef struct zio_gbh {
+	blkptr_t		zg_blkptr[SPA_GBH_NBLKPTRS];
+	uint64_t		zg_filler[SPA_GBH_FILLER];
+	zio_block_tail_t	zg_tail;
+} zio_gbh_phys_t;
+
 enum zio_checksum {
 	ZIO_CHECKSUM_INHERIT = 0,
 	ZIO_CHECKSUM_ON,