From owner-svn-src-stable@FreeBSD.ORG Mon Sep 26 07:38:02 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F0AF106566B; Mon, 26 Sep 2011 07:38:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D5C08FC0C; Mon, 26 Sep 2011 07:38:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8Q7c2Jj061597; Mon, 26 Sep 2011 07:38:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8Q7c2Qx061589; Mon, 26 Sep 2011 07:38:02 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201109260738.p8Q7c2Qx061589@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 26 Sep 2011 07:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225759 - stable/8/lib/libusb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2011 07:38:02 -0000 Author: hselasky Date: Mon Sep 26 07:38:01 2011 New Revision: 225759 URL: http://svn.freebsd.org/changeset/base/225759 Log: MFC r225659: Implement missing USB debug information functions. Modified: stable/8/lib/libusb/Makefile stable/8/lib/libusb/libusb.3 stable/8/lib/libusb/libusb.h stable/8/lib/libusb/libusb10.c stable/8/lib/libusb/libusb20.3 stable/8/lib/libusb/libusb20.c stable/8/lib/libusb/libusb20.h Directory Properties: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/Makefile ============================================================================== --- stable/8/lib/libusb/Makefile Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/Makefile Mon Sep 26 07:38:01 2011 (r225759) @@ -38,6 +38,7 @@ CFLAGS+= -DCOMPAT_32BIT MLINKS += libusb.3 libusb_init.3 MLINKS += libusb.3 libusb_exit.3 MLINKS += libusb.3 libusb_strerror.3 +MLINKS += libusb.3 libusb_error_name.3 MLINKS += libusb.3 libusb_set_debug.3 MLINKS += libusb.3 libusb_get_device_list.3 MLINKS += libusb.3 libusb_free_device_list.3 @@ -208,3 +209,5 @@ MLINKS += libusb20.3 libusb20_me_get_2.3 MLINKS += libusb20.3 libusb20_me_encode.3 MLINKS += libusb20.3 libusb20_me_decode.3 MLINKS += libusb20.3 libusb20_desc_foreach.3 +MLINKS += libusb20.3 libusb20_strerror.3 +MLINKS += libusb20.3 libusb20_error_name.3 Modified: stable/8/lib/libusb/libusb.3 ============================================================================== --- stable/8/lib/libusb/libusb.3 Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb.3 Mon Sep 26 07:38:01 2011 (r225759) @@ -63,6 +63,14 @@ Other libusb routines may not be called Get the ASCII representation of the error given by the .Fa code argument. +This function does not return NULL. +.Pp +.Ft const char * +.Fn libusb_error_name "int code" +Get the ASCII representation of the error enum given by the +.Fa code +argument. +This function does not return NULL. .Pp .Ft void .Fn libusb_set_debug "libusb_context *ctx" "int level" @@ -502,7 +510,8 @@ The library is also compliant with LibUS .Sh SEE ALSO .Xr libusb20 3 , .Xr usb 4 , -.Xr usbconfig 8 +.Xr usbconfig 8 , +.Xr usbdump 8 .Pp .Pa http://libusb.sourceforge.net/ .Sh HISTORY Modified: stable/8/lib/libusb/libusb.h ============================================================================== --- stable/8/lib/libusb/libusb.h Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb.h Mon Sep 26 07:38:01 2011 (r225759) @@ -303,6 +303,7 @@ typedef struct libusb_transfer { void libusb_set_debug(libusb_context * ctx, int level); const char *libusb_strerror(int code); +const char *libusb_error_name(int code); int libusb_init(libusb_context ** context); void libusb_exit(struct libusb_context *ctx); Modified: stable/8/lib/libusb/libusb10.c ============================================================================== --- stable/8/lib/libusb/libusb10.c Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb10.c Mon Sep 26 07:38:01 2011 (r225759) @@ -1449,6 +1449,73 @@ libusb_le16_to_cpu(uint16_t x) const char * libusb_strerror(int code) { - /* TODO */ - return ("Unknown error"); + switch (code) { + case LIBUSB_SUCCESS: + return ("Success"); + case LIBUSB_ERROR_IO: + return ("I/O error"); + case LIBUSB_ERROR_INVALID_PARAM: + return ("Invalid parameter"); + case LIBUSB_ERROR_ACCESS: + return ("Permissions error"); + case LIBUSB_ERROR_NO_DEVICE: + return ("No device"); + case LIBUSB_ERROR_NOT_FOUND: + return ("Not found"); + case LIBUSB_ERROR_BUSY: + return ("Device busy"); + case LIBUSB_ERROR_TIMEOUT: + return ("Timeout"); + case LIBUSB_ERROR_OVERFLOW: + return ("Overflow"); + case LIBUSB_ERROR_PIPE: + return ("Pipe error"); + case LIBUSB_ERROR_INTERRUPTED: + return ("Interrupted"); + case LIBUSB_ERROR_NO_MEM: + return ("Out of memory"); + case LIBUSB_ERROR_NOT_SUPPORTED: + return ("Not supported"); + case LIBUSB_ERROR_OTHER: + return ("Other error"); + default: + return ("Unknown error"); + } +} + +const char * +libusb_error_name(int code) +{ + switch (code) { + case LIBUSB_SUCCESS: + return ("LIBUSB_SUCCESS"); + case LIBUSB_ERROR_IO: + return ("LIBUSB_ERROR_IO"); + case LIBUSB_ERROR_INVALID_PARAM: + return ("LIBUSB_ERROR_INVALID_PARAM"); + case LIBUSB_ERROR_ACCESS: + return ("LIBUSB_ERROR_ACCESS"); + case LIBUSB_ERROR_NO_DEVICE: + return ("LIBUSB_ERROR_NO_DEVICE"); + case LIBUSB_ERROR_NOT_FOUND: + return ("LIBUSB_ERROR_NOT_FOUND"); + case LIBUSB_ERROR_BUSY: + return ("LIBUSB_ERROR_BUSY"); + case LIBUSB_ERROR_TIMEOUT: + return ("LIBUSB_ERROR_TIMEOUT"); + case LIBUSB_ERROR_OVERFLOW: + return ("LIBUSB_ERROR_OVERFLOW"); + case LIBUSB_ERROR_PIPE: + return ("LIBUSB_ERROR_PIPE"); + case LIBUSB_ERROR_INTERRUPTED: + return ("LIBUSB_ERROR_INTERRUPTED"); + case LIBUSB_ERROR_NO_MEM: + return ("LIBUSB_ERROR_NO_MEM"); + case LIBUSB_ERROR_NOT_SUPPORTED: + return ("LIBUSB_ERROR_NOT_SUPPORTED"); + case LIBUSB_ERROR_OTHER: + return ("LIBUSB_ERROR_OTHER"); + default: + return ("LIBUSB_ERROR_UNKNOWN"); + } } Modified: stable/8/lib/libusb/libusb20.3 ============================================================================== --- stable/8/lib/libusb/libusb20.3 Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb20.3 Mon Sep 26 07:38:01 2011 (r225759) @@ -212,6 +212,10 @@ USB access library (libusb -lusb) .Fn libusb20_me_decode "const void *pdata" "uint16_t len" "void *pdecoded" .Ft "const uint8_t *" .Fn libusb20_desc_foreach "const struct libusb20_me_struct *me" "const uint8_t *pdesc" +.Ft "const char *" +.Fn libusb20_strerror "int code" +.Ft "const char *" +.Fn libusb20_error_name "int code" . . .Sh DESCRIPTION @@ -996,6 +1000,22 @@ The total decoded length is returned. The buffer pointer cannot be NULL. . . +.Sh USB DEBUGGING +.Pp +.Ft const char * +.Fn libusb20_strerror "int code" +Get the ASCII representation of the error given by the +.Fa code +argument. +This function does not return NULL. +.Pp +.Ft const char * +.Fn libusb20_error_name "int code" +Get the ASCII representation of the error enum given by the +.Fa code +argument. +This function does not return NULL. +. .Sh FILES . . @@ -1003,7 +1023,8 @@ The buffer pointer cannot be NULL. .Sh SEE ALSO .Xr usb 4 , .Xr libusb 3 , -.Xr usbconfig 8 +.Xr usbconfig 8 , +.Xr usbdump 8 . . .Sh HISTORY Modified: stable/8/lib/libusb/libusb20.c ============================================================================== --- stable/8/lib/libusb/libusb20.c Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb20.c Mon Sep 26 07:38:01 2011 (r225759) @@ -1244,3 +1244,77 @@ libusb20_be_dequeue_device(struct libusb { TAILQ_REMOVE(&(pbe->usb_devs), pdev, dev_entry); } + +const char * +libusb20_strerror(int code) +{ + switch (code) { + case LIBUSB20_SUCCESS: + return ("Success"); + case LIBUSB20_ERROR_IO: + return ("I/O error"); + case LIBUSB20_ERROR_INVALID_PARAM: + return ("Invalid parameter"); + case LIBUSB20_ERROR_ACCESS: + return ("Permissions error"); + case LIBUSB20_ERROR_NO_DEVICE: + return ("No device"); + case LIBUSB20_ERROR_NOT_FOUND: + return ("Not found"); + case LIBUSB20_ERROR_BUSY: + return ("Device busy"); + case LIBUSB20_ERROR_TIMEOUT: + return ("Timeout"); + case LIBUSB20_ERROR_OVERFLOW: + return ("Overflow"); + case LIBUSB20_ERROR_PIPE: + return ("Pipe error"); + case LIBUSB20_ERROR_INTERRUPTED: + return ("Interrupted"); + case LIBUSB20_ERROR_NO_MEM: + return ("Out of memory"); + case LIBUSB20_ERROR_NOT_SUPPORTED: + return ("Not supported"); + case LIBUSB20_ERROR_OTHER: + return ("Other error"); + default: + return ("Unknown error"); + } +} + +const char * +libusb20_error_name(int code) +{ + switch (code) { + case LIBUSB20_SUCCESS: + return ("LIBUSB20_SUCCESS"); + case LIBUSB20_ERROR_IO: + return ("LIBUSB20_ERROR_IO"); + case LIBUSB20_ERROR_INVALID_PARAM: + return ("LIBUSB20_ERROR_INVALID_PARAM"); + case LIBUSB20_ERROR_ACCESS: + return ("LIBUSB20_ERROR_ACCESS"); + case LIBUSB20_ERROR_NO_DEVICE: + return ("LIBUSB20_ERROR_NO_DEVICE"); + case LIBUSB20_ERROR_NOT_FOUND: + return ("LIBUSB20_ERROR_NOT_FOUND"); + case LIBUSB20_ERROR_BUSY: + return ("LIBUSB20_ERROR_BUSY"); + case LIBUSB20_ERROR_TIMEOUT: + return ("LIBUSB20_ERROR_TIMEOUT"); + case LIBUSB20_ERROR_OVERFLOW: + return ("LIBUSB20_ERROR_OVERFLOW"); + case LIBUSB20_ERROR_PIPE: + return ("LIBUSB20_ERROR_PIPE"); + case LIBUSB20_ERROR_INTERRUPTED: + return ("LIBUSB20_ERROR_INTERRUPTED"); + case LIBUSB20_ERROR_NO_MEM: + return ("LIBUSB20_ERROR_NO_MEM"); + case LIBUSB20_ERROR_NOT_SUPPORTED: + return ("LIBUSB20_ERROR_NOT_SUPPORTED"); + case LIBUSB20_ERROR_OTHER: + return ("LIBUSB20_ERROR_OTHER"); + default: + return ("LIBUSB20_ERROR_UNKNOWN"); + } +} Modified: stable/8/lib/libusb/libusb20.h ============================================================================== --- stable/8/lib/libusb/libusb20.h Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb20.h Mon Sep 26 07:38:01 2011 (r225759) @@ -293,6 +293,11 @@ void libusb20_be_dequeue_device(struct l void libusb20_be_enqueue_device(struct libusb20_backend *pbe, struct libusb20_device *pdev); void libusb20_be_free(struct libusb20_backend *pbe); +/* USB debugging */ + +const char *libusb20_strerror(int); +const char *libusb20_error_name(int); + #if 0 { /* style */ #endif From owner-svn-src-stable@FreeBSD.ORG Mon Sep 26 10:12:17 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76D4B106564A; Mon, 26 Sep 2011 10:12:17 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8DA8FC0A; Mon, 26 Sep 2011 10:12:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8QACHKJ066420; Mon, 26 Sep 2011 10:12:17 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8QACHXr066417; Mon, 26 Sep 2011 10:12:17 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109261012.p8QACHXr066417@svn.freebsd.org> From: Attilio Rao Date: Mon, 26 Sep 2011 10:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225760 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2011 10:12:17 -0000 Author: attilio Date: Mon Sep 26 10:12:16 2011 New Revision: 225760 URL: http://svn.freebsd.org/changeset/base/225760 Log: MFC r225675: Initialize the pmap lock for the kernel pmap when it is really appropriate. Modified: stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Mon Sep 26 07:38:01 2011 (r225759) +++ stable/8/sys/sparc64/sparc64/machdep.c Mon Sep 26 10:12:16 2011 (r225760) @@ -596,11 +596,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_l wrpr(pil, 0, 0); wrpr(pstate, 0, PSTATE_KERNEL); - /* - * Finish pmap initialization now that we're ready for mutexes. - */ - PMAP_LOCK_INIT(kernel_pmap); - OF_getprop(root, "name", sparc64_model, sizeof(sparc64_model) - 1); kdb_init(); Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Sep 26 07:38:01 2011 (r225759) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Sep 26 10:12:16 2011 (r225760) @@ -671,11 +671,9 @@ pmap_bootstrap(u_int cpu_impl) /* * Initialize the kernel pmap (which is statically allocated). - * NOTE: PMAP_LOCK_INIT() is needed as part of the initialization - * but sparc64 start up is not ready to initialize mutexes yet. - * It is called in machdep.c. */ pm = kernel_pmap; + PMAP_LOCK_INIT(pm); for (i = 0; i < MAXCPU; i++) pm->pm_context[i] = TLB_CTX_KERNEL; pm->pm_active = ~0; From owner-svn-src-stable@FreeBSD.ORG Mon Sep 26 15:26:59 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8603E106564A; Mon, 26 Sep 2011 15:26:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73E318FC16; Mon, 26 Sep 2011 15:26:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8QFQxfC079914; Mon, 26 Sep 2011 15:26:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8QFQx5W079912; Mon, 26 Sep 2011 15:26:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109261526.p8QFQx5W079912@svn.freebsd.org> From: Adrian Chadd Date: Mon, 26 Sep 2011 15:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225767 - stable/6/sys/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2011 15:26:59 -0000 Author: adrian Date: Mon Sep 26 15:26:59 2011 New Revision: 225767 URL: http://svn.freebsd.org/changeset/base/225767 Log: Update if_de(4) to fix bugs - a combination of bitrot and busdma changes. This commit is a merge of 197465, 197464, 197463, 197461, 177937 and 170389. Submitted by: Andreas Longwitz Reviewed by: jhb Modified: stable/6/sys/pci/if_de.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) Modified: stable/6/sys/pci/if_de.c ============================================================================== --- stable/6/sys/pci/if_de.c Mon Sep 26 12:20:33 2011 (r225766) +++ stable/6/sys/pci/if_de.c Mon Sep 26 15:26:59 2011 (r225767) @@ -160,7 +160,7 @@ static void tulip_dma_map_rxbuf(void *, static void tulip_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - u_int32_t *paddr; + bus_addr_t *paddr; if (error) return; @@ -182,7 +182,7 @@ tulip_dma_map_rxbuf(void *arg, bus_dma_s KASSERT(nseg == 1, ("too many DMA segments")); KASSERT(segs[0].ds_len >= TULIP_RX_BUFLEN, ("receive buffer too small")); - desc->d_addr1 = segs[0].ds_addr; + desc->d_addr1 = segs[0].ds_addr & 0xffffffff; desc->d_length1 = TULIP_RX_BUFLEN; #ifdef not_needed /* These should already always be zero. */ @@ -3160,8 +3160,8 @@ tulip_reset(tulip_softc_t * const sc) sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } - TULIP_CSR_WRITE(sc, csr_txlist, sc->tulip_txinfo.ri_dma_addr); - TULIP_CSR_WRITE(sc, csr_rxlist, sc->tulip_rxinfo.ri_dma_addr); + TULIP_CSR_WRITE(sc, csr_txlist, sc->tulip_txinfo.ri_dma_addr & 0xffffffff); + TULIP_CSR_WRITE(sc, csr_rxlist, sc->tulip_rxinfo.ri_dma_addr & 0xffffffff); TULIP_CSR_WRITE(sc, csr_busmode, (1 << (3 /*pci_max_burst_len*/ + 8)) |TULIP_BUSMODE_CACHE_ALIGN8 @@ -3476,7 +3476,7 @@ tulip_rx_intr(tulip_softc_t * const sc) struct mbuf *m0; KASSERT(ms != NULL, ("no packet to accept")); -#if defined(TULIP_COPY_RXDATA) +#ifndef __NO_STRICT_ALIGNMENT /* * Copy the data into a new mbuf that is properly aligned. If * we fail to allocate a new mbuf, then drop the packet. We will @@ -3515,7 +3515,7 @@ tulip_rx_intr(tulip_softc_t * const sc) */ ms = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); -#if defined(TULIP_COPY_RXDATA) +#ifndef __NO_STRICT_ALIGNMENT skip_input: #endif if (ms == NULL) { @@ -3541,7 +3541,7 @@ tulip_rx_intr(tulip_softc_t * const sc) M_ASSERTPKTHDR(ms); KASSERT(ms->m_data == ms->m_ext.ext_buf, ("rx mbuf data doesn't point to cluster")); - ms->m_len = ms->m_pkthdr.len = MCLBYTES; + ms->m_len = ms->m_pkthdr.len = TULIP_RX_BUFLEN; error = bus_dmamap_load_mbuf(ri->ri_data_tag, *nextout->di_map, ms, tulip_dma_map_rxbuf, nextout->di_desc, BUS_DMA_NOWAIT); if (error) { @@ -4004,9 +4004,9 @@ tulip_txput(tulip_softc_t * const sc, st eop = nextout; eop->di_desc->d_flag &= TULIP_DFLAG_ENDRING|TULIP_DFLAG_CHAIN; eop->di_desc->d_status = d_status; - eop->di_desc->d_addr1 = segs[segcnt].ds_addr; + eop->di_desc->d_addr1 = segs[segcnt].ds_addr & 0xffffffff; eop->di_desc->d_length1 = segs[segcnt].ds_len; - eop->di_desc->d_addr2 = segs[segcnt+1].ds_addr; + eop->di_desc->d_addr2 = segs[segcnt+1].ds_addr & 0xffffffff; eop->di_desc->d_length2 = segs[segcnt+1].ds_len; d_status = TULIP_DSTS_OWNER; if (++nextout == ri->ri_last) @@ -4016,7 +4016,7 @@ tulip_txput(tulip_softc_t * const sc, st eop = nextout; eop->di_desc->d_flag &= TULIP_DFLAG_ENDRING|TULIP_DFLAG_CHAIN; eop->di_desc->d_status = d_status; - eop->di_desc->d_addr1 = segs[segcnt].ds_addr; + eop->di_desc->d_addr1 = segs[segcnt].ds_addr & 0xffffffff; eop->di_desc->d_length1 = segs[segcnt].ds_len; eop->di_desc->d_addr2 = 0; eop->di_desc->d_length2 = 0; @@ -4182,7 +4182,7 @@ tulip_txput_setup(tulip_softc_t * const nextout->d_length2 = 0; nextout->d_addr2 = 0; nextout->d_length1 = sizeof(sc->tulip_setupdata); - nextout->d_addr1 = sc->tulip_setup_dma_addr; + nextout->d_addr1 = sc->tulip_setup_dma_addr & 0xffffffff; bus_dmamap_sync(sc->tulip_setup_tag, sc->tulip_setup_map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); TULIP_TXDESC_PRESYNC(ri); @@ -4490,7 +4490,7 @@ tulip_busdma_freering(tulip_ringinfo_t * /* Allocate memory for a single descriptor ring. */ static int tulip_busdma_allocring(device_t dev, tulip_softc_t * const sc, size_t count, - bus_size_t maxsize, int nsegs, tulip_ringinfo_t *ri, const char *name) + bus_size_t align, int nsegs, tulip_ringinfo_t *ri, const char *name) { size_t size; int error, i; @@ -4498,7 +4498,7 @@ tulip_busdma_allocring(device_t dev, tul /* First, setup a tag. */ ri->ri_max = count; size = count * sizeof(tulip_desc_t); - error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL, &ri->ri_ring_tag); if (error) { @@ -4526,9 +4526,9 @@ tulip_busdma_allocring(device_t dev, tul } /* Allocate a tag for the data buffers. */ - error = bus_dma_tag_create(NULL, 4, 0, + error = bus_dma_tag_create(NULL, align, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - maxsize, nsegs, TULIP_DATA_PER_DESC, 0, NULL, NULL, &ri->ri_data_tag); + MCLBYTES * nsegs, nsegs, MCLBYTES, 0, NULL, NULL, &ri->ri_data_tag); if (error) { device_printf(dev, "failed to allocate %s buffer dma tag\n", name); return (error); @@ -4562,6 +4562,7 @@ tulip_busdma_cleanup(tulip_softc_t * con if (sc->tulip_setupbuf != NULL) { bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupdata, sc->tulip_setup_map); + bus_dmamap_destroy(sc->tulip_setup_tag, sc->tulip_setup_map); sc->tulip_setup_map = NULL; sc->tulip_setupbuf = NULL; } @@ -4585,8 +4586,8 @@ tulip_busdma_init(device_t dev, tulip_so /* * Allocate space and dmamap for transmit ring. */ - error = tulip_busdma_allocring(dev, sc, TULIP_TXDESCS, TULIP_DATA_PER_DESC, - TULIP_MAX_TXSEG, &sc->tulip_txinfo, "transmit"); + error = tulip_busdma_allocring(dev, sc, TULIP_TXDESCS, 1, TULIP_MAX_TXSEG, + &sc->tulip_txinfo, "transmit"); if (error) return (error); @@ -4597,7 +4598,7 @@ tulip_busdma_init(device_t dev, tulip_so * a waste in practice though as an ethernet frame can easily fit * in TULIP_RX_BUFLEN bytes. */ - error = tulip_busdma_allocring(dev, sc, TULIP_RXDESCS, MCLBYTES, 1, + error = tulip_busdma_allocring(dev, sc, TULIP_RXDESCS, 4, 1, &sc->tulip_rxinfo, "receive"); if (error) return (error); @@ -4605,7 +4606,7 @@ tulip_busdma_init(device_t dev, tulip_so /* * Allocate a DMA tag, memory, and map for setup descriptor */ - error = bus_dma_tag_create(NULL, 4, 0, + error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(sc->tulip_setupdata), 1, sizeof(sc->tulip_setupdata), 0, NULL, NULL, &sc->tulip_setup_tag); From owner-svn-src-stable@FreeBSD.ORG Tue Sep 27 07:19:02 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D26E106566B; Tue, 27 Sep 2011 07:19:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE538FC14; Tue, 27 Sep 2011 07:19:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R7J2Uq010250; Tue, 27 Sep 2011 07:19:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R7J2eY010248; Tue, 27 Sep 2011 07:19:02 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201109270719.p8R7J2eY010248@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 27 Sep 2011 07:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225779 - stable/8/sys/dev/usb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:19:02 -0000 Author: hselasky Date: Tue Sep 27 07:19:01 2011 New Revision: 225779 URL: http://svn.freebsd.org/changeset/base/225779 Log: MFC r225695: Fix minor race in device side mode. Modified: stable/8/sys/dev/usb/usb_transfer.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Tue Sep 27 07:14:12 2011 (r225778) +++ stable/8/sys/dev/usb/usb_transfer.c Tue Sep 27 07:19:01 2011 (r225779) @@ -2417,8 +2417,9 @@ usbd_transfer_start_cb(void *arg) #if USB_HAVE_PF usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT); #endif - /* start the transfer */ - (ep->methods->start) (xfer); + /* start USB transfer, if no error */ + if (xfer->error == 0) + (ep->methods->start) (xfer); xfer->flags_int.can_cancel_immed = 1; @@ -2597,8 +2598,9 @@ usbd_pipe_start(struct usb_xfer_queue *p #if USB_HAVE_PF usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT); #endif - /* start USB transfer */ - (ep->methods->start) (xfer); + /* start USB transfer, if no error */ + if (xfer->error == 0) + (ep->methods->start) (xfer); xfer->flags_int.can_cancel_immed = 1; From owner-svn-src-stable@FreeBSD.ORG Tue Sep 27 07:33:04 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E5A41065677; Tue, 27 Sep 2011 07:33:04 +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 5D90C8FC12; Tue, 27 Sep 2011 07:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R7X4CK010766; Tue, 27 Sep 2011 07:33:04 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R7X4wD010764; Tue, 27 Sep 2011 07:33:04 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201109270733.p8R7X4wD010764@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 27 Sep 2011 07:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225780 - stable/8/sys/dev/smc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:33:04 -0000 Author: stas Date: Tue Sep 27 07:33:04 2011 New Revision: 225780 URL: http://svn.freebsd.org/changeset/base/225780 Log: - MFC r225354: - Fix NULL pointer dereference when a packet of uneven size is being transmitted. Modified: stable/8/sys/dev/smc/if_smc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/smc/if_smc.c ============================================================================== --- stable/8/sys/dev/smc/if_smc.c Tue Sep 27 07:19:01 2011 (r225779) +++ stable/8/sys/dev/smc/if_smc.c Tue Sep 27 07:33:04 2011 (r225780) @@ -538,6 +538,7 @@ smc_task_tx(void *context, int pending) struct smc_softc *sc; struct mbuf *m, *m0; u_int packet, len; + int last_len; uint8_t *data; (void)pending; @@ -590,16 +591,18 @@ smc_task_tx(void *context, int pending) * Push the data out to the device. */ data = NULL; + last_len = 0; for (; m != NULL; m = m->m_next) { data = mtod(m, uint8_t *); smc_write_multi_2(sc, DATA0, (uint16_t *)data, m->m_len / 2); + last_len = m->m_len; } /* * Push out the control byte and and the odd byte if needed. */ if ((len & 1) != 0 && data != NULL) - smc_write_2(sc, DATA0, (CTRL_ODD << 8) | data[m->m_len - 1]); + smc_write_2(sc, DATA0, (CTRL_ODD << 8) | data[last_len - 1]); else smc_write_2(sc, DATA0, 0); From owner-svn-src-stable@FreeBSD.ORG Tue Sep 27 13:50:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A51FB106564A; Tue, 27 Sep 2011 13:50:30 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94D9B8FC0C; Tue, 27 Sep 2011 13:50:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RDoUI5026353; Tue, 27 Sep 2011 13:50:30 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RDoUwi026351; Tue, 27 Sep 2011 13:50:30 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109271350.p8RDoUwi026351@svn.freebsd.org> From: Attilio Rao Date: Tue, 27 Sep 2011 13:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225796 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 13:50:30 -0000 Author: attilio Date: Tue Sep 27 13:50:30 2011 New Revision: 225796 URL: http://svn.freebsd.org/changeset/base/225796 Log: MFC r225794: Backout r225372 MFC. Modified: stable/8/sys/kern/subr_kdb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/subr_kdb.c ============================================================================== --- stable/8/sys/kern/subr_kdb.c Tue Sep 27 13:47:23 2011 (r225795) +++ stable/8/sys/kern/subr_kdb.c Tue Sep 27 13:50:30 2011 (r225796) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" #include "opt_stack.h" -#include "opt_watchdog.h" #include #include @@ -41,9 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG -#include -#endif #include #include @@ -517,9 +513,6 @@ int kdb_trap(int type, int code, struct trapframe *tf) { struct kdb_dbbe *be; -#ifdef SW_WATCHDOG - u_int wdoglvt; -#endif register_t intr; #ifdef SMP int did_stop_cpus; @@ -536,10 +529,6 @@ kdb_trap(int type, int code, struct trap intr = intr_disable(); -#ifdef SW_WATCHDOG - wdoglvt = wdog_kern_last_timeout(); - wdog_kern_pat(WD_TO_NEVER); -#endif #ifdef SMP if ((did_stop_cpus = kdb_stop_cpus) != 0) stop_cpus_hard(PCPU_GET(other_cpus)); @@ -571,9 +560,6 @@ kdb_trap(int type, int code, struct trap if (did_stop_cpus) restart_cpus(stopped_cpus); #endif -#ifdef SW_WATCHDOG - wdog_kern_pat(wdoglvt); -#endif intr_restore(intr); From owner-svn-src-stable@FreeBSD.ORG Tue Sep 27 14:00:33 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 365A9106566C; Tue, 27 Sep 2011 14:00:33 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C67A8FC15; Tue, 27 Sep 2011 14:00:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RE0WFG026733; Tue, 27 Sep 2011 14:00:32 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RE0WqE026731; Tue, 27 Sep 2011 14:00:32 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109271400.p8RE0WqE026731@svn.freebsd.org> From: Attilio Rao Date: Tue, 27 Sep 2011 14:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225797 - stable/9/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 14:00:33 -0000 Author: attilio Date: Tue Sep 27 14:00:32 2011 New Revision: 225797 URL: http://svn.freebsd.org/changeset/base/225797 Log: Backout r225372. Eventhandler mutex cannot be acquired in kernel context. Sponsored by: Sandvine Incorporated Approved by: re (kib) Modified: stable/9/sys/kern/subr_kdb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/subr_kdb.c ============================================================================== --- stable/9/sys/kern/subr_kdb.c Tue Sep 27 13:50:30 2011 (r225796) +++ stable/9/sys/kern/subr_kdb.c Tue Sep 27 14:00:32 2011 (r225797) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" #include "opt_stack.h" -#include "opt_watchdog.h" #include #include @@ -42,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG -#include -#endif #include #include @@ -591,9 +587,6 @@ kdb_trap(int type, int code, struct trap cpuset_t other_cpus; #endif struct kdb_dbbe *be; -#ifdef SW_WATCHDOG - u_int wdoglvt; -#endif register_t intr; int handled; @@ -607,10 +600,6 @@ kdb_trap(int type, int code, struct trap intr = intr_disable(); -#ifdef SW_WATCHDOG - wdoglvt = wdog_kern_last_timeout(); - wdog_kern_pat(WD_TO_NEVER); -#endif #ifdef SMP other_cpus = all_cpus; CPU_CLR(PCPU_GET(cpuid), &other_cpus); @@ -642,9 +631,6 @@ kdb_trap(int type, int code, struct trap #ifdef SMP restart_cpus(stopped_cpus); #endif -#ifdef SW_WATCHDOG - wdog_kern_pat(wdoglvt); -#endif intr_restore(intr); From owner-svn-src-stable@FreeBSD.ORG Tue Sep 27 15:08:59 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8924F1065673; Tue, 27 Sep 2011 15:08:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78C348FC0A; Tue, 27 Sep 2011 15:08:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RF8xZD028973; Tue, 27 Sep 2011 15:08:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RF8xdt028971; Tue, 27 Sep 2011 15:08:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109271508.p8RF8xdt028971@svn.freebsd.org> From: Alexander Motin Date: Tue, 27 Sep 2011 15:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225799 - stable/9/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 15:08:59 -0000 Author: mav Date: Tue Sep 27 15:08:59 2011 New Revision: 225799 URL: http://svn.freebsd.org/changeset/base/225799 Log: MFC r225788: Fix interrupt counters dumping on SW_WATCHDOG fire. Approved by: re (kib) Modified: stable/9/sys/kern/kern_clock.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/kern_clock.c ============================================================================== --- stable/9/sys/kern/kern_clock.c Tue Sep 27 14:28:07 2011 (r225798) +++ stable/9/sys/kern/kern_clock.c Tue Sep 27 15:08:59 2011 (r225799) @@ -842,7 +842,7 @@ watchdog_fire(void) curintr = intrcnt; curname = intrnames; inttotal = 0; - nintr = sintrcnt; + nintr = sintrcnt / sizeof(u_long); printf("interrupt total\n"); while (--nintr >= 0) { From owner-svn-src-stable@FreeBSD.ORG Tue Sep 27 17:04:13 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EF69106566B; Tue, 27 Sep 2011 17:04:13 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DA708FC0C; Tue, 27 Sep 2011 17:04:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RH4Dwi032670; Tue, 27 Sep 2011 17:04:13 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RH4D5c032668; Tue, 27 Sep 2011 17:04:13 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109271704.p8RH4D5c032668@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 27 Sep 2011 17:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225803 - stable/9/usr.bin/fetch X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 17:04:13 -0000 Author: des Date: Tue Sep 27 17:04:13 2011 New Revision: 225803 URL: http://svn.freebsd.org/changeset/base/225803 Log: MFH r225800: finally fix resume mode with non-cooperating server. Approved by: re (kib) Modified: stable/9/usr.bin/fetch/fetch.c Directory Properties: stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/usr.bin/fetch/fetch.c ============================================================================== --- stable/9/usr.bin/fetch/fetch.c Tue Sep 27 16:57:14 2011 (r225802) +++ stable/9/usr.bin/fetch/fetch.c Tue Sep 27 17:04:13 2011 (r225803) @@ -540,7 +540,7 @@ fetch(char *URL, const char *path) goto failure; } /* we got it, open local file */ - if ((of = fopen(path, "a")) == NULL) { + if ((of = fopen(path, "r+")) == NULL) { warn("%s: fopen()", path); goto failure; } @@ -559,13 +559,13 @@ fetch(char *URL, const char *path) sb = nsb; /* picked up again later */ } - /* seek to where we left off */ - if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { - warn("%s: fseek()", path); - fclose(of); - of = NULL; - /* picked up again later */ - } + } + /* seek to where we left off */ + if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { + warn("%s: fseek()", path); + fclose(of); + of = NULL; + /* picked up again later */ } } else if (m_flag && sb.st_size != -1) { /* mirror mode, local file exists */ From owner-svn-src-stable@FreeBSD.ORG Tue Sep 27 17:11:10 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CFD310656B6; Tue, 27 Sep 2011 17:11:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E670E8FC17; Tue, 27 Sep 2011 17:11:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RHB9Fp032932; Tue, 27 Sep 2011 17:11:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RHB9Nu032930; Tue, 27 Sep 2011 17:11:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201109271711.p8RHB9Nu032930@svn.freebsd.org> From: Ed Maste Date: Tue, 27 Sep 2011 17:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225804 - stable/9/usr.sbin/mfiutil X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 17:11:10 -0000 Author: emaste Date: Tue Sep 27 17:11:09 2011 New Revision: 225804 URL: http://svn.freebsd.org/changeset/base/225804 Log: MFC r225798: Improve battery capacity reporting When a status pointer is passed in mfi_dcmd_command does not return an errno (if the ioctl is successful), so move the test for NO_HW_PRESENT outside of the error case. This should fix incorrect reporting for systems with a dead or no battery. Additionally, handle error codes other than NO_HW_PRESENT by omitting the battery capacity display. LSI's supercap-based parts (CV series) report their data using the same interface as battery-based parts, except that they do not include the capacity stats (state of charge, cumulative charge cycles, etc.) PR: bin/160581 Approved by: re Modified: stable/9/usr.sbin/mfiutil/mfi_show.c Directory Properties: stable/9/usr.sbin/mfiutil/ (props changed) Modified: stable/9/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_show.c Tue Sep 27 17:04:13 2011 (r225803) +++ stable/9/usr.sbin/mfiutil/mfi_show.c Tue Sep 27 17:11:09 2011 (r225804) @@ -141,7 +141,7 @@ show_battery(int ac, char **av) struct mfi_bbu_design_info design; struct mfi_bbu_status stat; uint8_t status; - int comma, error, fd; + int comma, error, fd, show_capacity; if (ac != 1) { warnx("show battery: extra arguments"); @@ -157,16 +157,17 @@ show_battery(int ac, char **av) if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_CAPACITY_INFO, &cap, sizeof(cap), NULL, 0, &status) < 0) { - if (status == MFI_STAT_NO_HW_PRESENT) { - printf("mfi%d: No battery present\n", mfi_unit); - close(fd); - return (0); - } error = errno; warn("Failed to get capacity info"); close(fd); return (error); } + if (status == MFI_STAT_NO_HW_PRESENT) { + printf("mfi%d: No battery present\n", mfi_unit); + close(fd); + return (0); + } + show_capacity = (status == MFI_STAT_OK); if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_DESIGN_INFO, &design, sizeof(design), NULL, 0, NULL) < 0) { @@ -192,10 +193,14 @@ show_battery(int ac, char **av) printf(" Model: %s\n", design.device_name); printf(" Chemistry: %s\n", design.device_chemistry); printf(" Design Capacity: %d mAh\n", design.design_capacity); - printf(" Full Charge Capacity: %d mAh\n", cap.full_charge_capacity); - printf(" Current Capacity: %d mAh\n", cap.remaining_capacity); - printf(" Charge Cycles: %d\n", cap.cycle_count); - printf(" Current Charge: %d%%\n", cap.relative_charge); + if (show_capacity) { + printf(" Full Charge Capacity: %d mAh\n", + cap.full_charge_capacity); + printf(" Current Capacity: %d mAh\n", + cap.remaining_capacity); + printf(" Charge Cycles: %d\n", cap.cycle_count); + printf(" Current Charge: %d%%\n", cap.relative_charge); + } printf(" Design Voltage: %d mV\n", design.design_voltage); printf(" Current Voltage: %d mV\n", stat.voltage); printf(" Temperature: %d C\n", stat.temperature); From owner-svn-src-stable@FreeBSD.ORG Tue Sep 27 18:40:14 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11E28106564A; Tue, 27 Sep 2011 18:40:14 +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 EB3388FC0C; Tue, 27 Sep 2011 18:40:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RIeDmF036151; Tue, 27 Sep 2011 18:40:13 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RIeDMF036136; Tue, 27 Sep 2011 18:40:13 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201109271840.p8RIeDMF036136@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 27 Sep 2011 18:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225811 - in stable/9: . kerberos5/lib/libasn1 kerberos5/lib/libgssapi_krb5 kerberos5/lib/libgssapi_ntlm kerberos5/lib/libgssapi_spnego kerberos5/lib/libhdb kerberos5/lib/libheimntlm ke... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 18:40:14 -0000 Author: stas Date: Tue Sep 27 18:40:13 2011 New Revision: 225811 URL: http://svn.freebsd.org/changeset/base/225811 Log: - MFC r225778: - Add missing interdependencies to kerberos libraries. Some of the kerberos libraries were not linked properly (missing dependencies), which causes 3rd party applications linking to fail when --as-needed ld flag is used. I also added the --no-undefined ld(1) flag to make sure that there're no missing dependencies. Approved by: re (kib) Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/kerberos5/lib/libasn1/Makefile stable/9/kerberos5/lib/libgssapi_krb5/Makefile stable/9/kerberos5/lib/libgssapi_ntlm/Makefile stable/9/kerberos5/lib/libgssapi_spnego/Makefile stable/9/kerberos5/lib/libhdb/Makefile stable/9/kerberos5/lib/libheimntlm/Makefile stable/9/kerberos5/lib/libhx509/Makefile stable/9/kerberos5/lib/libkadm5clnt/Makefile stable/9/kerberos5/lib/libkadm5srv/Makefile stable/9/kerberos5/lib/libkafs5/Makefile stable/9/kerberos5/lib/libkrb5/Makefile stable/9/kerberos5/lib/libroken/Makefile stable/9/tools/make_libdeps.sh Directory Properties: stable/9/kerberos5/ (props changed) stable/9/tools/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/Makefile.inc1 Tue Sep 27 18:40:13 2011 (r225811) @@ -1218,7 +1218,8 @@ _startup_libs+= lib/libc gnu/lib/libgcc__L: lib/libc__L -_prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libheimntlm} \ +_prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libhdb} \ + ${_kerberos5_lib_libheimntlm} \ ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libroken} \ lib/libbz2 lib/libcom_err lib/libcrypt \ @@ -1268,6 +1269,19 @@ secure/lib/libssh__L: lib/libgssapi__L k _secure_lib= secure/lib .endif +.if ${MK_KERBEROS} != "no" +kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L +kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ + kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L +kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L +kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ + secure/lib/libcrypto__L kerberos5/lib/libroken__L +kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ + lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \ + kerberos5/lib/libroken__L +kerberos5/lib/libroken__L: lib/libcrypt__L +.endif + .if ${MK_GSSAPI} != "no" _lib_libgssapi= lib/libgssapi .endif @@ -1279,6 +1293,7 @@ _lib_libipx= lib/libipx .if ${MK_KERBEROS} != "no" _kerberos5_lib= kerberos5/lib _kerberos5_lib_libasn1= kerberos5/lib/libasn1 +_kerberos5_lib_libhdb= kerberos5/lib/libhdb _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5 _kerberos5_lib_libhx509= kerberos5/lib/libhx509 _kerberos5_lib_libroken= kerberos5/lib/libroken Modified: stable/9/kerberos5/lib/libasn1/Makefile ============================================================================== --- stable/9/kerberos5/lib/libasn1/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libasn1/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,7 +1,10 @@ # $FreeBSD$ LIB= asn1 +LDFLAGS= -Wl,--no-undefined INCS= asn1_err.h heim_asn1.h +LDADD= -lcom_err -lroken +DPADD= ${LIBCOM_ERR} ${LIBROKEN} SRCS= asn1_err.c \ asn1_err.h \ Modified: stable/9/kerberos5/lib/libgssapi_krb5/Makefile ============================================================================== --- stable/9/kerberos5/lib/libgssapi_krb5/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libgssapi_krb5/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= gssapi_krb5 -LDFLAGS= -Wl,-Bsymbolic +LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined LDADD= -lgssapi -lkrb5 -lhx509 -lcrypto -lroken -lasn1 -lcom_err -lcrypt DPADD= ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBCRYPTO} ${LIBROKEN} ${LIBASN1} \ ${LIBCOM_ERR} ${LIBCRYPT} Modified: stable/9/kerberos5/lib/libgssapi_ntlm/Makefile ============================================================================== --- stable/9/kerberos5/lib/libgssapi_ntlm/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libgssapi_ntlm/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,9 +1,9 @@ # $FreeBSD$ LIB= gssapi_ntlm -LDFLAGS= -Wl,-Bsymbolic -LDADD= -lkrb5 -lhx509 -lheimntlm -lroken -DPADD= ${LIBKRB5} ${LIBHX509} ${LIBHEIMNTLM} ${LIBROKEN} +LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined +LDADD= -lcrypto -lgssapi -lkrb5 -lhx509 -lheimntlm -lroken +DPADD= ${LIBCRYPTO} ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBHEIMNTLM} ${LIBROKEN} SRCS= accept_sec_context.c \ acquire_cred.c \ Modified: stable/9/kerberos5/lib/libgssapi_spnego/Makefile ============================================================================== --- stable/9/kerberos5/lib/libgssapi_spnego/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libgssapi_spnego/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,9 +1,9 @@ # $FreeBSD$ LIB= gssapi_spnego -LDFLAGS= -Wl,-Bsymbolic -LDADD= -lgssapi -lasn1 -DPADD= ${LIBGSSAPI} ${LIBASN1} +LDFLAGS= -Wl,-Bsymbolic -Wl,--no-undefined +LDADD= -lgssapi -lasn1 -lroken +DPADD= ${LIBGSSAPI} ${LIBASN1} ${LIBROKEN} SRCS= accept_sec_context.c \ compat.c \ Modified: stable/9/kerberos5/lib/libhdb/Makefile ============================================================================== --- stable/9/kerberos5/lib/libhdb/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libhdb/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,6 +1,9 @@ # $FreeBSD$ LIB= hdb +LDFLAGS= -Wl,--no-undefined +LDADD= -lasn1 -lcom_err -lkrb5 -lroken +DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN} INCS= hdb-private.h \ hdb-protos.h \ Modified: stable/9/kerberos5/lib/libheimntlm/Makefile ============================================================================== --- stable/9/kerberos5/lib/libheimntlm/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libheimntlm/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,6 +1,9 @@ # $FreeBSD$ LIB= heimntlm +LDFLAGS= -Wl,--no-undefined +LDADD= -lcrypto -lkrb5 +DPADD= ${LIBCRYPTO} ${LIBKRB5} SRCS= ntlm.c INCS= heimntlm.h heimntlm-protos.h CFLAGS+=-I${KRB5DIR}/lib/ntlm Modified: stable/9/kerberos5/lib/libhx509/Makefile ============================================================================== --- stable/9/kerberos5/lib/libhx509/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libhx509/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,7 +1,10 @@ # $FreeBSD$ LIB= hx509 +LDFLAGS= -Wl,--no-undefined VERSION_MAP= ${KRB5DIR}/lib/hx509/version-script.map +LDADD= -lasn1 -lcom_err -lcrypto -lroken +DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBCRYPTO} ${LIBROKEN} INCS= hx509-private.h \ hx509-protos.h \ Modified: stable/9/kerberos5/lib/libkadm5clnt/Makefile ============================================================================== --- stable/9/kerberos5/lib/libkadm5clnt/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libkadm5clnt/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,6 +1,9 @@ # $FreeBSD$ LIB= kadm5clnt +LDFLAGS= -Wl,--no-undefined +LDADD= -lcom_err -lkrb5 -lroken +DPADD= ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN} INCS= admin.h \ kadm5-private.h \ Modified: stable/9/kerberos5/lib/libkadm5srv/Makefile ============================================================================== --- stable/9/kerberos5/lib/libkadm5srv/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libkadm5srv/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,6 +1,9 @@ # $FreeBSD$ LIB= kadm5srv +LDFLAGS= -Wl,--no-undefined +LDADD= -lcom_err -lhdb -lkrb5 -lroken +DPADD= ${LIBCOM_ERR} ${LIBHDB} ${LIBKRB5} ${LIBROKEN} VERSION_MAP= ${KRB5DIR}/lib/kadm5/version-script.map SRCS= acl.c \ Modified: stable/9/kerberos5/lib/libkafs5/Makefile ============================================================================== --- stable/9/kerberos5/lib/libkafs5/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libkafs5/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,6 +1,9 @@ # $FreeBSD$ LIB= kafs5 +LDFLAGS= -Wl,--no-undefined +LDADD= -lasn1 -lkrb5 -lroken +DPADD= ${LIBASN1} ${LIBKRB5} ${LIBROKEN} INCS= kafs.h MAN= kafs5.3 Modified: stable/9/kerberos5/lib/libkrb5/Makefile ============================================================================== --- stable/9/kerberos5/lib/libkrb5/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libkrb5/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,7 +1,10 @@ # $FreeBSD$ LIB= krb5 +LDFLAGS= -Wl,--no-undefined VERSION_MAP= ${KRB5DIR}/lib/krb5/version-script.map +LDADD= -lasn1 -lcom_err -lcrypt -lcrypto -lhx509 -lroken +DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO} ${LIBHX509} ${LIBROKEN} INCS= heim_err.h \ heim_threads.h \ Modified: stable/9/kerberos5/lib/libroken/Makefile ============================================================================== --- stable/9/kerberos5/lib/libroken/Makefile Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/kerberos5/lib/libroken/Makefile Tue Sep 27 18:40:13 2011 (r225811) @@ -1,6 +1,8 @@ # $FreeBSD$ LIB= roken +LDADD= -lcrypt +DPADD= ${LIBCRYPT} INCS= roken.h roken-common.h SRCS= base64.c \ Modified: stable/9/tools/make_libdeps.sh ============================================================================== --- stable/9/tools/make_libdeps.sh Tue Sep 27 18:23:58 2011 (r225810) +++ stable/9/tools/make_libdeps.sh Tue Sep 27 18:40:13 2011 (r225811) @@ -52,7 +52,7 @@ sed -E -e's;-l(ncurses|termcap)!;lib/ncurses/ncurses;g' -e's;-l(gcc)!;gnu/lib/lib\1;g' -e's;-lssp_nonshared!;gnu/lib/libssp/libssp_nonshared;g' - -e's;-l(asn1|heimntlm|hx509|krb5|roken)!;kerberos5/lib/lib\1;g' + -e's;-l(asn1|hdb|heimntlm|hx509|krb5|roken)!;kerberos5/lib/lib\1;g' -e's;-l(crypto|ssh|ssl)!;secure/lib/lib\1;g' -e's;-l([^!]+)!;lib/lib\1;g' " From owner-svn-src-stable@FreeBSD.ORG Tue Sep 27 19:08:28 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F9BC1065675; Tue, 27 Sep 2011 19:08:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DF588FC15; Tue, 27 Sep 2011 19:08:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RJ8S1t037251; Tue, 27 Sep 2011 19:08:28 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RJ8SK8037249; Tue, 27 Sep 2011 19:08:28 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109271908.p8RJ8SK8037249@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 27 Sep 2011 19:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225816 - stable/9/usr.bin/fetch X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 19:08:28 -0000 Author: des Date: Tue Sep 27 19:08:27 2011 New Revision: 225816 URL: http://svn.freebsd.org/changeset/base/225816 Log: MFH r225805: use fseeko(2) instead of fseek(2). Approved by: re (kib) Modified: stable/9/usr.bin/fetch/fetch.c Directory Properties: stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/usr.bin/fetch/fetch.c ============================================================================== --- stable/9/usr.bin/fetch/fetch.c Tue Sep 27 19:02:44 2011 (r225815) +++ stable/9/usr.bin/fetch/fetch.c Tue Sep 27 19:08:27 2011 (r225816) @@ -561,8 +561,8 @@ fetch(char *URL, const char *path) } } /* seek to where we left off */ - if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { - warn("%s: fseek()", path); + if (of != NULL && fseeko(of, url->offset, SEEK_SET) != 0) { + warn("%s: fseeko()", path); fclose(of); of = NULL; /* picked up again later */ From owner-svn-src-stable@FreeBSD.ORG Wed Sep 28 01:26:18 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7801106566B; Wed, 28 Sep 2011 01:26:18 +0000 (UTC) (envelope-from poyopoyo@puripuri.plala.or.jp) Received: from msa04b.plala.or.jp (msa04.plala.or.jp [IPv6:2400:7800:0:5010::4]) by mx1.freebsd.org (Postfix) with ESMTP id 0430A8FC08; Wed, 28 Sep 2011 01:26:17 +0000 (UTC) Received: from i220-109-122-8.s02.a026.ap.plala.or.jp ([220.109.122.8]) by msa04b.plala.or.jp with ESMTP id <20110928012616.CZVZ10746.msa04b.plala.or.jp@i220-109-122-8.s02.a026.ap.plala.or.jp>; Wed, 28 Sep 2011 10:26:16 +0900 Date: Wed, 28 Sep 2011 10:26:16 +0900 Message-ID: <86bou5sbif.wl%poyopoyo@puripuri.plala.or.jp> From: poyopoyo@puripuri.plala.or.jp To: Ken Smith In-Reply-To: <201109230051.p8N0pbV2045995@svn.freebsd.org> References: <201109230051.p8N0pbV2045995@svn.freebsd.org> Mail-Followup-To: Ken Smith , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org, poyopoyo@puripuri.plala.or.jp User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.3 (amd64-portbld-freebsd9.0) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-VirusScan: Outbound; msa04b; Wed, 28 Sep 2011 10:26:16 +0900 X-Mailman-Approved-At: Wed, 28 Sep 2011 02:29:46 +0000 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-other@freebsd.org Subject: Re: svn commit: r225736 - stable/9 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 01:26:19 -0000 > X-SVN-Group: stable-other Perhaps time has come to modify sysadmin/conf/mailer.conf to create stable-9 group for stable/9? -- kuro From owner-svn-src-stable@FreeBSD.ORG Wed Sep 28 08:47:18 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B4241065673; Wed, 28 Sep 2011 08:47:18 +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 675668FC20; Wed, 28 Sep 2011 08:47:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S8lI7l063637; Wed, 28 Sep 2011 08:47:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S8lIRf063633; Wed, 28 Sep 2011 08:47:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201109280847.p8S8lIRf063633@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 28 Sep 2011 08:47: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: r225827 - head/sys/kern head/usr.bin/compress head/usr.bin/gzip releng/7.3 releng/7.3/sys/conf releng/7.3/sys/kern releng/7.3/usr.bin/compress releng/7.3/usr.bin/gzip releng/7.4 releng/... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 08:47:18 -0000 Author: bz Date: Wed Sep 28 08:47:17 2011 New Revision: 225827 URL: http://svn.freebsd.org/changeset/base/225827 Log: Fix handling of corrupt compress(1)ed data. [11:04] Add missing length checks on unix socket addresses. [11:05] Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-11:04.compress Security: CVE-2011-2895 [11:04] Security: FreeBSD-SA-11:05.unix Modified: stable/7/sys/kern/uipc_usrreq.c stable/7/usr.bin/compress/zopen.c stable/7/usr.bin/gzip/zuncompress.c Changes in other areas also in this revision: Modified: head/sys/kern/uipc_usrreq.c head/usr.bin/compress/zopen.c head/usr.bin/gzip/zuncompress.c releng/7.3/UPDATING releng/7.3/sys/conf/newvers.sh releng/7.3/sys/kern/uipc_usrreq.c releng/7.3/usr.bin/compress/zopen.c releng/7.3/usr.bin/gzip/zuncompress.c releng/7.4/UPDATING releng/7.4/sys/conf/newvers.sh releng/7.4/sys/kern/uipc_usrreq.c releng/7.4/usr.bin/compress/zopen.c releng/7.4/usr.bin/gzip/zuncompress.c releng/8.1/UPDATING releng/8.1/sys/conf/newvers.sh releng/8.1/sys/kern/uipc_usrreq.c releng/8.1/usr.bin/compress/zopen.c releng/8.1/usr.bin/gzip/zuncompress.c releng/8.2/UPDATING releng/8.2/sys/conf/newvers.sh releng/8.2/sys/kern/uipc_usrreq.c releng/8.2/usr.bin/compress/zopen.c releng/8.2/usr.bin/gzip/zuncompress.c stable/8/sys/kern/uipc_usrreq.c stable/8/usr.bin/compress/zopen.c stable/8/usr.bin/gzip/zuncompress.c stable/9/sys/kern/uipc_usrreq.c stable/9/usr.bin/compress/zopen.c stable/9/usr.bin/gzip/zuncompress.c Modified: stable/7/sys/kern/uipc_usrreq.c ============================================================================== --- stable/7/sys/kern/uipc_usrreq.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/7/sys/kern/uipc_usrreq.c Wed Sep 28 08:47:17 2011 (r225827) @@ -395,6 +395,8 @@ uipc_bind(struct socket *so, struct sock unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_bind: unp == NULL")); + if (soun->sun_len > sizeof(struct sockaddr_un)) + return (EINVAL); namelen = soun->sun_len - offsetof(struct sockaddr_un, sun_path); if (namelen <= 0) return (EINVAL); @@ -1142,6 +1144,8 @@ unp_connect(struct socket *so, struct so unp = sotounpcb(so); KASSERT(unp != NULL, ("unp_connect: unp == NULL")); + if (nam->sa_len > sizeof(struct sockaddr_un)) + return (EINVAL); len = nam->sa_len - offsetof(struct sockaddr_un, sun_path); if (len <= 0) return (EINVAL); Modified: stable/7/usr.bin/compress/zopen.c ============================================================================== --- stable/7/usr.bin/compress/zopen.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/7/usr.bin/compress/zopen.c Wed Sep 28 08:47:17 2011 (r225827) @@ -490,7 +490,7 @@ zread(void *cookie, char *rbp, int num) block_compress = maxbits & BLOCK_MASK; maxbits &= BIT_MASK; maxmaxcode = 1L << maxbits; - if (maxbits > BITS) { + if (maxbits > BITS || maxbits < 12) { errno = EFTYPE; return (-1); } @@ -517,17 +517,28 @@ zread(void *cookie, char *rbp, int num) for (code = 255; code >= 0; code--) tab_prefixof(code) = 0; clear_flg = 1; - free_ent = FIRST - 1; - if ((code = getcode(zs)) == -1) /* O, untimely death! */ - break; + free_ent = FIRST; + oldcode = -1; + continue; } incode = code; - /* Special case for KwKwK string. */ + /* Special case for kWkWk string. */ if (code >= free_ent) { + if (code > free_ent || oldcode == -1) { + /* Bad stream. */ + errno = EINVAL; + return (-1); + } *stackp++ = finchar; code = oldcode; } + /* + * The above condition ensures that code < free_ent. + * The construction of tab_prefixof in turn guarantees that + * each iteration decreases code and therefore stack usage is + * bound by 1 << BITS - 256. + */ /* Generate output characters in reverse order. */ while (code >= 256) { @@ -544,7 +555,7 @@ middle: do { } while (stackp > de_stack); /* Generate the new entry. */ - if ((code = free_ent) < maxmaxcode) { + if ((code = free_ent) < maxmaxcode && oldcode != -1) { tab_prefixof(code) = (u_short) oldcode; tab_suffixof(code) = finchar; free_ent = code + 1; Modified: stable/7/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/7/usr.bin/gzip/zuncompress.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/7/usr.bin/gzip/zuncompress.c Wed Sep 28 08:47:17 2011 (r225827) @@ -247,7 +247,7 @@ zread(void *cookie, char *rbp, int num) zs->zs_block_compress = zs->zs_maxbits & BLOCK_MASK; zs->zs_maxbits &= BIT_MASK; zs->zs_maxmaxcode = 1L << zs->zs_maxbits; - if (zs->zs_maxbits > BITS) { + if (zs->zs_maxbits > BITS || zs->zs_maxbits < 12) { errno = EFTYPE; return (-1); } @@ -259,13 +259,7 @@ zread(void *cookie, char *rbp, int num) } zs->zs_free_ent = zs->zs_block_compress ? FIRST : 256; - zs->u.r.zs_finchar = zs->u.r.zs_oldcode = getcode(zs); - if (zs->u.r.zs_oldcode == -1) /* EOF already? */ - return (0); /* Get out of here */ - - /* First code must be 8 bits = char. */ - *bp++ = (u_char)zs->u.r.zs_finchar; - count--; + zs->u.r.zs_oldcode = -1; zs->u.r.zs_stackp = de_stack; while ((zs->u.r.zs_code = getcode(zs)) > -1) { @@ -275,17 +269,29 @@ zread(void *cookie, char *rbp, int num) zs->u.r.zs_code--) tab_prefixof(zs->u.r.zs_code) = 0; zs->zs_clear_flg = 1; - zs->zs_free_ent = FIRST - 1; - if ((zs->u.r.zs_code = getcode(zs)) == -1) /* O, untimely death! */ - break; + zs->zs_free_ent = FIRST; + zs->u.r.zs_oldcode = -1; + continue; } zs->u.r.zs_incode = zs->u.r.zs_code; /* Special case for KwKwK string. */ if (zs->u.r.zs_code >= zs->zs_free_ent) { + if (zs->u.r.zs_code > zs->zs_free_ent || + zs->u.r.zs_oldcode == -1) { + /* Bad stream. */ + errno = EINVAL; + return (-1); + } *zs->u.r.zs_stackp++ = zs->u.r.zs_finchar; zs->u.r.zs_code = zs->u.r.zs_oldcode; } + /* + * The above condition ensures that code < free_ent. + * The construction of tab_prefixof in turn guarantees that + * each iteration decreases code and therefore stack usage is + * bound by 1 << BITS - 256. + */ /* Generate output characters in reverse order. */ while (zs->u.r.zs_code >= 256) { @@ -302,7 +308,8 @@ middle: do { } while (zs->u.r.zs_stackp > de_stack); /* Generate the new entry. */ - if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode) { + if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode && + zs->u.r.zs_oldcode != -1) { tab_prefixof(zs->u.r.zs_code) = (u_short) zs->u.r.zs_oldcode; tab_suffixof(zs->u.r.zs_code) = zs->u.r.zs_finchar; zs->zs_free_ent = zs->u.r.zs_code + 1; From owner-svn-src-stable@FreeBSD.ORG Wed Sep 28 08:47:18 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F3B81065677; Wed, 28 Sep 2011 08:47:18 +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 7B1348FC21; Wed, 28 Sep 2011 08:47:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S8lIRe063645; Wed, 28 Sep 2011 08:47:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S8lIm6063641; Wed, 28 Sep 2011 08:47:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201109280847.p8S8lIm6063641@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 28 Sep 2011 08:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225827 - head/sys/kern head/usr.bin/compress head/usr.bin/gzip releng/7.3 releng/7.3/sys/conf releng/7.3/sys/kern releng/7.3/usr.bin/compress releng/7.3/usr.bin/gzip releng/7.4 releng/... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 08:47:18 -0000 Author: bz Date: Wed Sep 28 08:47:17 2011 New Revision: 225827 URL: http://svn.freebsd.org/changeset/base/225827 Log: Fix handling of corrupt compress(1)ed data. [11:04] Add missing length checks on unix socket addresses. [11:05] Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-11:04.compress Security: CVE-2011-2895 [11:04] Security: FreeBSD-SA-11:05.unix Modified: stable/8/sys/kern/uipc_usrreq.c stable/8/usr.bin/compress/zopen.c stable/8/usr.bin/gzip/zuncompress.c Changes in other areas also in this revision: Modified: head/sys/kern/uipc_usrreq.c head/usr.bin/compress/zopen.c head/usr.bin/gzip/zuncompress.c releng/7.3/UPDATING releng/7.3/sys/conf/newvers.sh releng/7.3/sys/kern/uipc_usrreq.c releng/7.3/usr.bin/compress/zopen.c releng/7.3/usr.bin/gzip/zuncompress.c releng/7.4/UPDATING releng/7.4/sys/conf/newvers.sh releng/7.4/sys/kern/uipc_usrreq.c releng/7.4/usr.bin/compress/zopen.c releng/7.4/usr.bin/gzip/zuncompress.c releng/8.1/UPDATING releng/8.1/sys/conf/newvers.sh releng/8.1/sys/kern/uipc_usrreq.c releng/8.1/usr.bin/compress/zopen.c releng/8.1/usr.bin/gzip/zuncompress.c releng/8.2/UPDATING releng/8.2/sys/conf/newvers.sh releng/8.2/sys/kern/uipc_usrreq.c releng/8.2/usr.bin/compress/zopen.c releng/8.2/usr.bin/gzip/zuncompress.c stable/7/sys/kern/uipc_usrreq.c stable/7/usr.bin/compress/zopen.c stable/7/usr.bin/gzip/zuncompress.c stable/9/sys/kern/uipc_usrreq.c stable/9/usr.bin/compress/zopen.c stable/9/usr.bin/gzip/zuncompress.c Modified: stable/8/sys/kern/uipc_usrreq.c ============================================================================== --- stable/8/sys/kern/uipc_usrreq.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/8/sys/kern/uipc_usrreq.c Wed Sep 28 08:47:17 2011 (r225827) @@ -419,6 +419,8 @@ uipc_bind(struct socket *so, struct sock unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_bind: unp == NULL")); + if (soun->sun_len > sizeof(struct sockaddr_un)) + return (EINVAL); namelen = soun->sun_len - offsetof(struct sockaddr_un, sun_path); if (namelen <= 0) return (EINVAL); @@ -1168,6 +1170,8 @@ unp_connect(struct socket *so, struct so unp = sotounpcb(so); KASSERT(unp != NULL, ("unp_connect: unp == NULL")); + if (nam->sa_len > sizeof(struct sockaddr_un)) + return (EINVAL); len = nam->sa_len - offsetof(struct sockaddr_un, sun_path); if (len <= 0) return (EINVAL); Modified: stable/8/usr.bin/compress/zopen.c ============================================================================== --- stable/8/usr.bin/compress/zopen.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/8/usr.bin/compress/zopen.c Wed Sep 28 08:47:17 2011 (r225827) @@ -490,7 +490,7 @@ zread(void *cookie, char *rbp, int num) block_compress = maxbits & BLOCK_MASK; maxbits &= BIT_MASK; maxmaxcode = 1L << maxbits; - if (maxbits > BITS) { + if (maxbits > BITS || maxbits < 12) { errno = EFTYPE; return (-1); } @@ -517,17 +517,28 @@ zread(void *cookie, char *rbp, int num) for (code = 255; code >= 0; code--) tab_prefixof(code) = 0; clear_flg = 1; - free_ent = FIRST - 1; - if ((code = getcode(zs)) == -1) /* O, untimely death! */ - break; + free_ent = FIRST; + oldcode = -1; + continue; } incode = code; - /* Special case for KwKwK string. */ + /* Special case for kWkWk string. */ if (code >= free_ent) { + if (code > free_ent || oldcode == -1) { + /* Bad stream. */ + errno = EINVAL; + return (-1); + } *stackp++ = finchar; code = oldcode; } + /* + * The above condition ensures that code < free_ent. + * The construction of tab_prefixof in turn guarantees that + * each iteration decreases code and therefore stack usage is + * bound by 1 << BITS - 256. + */ /* Generate output characters in reverse order. */ while (code >= 256) { @@ -544,7 +555,7 @@ middle: do { } while (stackp > de_stack); /* Generate the new entry. */ - if ((code = free_ent) < maxmaxcode) { + if ((code = free_ent) < maxmaxcode && oldcode != -1) { tab_prefixof(code) = (u_short) oldcode; tab_suffixof(code) = finchar; free_ent = code + 1; Modified: stable/8/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/8/usr.bin/gzip/zuncompress.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/8/usr.bin/gzip/zuncompress.c Wed Sep 28 08:47:17 2011 (r225827) @@ -247,7 +247,7 @@ zread(void *cookie, char *rbp, int num) zs->zs_block_compress = zs->zs_maxbits & BLOCK_MASK; zs->zs_maxbits &= BIT_MASK; zs->zs_maxmaxcode = 1L << zs->zs_maxbits; - if (zs->zs_maxbits > BITS) { + if (zs->zs_maxbits > BITS || zs->zs_maxbits < 12) { errno = EFTYPE; return (-1); } @@ -259,13 +259,7 @@ zread(void *cookie, char *rbp, int num) } zs->zs_free_ent = zs->zs_block_compress ? FIRST : 256; - zs->u.r.zs_finchar = zs->u.r.zs_oldcode = getcode(zs); - if (zs->u.r.zs_oldcode == -1) /* EOF already? */ - return (0); /* Get out of here */ - - /* First code must be 8 bits = char. */ - *bp++ = (u_char)zs->u.r.zs_finchar; - count--; + zs->u.r.zs_oldcode = -1; zs->u.r.zs_stackp = de_stack; while ((zs->u.r.zs_code = getcode(zs)) > -1) { @@ -275,17 +269,29 @@ zread(void *cookie, char *rbp, int num) zs->u.r.zs_code--) tab_prefixof(zs->u.r.zs_code) = 0; zs->zs_clear_flg = 1; - zs->zs_free_ent = FIRST - 1; - if ((zs->u.r.zs_code = getcode(zs)) == -1) /* O, untimely death! */ - break; + zs->zs_free_ent = FIRST; + zs->u.r.zs_oldcode = -1; + continue; } zs->u.r.zs_incode = zs->u.r.zs_code; /* Special case for KwKwK string. */ if (zs->u.r.zs_code >= zs->zs_free_ent) { + if (zs->u.r.zs_code > zs->zs_free_ent || + zs->u.r.zs_oldcode == -1) { + /* Bad stream. */ + errno = EINVAL; + return (-1); + } *zs->u.r.zs_stackp++ = zs->u.r.zs_finchar; zs->u.r.zs_code = zs->u.r.zs_oldcode; } + /* + * The above condition ensures that code < free_ent. + * The construction of tab_prefixof in turn guarantees that + * each iteration decreases code and therefore stack usage is + * bound by 1 << BITS - 256. + */ /* Generate output characters in reverse order. */ while (zs->u.r.zs_code >= 256) { @@ -302,7 +308,8 @@ middle: do { } while (zs->u.r.zs_stackp > de_stack); /* Generate the new entry. */ - if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode) { + if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode && + zs->u.r.zs_oldcode != -1) { tab_prefixof(zs->u.r.zs_code) = (u_short) zs->u.r.zs_oldcode; tab_suffixof(zs->u.r.zs_code) = zs->u.r.zs_finchar; zs->zs_free_ent = zs->u.r.zs_code + 1; From owner-svn-src-stable@FreeBSD.ORG Wed Sep 28 08:47:18 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A358C1065678; Wed, 28 Sep 2011 08:47:18 +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 8EFF88FC14; Wed, 28 Sep 2011 08:47:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S8lIKi063653; Wed, 28 Sep 2011 08:47:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S8lIP0063649; Wed, 28 Sep 2011 08:47:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201109280847.p8S8lIP0063649@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 28 Sep 2011 08:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225827 - head/sys/kern head/usr.bin/compress head/usr.bin/gzip releng/7.3 releng/7.3/sys/conf releng/7.3/sys/kern releng/7.3/usr.bin/compress releng/7.3/usr.bin/gzip releng/7.4 releng/... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 08:47:18 -0000 Author: bz Date: Wed Sep 28 08:47:17 2011 New Revision: 225827 URL: http://svn.freebsd.org/changeset/base/225827 Log: Fix handling of corrupt compress(1)ed data. [11:04] Add missing length checks on unix socket addresses. [11:05] Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-11:04.compress Security: CVE-2011-2895 [11:04] Security: FreeBSD-SA-11:05.unix Modified: stable/9/sys/kern/uipc_usrreq.c stable/9/usr.bin/compress/zopen.c stable/9/usr.bin/gzip/zuncompress.c Changes in other areas also in this revision: Modified: head/sys/kern/uipc_usrreq.c head/usr.bin/compress/zopen.c head/usr.bin/gzip/zuncompress.c releng/7.3/UPDATING releng/7.3/sys/conf/newvers.sh releng/7.3/sys/kern/uipc_usrreq.c releng/7.3/usr.bin/compress/zopen.c releng/7.3/usr.bin/gzip/zuncompress.c releng/7.4/UPDATING releng/7.4/sys/conf/newvers.sh releng/7.4/sys/kern/uipc_usrreq.c releng/7.4/usr.bin/compress/zopen.c releng/7.4/usr.bin/gzip/zuncompress.c releng/8.1/UPDATING releng/8.1/sys/conf/newvers.sh releng/8.1/sys/kern/uipc_usrreq.c releng/8.1/usr.bin/compress/zopen.c releng/8.1/usr.bin/gzip/zuncompress.c releng/8.2/UPDATING releng/8.2/sys/conf/newvers.sh releng/8.2/sys/kern/uipc_usrreq.c releng/8.2/usr.bin/compress/zopen.c releng/8.2/usr.bin/gzip/zuncompress.c stable/7/sys/kern/uipc_usrreq.c stable/7/usr.bin/compress/zopen.c stable/7/usr.bin/gzip/zuncompress.c stable/8/sys/kern/uipc_usrreq.c stable/8/usr.bin/compress/zopen.c stable/8/usr.bin/gzip/zuncompress.c Modified: stable/9/sys/kern/uipc_usrreq.c ============================================================================== --- stable/9/sys/kern/uipc_usrreq.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/9/sys/kern/uipc_usrreq.c Wed Sep 28 08:47:17 2011 (r225827) @@ -462,6 +462,8 @@ uipc_bind(struct socket *so, struct sock unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_bind: unp == NULL")); + if (soun->sun_len > sizeof(struct sockaddr_un)) + return (EINVAL); namelen = soun->sun_len - offsetof(struct sockaddr_un, sun_path); if (namelen <= 0) return (EINVAL); @@ -1252,6 +1254,8 @@ unp_connect(struct socket *so, struct so unp = sotounpcb(so); KASSERT(unp != NULL, ("unp_connect: unp == NULL")); + if (nam->sa_len > sizeof(struct sockaddr_un)) + return (EINVAL); len = nam->sa_len - offsetof(struct sockaddr_un, sun_path); if (len <= 0) return (EINVAL); Modified: stable/9/usr.bin/compress/zopen.c ============================================================================== --- stable/9/usr.bin/compress/zopen.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/9/usr.bin/compress/zopen.c Wed Sep 28 08:47:17 2011 (r225827) @@ -486,7 +486,7 @@ zread(void *cookie, char *rbp, int num) block_compress = maxbits & BLOCK_MASK; maxbits &= BIT_MASK; maxmaxcode = 1L << maxbits; - if (maxbits > BITS) { + if (maxbits > BITS || maxbits < 12) { errno = EFTYPE; return (-1); } @@ -513,17 +513,28 @@ zread(void *cookie, char *rbp, int num) for (code = 255; code >= 0; code--) tab_prefixof(code) = 0; clear_flg = 1; - free_ent = FIRST - 1; - if ((code = getcode(zs)) == -1) /* O, untimely death! */ - break; + free_ent = FIRST; + oldcode = -1; + continue; } incode = code; - /* Special case for KwKwK string. */ + /* Special case for kWkWk string. */ if (code >= free_ent) { + if (code > free_ent || oldcode == -1) { + /* Bad stream. */ + errno = EINVAL; + return (-1); + } *stackp++ = finchar; code = oldcode; } + /* + * The above condition ensures that code < free_ent. + * The construction of tab_prefixof in turn guarantees that + * each iteration decreases code and therefore stack usage is + * bound by 1 << BITS - 256. + */ /* Generate output characters in reverse order. */ while (code >= 256) { @@ -540,7 +551,7 @@ middle: do { } while (stackp > de_stack); /* Generate the new entry. */ - if ((code = free_ent) < maxmaxcode) { + if ((code = free_ent) < maxmaxcode && oldcode != -1) { tab_prefixof(code) = (u_short) oldcode; tab_suffixof(code) = finchar; free_ent = code + 1; Modified: stable/9/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/9/usr.bin/gzip/zuncompress.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/9/usr.bin/gzip/zuncompress.c Wed Sep 28 08:47:17 2011 (r225827) @@ -247,7 +247,7 @@ zread(void *cookie, char *rbp, int num) zs->zs_block_compress = zs->zs_maxbits & BLOCK_MASK; zs->zs_maxbits &= BIT_MASK; zs->zs_maxmaxcode = 1L << zs->zs_maxbits; - if (zs->zs_maxbits > BITS) { + if (zs->zs_maxbits > BITS || zs->zs_maxbits < 12) { errno = EFTYPE; return (-1); } @@ -259,13 +259,7 @@ zread(void *cookie, char *rbp, int num) } zs->zs_free_ent = zs->zs_block_compress ? FIRST : 256; - zs->u.r.zs_finchar = zs->u.r.zs_oldcode = getcode(zs); - if (zs->u.r.zs_oldcode == -1) /* EOF already? */ - return (0); /* Get out of here */ - - /* First code must be 8 bits = char. */ - *bp++ = (u_char)zs->u.r.zs_finchar; - count--; + zs->u.r.zs_oldcode = -1; zs->u.r.zs_stackp = de_stack; while ((zs->u.r.zs_code = getcode(zs)) > -1) { @@ -275,17 +269,29 @@ zread(void *cookie, char *rbp, int num) zs->u.r.zs_code--) tab_prefixof(zs->u.r.zs_code) = 0; zs->zs_clear_flg = 1; - zs->zs_free_ent = FIRST - 1; - if ((zs->u.r.zs_code = getcode(zs)) == -1) /* O, untimely death! */ - break; + zs->zs_free_ent = FIRST; + zs->u.r.zs_oldcode = -1; + continue; } zs->u.r.zs_incode = zs->u.r.zs_code; /* Special case for KwKwK string. */ if (zs->u.r.zs_code >= zs->zs_free_ent) { + if (zs->u.r.zs_code > zs->zs_free_ent || + zs->u.r.zs_oldcode == -1) { + /* Bad stream. */ + errno = EINVAL; + return (-1); + } *zs->u.r.zs_stackp++ = zs->u.r.zs_finchar; zs->u.r.zs_code = zs->u.r.zs_oldcode; } + /* + * The above condition ensures that code < free_ent. + * The construction of tab_prefixof in turn guarantees that + * each iteration decreases code and therefore stack usage is + * bound by 1 << BITS - 256. + */ /* Generate output characters in reverse order. */ while (zs->u.r.zs_code >= 256) { @@ -302,7 +308,8 @@ middle: do { } while (zs->u.r.zs_stackp > de_stack); /* Generate the new entry. */ - if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode) { + if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode && + zs->u.r.zs_oldcode != -1) { tab_prefixof(zs->u.r.zs_code) = (u_short) zs->u.r.zs_oldcode; tab_suffixof(zs->u.r.zs_code) = zs->u.r.zs_finchar; zs->zs_free_ent = zs->u.r.zs_code + 1; From owner-svn-src-stable@FreeBSD.ORG Wed Sep 28 08:51:37 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07ABE106566B; Wed, 28 Sep 2011 08:51:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 8B8398FC18; Wed, 28 Sep 2011 08:51:36 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id C486B25D3860; Wed, 28 Sep 2011 08:51:34 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D2C73BD3D28; Wed, 28 Sep 2011 08:51:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id IplEqJpYVB90; Wed, 28 Sep 2011 08:51:33 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id C0C92BD3C22; Wed, 28 Sep 2011 08:51:32 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <86bou5sbif.wl%poyopoyo@puripuri.plala.or.jp> Date: Wed, 28 Sep 2011 08:51:31 +0000 Content-Transfer-Encoding: 7bit Message-Id: <51E92007-864E-4A61-A333-CD1B8865D20C@FreeBSD.org> References: <201109230051.p8N0pbV2045995@svn.freebsd.org> <86bou5sbif.wl%poyopoyo@puripuri.plala.or.jp> To: poyopoyo@puripuri.plala.or.jp X-Mailer: Apple Mail (2.1084) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-other@freebsd.org, Ken Smith Subject: Re: svn commit: r225736 - stable/9 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 08:51:37 -0000 On Sep 28, 2011, at 1:26 AM, poyopoyo@puripuri.plala.or.jp wrote: >> X-SVN-Group: stable-other > > Perhaps time has come to modify sysadmin/conf/mailer.conf to create > stable-9 group for stable/9? I have emailed postmaster to create the list yesterday and I have an approved diff for mailer.conf already waiting on the list creation to happen. /bz -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-stable@FreeBSD.ORG Wed Sep 28 11:49:05 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F19F3106566C; Wed, 28 Sep 2011 11:49:04 +0000 (UTC) (envelope-from poyopoyo@puripuri.plala.or.jp) Received: from msa02b.plala.or.jp (msa02.plala.or.jp [IPv6:2400:7800:0:5010::2]) by mx1.freebsd.org (Postfix) with ESMTP id D3A978FC15; Wed, 28 Sep 2011 11:49:03 +0000 (UTC) Received: from i220-109-122-8.s02.a026.ap.plala.or.jp ([220.109.122.8]) by msa02b.plala.or.jp with ESMTP id <20110928114902.GQQD16800.msa02b.plala.or.jp@i220-109-122-8.s02.a026.ap.plala.or.jp>; Wed, 28 Sep 2011 20:49:02 +0900 Date: Wed, 28 Sep 2011 20:49:02 +0900 Message-ID: <868vp8sx8x.wl%poyopoyo@puripuri.plala.or.jp> From: poyopoyo@puripuri.plala.or.jp To: "Bjoern A. Zeeb" In-Reply-To: <51E92007-864E-4A61-A333-CD1B8865D20C@FreeBSD.org> References: <201109230051.p8N0pbV2045995@svn.freebsd.org> <86bou5sbif.wl%poyopoyo@puripuri.plala.or.jp> <51E92007-864E-4A61-A333-CD1B8865D20C@FreeBSD.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.3 (amd64-portbld-freebsd9.0) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-VirusScan: Outbound; msa02b; Wed, 28 Sep 2011 20:49:02 +0900 X-Mailman-Approved-At: Wed, 28 Sep 2011 13:22:27 +0000 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-other@freebsd.org, Ken Smith Subject: Re: svn commit: r225736 - stable/9 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 11:49:05 -0000 At Wed, 28 Sep 2011 08:51:31 +0000, Bjoern A. Zeeb wrote: > I have emailed postmaster to create the list yesterday and I have an > approved diff for mailer.conf already waiting on the list creation > to happen. That's nice! Thank you. -- kuro From owner-svn-src-stable@FreeBSD.ORG Wed Sep 28 19:36:22 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05F99106566B; Wed, 28 Sep 2011 19:36:22 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E921A8FC19; Wed, 28 Sep 2011 19:36:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SJaLWS086919; Wed, 28 Sep 2011 19:36:21 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SJaLQk086917; Wed, 28 Sep 2011 19:36:21 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201109281936.p8SJaLQk086917@svn.freebsd.org> From: Kirk McKusick Date: Wed, 28 Sep 2011 19:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225850 - stable/9/sys/ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 19:36:22 -0000 Author: mckusick Date: Wed Sep 28 19:36:21 2011 New Revision: 225850 URL: http://svn.freebsd.org/changeset/base/225850 Log: MFC: r225806: This update eliminates the system hang reported in kern/160662 when taking a snapshot on a filesystem running with journaled soft updates. As journaled soft updates first appeared in 9.0, this will be the only MFC of this change. Approved by: re (kib) Reported by: Hans Ottevanger Fix verified by: Hans Ottevanger PR: kern/160662 Modified: stable/9/sys/ufs/ffs/ffs_snapshot.c Modified: stable/9/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_snapshot.c Wed Sep 28 19:01:15 2011 (r225849) +++ stable/9/sys/ufs/ffs/ffs_snapshot.c Wed Sep 28 19:36:21 2011 (r225850) @@ -203,7 +203,7 @@ ffs_snapshot(mp, snapfile) ufs2_daddr_t numblks, blkno, *blkp, *snapblklist; int error, cg, snaploc; int i, size, len, loc; - int flag; + uint64_t flag; struct timespec starttime = {0, 0}, endtime; char saved_nice = 0; long redo = 0, snaplistsize = 0; From owner-svn-src-stable@FreeBSD.ORG Wed Sep 28 19:38:48 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28089106564A; Wed, 28 Sep 2011 19:38:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6968FC21; Wed, 28 Sep 2011 19:38:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8SJclMW087022; Wed, 28 Sep 2011 19:38:47 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8SJclbt087020; Wed, 28 Sep 2011 19:38:47 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201109281938.p8SJclbt087020@svn.freebsd.org> From: Kirk McKusick Date: Wed, 28 Sep 2011 19:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225851 - stable/9/sys/ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 19:38:48 -0000 Author: mckusick Date: Wed Sep 28 19:38:47 2011 New Revision: 225851 URL: http://svn.freebsd.org/changeset/base/225851 Log: MFC r225807: This update eliminates a lock-order reversal warning discovered whle tracking down the system hang reported in kern/160662 and corrected in revision 225806 (MFC'ed as 225850). The LOR is not the cause of the system hang and indeed cannot cause an actual deadlock. However, it can be easily eliminated by defering the acquisition of a buflock until after all the vnode locks have been acquired. As journaled soft updates first appeared in 9.0, this will be the only MFC of this change. Approved by: re (kib) Reported by: Hans Ottevanger PR: kern/160662 Modified: stable/9/sys/ufs/ffs/ffs_snapshot.c Modified: stable/9/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_snapshot.c Wed Sep 28 19:36:21 2011 (r225850) +++ stable/9/sys/ufs/ffs/ffs_snapshot.c Wed Sep 28 19:38:47 2011 (r225851) @@ -212,7 +212,7 @@ ffs_snapshot(mp, snapfile) struct fs *copy_fs = NULL, *fs; struct thread *td = curthread; struct inode *ip, *xp; - struct buf *bp, *nbp, *ibp, *sbp = NULL; + struct buf *bp, *nbp, *ibp; struct nameidata nd; struct mount *wrtmp; struct vattr vat; @@ -460,21 +460,14 @@ restart: * Grab a copy of the superblock and its summary information. * We delay writing it until the suspension is released below. */ - error = bread(vp, lblkno(fs, fs->fs_sblockloc), fs->fs_bsize, - KERNCRED, &sbp); - if (error) { - brelse(sbp); - sbp = NULL; - goto out1; - } - loc = blkoff(fs, fs->fs_sblockloc); - copy_fs = (struct fs *)(sbp->b_data + loc); + copy_fs = malloc((u_long)fs->fs_bsize, M_UFSMNT, M_WAITOK); bcopy(fs, copy_fs, fs->fs_sbsize); if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) == 0) copy_fs->fs_clean = 1; size = fs->fs_bsize < SBLOCKSIZE ? fs->fs_bsize : SBLOCKSIZE; if (fs->fs_sbsize < size) - bzero(&sbp->b_data[loc + fs->fs_sbsize], size - fs->fs_sbsize); + bzero(&((char *)copy_fs)[fs->fs_sbsize], + size - fs->fs_sbsize); size = blkroundup(fs, fs->fs_cssize); if (fs->fs_contigsumsize > 0) size += fs->fs_ncg * sizeof(int32_t); @@ -490,8 +483,8 @@ restart: len, KERNCRED, &bp)) != 0) { brelse(bp); free(copy_fs->fs_csp, M_UFSMNT); - bawrite(sbp); - sbp = NULL; + free(copy_fs, M_UFSMNT); + copy_fs = NULL; goto out1; } bcopy(bp->b_data, space, (u_int)len); @@ -606,8 +599,8 @@ loop: vdrop(xvp); if (error) { free(copy_fs->fs_csp, M_UFSMNT); - bawrite(sbp); - sbp = NULL; + free(copy_fs, M_UFSMNT); + copy_fs = NULL; MNT_VNODE_FOREACH_ABORT(mp, mvp); goto out1; } @@ -621,8 +614,8 @@ loop: error = softdep_journal_lookup(mp, &xvp); if (error) { free(copy_fs->fs_csp, M_UFSMNT); - bawrite(sbp); - sbp = NULL; + free(copy_fs, M_UFSMNT); + copy_fs = NULL; goto out1; } xp = VTOI(xvp); @@ -688,8 +681,8 @@ loop: VI_UNLOCK(devvp); ASSERT_VOP_LOCKED(vp, "ffs_snapshot vp"); out1: - KASSERT((sn != NULL && sbp != NULL && error == 0) || - (sn == NULL && sbp == NULL && error != 0), + KASSERT((sn != NULL && copy_fs != NULL && error == 0) || + (sn == NULL && copy_fs == NULL && error != 0), ("email phk@ and mckusick@")); /* * Resume operation on filesystem. @@ -703,7 +696,7 @@ out1: vp->v_mount->mnt_stat.f_mntonname, (long)endtime.tv_sec, endtime.tv_nsec / 1000000, redo, fs->fs_ncg); } - if (sbp == NULL) + if (copy_fs == NULL) goto out; /* * Copy allocation information from all the snapshots in @@ -793,6 +786,15 @@ out1: space = (char *)space + fs->fs_bsize; bawrite(nbp); } + error = bread(vp, lblkno(fs, fs->fs_sblockloc), fs->fs_bsize, + KERNCRED, &nbp); + if (error) { + brelse(nbp); + } else { + loc = blkoff(fs, fs->fs_sblockloc); + bcopy((char *)copy_fs, &nbp->b_data[loc], fs->fs_bsize); + bawrite(nbp); + } /* * As this is the newest list, it is the most inclusive, so * should replace the previous list. @@ -822,7 +824,8 @@ out1: vrele(vp); /* Drop extra reference */ done: free(copy_fs->fs_csp, M_UFSMNT); - bawrite(sbp); + free(copy_fs, M_UFSMNT); + copy_fs = NULL; out: NDFREE(&nd, NDF_ONLY_PNBUF); if (saved_nice > 0) { From owner-svn-src-stable@FreeBSD.ORG Thu Sep 29 00:39:57 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50CE1106564A; Thu, 29 Sep 2011 00:39:57 +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 3CCCC8FC12; Thu, 29 Sep 2011 00:39:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8T0dveU096801; Thu, 29 Sep 2011 00:39:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T0dvEo096785; Thu, 29 Sep 2011 00:39:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109290039.p8T0dvEo096785@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 29 Sep 2011 00:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225855 - in stable/8/sys: amd64/amd64 amd64/ia32 amd64/include i386/i386 ia64/ia32 ia64/ia64 kern powerpc/aim powerpc/booke sparc64/sparc64 sun4v/sun4v sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 00:39:57 -0000 Author: kib Date: Thu Sep 29 00:39:56 2011 New Revision: 225855 URL: http://svn.freebsd.org/changeset/base/225855 Log: Merge the optimizations for the syscall entry and leave. MFC r225474: Inline the syscallenter() and syscallret(). This reduces the time measured by the syscall entry speed microbenchmarks by ~10% on amd64. MFC r225475: Perform amd64-specific microoptimizations for native syscall entry sequence. The effect is ~1% on the microbenchmark. In particular, do not restore registers which are preserved by the C calling sequence. Align the jump target. Avoid unneeded memory accesses by calculating some data in syscall entry trampoline. MFC r225483: The jump target shall be after the padding, not into it. MFC r225575: Microoptimize the return path for the fast syscalls on amd64. Arrange the code to have the fall-through path to follow the likely target. Do not use intermediate register to reload user %rsp. MFC r225576: Put amd64_syscall() prototype in md_var.h. Tested by: Alexandr Kovalenko Added: stable/8/sys/kern/subr_syscall.c - copied, changed from r225474, head/sys/kern/subr_syscall.c Modified: stable/8/sys/amd64/amd64/exception.S stable/8/sys/amd64/amd64/genassym.c stable/8/sys/amd64/amd64/trap.c stable/8/sys/amd64/ia32/ia32_syscall.c stable/8/sys/amd64/include/md_var.h stable/8/sys/i386/i386/trap.c stable/8/sys/ia64/ia32/ia32_trap.c stable/8/sys/ia64/ia64/trap.c stable/8/sys/kern/subr_trap.c stable/8/sys/powerpc/aim/trap.c stable/8/sys/powerpc/booke/trap.c stable/8/sys/sparc64/sparc64/trap.c stable/8/sys/sun4v/sun4v/trap.c stable/8/sys/sys/proc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/exception.S ============================================================================== --- stable/8/sys/amd64/amd64/exception.S Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/amd64/amd64/exception.S Thu Sep 29 00:39:56 2011 (r225855) @@ -380,8 +380,11 @@ IDTVEC(fast_syscall) movl $TF_HASSEGS,TF_FLAGS(%rsp) cld FAKE_MCOUNT(TF_RIP(%rsp)) - movq %rsp,%rdi - call syscall + movq PCPU(CURTHREAD),%rdi + movq %rsp,TD_FRAME(%rdi) + movl TF_RFLAGS(%rsp),%esi + andl $PSL_T,%esi + call amd64_syscall 1: movq PCPU(CURPCB),%rax /* Disable interrupts before testing PCB_FULL_IRET. */ cli @@ -390,29 +393,25 @@ IDTVEC(fast_syscall) /* Check for and handle AST's on return to userland. */ movq PCPU(CURTHREAD),%rax testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax) - je 2f - sti - movq %rsp, %rdi - call ast - jmp 1b -2: /* Restore preserved registers. */ + jne 2f + /* Restore preserved registers. */ MEXITCOUNT movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ movq TF_RSI(%rsp),%rsi /* bonus: preserve arg 2 */ movq TF_RDX(%rsp),%rdx /* return value 2 */ movq TF_RAX(%rsp),%rax /* return value 1 */ - movq TF_RBX(%rsp),%rbx /* C preserved */ - movq TF_RBP(%rsp),%rbp /* C preserved */ - movq TF_R12(%rsp),%r12 /* C preserved */ - movq TF_R13(%rsp),%r13 /* C preserved */ - movq TF_R14(%rsp),%r14 /* C preserved */ - movq TF_R15(%rsp),%r15 /* C preserved */ movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ movq TF_RIP(%rsp),%rcx /* original %rip */ - movq TF_RSP(%rsp),%r9 /* user stack pointer */ - movq %r9,%rsp /* original %rsp */ + movq TF_RSP(%rsp),%rsp /* user stack pointer */ swapgs sysretq + +2: /* AST scheduled. */ + sti + movq %rsp,%rdi + call ast + jmp 1b + 3: /* Requested full context restore, use doreti for that. */ MEXITCOUNT jmp doreti Modified: stable/8/sys/amd64/amd64/genassym.c ============================================================================== --- stable/8/sys/amd64/amd64/genassym.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/amd64/amd64/genassym.c Thu Sep 29 00:39:56 2011 (r225855) @@ -87,6 +87,7 @@ ASSYM(TD_PCB, offsetof(struct thread, td ASSYM(TD_PFLAGS, offsetof(struct thread, td_pflags)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_TID, offsetof(struct thread, td_tid)); +ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); Modified: stable/8/sys/amd64/amd64/trap.c ============================================================================== --- stable/8/sys/amd64/amd64/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/amd64/amd64/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -889,41 +889,37 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + /* * syscall - system call request C handler * * A system call is essentially treated as a trap. */ void -syscall(struct trapframe *frame) +amd64_syscall(struct thread *td, int traced) { - struct thread *td; struct syscall_args sa; - register_t orig_tf_rflags; int error; ksiginfo_t ksi; #ifdef DIAGNOSTIC - if (ISPL(frame->tf_cs) != SEL_UPL) { + if (ISPL(td->td_frame->tf_cs) != SEL_UPL) { panic("syscall"); /* NOT REACHED */ } #endif - orig_tf_rflags = frame->tf_rflags; - td = curthread; - td->td_frame = frame; - error = syscallenter(td, &sa); /* * Traced syscall. */ - if (orig_tf_rflags & PSL_T) { - frame->tf_rflags &= ~PSL_T; + if (__predict_false(traced)) { + td->td_frame->tf_rflags &= ~PSL_T; ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGTRAP; ksi.ksi_code = TRAP_TRACE; - ksi.ksi_addr = (void *)frame->tf_rip; + ksi.ksi_addr = (void *)td->td_frame->tf_rip; trapsignal(td, &ksi); } Modified: stable/8/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_syscall.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/amd64/ia32/ia32_syscall.c Thu Sep 29 00:39:56 2011 (r225855) @@ -156,6 +156,8 @@ ia32_fetch_syscall_args(struct thread *t return (error); } +#include "../../kern/subr_syscall.c" + void ia32_syscall(struct trapframe *frame) { Modified: stable/8/sys/amd64/include/md_var.h ============================================================================== --- stable/8/sys/amd64/include/md_var.h Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/amd64/include/md_var.h Thu Sep 29 00:39:56 2011 (r225855) @@ -75,6 +75,7 @@ struct fpreg; struct dbreg; struct dumperinfo; +void amd64_syscall(struct thread *td, int traced); void busdma_swi(void); void cpu_setregs(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); Modified: stable/8/sys/i386/i386/trap.c ============================================================================== --- stable/8/sys/i386/i386/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/i386/i386/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -1060,6 +1060,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + /* * syscall - system call request C handler * Modified: stable/8/sys/ia64/ia32/ia32_trap.c ============================================================================== --- stable/8/sys/ia64/ia32/ia32_trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/ia64/ia32/ia32_trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -144,6 +144,8 @@ ia32_fetch_syscall_args(struct thread *t return (error); } +#include "../../kern/subr_syscall.c" + static void ia32_syscall(struct trapframe *tf) { Modified: stable/8/sys/ia64/ia64/trap.c ============================================================================== --- stable/8/sys/ia64/ia64/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/ia64/ia64/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -936,6 +936,8 @@ cpu_fetch_syscall_args(struct thread *td return (0); } +#include "../../kern/subr_syscall.c" + /* * Process a system call. * Copied and modified: stable/8/sys/kern/subr_syscall.c (from r225474, head/sys/kern/subr_syscall.c) ============================================================================== --- head/sys/kern/subr_syscall.c Sun Sep 11 16:05:09 2011 (r225474, copy source) +++ stable/8/sys/kern/subr_syscall.c Thu Sep 29 00:39:56 2011 (r225855) @@ -38,13 +38,11 @@ * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 */ -#include "opt_capsicum.h" #include "opt_ktrace.h" #include "opt_kdtrace.h" __FBSDID("$FreeBSD$"); -#include #include #ifdef KTRACE #include @@ -100,22 +98,6 @@ syscallenter(struct thread *td, struct s goto retval; } -#ifdef CAPABILITY_MODE - /* - * In capability mode, we only allow access to system calls - * flagged with SYF_CAPENABLED. - */ - if (IN_CAPABILITY_MODE(td) && - !(sa->callp->sy_flags & SYF_CAPENABLED)) { - error = ECAPMODE; - goto retval; - } -#endif - - error = syscall_thread_enter(td, sa->callp); - if (error != 0) - goto retval; - #ifdef KDTRACE_HOOKS /* * If the systrace module has registered it's probe @@ -144,7 +126,6 @@ syscallenter(struct thread *td, struct s (*systrace_probe_func)(sa->callp->sy_return, sa->code, sa->callp, NULL, (error) ? -1 : td->td_retval[0]); #endif - syscall_thread_exit(td, sa->callp); CTR4(KTR_SYSC, "syscall: p=%p error=%d return %#lx %#lx", p, error, td->td_retval[0], td->td_retval[1]); } Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/kern/subr_trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -249,7 +249,6 @@ ast(struct trapframe *framep) mtx_assert(&Giant, MA_NOTOWNED); } -#ifdef HAVE_SYSCALL_ARGS_DEF const char * syscallname(struct proc *p, u_int code) { @@ -261,148 +260,3 @@ syscallname(struct proc *p, u_int code) return (unknown); return (sv->sv_syscallnames[code]); } - -int -syscallenter(struct thread *td, struct syscall_args *sa) -{ - struct proc *p; - int error, traced; - - PCPU_INC(cnt.v_syscall); - p = td->td_proc; - td->td_syscalls++; - - td->td_pticks = 0; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); - if (p->p_flag & P_TRACED) { - traced = 1; - PROC_LOCK(p); - td->td_dbgflags &= ~TDB_USERWR; - td->td_dbgflags |= TDB_SCE; - PROC_UNLOCK(p); - } else - traced = 0; - error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->args); -#endif - - CTR6(KTR_SYSC, -"syscall: td=%p pid %d %s (%#lx, %#lx, %#lx)", - td, td->td_proc->p_pid, syscallname(p, sa->code), - sa->args[0], sa->args[1], sa->args[2]); - - if (error == 0) { - STOPEVENT(p, S_SCE, sa->narg); - PTRACESTOP_SC(p, td, S_PT_SCE); - if (td->td_dbgflags & TDB_USERWR) { - /* - * Reread syscall number and arguments if - * debugger modified registers or memory. - */ - error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->args); -#endif - if (error != 0) - goto retval; - } - -#ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'entry', process the probe. - */ - if (systrace_probe_func != NULL && sa->callp->sy_entry != 0) - (*systrace_probe_func)(sa->callp->sy_entry, sa->code, - sa->callp, sa->args, 0); -#endif - - AUDIT_SYSCALL_ENTER(sa->code, td); - error = (sa->callp->sy_call)(td, sa->args); - AUDIT_SYSCALL_EXIT(error, td); - - /* Save the latest error return value. */ - td->td_errno = error; - -#ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'return', process the probe. - */ - if (systrace_probe_func != NULL && sa->callp->sy_return != 0) - (*systrace_probe_func)(sa->callp->sy_return, sa->code, - sa->callp, NULL, (error) ? -1 : td->td_retval[0]); -#endif - CTR4(KTR_SYSC, "syscall: p=%p error=%d return %#lx %#lx", - p, error, td->td_retval[0], td->td_retval[1]); - } - retval: - if (traced) { - PROC_LOCK(p); - td->td_dbgflags &= ~TDB_SCE; - PROC_UNLOCK(p); - } - (p->p_sysent->sv_set_syscall_retval)(td, error); - return (error); -} - -void -syscallret(struct thread *td, int error, struct syscall_args *sa __unused) -{ - struct proc *p; - int traced; - - p = td->td_proc; - - /* - * Check for misbehavior. - */ - WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - syscallname(p, sa->code)); - KASSERT(td->td_critnest == 0, - ("System call %s returning in a critical section", - syscallname(p, sa->code))); - KASSERT(td->td_locks == 0, - ("System call %s returning with %d locks held", - syscallname(p, sa->code), td->td_locks)); - - /* - * Handle reschedule and other end-of-syscall issues - */ - userret(td, td->td_frame); - - CTR4(KTR_SYSC, "syscall %s exit thread %p pid %d proc %s", - syscallname(p, sa->code), td, td->td_proc->p_pid, td->td_name); - -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(sa->code, error, td->td_retval[0]); -#endif - - if (p->p_flag & P_TRACED) { - traced = 1; - PROC_LOCK(p); - td->td_dbgflags |= TDB_SCX; - PROC_UNLOCK(p); - } else - traced = 0; - /* - * This works because errno is findable through the - * register set. If we ever support an emulation where this - * is not the case, this code will need to be revisited. - */ - STOPEVENT(p, S_SCX, sa->code); - PTRACESTOP_SC(p, td, S_PT_SCX); - if (traced || (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0) { - PROC_LOCK(p); - td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); - PROC_UNLOCK(p); - } -} -#endif /* HAVE_SYSCALL_ARGS_DEF */ Modified: stable/8/sys/powerpc/aim/trap.c ============================================================================== --- stable/8/sys/powerpc/aim/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/powerpc/aim/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -394,6 +394,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + void syscall(struct trapframe *frame) { Modified: stable/8/sys/powerpc/booke/trap.c ============================================================================== --- stable/8/sys/powerpc/booke/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/powerpc/booke/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -379,6 +379,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + void syscall(struct trapframe *frame) { Modified: stable/8/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/sparc64/sparc64/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -614,6 +614,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + /* * Syscall handler * The arguments to the syscall are passed in the out registers by the caller, Modified: stable/8/sys/sun4v/sun4v/trap.c ============================================================================== --- stable/8/sys/sun4v/sun4v/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/sun4v/sun4v/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -610,6 +610,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + /* * Syscall handler. The arguments to the syscall are passed in the o registers * by the caller, and are saved in the trap frame. The syscall number is passed Modified: stable/8/sys/sys/proc.h ============================================================================== --- stable/8/sys/sys/proc.h Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/sys/proc.h Thu Sep 29 00:39:56 2011 (r225855) @@ -853,9 +853,6 @@ void cpu_switch(struct thread *, struct void cpu_throw(struct thread *, struct thread *) __dead2; void unsleep(struct thread *); void userret(struct thread *, struct trapframe *); -struct syscall_args; -int syscallenter(struct thread *, struct syscall_args *); -void syscallret(struct thread *, int, struct syscall_args *); void cpu_exit(struct thread *); void exit1(struct thread *, int) __dead2; From owner-svn-src-stable@FreeBSD.ORG Thu Sep 29 10:38:00 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AB1A10656D8; Thu, 29 Sep 2011 10:38:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CDC58FC1B; Thu, 29 Sep 2011 10:38:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8TAc0fA018038; Thu, 29 Sep 2011 10:38:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8TAc0Ct018036; Thu, 29 Sep 2011 10:38:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109291038.p8TAc0Ct018036@svn.freebsd.org> From: Alexander Motin Date: Thu, 29 Sep 2011 10:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225873 - stable/9/sys/dev/ahci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 10:38:00 -0000 Author: mav Date: Thu Sep 29 10:37:59 2011 New Revision: 225873 URL: http://svn.freebsd.org/changeset/base/225873 Log: MFC r225789: Add one more ID for the Marvell 88SE9128 6Gbps SATA controller. Approved by: re (kib) Modified: stable/9/sys/dev/ahci/ahci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Thu Sep 29 10:37:42 2011 (r225872) +++ stable/9/sys/dev/ahci/ahci.c Thu Sep 29 10:37:59 2011 (r225873) @@ -197,6 +197,7 @@ static struct { {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, {0x91251b4b, 0x00, "Marvell 88SE9125", AHCI_Q_NOBSYRES}, + {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES}, {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES}, {0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, From owner-svn-src-stable@FreeBSD.ORG Thu Sep 29 10:42:52 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C96C1065674; Thu, 29 Sep 2011 10:42:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F0F08FC13; Thu, 29 Sep 2011 10:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8TAgqDO018232; Thu, 29 Sep 2011 10:42:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8TAgqWL018230; Thu, 29 Sep 2011 10:42:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109291042.p8TAgqWL018230@svn.freebsd.org> From: Alexander Motin Date: Thu, 29 Sep 2011 10:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225874 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 10:42:52 -0000 Author: mav Date: Thu Sep 29 10:42:51 2011 New Revision: 225874 URL: http://svn.freebsd.org/changeset/base/225874 Log: MFC r225789: Add one more ID for the Marvell 88SE9128 6Gbps SATA controller. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Thu Sep 29 10:37:59 2011 (r225873) +++ stable/8/sys/dev/ahci/ahci.c Thu Sep 29 10:42:51 2011 (r225874) @@ -197,6 +197,7 @@ static struct { {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, {0x91251b4b, 0x00, "Marvell 88SE9125", AHCI_Q_NOBSYRES}, + {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES}, {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES}, {0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, From owner-svn-src-stable@FreeBSD.ORG Thu Sep 29 15:05:17 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BBA01065675; Thu, 29 Sep 2011 15:05:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEC7E8FC13; Thu, 29 Sep 2011 15:05:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8TF5GhT028105; Thu, 29 Sep 2011 15:05:16 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8TF5G13028102; Thu, 29 Sep 2011 15:05:16 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201109291505.p8TF5G13028102@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 29 Sep 2011 15:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225876 - in stable/8/sys: modules/netgraph/ipfw netgraph X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 15:05:17 -0000 Author: ae Date: Thu Sep 29 15:05:16 2011 New Revision: 225876 URL: http://svn.freebsd.org/changeset/base/225876 Log: MFC r225586: Add IPv6 support to the ng_ipfw(4) [1]. Also add ifdefs to be able build it with and without INET/INET6 support. Submitted by: Alexander V. Chernikov [1] Tested by: Alexander V. Chernikov [1] Modified: stable/8/sys/modules/netgraph/ipfw/Makefile stable/8/sys/netgraph/ng_ipfw.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/modules/netgraph/ipfw/Makefile ============================================================================== --- stable/8/sys/modules/netgraph/ipfw/Makefile Thu Sep 29 14:19:34 2011 (r225875) +++ stable/8/sys/modules/netgraph/ipfw/Makefile Thu Sep 29 15:05:16 2011 (r225876) @@ -1,6 +1,20 @@ # $FreeBSD$ +.include + KMOD= ng_ipfw -SRCS= ng_ipfw.c +SRCS= ng_ipfw.c opt_inet.h opt_inet6.h + +.if !defined(KERNBUILDDIR) + +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + echo "#define INET 1" > ${.TARGET} +.endif +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + echo "#define INET6 1" > ${.TARGET} +.endif +.endif .include Modified: stable/8/sys/netgraph/ng_ipfw.c ============================================================================== --- stable/8/sys/netgraph/ng_ipfw.c Thu Sep 29 14:19:34 2011 (r225875) +++ stable/8/sys/netgraph/ng_ipfw.c Thu Sep 29 15:05:16 2011 (r225876) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include #include @@ -47,6 +50,8 @@ #include #include #include +#include +#include #include #include @@ -224,6 +229,7 @@ ng_ipfw_rcvdata(hook_p hook, item_p item struct m_tag *tag; struct ipfw_rule_ref *r; struct mbuf *m; + struct ip *ip; NGI_GET_M(item, m); NG_FREE_ITEM(item); @@ -234,23 +240,47 @@ ng_ipfw_rcvdata(hook_p hook, item_p item return (EINVAL); /* XXX: find smth better */ }; + if (m->m_len < sizeof(struct ip) && + (m = m_pullup(m, sizeof(struct ip))) == NULL) + return (EINVAL); + + ip = mtod(m, struct ip *); + r = (struct ipfw_rule_ref *)(tag + 1); if (r->info & IPFW_INFO_IN) { - ip_input(m); + switch (ip->ip_v) { +#ifdef INET + case IPVERSION: + ip_input(m); + break; +#endif +#ifdef INET6 + case IPV6_VERSION >> 4: + ip6_input(m); + break; +#endif + default: + NG_FREE_M(m); + return (EINVAL); + } return (0); } else { - struct ip *ip; - - if (m->m_len < sizeof(struct ip) && - (m = m_pullup(m, sizeof(struct ip))) == NULL) + switch (ip->ip_v) { +#ifdef INET + case IPVERSION: + SET_HOST_IPLEN(ip); + return (ip_output(m, NULL, NULL, IP_FORWARDING, + NULL, NULL)); +#endif +#ifdef INET6 + case IPV6_VERSION >> 4: + return (ip6_output(m, NULL, NULL, 0, NULL, + NULL, NULL)); +#endif + default: return (EINVAL); - - ip = mtod(m, struct ip *); - - SET_HOST_IPLEN(ip); - - return ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); - } + } + } } static int From owner-svn-src-stable@FreeBSD.ORG Thu Sep 29 18:42:44 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 916BE106567F; Thu, 29 Sep 2011 18:42:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7C58FC1B; Thu, 29 Sep 2011 18:42:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8TIgiYO034836; Thu, 29 Sep 2011 18:42:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8TIgihh034832; Thu, 29 Sep 2011 18:42:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109291842.p8TIgihh034832@svn.freebsd.org> From: Alexander Motin Date: Thu, 29 Sep 2011 18:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225881 - in stable/7: sbin/geom/class/mirror sys/geom/mirror X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 18:42:44 -0000 Author: mav Date: Thu Sep 29 18:42:44 2011 New Revision: 225881 URL: http://svn.freebsd.org/changeset/base/225881 Log: MFC r196879: Add support for changing providers priority. PR: kern/160811 Modified: stable/7/sbin/geom/class/mirror/geom_mirror.c stable/7/sbin/geom/class/mirror/gmirror.8 stable/7/sys/geom/mirror/g_mirror_ctl.c Directory Properties: stable/7/sbin/geom/ (props changed) stable/7/sbin/geom/class/journal/ (props changed) stable/7/sbin/geom/class/label/ (props changed) stable/7/sbin/geom/class/part/ (props changed) stable/7/sbin/geom/class/stripe/ (props changed) stable/7/sbin/geom/misc/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- stable/7/sbin/geom/class/mirror/geom_mirror.c Thu Sep 29 18:12:40 2011 (r225880) +++ stable/7/sbin/geom/class/mirror/geom_mirror.c Thu Sep 29 18:42:44 2011 (r225881) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004-2005 Pawel Jakub Dawidek + * Copyright (c) 2004-2009 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,13 +41,12 @@ __FBSDID("$FreeBSD$"); #include #include - uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_MIRROR_VERSION; static char label_balance[] = "load", configure_balance[] = "none"; static intmax_t label_slice = 4096, configure_slice = -1; -static intmax_t insert_priority = 0; +static intmax_t insert_priority = 0, configure_priority = -1; static void mirror_main(struct gctl_req *req, unsigned flags); static void mirror_activate(struct gctl_req *req); @@ -71,10 +70,12 @@ struct g_command class_commands[] = { { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'h', "hardcode", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, { 's', "slice", &configure_slice, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-adfFhnv] [-b balance] [-s slice] name" + NULL, "[-adfFhnv] [-b balance] [-s slice] name\n" + "[-v] -p priority name prov" }, { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, "[-v] name prov ..." Modified: stable/7/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- stable/7/sbin/geom/class/mirror/gmirror.8 Thu Sep 29 18:12:40 2011 (r225880) +++ stable/7/sbin/geom/class/mirror/gmirror.8 Thu Sep 29 18:42:44 2011 (r225881) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek +.\" Copyright (c) 2004-2009 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2006 +.Dd August 1, 2009 .Dt GMIRROR 8 .Os .Sh NAME @@ -49,6 +49,12 @@ .Op Fl s Ar slice .Ar name .Nm +.Cm configure +.Op Fl v +.Fl p Ar priority +.Ar name +.Ar prov +.Nm .Cm rebuild .Op Fl v .Ar name @@ -115,8 +121,8 @@ indicates an action to be performed: .It Cm label Create a mirror. The order of components is important, because a component's priority is based on its position -(starting from 0). -The component with the biggest priority is used by the +(starting from 0 to 255). +The component with the biggest priority (the lowest number) is used by the .Cm prefer balance algorithm and is also used as a master component when resynchronization is needed, @@ -159,7 +165,7 @@ Clear metadata on the given providers. Configure the given device. .Pp Additional options include: -.Bl -tag -width ".Fl b Ar balance" +.Bl -tag -width ".Fl p Ar priority" .It Fl a Turn on autosynchronization of stale components. .It Fl b Ar balance @@ -175,6 +181,9 @@ Assumes device is in consistent state. Hardcode providers' names in metadata. .It Fl n Turn off autosynchronization of stale components. +.It Fl p Ar priority +Specifies priority for the given component +.Ar prov . .It Fl s Ar slice Specifies slice size for .Cm split Modified: stable/7/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- stable/7/sys/geom/mirror/g_mirror_ctl.c Thu Sep 29 18:12:40 2011 (r225880) +++ stable/7/sys/geom/mirror/g_mirror_ctl.c Thu Sep 29 18:42:44 2011 (r225881) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004-2006 Pawel Jakub Dawidek + * Copyright (c) 2004-2009 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -93,19 +93,19 @@ g_mirror_ctl_configure(struct gctl_req * { struct g_mirror_softc *sc; struct g_mirror_disk *disk; - const char *name, *balancep; - intmax_t *slicep; + const char *name, *balancep, *prov; + intmax_t *slicep, *priority; uint32_t slice; uint8_t balance; int *autosync, *noautosync, *failsync, *nofailsync, *hardcode, *dynamic; - int *nargs, do_sync = 0, dirty = 1; + int *nargs, do_sync = 0, dirty = 1, do_priority = 0; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { gctl_error(req, "No '%s' argument.", "nargs"); return; } - if (*nargs != 1) { + if (*nargs != 1 && *nargs != 2) { gctl_error(req, "Invalid number of arguments."); return; } @@ -149,6 +149,29 @@ g_mirror_ctl_configure(struct gctl_req * gctl_error(req, "No '%s' argument.", "dynamic"); return; } + priority = gctl_get_paraml(req, "priority", sizeof(*priority)); + if (priority == NULL) { + gctl_error(req, "No '%s' argument.", "priority"); + return; + } + if (*priority < -1 || *priority > 255) { + gctl_error(req, "Priority range is 0 to 255, %jd given", + *priority); + return; + } + /* + * Since we have a priority, we also need a provider now. + * Note: be WARNS safe, by always assigning prov and only throw an + * error if *priority != -1. + */ + prov = gctl_get_asciiparam(req, "arg1"); + if (*priority > -1) { + if (prov == NULL) { + gctl_error(req, "Priority needs a disk name"); + return; + } + do_priority = 1; + } if (*autosync && *noautosync) { gctl_error(req, "'%s' and '%s' specified.", "autosync", "noautosync"); @@ -189,19 +212,32 @@ g_mirror_ctl_configure(struct gctl_req * slice = sc->sc_slice; else slice = *slicep; - if (g_mirror_ndisks(sc, -1) < sc->sc_ndisks) { + /* Enforce usage() of -p not allowing any other options. */ + if (do_priority && (*autosync || *noautosync || *failsync || + *nofailsync || *hardcode || *dynamic || *slicep != -1 || + strcmp(balancep, "none") != 0)) { sx_xunlock(&sc->sc_lock); - gctl_error(req, "Not all disks connected. Try 'forget' command " - "first."); + gctl_error(req, "only -p accepted when setting priority"); return; } if (sc->sc_balance == balance && sc->sc_slice == slice && !*autosync && !*noautosync && !*failsync && !*nofailsync && !*hardcode && - !*dynamic) { + !*dynamic && !do_priority) { sx_xunlock(&sc->sc_lock); gctl_error(req, "Nothing has changed."); return; } + if ((!do_priority && *nargs != 1) || (do_priority && *nargs != 2)) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Invalid number of arguments."); + return; + } + if (g_mirror_ndisks(sc, -1) < sc->sc_ndisks) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Not all disks connected. Try 'forget' command " + "first."); + return; + } sc->sc_balance = balance; sc->sc_slice = slice; if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_NOAUTOSYNC) != 0) { @@ -223,6 +259,23 @@ g_mirror_ctl_configure(struct gctl_req * } } LIST_FOREACH(disk, &sc->sc_disks, d_next) { + /* + * Handle priority first, since we only need one disk, do one + * operation on it and then we're done. No need to check other + * flags, as usage doesn't allow it. + */ + if (do_priority) { + if (strcmp(disk->d_name, prov) == 0) { + if (disk->d_priority == *priority) + gctl_error(req, "Nothing has changed."); + else { + disk->d_priority = *priority; + g_mirror_update_metadata(disk); + } + break; + } + continue; + } if (do_sync) { if (disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING) disk->d_flags &= ~G_MIRROR_DISK_FLAG_FORCE_SYNC; From owner-svn-src-stable@FreeBSD.ORG Sat Oct 1 11:49:25 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42D8F106566B; Sat, 1 Oct 2011 11:49:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28ED78FC0A; Sat, 1 Oct 2011 11:49:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91BnPLV015804; Sat, 1 Oct 2011 11:49:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91BnP96015802; Sat, 1 Oct 2011 11:49:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110011149.p91BnP96015802@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Oct 2011 11:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225895 - stable/8/lib/libthr/thread X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 11:49:25 -0000 Author: kib Date: Sat Oct 1 11:49:24 2011 New Revision: 225895 URL: http://svn.freebsd.org/changeset/base/225895 Log: MFC r211526: Reduce redundant code. Modified: stable/8/lib/libthr/thread/thr_sig.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_sig.c ============================================================================== --- stable/8/lib/libthr/thread/thr_sig.c Sat Oct 1 10:18:55 2011 (r225894) +++ stable/8/lib/libthr/thread/thr_sig.c Sat Oct 1 11:49:24 2011 (r225895) @@ -233,23 +233,26 @@ _pthread_sigmask(int how, const sigset_t __weak_reference(__sigsuspend, sigsuspend); -int -_sigsuspend(const sigset_t * set) +static const sigset_t * +thr_remove_thr_signals(const sigset_t *set, sigset_t *newset) { - sigset_t newset; const sigset_t *pset; - int ret; if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; + *newset = *set; + SIGDELSET(*newset, SIGCANCEL); + pset = newset; } else pset = set; + return (pset); +} - ret = __sys_sigsuspend(pset); +int +_sigsuspend(const sigset_t * set) +{ + sigset_t newset; - return (ret); + return (__sys_sigsuspend(thr_remove_thr_signals(set, &newset))); } int @@ -257,18 +260,10 @@ __sigsuspend(const sigset_t * set) { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - _thr_cancel_enter(curthread); - ret = __sys_sigsuspend(pset); + ret = __sys_sigsuspend(thr_remove_thr_signals(set, &newset)); _thr_cancel_leave(curthread); return (ret); @@ -283,17 +278,9 @@ _sigtimedwait(const sigset_t *set, sigin const struct timespec * timeout) { sigset_t newset; - const sigset_t *pset; - int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - ret = __sys_sigtimedwait(pset, info, timeout); - return (ret); + return (__sys_sigtimedwait(thr_remove_thr_signals(set, &newset), info, + timeout)); } int @@ -302,17 +289,11 @@ __sigtimedwait(const sigset_t *set, sigi { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; _thr_cancel_enter(curthread); - ret = __sys_sigtimedwait(pset, info, timeout); + ret = __sys_sigtimedwait(thr_remove_thr_signals(set, &newset), info, + timeout); _thr_cancel_leave(curthread); return (ret); } @@ -321,18 +302,8 @@ int _sigwaitinfo(const sigset_t *set, siginfo_t *info) { sigset_t newset; - const sigset_t *pset; - int ret; - - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - ret = __sys_sigwaitinfo(pset, info); - return (ret); + return (__sys_sigwaitinfo(thr_remove_thr_signals(set, &newset), info)); } int @@ -340,18 +311,10 @@ __sigwaitinfo(const sigset_t *set, sigin { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - _thr_cancel_enter(curthread); - ret = __sys_sigwaitinfo(pset, info); + ret = __sys_sigwaitinfo(thr_remove_thr_signals(set, &newset), info); _thr_cancel_leave(curthread); return (ret); } @@ -360,18 +323,8 @@ int _sigwait(const sigset_t *set, int *sig) { sigset_t newset; - const sigset_t *pset; - int ret; - - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - ret = __sys_sigwait(pset, sig); - return (ret); + return (__sys_sigwait(thr_remove_thr_signals(set, &newset), sig)); } int @@ -379,18 +332,10 @@ __sigwait(const sigset_t *set, int *sig) { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - _thr_cancel_enter(curthread); - ret = __sys_sigwait(pset, sig); + ret = __sys_sigwait(thr_remove_thr_signals(set, &newset), sig); _thr_cancel_leave(curthread); return (ret); } From owner-svn-src-stable@FreeBSD.ORG Sat Oct 1 11:59:45 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4FD9106566C; Sat, 1 Oct 2011 11:59:45 +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 932A98FC17; Sat, 1 Oct 2011 11:59:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91BxjqG016153; Sat, 1 Oct 2011 11:59:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91Bxj1N016147; Sat, 1 Oct 2011 11:59:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110011159.p91Bxj1N016147@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Oct 2011 11:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225896 - in stable/8/lib: libc/stdlib libc/sys libthr/thread X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 11:59:45 -0000 Author: kib Date: Sat Oct 1 11:59:45 2011 New Revision: 225896 URL: http://svn.freebsd.org/changeset/base/225896 Log: MFC r212405 (by davidxu): Because POSIX does not allow EINTR to be returned from sigwait(), add a wrapper for it in libc and rework the code in libthr, the system call still can return EINTR, we keep this feature. Discussed with: davidxu Added: stable/8/lib/libc/sys/sigwait.c - copied unchanged from r212405, head/lib/libc/sys/sigwait.c Modified: stable/8/lib/libc/stdlib/Makefile.inc stable/8/lib/libc/sys/Makefile.inc stable/8/lib/libc/sys/Symbol.map stable/8/lib/libthr/thread/thr_sig.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/8/lib/libc/stdlib/Makefile.inc Sat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libc/stdlib/Makefile.inc Sat Oct 1 11:59:45 2011 (r225896) @@ -9,7 +9,7 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate getsubopt.c hcreate.c heapsort.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c malloc.c \ merge.c ptsname.c qsort.c qsort_r.c radixsort.c rand.c random.c \ - reallocf.c realpath.c remque.c strfmon.c strtoimax.c \ + reallocf.c realpath.c remque.c sigwait.c strfmon.c strtoimax.c \ strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c Modified: stable/8/lib/libc/sys/Makefile.inc ============================================================================== --- stable/8/lib/libc/sys/Makefile.inc Sat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libc/sys/Makefile.inc Sat Oct 1 11:59:45 2011 (r225896) @@ -23,6 +23,9 @@ SRCS+= stack_protector.c stack_protector SRCS+= fcntl.c ftruncate.c lseek.c mmap.c pread.c pwrite.c truncate.c PSEUDO+= _fcntl.o .endif +SRCS+= sigwait.c +NOASM+= sigwait.o +PSEUDO+= _sigwait.o # Add machine dependent asm sources: SRCS+=${MDASM} Modified: stable/8/lib/libc/sys/Symbol.map ============================================================================== --- stable/8/lib/libc/sys/Symbol.map Sat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libc/sys/Symbol.map Sat Oct 1 11:59:45 2011 (r225896) @@ -917,6 +917,7 @@ FBSDprivate_1.0 { _sigtimedwait; __sys_sigtimedwait; _sigwait; + __sigwait; __sys_sigwait; _sigwaitinfo; __sys_sigwaitinfo; Copied: stable/8/lib/libc/sys/sigwait.c (from r212405, head/lib/libc/sys/sigwait.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libc/sys/sigwait.c Sat Oct 1 11:59:45 2011 (r225896, copy of r212405, head/lib/libc/sys/sigwait.c) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2010 davidxu@freebsd.org + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +int __sys_sigwait(const sigset_t * restrict, int * restrict); + +__weak_reference(__sigwait, sigwait); + +int +__sigwait(const sigset_t * restrict set, int * restrict sig) +{ + int ret; + + /* POSIX does not allow EINTR to be returned */ + do { + ret = __sys_sigwait(set, sig); + } while (ret == EINTR); + return (ret); +} Modified: stable/8/lib/libthr/thread/thr_sig.c ============================================================================== --- stable/8/lib/libthr/thread/thr_sig.c Sat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libthr/thread/thr_sig.c Sat Oct 1 11:59:45 2011 (r225896) @@ -56,7 +56,7 @@ int _sigtimedwait(const sigset_t *set, s const struct timespec * timeout); int __sigwaitinfo(const sigset_t *set, siginfo_t *info); int _sigwaitinfo(const sigset_t *set, siginfo_t *info); -int __sigwait(const sigset_t *set, int *sig); +int ___sigwait(const sigset_t *set, int *sig); int _sigwait(const sigset_t *set, int *sig); int __sigsuspend(const sigset_t *sigmask); @@ -269,7 +269,7 @@ __sigsuspend(const sigset_t * set) return (ret); } -__weak_reference(__sigwait, sigwait); +__weak_reference(___sigwait, sigwait); __weak_reference(__sigtimedwait, sigtimedwait); __weak_reference(__sigwaitinfo, sigwaitinfo); @@ -328,14 +328,16 @@ _sigwait(const sigset_t *set, int *sig) } int -__sigwait(const sigset_t *set, int *sig) +___sigwait(const sigset_t *set, int *sig) { struct pthread *curthread = _get_curthread(); sigset_t newset; int ret; - _thr_cancel_enter(curthread); - ret = __sys_sigwait(thr_remove_thr_signals(set, &newset), sig); - _thr_cancel_leave(curthread); + do { + _thr_cancel_enter(curthread); + ret = __sys_sigwait(thr_remove_thr_signals(set, &newset), sig); + _thr_cancel_leave(curthread); + } while (ret == EINTR); return (ret); } From owner-svn-src-stable@FreeBSD.ORG Sat Oct 1 12:35:10 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72F78106566C; Sat, 1 Oct 2011 12:35:10 +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 48CC78FC08; Sat, 1 Oct 2011 12:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91CZABQ017275; Sat, 1 Oct 2011 12:35:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91CZAoQ017272; Sat, 1 Oct 2011 12:35:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110011235.p91CZAoQ017272@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Oct 2011 12:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225898 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 12:35:10 -0000 Author: kib Date: Sat Oct 1 12:35:09 2011 New Revision: 225898 URL: http://svn.freebsd.org/changeset/base/225898 Log: MFC r225172: Clarify the behaviour of sigwait() on signal interruption, and note the difference between sigwait() and sigtimedwait()/sigwaitinfo(). Modified: stable/8/lib/libc/sys/sigwait.2 stable/8/lib/libc/sys/sigwaitinfo.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/sigwait.2 ============================================================================== --- stable/8/lib/libc/sys/sigwait.2 Sat Oct 1 12:19:48 2011 (r225897) +++ stable/8/lib/libc/sys/sigwait.2 Sat Oct 1 12:35:09 2011 (r225898) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGWAIT 2 .Os .Sh NAME @@ -82,6 +82,14 @@ selected, it will be the lowest numbered The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified. +.Sh IMPLEMENTATION NOTES +The +.Fn sigwait +function is implemented as a wrapper around the +.Fn __sys_sigwait +system call, which retries the call on +.Er EINTR +error. .Sh RETURN VALUES If successful, .Fn sigwait Modified: stable/8/lib/libc/sys/sigwaitinfo.2 ============================================================================== --- stable/8/lib/libc/sys/sigwaitinfo.2 Sat Oct 1 12:19:48 2011 (r225897) +++ stable/8/lib/libc/sys/sigwaitinfo.2 Sat Oct 1 12:35:09 2011 (r225898) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGTIMEDWAIT 2 .Os .Sh NAME @@ -116,6 +116,16 @@ except that the selected signal number s member, and the cause of the signal shall be stored in the .Va si_code member. +Besides this, the +.Fn sigwaitinfo +and +.Fn sigtimedwait +system calls may return +.Er EINTR +if interrupted by signal, which is not allowed for the +.Fn sigwait +function. +.Pp If any value is queued to the selected signal, the first such queued value is dequeued and, if the info argument is .Pf non- Dv NULL , From owner-svn-src-stable@FreeBSD.ORG Sat Oct 1 13:47:50 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75699106566B; Sat, 1 Oct 2011 13:47:50 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 647178FC16; Sat, 1 Oct 2011 13:47:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91DloRc019982; Sat, 1 Oct 2011 13:47:50 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91DloAl019980; Sat, 1 Oct 2011 13:47:50 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201110011347.p91DloAl019980@svn.freebsd.org> From: Gabor Kovesdan Date: Sat, 1 Oct 2011 13:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225902 - stable/9/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 13:47:50 -0000 Author: gabor Date: Sat Oct 1 13:47:50 2011 New Revision: 225902 URL: http://svn.freebsd.org/changeset/base/225902 Log: MFC: r225775 - Move misplaced reference - Sort references - s/Since/Because/ Approved by: re (kib) Modified: stable/9/share/man/man4/smp.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/smp.4 ============================================================================== --- stable/9/share/man/man4/smp.4 Sat Oct 1 13:33:14 2011 (r225901) +++ stable/9/share/man/man4/smp.4 Sat Oct 1 13:47:50 2011 (r225902) @@ -120,25 +120,24 @@ tasks on CPUs that are closely grouped t .Pp .Fx supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. -Since using logical CPUs can cause performance penalties under certain loads, +Because using logical CPUs can cause performance penalties under certain loads, the logical CPUs can be disabled by setting the .Va machdep.hyperthreading_allowed tunable to zero. -.Xr cpuset 1 . .Sh SEE ALSO +.Xr cpuset 1 , .Xr mptable 1 , +.Xr sched_4bsd 4 , +.Xr sched_ule 4 , .Xr loader 8 , .Xr sysctl 8 , .Xr condvar 9 , .Xr msleep 9 , .Xr mtx_pool 9 , .Xr mutex 9 , -.Xr sema 9 , -.Xr sx 9 , .Xr rwlock 9 , -.Xr sched_4bsd 4 , -.Xr sched_ule 4 , -.Xr cpuset 1 +.Xr sema 9 , +.Xr sx 9 .Sh HISTORY The .Nm From owner-svn-src-stable@FreeBSD.ORG Sat Oct 1 13:54:49 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BD03106566C; Sat, 1 Oct 2011 13:54:49 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AD568FC08; Sat, 1 Oct 2011 13:54:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91DsmV0020398; Sat, 1 Oct 2011 13:54:48 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91Dsm58020396; Sat, 1 Oct 2011 13:54:48 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201110011354.p91Dsm58020396@svn.freebsd.org> From: Gabor Kovesdan Date: Sat, 1 Oct 2011 13:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225903 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 13:54:49 -0000 Author: gabor Date: Sat Oct 1 13:54:48 2011 New Revision: 225903 URL: http://svn.freebsd.org/changeset/base/225903 Log: MFC: r225775 - Move misplaced reference - Sort references - s/Since/Because/ Modified: stable/8/share/man/man4/smp.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/smp.4 ============================================================================== --- stable/8/share/man/man4/smp.4 Sat Oct 1 13:47:50 2011 (r225902) +++ stable/8/share/man/man4/smp.4 Sat Oct 1 13:54:48 2011 (r225903) @@ -120,25 +120,25 @@ tasks on CPUs that are closely grouped t .Pp .Fx supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. -Since using logical CPUs can cause performance penalties under certain loads, +Because using logical CPUs can cause performance penalties under certain loads, the logical CPUs can be disabled by setting the .Va machdep.hlt_logical_cpus sysctl to one. Note that this operation is different from the mechanism used by the -.Xr cpuset 1 . .Sh SEE ALSO +.Xr cpuset 1 , .Xr mptable 1 , +.Xr sched_4bsd 4 , +.Xr sched_ule 4 , +.Xr loader 8 , .Xr sysctl 8 , .Xr condvar 9 , .Xr msleep 9 , .Xr mtx_pool 9 , .Xr mutex 9 , -.Xr sema 9 , -.Xr sx 9 , .Xr rwlock 9 , -.Xr sched_4bsd 4 , -.Xr sched_ule 4 , -.Xr cpuset 1 +.Xr sema 9 , +.Xr sx 9 .Sh HISTORY The .Nm From owner-svn-src-stable@FreeBSD.ORG Sat Oct 1 15:32:54 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 836B41065673; Sat, 1 Oct 2011 15:32:54 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 08C728FC08; Sat, 1 Oct 2011 15:32:53 +0000 (UTC) Received: by ywp17 with SMTP id 17so2937174ywp.13 for ; Sat, 01 Oct 2011 08:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=kNzumgCM8bi5u40iTBGFo6njY6BS+ktTxzgM4Fv6t1M=; b=u64cXPe0FZNjHpefC+pC9hlRDhK50C9rfpuTqhLXPNED8LA4BN33J6MWhxKxvbIK73 Yww9knJsbfvKGoyN4e12HD9ituMS7R2PHwQ42MVHQaYkieOijjSW0vlqXaSpgY8OSDOO vslNLqV4/Jus3a5ALYnpgFyVdGgZ0yRcEgghQ= MIME-Version: 1.0 Received: by 10.236.103.102 with SMTP id e66mr27283026yhg.1.1317481534999; Sat, 01 Oct 2011 08:05:34 -0700 (PDT) Received: by 10.236.103.130 with HTTP; Sat, 1 Oct 2011 08:05:34 -0700 (PDT) In-Reply-To: <201110011235.p91CZAoQ017272@svn.freebsd.org> References: <201110011235.p91CZAoQ017272@svn.freebsd.org> Date: Sat, 1 Oct 2011 11:05:34 -0400 Message-ID: From: Ben Kaduk To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r225898 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 15:32:54 -0000 On Sat, Oct 1, 2011 at 8:35 AM, Konstantin Belousov wrote= : > Author: kib > Date: Sat Oct =A01 12:35:09 2011 > New Revision: 225898 > URL: http://svn.freebsd.org/changeset/base/225898 > > Log: > =A0MFC r225172: > =A0Clarify the behaviour of sigwait() on signal interruption, and note > =A0the difference between sigwait() and sigtimedwait()/sigwaitinfo(). > > Modified: > =A0stable/8/lib/libc/sys/sigwait.2 > =A0stable/8/lib/libc/sys/sigwaitinfo.2 > Directory Properties: > =A0stable/8/lib/libc/ =A0 (props changed) > =A0stable/8/lib/libc/stdtime/ =A0 (props changed) > > Modified: stable/8/lib/libc/sys/sigwait.2 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/lib/libc/sys/sigwait.2 =A0 =A0 Sat Oct =A01 12:19:48 2011 = =A0 =A0 =A0 =A0(r225897) > +++ stable/8/lib/libc/sys/sigwait.2 =A0 =A0 Sat Oct =A01 12:35:09 2011 = =A0 =A0 =A0 =A0(r225898) > @@ -27,7 +27,7 @@ > =A0.\" > =A0.\" $FreeBSD$ > =A0.\" > -.Dd November 11, 2005 > +.Dd August 24, 2011 > =A0.Dt SIGWAIT 2 > =A0.Os > =A0.Sh NAME > @@ -82,6 +82,14 @@ selected, it will be the lowest numbered > =A0The selection order between realtime > =A0and non-realtime signals, or between multiple pending non-realtime sig= nals, > =A0is unspecified. > +.Sh IMPLEMENTATION NOTES > +The > +.Fn sigwait > +function is implemented as a wrapper around the > +.Fn __sys_sigwait I thought the sys_sigwait rename was only on head/stable-9? -Ben Kaduk > +system call, which retries the call on > +.Er EINTR > +error. > =A0.Sh RETURN VALUES > =A0If successful, > =A0.Fn sigwait > From owner-svn-src-stable@FreeBSD.ORG Sat Oct 1 17:46:45 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7937F1065670; Sat, 1 Oct 2011 17:46:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 125DC8FC14; Sat, 1 Oct 2011 17:46:44 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p91HkZWl073972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 1 Oct 2011 20:46:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id p91HkZ0m066411; Sat, 1 Oct 2011 20:46:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id p91HkZWO066410; Sat, 1 Oct 2011 20:46:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 1 Oct 2011 20:46:35 +0300 From: Kostik Belousov To: Ben Kaduk Message-ID: <20111001174634.GD1511@deviant.kiev.zoral.com.ua> References: <201110011235.p91CZAoQ017272@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tJ6vydIQpqz6Mizf" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r225898 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 17:46:45 -0000 --tJ6vydIQpqz6Mizf Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 01, 2011 at 11:05:34AM -0400, Ben Kaduk wrote: > On Sat, Oct 1, 2011 at 8:35 AM, Konstantin Belousov wro= te: > > Author: kib > > Date: Sat Oct =9A1 12:35:09 2011 > > New Revision: 225898 > > URL: http://svn.freebsd.org/changeset/base/225898 > > > > Log: > > =9AMFC r225172: > > =9AClarify the behaviour of sigwait() on signal interruption, and note > > =9Athe difference between sigwait() and sigtimedwait()/sigwaitinfo(). > > > > Modified: > > =9Astable/8/lib/libc/sys/sigwait.2 > > =9Astable/8/lib/libc/sys/sigwaitinfo.2 > > Directory Properties: > > =9Astable/8/lib/libc/ =9A (props changed) > > =9Astable/8/lib/libc/stdtime/ =9A (props changed) > > > > Modified: stable/8/lib/libc/sys/sigwait.2 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/8/lib/libc/sys/sigwait.2 =9A =9A Sat Oct =9A1 12:19:48 2011 = =9A =9A =9A =9A(r225897) > > +++ stable/8/lib/libc/sys/sigwait.2 =9A =9A Sat Oct =9A1 12:35:09 2011 = =9A =9A =9A =9A(r225898) > > @@ -27,7 +27,7 @@ > > =9A.\" > > =9A.\" $FreeBSD$ > > =9A.\" > > -.Dd November 11, 2005 > > +.Dd August 24, 2011 > > =9A.Dt SIGWAIT 2 > > =9A.Os > > =9A.Sh NAME > > @@ -82,6 +82,14 @@ selected, it will be the lowest numbered > > =9AThe selection order between realtime > > =9Aand non-realtime signals, or between multiple pending non-realtime s= ignals, > > =9Ais unspecified. > > +.Sh IMPLEMENTATION NOTES > > +The > > +.Fn sigwait > > +function is implemented as a wrapper around the > > +.Fn __sys_sigwait >=20 > I thought the sys_sigwait rename was only on head/stable-9? I merged the wrapper sigwait(3) several commits earlier, see r225896. --tJ6vydIQpqz6Mizf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEUEARECAAYFAk6HUfoACgkQC3+MBN1Mb4iowwCXXSGVFpGyrFktUhkJEJykq8j+ cACg4owwP7H9+4a4clrNTaommbWi2N0= =ig1t -----END PGP SIGNATURE----- --tJ6vydIQpqz6Mizf-- From owner-svn-src-stable@FreeBSD.ORG Sat Oct 1 19:58:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B5BA106566C; Sat, 1 Oct 2011 19:58:36 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 413B48FC13; Sat, 1 Oct 2011 19:58:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91JwaP6031689; Sat, 1 Oct 2011 19:58:36 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91JwaBl031685; Sat, 1 Oct 2011 19:58:36 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201110011958.p91JwaBl031685@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 1 Oct 2011 19:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225907 - stable/9/contrib/sendmail/src X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 19:58:36 -0000 Author: ume Date: Sat Oct 1 19:58:35 2011 New Revision: 225907 URL: http://svn.freebsd.org/changeset/base/225907 Log: MFC r225906: Shut up warnings with Cyrus SASL 2.1.25. Approved by: re (kib) Modified: stable/9/contrib/sendmail/src/main.c stable/9/contrib/sendmail/src/sendmail.h stable/9/contrib/sendmail/src/usersmtp.c Directory Properties: stable/9/contrib/sendmail/ (props changed) Modified: stable/9/contrib/sendmail/src/main.c ============================================================================== --- stable/9/contrib/sendmail/src/main.c Sat Oct 1 18:20:10 2011 (r225906) +++ stable/9/contrib/sendmail/src/main.c Sat Oct 1 19:58:35 2011 (r225907) @@ -109,8 +109,8 @@ GIDSET_T InitialGidSet[NGROUPS_MAX]; #if SASL static sasl_callback_t srvcallbacks[] = { - { SASL_CB_VERIFYFILE, &safesaslfile, NULL }, - { SASL_CB_PROXY_POLICY, &proxy_policy, NULL }, + { SASL_CB_VERIFYFILE, (sasl_callback_ft)&safesaslfile, NULL }, + { SASL_CB_PROXY_POLICY, (sasl_callback_ft)&proxy_policy, NULL }, { SASL_CB_LIST_END, NULL, NULL } }; #endif /* SASL */ Modified: stable/9/contrib/sendmail/src/sendmail.h ============================================================================== --- stable/9/contrib/sendmail/src/sendmail.h Sat Oct 1 18:20:10 2011 (r225906) +++ stable/9/contrib/sendmail/src/sendmail.h Sat Oct 1 19:58:35 2011 (r225907) @@ -133,10 +133,15 @@ SM_UNUSED(static char SmailId[]) = "@(#) # if SASL == 2 || SASL >= 20000 # include +# include # include +# if SASL_VERSION_FULL < 0x020119 +typedef int (*sasl_callback_ft)(void); +# endif # else /* SASL == 2 || SASL >= 20000 */ # include # include +typedef int (*sasl_callback_ft)(void); # endif /* SASL == 2 || SASL >= 20000 */ # if defined(SASL_VERSION_MAJOR) && defined(SASL_VERSION_MINOR) && defined(SASL_VERSION_STEP) # define SASL_VERSION (SASL_VERSION_MAJOR * 10000) + (SASL_VERSION_MINOR * 100) + SASL_VERSION_STEP Modified: stable/9/contrib/sendmail/src/usersmtp.c ============================================================================== --- stable/9/contrib/sendmail/src/usersmtp.c Sat Oct 1 18:20:10 2011 (r225906) +++ stable/9/contrib/sendmail/src/usersmtp.c Sat Oct 1 19:58:35 2011 (r225907) @@ -524,15 +524,15 @@ static int attemptauth __P((MAILER *, MC static sasl_callback_t callbacks[] = { - { SASL_CB_GETREALM, &saslgetrealm, NULL }, + { SASL_CB_GETREALM, (sasl_callback_ft)&saslgetrealm, NULL }, #define CB_GETREALM_IDX 0 - { SASL_CB_PASS, &getsecret, NULL }, + { SASL_CB_PASS, (sasl_callback_ft)&getsecret, NULL }, #define CB_PASS_IDX 1 - { SASL_CB_USER, &getsimple, NULL }, + { SASL_CB_USER, (sasl_callback_ft)&getsimple, NULL }, #define CB_USER_IDX 2 - { SASL_CB_AUTHNAME, &getsimple, NULL }, + { SASL_CB_AUTHNAME, (sasl_callback_ft)&getsimple, NULL }, #define CB_AUTHNAME_IDX 3 - { SASL_CB_VERIFYFILE, &safesaslfile, NULL }, + { SASL_CB_VERIFYFILE, (sasl_callback_ft)&safesaslfile, NULL }, #define CB_SAFESASL_IDX 4 { SASL_CB_LIST_END, NULL, NULL } };