From owner-svn-src-stable-9@FreeBSD.ORG Sun Oct 21 09:31:49 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CCA5F72; Sun, 21 Oct 2012 09:31:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DAD28FC0C; Sun, 21 Oct 2012 09:31: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 q9L9VnMD038035; Sun, 21 Oct 2012 09:31:49 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9L9Vn50038033; Sun, 21 Oct 2012 09:31:49 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201210210931.q9L9Vn50038033@svn.freebsd.org> From: Brooks Davis Date: Sun, 21 Oct 2012 09:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241799 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2012 09:31:49 -0000 Author: brooks Date: Sun Oct 21 09:31:48 2012 New Revision: 241799 URL: http://svn.freebsd.org/changeset/base/241799 Log: MFC r228120: Allow NO_FOO to override WITH_FOO that could be specified in /etc/src.conf. This is required to override knobs (e.g. WITH_PROFILE) during buildworld stages in Makefile.inc1 (otherwise the build is stopped due to both WITH_FOO and WITHOUT_FOO defined). PR: misc/172873 Modified: stable/9/share/mk/bsd.own.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Sun Oct 21 08:46:15 2012 (r241798) +++ stable/9/share/mk/bsd.own.mk Sun Oct 21 09:31:48 2012 (r241799) @@ -208,6 +208,13 @@ COMPRESS_EXT?= .gz MAN \ PROFILE .if defined(NO_${var}) +.if defined(WITH_${var}) +.warning unsetting WITH_${var} +.undef WITH_${var} +.if defined(WITH_${var}) +.error wtf +.endif +.endif WITHOUT_${var}= .endif .endfor From owner-svn-src-stable-9@FreeBSD.ORG Sun Oct 21 10:19:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A7D5F50; Sun, 21 Oct 2012 10:19:08 +0000 (UTC) (envelope-from kuriyama@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 288938FC08; Sun, 21 Oct 2012 10:19:08 +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 q9LAJ8cN047063; Sun, 21 Oct 2012 10:19:08 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9LAJ7bM047060; Sun, 21 Oct 2012 10:19:07 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <201210211019.q9LAJ7bM047060@svn.freebsd.org> From: Jun Kuriyama Date: Sun, 21 Oct 2012 10:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241801 - in stable/9/etc: defaults rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2012 10:19:08 -0000 Author: kuriyama Date: Sun Oct 21 10:19:07 2012 New Revision: 241801 URL: http://svn.freebsd.org/changeset/base/241801 Log: MFC r239382: - Allow to pass extra parameters for each jails. - To achieve above, convert jail(8) invocation to use new style command line "-c" flag. Modified: stable/9/etc/defaults/rc.conf stable/9/etc/rc.d/jail Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/defaults/rc.conf ============================================================================== --- stable/9/etc/defaults/rc.conf Sun Oct 21 09:46:02 2012 (r241800) +++ stable/9/etc/defaults/rc.conf Sun Oct 21 10:19:07 2012 (r241801) @@ -702,6 +702,7 @@ jail_sysvipc_allow="NO" # Allow SystemV #jail_example_mount_enable="NO" # mount/umount jail's fs #jail_example_fstab="" # fstab(5) for mount/umount #jail_example_flags="-l -U root" # flags for jail(8) +#jail_example_parameters="allow.raw_sockets=1" # extra parameters for this jail ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## Modified: stable/9/etc/rc.d/jail ============================================================================== --- stable/9/etc/rc.d/jail Sun Oct 21 09:46:02 2012 (r241800) +++ stable/9/etc/rc.d/jail Sun Oct 21 10:19:07 2012 (r241801) @@ -115,6 +115,8 @@ init_variables() [ -z "${_flags}" ] && _flags="-l -U root" eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\" [ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log" + eval _parameters=\"\${jail_${_j}_parameters:-${jail_parameters}}\" + [ -z "${_parameters}" ] && _parameters="" eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\" # Debugging aid @@ -193,6 +195,7 @@ init_variables() debug "$_j flags: $_flags" debug "$_j consolelog: $_consolelog" + debug "$_j parameters: $_parameters" if [ -z "${_hostname}" ]; then err 3 "$name: No hostname has been defined for ${_j}" @@ -484,9 +487,19 @@ jail_handle_ips_option() esac # Append address to list of addresses for the jail command. - case "${_addrl}" in - "") _addrl="${_addr}" ;; - *) _addrl="${_addrl},${_addr}" ;; + case "${_type}" in + inet) + case "${_addrl}" in + "") _addrl="${_addr}" ;; + *) _addrl="${_addrl},${_addr}" ;; + esac + ;; + inet6) + case "${_addr6l}" in + "") _addr6l="${_addr}" ;; + *) _addr6l="${_addr6l},${_addr}" ;; + esac + ;; esac # Configure interface alias if requested by a given interface @@ -576,6 +589,7 @@ jail_start() continue; fi _addrl="" + _addr6l="" jail_ips "add" if [ -n "${_fib}" ]; then _setfib="setfib -F '${_fib}'" @@ -641,8 +655,8 @@ jail_start() i=$((i + 1)) done - eval ${_setfib} jail -n ${_jail} ${_flags} -i ${_rootdir} ${_hostname} \ - \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ + eval ${_setfib} jail -n ${_jail} ${_flags} -i -c path=${_rootdir} host.hostname=${_hostname} \ + ip4.addr=\"${_addrl}\" ip6.addr=\"${_addr6l}\" ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \ Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 543DB6A1; Sun, 21 Oct 2012 11:43:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21EC48FC08; Sun, 21 Oct 2012 11:43: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 q9LBhhUJ064873; Sun, 21 Oct 2012 11:43:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9LBhhDn064871; Sun, 21 Oct 2012 11:43:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201210211143.q9LBhhDn064871@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Oct 2012 11:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241803 - stable/9/sys/dev/iicbus X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2012 11:43:44 -0000 Author: marius Date: Sun Oct 21 11:43:43 2012 New Revision: 241803 URL: http://svn.freebsd.org/changeset/base/241803 Log: MFC: r241679 It turns out that as documented, PCF8563_R_SECOND_VL (i.e. battery low) doesn't automatically clear when VDD rises above Vlow again and needs to be cleared manually. However, apparently this needs all of the time registers to be set, i.e. pcf8563_settime(), and not just PCF8563_R_SECOND in order for PCF8563_R_SECOND_VL to stick. Thus, we just issue a warning during pcf8563_attach() rather than failing with ENXIO in case it is set. Modified: stable/9/sys/dev/iicbus/pcf8563.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/iicbus/pcf8563.c ============================================================================== --- stable/9/sys/dev/iicbus/pcf8563.c Sun Oct 21 11:16:16 2012 (r241802) +++ stable/9/sys/dev/iicbus/pcf8563.c Sun Oct 21 11:43:43 2012 (r241803) @@ -83,6 +83,16 @@ pcf8563_attach(device_t dev) if (sc->sc_addr == 0) sc->sc_addr = PCF8563_ADDR; + /* + * NB: PCF8563_R_SECOND_VL doesn't automatically clear when VDD + * rises above Vlow again and needs to be cleared manually. + * However, apparently this needs all of the time registers to be + * set, i.e. pcf8563_settime(), and not just PCF8563_R_SECOND in + * order for PCF8563_R_SECOND_VL to stick. Thus, we just issue a + * warning here rather than failing with ENXIO in case it is set. + * Note that pcf8563_settime() will also clear PCF8563_R_SECOND_VL + * as a side-effect. + */ msgs[0].slave = msgs[1].slave = sc->sc_addr; error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / sizeof(*msgs)); @@ -90,10 +100,8 @@ pcf8563_attach(device_t dev) device_printf(dev, "%s: cannot read RTC\n", __func__); return (error); } - if ((val & PCF8563_R_SECOND_VL) != 0) { + if ((val & PCF8563_R_SECOND_VL) != 0) device_printf(dev, "%s: battery low\n", __func__); - return (ENXIO); - } sc->sc_year0 = 1900; clock_register(dev, 1000000); /* 1 second resolution */ From owner-svn-src-stable-9@FreeBSD.ORG Sun Oct 21 12:15:59 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 346FBB96; Sun, 21 Oct 2012 12:15:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0A98FC08; Sun, 21 Oct 2012 12:15:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9LCFwiW071828; Sun, 21 Oct 2012 12:15:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9LCFwdL071826; Sun, 21 Oct 2012 12:15:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210211215.q9LCFwdL071826@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Oct 2012 12:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241810 - stable/9/sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2012 12:15:59 -0000 Author: kib Date: Sun Oct 21 12:15:58 2012 New Revision: 241810 URL: http://svn.freebsd.org/changeset/base/241810 Log: MFC r241549: Print the %rip value for uprintf_signal. Modified: stable/9/sys/amd64/amd64/trap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/trap.c ============================================================================== --- stable/9/sys/amd64/amd64/trap.c Sun Oct 21 12:14:58 2012 (r241809) +++ stable/9/sys/amd64/amd64/trap.c Sun Oct 21 12:15:58 2012 (r241810) @@ -617,8 +617,10 @@ trap(struct trapframe *frame) ksi.ksi_addr = (void *)addr; if (uprintf_signal) { uprintf("pid %d comm %s: signal %d err %lx code %d type %d " - "addr 0x%lx <%02x %02x %02x %02x %02x %02x %02x %02x>\n", + "addr 0x%lx rip 0x%lx " + "<%02x %02x %02x %02x %02x %02x %02x %02x>\n", p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr, + frame->tf_rip, fubyte((void *)(frame->tf_rip + 0)), fubyte((void *)(frame->tf_rip + 1)), fubyte((void *)(frame->tf_rip + 2)), From owner-svn-src-stable-9@FreeBSD.ORG Sun Oct 21 12:17:22 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C536EDCD; Sun, 21 Oct 2012 12:17:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABCF08FC12; Sun, 21 Oct 2012 12:17:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9LCHMSb072227; Sun, 21 Oct 2012 12:17:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9LCHMjM072225; Sun, 21 Oct 2012 12:17:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210211217.q9LCHMjM072225@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Oct 2012 12:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241811 - stable/9/sys/i386/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2012 12:17:22 -0000 Author: kib Date: Sun Oct 21 12:17:22 2012 New Revision: 241811 URL: http://svn.freebsd.org/changeset/base/241811 Log: MFC r241550: MFamd64: add machdep.uprintf_signal. Modified: stable/9/sys/i386/i386/trap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/i386/trap.c ============================================================================== --- stable/9/sys/i386/i386/trap.c Sun Oct 21 12:15:58 2012 (r241810) +++ stable/9/sys/i386/i386/trap.c Sun Oct 21 12:17:22 2012 (r241811) @@ -195,6 +195,10 @@ TUNABLE_INT("machdep.panic_on_nmi", &pan static int prot_fault_translation = 0; SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW, &prot_fault_translation, 0, "Select signal to deliver on protection fault"); +static int uprintf_signal; +SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW, + &uprintf_signal, 0, + "Print debugging information on trap signal to ctty"); /* * Exception, fault, and trap interface to the FreeBSD kernel. @@ -760,6 +764,21 @@ trap(struct trapframe *frame) ksi.ksi_code = ucode; ksi.ksi_addr = (void *)addr; ksi.ksi_trapno = type; + if (uprintf_signal) { + uprintf("pid %d comm %s: signal %d err %x code %d type %d " + "addr 0x%x eip 0x%08x " + "<%02x %02x %02x %02x %02x %02x %02x %02x>\n", + p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr, + frame->tf_eip, + fubyte((void *)(frame->tf_eip + 0)), + fubyte((void *)(frame->tf_eip + 1)), + fubyte((void *)(frame->tf_eip + 2)), + fubyte((void *)(frame->tf_eip + 3)), + fubyte((void *)(frame->tf_eip + 4)), + fubyte((void *)(frame->tf_eip + 5)), + fubyte((void *)(frame->tf_eip + 6)), + fubyte((void *)(frame->tf_eip + 7))); + } trapsignal(td, &ksi); #ifdef DEBUG From owner-svn-src-stable-9@FreeBSD.ORG Sun Oct 21 12:33:38 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C677C3A7; Sun, 21 Oct 2012 12:33:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC9988FC0A; Sun, 21 Oct 2012 12:33:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9LCXcuw075723; Sun, 21 Oct 2012 12:33:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9LCXcu2075717; Sun, 21 Oct 2012 12:33:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210211233.q9LCXcu2075717@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Oct 2012 12:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241812 - in stable/9/sys: kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2012 12:33:39 -0000 Author: kib Date: Sun Oct 21 12:33:38 2012 New Revision: 241812 URL: http://svn.freebsd.org/changeset/base/241812 Log: MFC r241556: Add a KPI to allow to reserve some amount of space in the numvnodes counter, without actually allocating the vnodes. For KBI stability, the td_vp_reserv was moved to the end of struct thread. Modified: stable/9/sys/kern/kern_thread.c stable/9/sys/kern/subr_trap.c stable/9/sys/kern/vfs_subr.c stable/9/sys/sys/proc.h stable/9/sys/sys/vnode.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_thread.c ============================================================================== --- stable/9/sys/kern/kern_thread.c Sun Oct 21 12:17:22 2012 (r241811) +++ stable/9/sys/kern/kern_thread.c Sun Oct 21 12:33:38 2012 (r241812) @@ -207,6 +207,7 @@ thread_init(void *mem, int size, int fla td->td_sleepqueue = sleepq_alloc(); td->td_turnstile = turnstile_alloc(); td->td_rlqe = NULL; + td->td_vp_reserv = 0; EVENTHANDLER_INVOKE(thread_init, td); td->td_sched = (struct td_sched *)&td[1]; umtx_thread_init(td); Modified: stable/9/sys/kern/subr_trap.c ============================================================================== --- stable/9/sys/kern/subr_trap.c Sun Oct 21 12:17:22 2012 (r241811) +++ stable/9/sys/kern/subr_trap.c Sun Oct 21 12:33:38 2012 (r241812) @@ -139,6 +139,8 @@ userret(struct thread *td, struct trapfr sched_userret(td); KASSERT(td->td_locks == 0, ("userret: Returning with %d locks held.", td->td_locks)); + KASSERT(td->td_vp_reserv == 0, + ("userret: Returning while holding vnode reservation")); #ifdef VIMAGE /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ VNET_ASSERT(curvnet == NULL, Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Sun Oct 21 12:17:22 2012 (r241811) +++ stable/9/sys/kern/vfs_subr.c Sun Oct 21 12:33:38 2012 (r241812) @@ -935,34 +935,22 @@ vtryrecycle(struct vnode *vp) } /* - * Return the next vnode from the free list. + * Wait for available vnodes. */ -int -getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, - struct vnode **vpp) +static int +getnewvnode_wait(int suspended) { - struct vnode *vp = NULL; - struct bufobj *bo; - CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag); - mtx_lock(&vnode_free_list_mtx); - /* - * Lend our context to reclaim vnodes if they've exceeded the max. - */ - if (freevnodes > wantfreevnodes) - vnlru_free(1); - /* - * Wait for available vnodes. - */ + mtx_assert(&vnode_free_list_mtx, MA_OWNED); if (numvnodes > desiredvnodes) { - if (mp != NULL && (mp->mnt_kern_flag & MNTK_SUSPEND)) { + if (suspended) { /* * File system is beeing suspended, we cannot risk a * deadlock here, so allocate new vnode anyway. */ if (freevnodes > wantfreevnodes) vnlru_free(freevnodes - wantfreevnodes); - goto alloc; + return (0); } if (vnlruproc_sig == 0) { vnlruproc_sig = 1; /* avoid unnecessary wakeups */ @@ -970,16 +958,76 @@ getnewvnode(const char *tag, struct moun } msleep(&vnlruproc_sig, &vnode_free_list_mtx, PVFS, "vlruwk", hz); -#if 0 /* XXX Not all VFS_VGET/ffs_vget callers check returns. */ - if (numvnodes > desiredvnodes) { - mtx_unlock(&vnode_free_list_mtx); - return (ENFILE); + } + return (numvnodes > desiredvnodes ? ENFILE : 0); +} + +void +getnewvnode_reserve(u_int count) +{ + struct thread *td; + + td = curthread; + mtx_lock(&vnode_free_list_mtx); + while (count > 0) { + if (getnewvnode_wait(0) == 0) { + count--; + td->td_vp_reserv++; + numvnodes++; } -#endif } -alloc: + mtx_unlock(&vnode_free_list_mtx); +} + +void +getnewvnode_drop_reserve(void) +{ + struct thread *td; + + td = curthread; + mtx_lock(&vnode_free_list_mtx); + KASSERT(numvnodes >= td->td_vp_reserv, ("reserve too large")); + numvnodes -= td->td_vp_reserv; + mtx_unlock(&vnode_free_list_mtx); + td->td_vp_reserv = 0; +} + +/* + * Return the next vnode from the free list. + */ +int +getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, + struct vnode **vpp) +{ + struct vnode *vp; + struct bufobj *bo; + struct thread *td; + int error; + + CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag); + vp = NULL; + td = curthread; + if (td->td_vp_reserv > 0) { + td->td_vp_reserv -= 1; + goto alloc; + } + mtx_lock(&vnode_free_list_mtx); + /* + * Lend our context to reclaim vnodes if they've exceeded the max. + */ + if (freevnodes > wantfreevnodes) + vnlru_free(1); + error = getnewvnode_wait(mp != NULL && (mp->mnt_kern_flag & + MNTK_SUSPEND)); +#if 0 /* XXX Not all VFS_VGET/ffs_vget callers check returns. */ + if (error != 0) { + mtx_unlock(&vnode_free_list_mtx); + return (error); + } +#endif numvnodes++; mtx_unlock(&vnode_free_list_mtx); +alloc: vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK|M_ZERO); /* * Setup locks. Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Sun Oct 21 12:17:22 2012 (r241811) +++ stable/9/sys/sys/proc.h Sun Oct 21 12:33:38 2012 (r241812) @@ -316,6 +316,7 @@ struct thread { struct vm_page **td_ma; /* (k) uio pages held */ int td_ma_cnt; /* (k) size of *td_ma */ struct rl_q_entry *td_rlqe; /* (k) Associated range lock entry. */ + u_int td_vp_reserv; /* (k) Count of reserved vnodes. */ }; struct mtx *thread_lock_block(struct thread *); Modified: stable/9/sys/sys/vnode.h ============================================================================== --- stable/9/sys/sys/vnode.h Sun Oct 21 12:17:22 2012 (r241811) +++ stable/9/sys/sys/vnode.h Sun Oct 21 12:33:38 2012 (r241812) @@ -603,6 +603,8 @@ void cvtstat(struct stat *st, struct ost void cvtnstat(struct stat *sb, struct nstat *nsb); int getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, struct vnode **vpp); +void getnewvnode_reserve(u_int count); +void getnewvnode_drop_reserve(void); int insmntque1(struct vnode *vp, struct mount *mp, void (*dtr)(struct vnode *, void *), void *dtr_arg); int insmntque(struct vnode *vp, struct mount *mp); From owner-svn-src-stable-9@FreeBSD.ORG Sun Oct 21 21:47:59 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9CDB2EBF; Sun, 21 Oct 2012 21:47:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7777B8FC08; Sun, 21 Oct 2012 21:47: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 q9LLlxBw063507; Sun, 21 Oct 2012 21:47:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9LLlxDL063504; Sun, 21 Oct 2012 21:47:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201210212147.q9LLlxDL063504@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 21 Oct 2012 21:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241819 - stable/9/usr.bin/touch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2012 21:47:59 -0000 Author: jilles Date: Sun Oct 21 21:47:58 2012 New Revision: 241819 URL: http://svn.freebsd.org/changeset/base/241819 Log: MFC r236852: touch: Add the -d option from POSIX.1-2008. This is much like -t but with a different format which is ISO8601-like and allows fractions of a second. The precision is limited to microseconds because of utimes() and friends, even though stat() returns nanoseconds. Modified: stable/9/usr.bin/touch/touch.1 stable/9/usr.bin/touch/touch.c Directory Properties: stable/9/usr.bin/touch/ (props changed) Modified: stable/9/usr.bin/touch/touch.1 ============================================================================== --- stable/9/usr.bin/touch/touch.1 Sun Oct 21 18:25:12 2012 (r241818) +++ stable/9/usr.bin/touch/touch.1 Sun Oct 21 21:47:58 2012 (r241819) @@ -31,7 +31,7 @@ .\" @(#)touch.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 28, 1995 +.Dd June 10, 2012 .Dt TOUCH 1 .Os .Sh NAME @@ -43,6 +43,7 @@ .Op Fl acfhm .Op Fl r Ar file .Op Fl t Ar [[CC]YY]MMDDhhmm[.SS] +.Op Fl d Ar YYYY-MM-DDThh:mm:SS[.frac][tz] .Ar .Sh DESCRIPTION The @@ -61,8 +62,10 @@ individually. Selecting both is equivalent to the default. By default, the timestamps are set to the current time. The +.Fl d +and .Fl t -flag explicitly specifies a different time, and the +flags explicitly specify a different time, and the .Fl r flag specifies to set the times those of the specified file. The @@ -112,6 +115,41 @@ No error messages are displayed and the .It Fl f Attempt to force the update, even if the file permissions do not currently permit it. +.It Fl d +Change the access and modification times to the specified time instead +of the current time of day. +The argument is of the form +.Dq YYYY-MM-DDThh:mm:SS[.frac][tz] +where the letters represent the following: +.Bl -tag -width Ds -compact -offset indent +.It Ar YYYY +The year. +.It Ar MM +The month of the year, from 01 to 12. +.It Ar DD +The day of the month, from 01 to 31. +.It Ar T +The letter +.Li T +or a space. +.It Ar hh +The hour of the day, from 00 to 23. +.It Ar mm +The minute of the hour, from 00 to 59. +.It Ar SS +The second of the minute, from 00 to 61. +.It Ar .frac +An optional fraction, +consisting of a period or a comma followed by one or more digits. +The number of significant digits depends on the kernel configuration and +the filesystem, and may be zero. +.It Ar tz +An optional letter +.Li Z +indicating the time is in +.Tn UTC . +Otherwise, the time is assumed to be in local time. +.El .It Fl h If the file is a symbolic link, change the times of the link itself rather than the file that the link points to. Modified: stable/9/usr.bin/touch/touch.c ============================================================================== --- stable/9/usr.bin/touch/touch.c Sun Oct 21 18:25:12 2012 (r241818) +++ stable/9/usr.bin/touch/touch.c Sun Oct 21 21:47:58 2012 (r241819) @@ -45,6 +45,7 @@ static const char sccsid[] = "@(#)touch. #include #include +#include #include #include #include @@ -58,6 +59,7 @@ static const char sccsid[] = "@(#)touch. int rw(char *, struct stat *, int); void stime_arg1(char *, struct timeval *); void stime_arg2(char *, int, struct timeval *); +void stime_darg(char *, struct timeval *); void stime_file(char *, struct timeval *); int timeoffset(char *); void usage(char *); @@ -80,7 +82,7 @@ main(int argc, char *argv[]) if (gettimeofday(&tv[0], NULL)) err(1, "gettimeofday"); - while ((ch = getopt(argc, argv, "A:acfhmr:t:")) != -1) + while ((ch = getopt(argc, argv, "A:acd:fhmr:t:")) != -1) switch(ch) { case 'A': Aflag = timeoffset(optarg); @@ -91,6 +93,10 @@ main(int argc, char *argv[]) case 'c': cflag = 1; break; + case 'd': + timeset = 1; + stime_darg(optarg, tv); + break; case 'f': fflag = 1; break; @@ -327,6 +333,50 @@ stime_arg2(char *arg, int year, struct t tvp[0].tv_usec = tvp[1].tv_usec = 0; } +void +stime_darg(char *arg, struct timeval *tvp) +{ + struct tm t = { .tm_sec = 0 }; + const char *fmt, *colon; + char *p; + int val, isutc = 0; + + tvp[0].tv_usec = 0; + t.tm_isdst = -1; + colon = strchr(arg, ':'); + if (colon == NULL || strchr(colon + 1, ':') == NULL) + goto bad; + fmt = strchr(arg, 'T') != NULL ? "%Y-%m-%dT%H:%M:%S" : + "%Y-%m-%d %H:%M:%S"; + p = strptime(arg, fmt, &t); + if (p == NULL) + goto bad; + /* POSIX: must have at least one digit after dot */ + if ((*p == '.' || *p == ',') && isdigit((unsigned char)p[1])) { + p++; + val = 100000; + while (isdigit((unsigned char)*p)) { + tvp[0].tv_usec += val * (*p - '0'); + p++; + val /= 10; + } + } + if (*p == 'Z') { + isutc = 1; + p++; + } + if (*p != '\0') + goto bad; + + tvp[0].tv_sec = isutc ? timegm(&t) : mktime(&t); + + tvp[1] = tvp[0]; + return; + +bad: + errx(1, "out of range or illegal time specification: YYYY-MM-DDThh:mm:SS[.frac][tz]"); +} + /* Calculate a time offset in seconds, given an arg of the format [-]HHMMSS. */ int timeoffset(char *arg) @@ -420,7 +470,9 @@ err: rval = 1; void usage(char *myname) { - fprintf(stderr, "usage:\n" "%s [-A [-][[hh]mm]SS] [-acfhm] [-r file] " - "[-t [[CC]YY]MMDDhhmm[.SS]] file ...\n", myname); + fprintf(stderr, "usage: %s [-A [-][[hh]mm]SS] [-acfhm] [-r file] " + "[-t [[CC]YY]MMDDhhmm[.SS]]\n" + " [-d YYYY-MM-DDThh:mm:SS[.frac][tz]] " + "file ...\n", myname); exit(1); } From owner-svn-src-stable-9@FreeBSD.ORG Mon Oct 22 09:07:13 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D38D860; Mon, 22 Oct 2012 09:07:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14E588FC0A; Mon, 22 Oct 2012 09:07: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 q9M97CTx075958; Mon, 22 Oct 2012 09:07:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9M97CFu075956; Mon, 22 Oct 2012 09:07:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210220907.q9M97CFu075956@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 22 Oct 2012 09:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241865 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2012 09:07:13 -0000 Author: kib Date: Mon Oct 22 09:07:12 2012 New Revision: 241865 URL: http://svn.freebsd.org/changeset/base/241865 Log: MFC r241597: Acquire the rangelock for truncate(2) as well. Modified: stable/9/sys/kern/vfs_syscalls.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_syscalls.c ============================================================================== --- stable/9/sys/kern/vfs_syscalls.c Mon Oct 22 07:04:34 2012 (r241864) +++ stable/9/sys/kern/vfs_syscalls.c Mon Oct 22 09:07:12 2012 (r241865) @@ -3461,10 +3461,10 @@ kern_truncate(struct thread *td, char *p { struct mount *mp; struct vnode *vp; + void *rl_cookie; struct vattr vattr; - int error; struct nameidata nd; - int vfslocked; + int error, vfslocked; if (length < 0) return(EINVAL); @@ -3473,7 +3473,9 @@ kern_truncate(struct thread *td, char *p return (error); vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; + rl_cookie = vn_rangelock_wlock(vp, 0, OFF_MAX); if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) { + vn_rangelock_unlock(vp, rl_cookie); vrele(vp); VFS_UNLOCK_GIANT(vfslocked); return (error); @@ -3492,8 +3494,10 @@ kern_truncate(struct thread *td, char *p vattr.va_size = length; error = VOP_SETATTR(vp, &vattr, td->td_ucred); } - vput(vp); + VOP_UNLOCK(vp, 0); vn_finished_write(mp); + vn_rangelock_unlock(vp, rl_cookie); + vrele(vp); VFS_UNLOCK_GIANT(vfslocked); return (error); } From owner-svn-src-stable-9@FreeBSD.ORG Mon Oct 22 10:31:29 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E23772C; Mon, 22 Oct 2012 10:31:29 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ADE88FC0C; Mon, 22 Oct 2012 10:31:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9MAVTSE090039; Mon, 22 Oct 2012 10:31:29 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9MAVTbE090036; Mon, 22 Oct 2012 10:31:29 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201210221031.q9MAVTbE090036@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 22 Oct 2012 10:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241873 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2012 10:31:29 -0000 Author: edwin Date: Mon Oct 22 10:31:28 2012 New Revision: 241873 URL: http://svn.freebsd.org/changeset/base/241873 Log: Merge of 241869 Import of tzdata2012g - Fix end of DST in Gaza and Hebron - Western Samoa: DST start at 30 Septembet 2012 and finished at 7 April 2013. Modified: stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/australasia Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Mon Oct 22 10:30:43 2012 (r241872) +++ stable/9/contrib/tzdata/asia Mon Oct 22 10:31:28 2012 (r241873) @@ -2293,6 +2293,8 @@ Rule Palestine 2010 only - Aug 11 0:00 0 # From Arthur David Olson (2011-09-20): # 2011 transitions per http://www.timeanddate.com as of 2011-09-20. +# From Paul Eggert (2012-10-12): +# 2012 transitions per http://www.timeanddate.com as of 2012-10-12. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -2303,7 +2305,7 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct 2:00 Palestine EE%sT 2011 Apr 2 12:01 2:00 1:00 EEST 2011 Aug 1 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 28 + 2:00 1:00 EEST 2012 Sep 21 1:00 2:00 - EET Zone Asia/Hebron 2:20:23 - LMT 1900 Oct @@ -2318,7 +2320,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct 2:00 - EET 2011 Aug 30 2:00 1:00 EEST 2011 Sep 30 3:00 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 28 3:00 + 2:00 1:00 EEST 2012 Sep 21 1:00 2:00 - EET # Paracel Is Modified: stable/9/contrib/tzdata/australasia ============================================================================== --- stable/9/contrib/tzdata/australasia Mon Oct 22 10:30:43 2012 (r241872) +++ stable/9/contrib/tzdata/australasia Mon Oct 22 10:31:28 2012 (r241873) @@ -628,6 +628,23 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1 # Although Samoa has used Daylight Saving Time in the 2010-2011 and 2011-2012 # seasons, there is not yet any indication that this trend will continue on # a regular basis. For now, we have explicitly listed the transitions below. +# +# From Nicky (2012-09-10): +# Daylight Saving Time commences on Sunday 30th September 2012 and +# ends on Sunday 7th of April 2013. +# +# Please find link below for more information. +# http://www.mcil.gov.ws/mcil_publications.html +# +# That publication also includes dates for Summer of 2013/4 as well +# which give the impression of a pattern in selecting dates for the +# future, so for now, we will guess this will continue. + +# Western Samoa +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule WS 2012 max - Sep lastSun 3:00 1 D +Rule WS 2012 max - Apr Sun>=1 4:00 0 - +# Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5 -11:26:56 - LMT 1911 -11:30 - SAMT 1950 # Samoa Time @@ -635,8 +652,8 @@ Zone Pacific/Apia 12:33:04 - LMT 1879 J -11:00 1:00 WSDT 2011 Apr 2 4:00 -11:00 - WST 2011 Sep 24 3:00 -11:00 1:00 WSDT 2011 Dec 30 - 13:00 1:00 WSDT 2012 Apr 1 4:00 - 13:00 - WST + 13:00 1:00 WSDT 2012 Apr Sun>=1 4:00 + 13:00 WS WS%sT # Solomon Is # excludes Bougainville, for which see Papua New Guinea From owner-svn-src-stable-9@FreeBSD.ORG Mon Oct 22 11:08:00 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40124699; Mon, 22 Oct 2012 11:08:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11F828FC18; Mon, 22 Oct 2012 11:08: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 q9MB7xn6097322; Mon, 22 Oct 2012 11:07:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9MB7x4t097320; Mon, 22 Oct 2012 11:07:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201210221107.q9MB7x4t097320@svn.freebsd.org> From: Marius Strobl Date: Mon, 22 Oct 2012 11:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241877 - stable/9/sys/sparc64/sparc64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2012 11:08:00 -0000 Author: marius Date: Mon Oct 22 11:07:59 2012 New Revision: 241877 URL: http://svn.freebsd.org/changeset/base/241877 Log: MFC: r241734 Let SCHED_ULE give affinity to the CPU the tick interrupt triggered on when running tick_process(), similarly to what the x86 equivalents of this function do, however employing the less racy sequence also used in intr_event_handle(). Modified: stable/9/sys/sparc64/sparc64/tick.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/9/sys/sparc64/sparc64/tick.c Mon Oct 22 11:01:43 2012 (r241876) +++ stable/9/sys/sparc64/sparc64/tick.c Mon Oct 22 11:07:59 2012 (r241877) @@ -245,14 +245,16 @@ tick_process(struct trapframe *tf) struct trapframe *oldframe; struct thread *td; + td = curthread; + td->td_intr_nesting_level++; critical_enter(); if (tick_et.et_active) { - td = curthread; oldframe = td->td_intr_frame; td->td_intr_frame = tf; tick_et.et_event_cb(&tick_et, tick_et.et_arg); td->td_intr_frame = oldframe; } + td->td_intr_nesting_level--; critical_exit(); } From owner-svn-src-stable-9@FreeBSD.ORG Mon Oct 22 11:10:14 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90ACFD77; Mon, 22 Oct 2012 11:10:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 788748FC08; Mon, 22 Oct 2012 11:10:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9MBAE8b097754; Mon, 22 Oct 2012 11:10:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9MBAEMI097752; Mon, 22 Oct 2012 11:10:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201210221110.q9MBAEMI097752@svn.freebsd.org> From: Marius Strobl Date: Mon, 22 Oct 2012 11:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241878 - stable/9/sys/sparc64/sparc64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2012 11:10:14 -0000 Author: marius Date: Mon Oct 22 11:10:14 2012 New Revision: 241878 URL: http://svn.freebsd.org/changeset/base/241878 Log: MFC: r241740 - Remove an unused header. - Don't waste a delay slot. Modified: stable/9/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/9/sys/sparc64/sparc64/interrupt.S Mon Oct 22 11:07:59 2012 (r241877) +++ stable/9/sys/sparc64/sparc64/interrupt.S Mon Oct 22 11:10:14 2012 (r241878) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -84,13 +83,13 @@ ENTRY(intr_vector) * The 2nd word points to code to execute and the 3rd is an argument * to pass. Jump to it. */ - brnz,pt %g3, 1f + brnz,a,pt %g3, 1f + srlx %g3, 60, %g6 /* * NB: Zeus CPUs set some undocumented bits in the first data word. */ - and %g3, IV_MAX - 1, %g3 jmpl %g4, %g0 - nop + and %g3, IV_MAX - 1, %g3 /* NOTREACHED */ /* @@ -99,8 +98,7 @@ ENTRY(intr_vector) * 4 bits of the 1st data word specify a priority, and the 2nd and * 3rd a function and argument. */ -1: srlx %g3, 60, %g6 - brnz,a,pn %g6, 2f +1: brnz,a,pn %g6, 2f clr %g3 /* From owner-svn-src-stable-9@FreeBSD.ORG Mon Oct 22 12:39:57 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B551CF68; Mon, 22 Oct 2012 12:39:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 804318FC08; Mon, 22 Oct 2012 12: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 q9MCdvHe011772; Mon, 22 Oct 2012 12:39:57 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9MCdvkE011770; Mon, 22 Oct 2012 12:39:57 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201210221239.q9MCdvkE011770@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 22 Oct 2012 12:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241883 - stable/9/sbin/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2012 12:39:58 -0000 Author: melifaro Date: Mon Oct 22 12:39:57 2012 New Revision: 241883 URL: http://svn.freebsd.org/changeset/base/241883 Log: Merge r240892,r240893 Permit table to be used as IPv6 address. Whitespace fixes Reported by: Serhiy Popov Modified: stable/9/sbin/ipfw/ipv6.c Directory Properties: stable/9/sbin/ (props changed) stable/9/sbin/ipfw/ (props changed) Modified: stable/9/sbin/ipfw/ipv6.c ============================================================================== --- stable/9/sbin/ipfw/ipv6.c Mon Oct 22 12:22:56 2012 (r241882) +++ stable/9/sbin/ipfw/ipv6.c Mon Oct 22 12:39:57 2012 (r241883) @@ -336,24 +336,40 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) * Note d[1] points to struct in6_add r mask6 of cmd */ - cmd->o.len &= ~F_LEN_MASK; /* zero len */ + cmd->o.len &= ~F_LEN_MASK; /* zero len */ - if (strcmp(av, "any") == 0) - return (1); + if (strcmp(av, "any") == 0) + return (1); - if (strcmp(av, "me") == 0) { /* Set the data for "me" opt*/ - cmd->o.len |= F_INSN_SIZE(ipfw_insn); - return (1); - } + if (strcmp(av, "me") == 0) { /* Set the data for "me" opt*/ + cmd->o.len |= F_INSN_SIZE(ipfw_insn); + return (1); + } + + if (strcmp(av, "me6") == 0) { /* Set the data for "me" opt*/ + cmd->o.len |= F_INSN_SIZE(ipfw_insn); + return (1); + } - if (strcmp(av, "me6") == 0) { /* Set the data for "me" opt*/ - cmd->o.len |= F_INSN_SIZE(ipfw_insn); - return (1); - } + if (strncmp(av, "table(", 6) == 0) { + char *p = strchr(av + 6, ','); + uint32_t *dm = ((ipfw_insn_u32 *)cmd)->d; + + if (p) + *p++ = '\0'; + cmd->o.opcode = O_IP_DST_LOOKUP; + cmd->o.arg1 = strtoul(av + 6, NULL, 0); + if (p) { + cmd->o.len |= F_INSN_SIZE(ipfw_insn_u32); + dm[0] = strtoul(p, NULL, 0); + } else + cmd->o.len |= F_INSN_SIZE(ipfw_insn); + return (1); + } - av = strdup(av); - while (av) { + av = strdup(av); + while (av) { /* * After the address we can have '/' indicating a mask, * or ',' indicating another address follows. @@ -469,7 +485,11 @@ add_srcip6(ipfw_insn *cmd, char *av) { fill_ip6((ipfw_insn_ip6 *)cmd, av); - if (F_LEN(cmd) == 0) { /* any */ + if (cmd->opcode == O_IP_DST_SET) /* set */ + cmd->opcode = O_IP_SRC_SET; + else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ + cmd->opcode = O_IP_SRC_LOOKUP; + else if (F_LEN(cmd) == 0) { /* any */ } else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn)) { /* "me" */ cmd->opcode = O_IP6_SRC_ME; } else if (F_LEN(cmd) == @@ -487,7 +507,11 @@ add_dstip6(ipfw_insn *cmd, char *av) { fill_ip6((ipfw_insn_ip6 *)cmd, av); - if (F_LEN(cmd) == 0) { /* any */ + if (cmd->opcode == O_IP_DST_SET) /* set */ + ; + else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ + ; + else if (F_LEN(cmd) == 0) { /* any */ } else if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn)) { /* "me" */ cmd->opcode = O_IP6_DST_ME; } else if (F_LEN(cmd) == From owner-svn-src-stable-9@FreeBSD.ORG Mon Oct 22 17:56:16 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3649F73E; Mon, 22 Oct 2012 17:56:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CF158FC19; Mon, 22 Oct 2012 17:56: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 q9MHuFYL063300; Mon, 22 Oct 2012 17:56:15 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9MHuFEr063297; Mon, 22 Oct 2012 17:56:15 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201210221756.q9MHuFEr063297@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 22 Oct 2012 17:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241898 - stable/9/sys/dev/cxgbe/tom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2012 17:56:16 -0000 Author: np Date: Mon Oct 22 17:56:15 2012 New Revision: 241898 URL: http://svn.freebsd.org/changeset/base/241898 Log: MFC r241626, r241642. r241626: Whitespace cleanup. r241642: Always provide sndbuf and MSS values in a flowc command, even when the driver is going to abort the connection right after the flowc. Modified: stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c stable/9/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 22 17:54:32 2012 (r241897) +++ stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 22 17:56:15 2012 (r241898) @@ -73,9 +73,9 @@ VNET_DECLARE(int, tcp_autorcvbuf_max); void send_flowc_wr(struct toepcb *toep, struct flowc_tx_params *ftxp) { - struct wrqe *wr; - struct fw_flowc_wr *flowc; - unsigned int nparams = ftxp ? 8 : 4, flowclen; + struct wrqe *wr; + struct fw_flowc_wr *flowc; + unsigned int nparams = ftxp ? 8 : 6, flowclen; struct port_info *pi = toep->port; struct adapter *sc = pi->adapter; unsigned int pfvf = G_FW_VIID_PFN(pi->viid) << S_FW_VIID_PFN; @@ -102,13 +102,13 @@ send_flowc_wr(struct toepcb *toep, struc V_FW_WR_FLOWID(toep->tid)); flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; - flowc->mnemval[0].val = htobe32(pfvf); - flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; - flowc->mnemval[1].val = htobe32(pi->tx_chan); - flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; - flowc->mnemval[2].val = htobe32(pi->tx_chan); - flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; - flowc->mnemval[3].val = htobe32(toep->ofld_rxq->iq.abs_id); + flowc->mnemval[0].val = htobe32(pfvf); + flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; + flowc->mnemval[1].val = htobe32(pi->tx_chan); + flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; + flowc->mnemval[2].val = htobe32(pi->tx_chan); + flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; + flowc->mnemval[3].val = htobe32(toep->ofld_rxq->iq.abs_id); if (ftxp) { uint32_t sndbuf = min(ftxp->snd_space, sc->tt.sndbuf); @@ -120,6 +120,11 @@ send_flowc_wr(struct toepcb *toep, struc flowc->mnemval[6].val = htobe32(sndbuf); flowc->mnemval[7].mnemonic = FW_FLOWC_MNEM_MSS; flowc->mnemval[7].val = htobe32(ftxp->mss); + } else { + flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; + flowc->mnemval[4].val = htobe32(512); + flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS; + flowc->mnemval[5].val = htobe32(512); } txsd->tx_credits = howmany(flowclen, 16); Modified: stable/9/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_listen.c Mon Oct 22 17:54:32 2012 (r241897) +++ stable/9/sys/dev/cxgbe/tom/t4_listen.c Mon Oct 22 17:56:15 2012 (r241898) @@ -271,13 +271,13 @@ send_reset_synqe(struct toedev *tod, str struct ifnet *ifp = m->m_pkthdr.rcvif; struct port_info *pi = ifp->if_softc; struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; - struct wrqe *wr; - struct fw_flowc_wr *flowc; + struct wrqe *wr; + struct fw_flowc_wr *flowc; struct cpl_abort_req *req; int txqid, rxqid, flowclen; struct sge_wrq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; - const int nparams = 4; + const int nparams = 6; unsigned int pfvf = G_FW_VIID_PFN(pi->viid) << S_FW_VIID_PFN; INP_WLOCK_ASSERT(synqe->lctx->inp); @@ -312,13 +312,17 @@ send_reset_synqe(struct toedev *tod, str flowc->flowid_len16 = htonl(V_FW_WR_LEN16(howmany(flowclen, 16)) | V_FW_WR_FLOWID(synqe->tid)); flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; - flowc->mnemval[0].val = htobe32(pfvf); - flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; - flowc->mnemval[1].val = htobe32(pi->tx_chan); - flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; - flowc->mnemval[2].val = htobe32(pi->tx_chan); - flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; - flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id); + flowc->mnemval[0].val = htobe32(pfvf); + flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; + flowc->mnemval[1].val = htobe32(pi->tx_chan); + flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; + flowc->mnemval[2].val = htobe32(pi->tx_chan); + flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; + flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id); + flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; + flowc->mnemval[4].val = htobe32(512); + flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS; + flowc->mnemval[5].val = htobe32(512); synqe->flags |= TPF_FLOWC_WR_SENT; /* ... then ABORT request */ From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 12:37:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65B32646; Tue, 23 Oct 2012 12:37:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D3AC8FC12; Tue, 23 Oct 2012 12:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NCb3Rh063377; Tue, 23 Oct 2012 12:37:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NCb3Oq063374; Tue, 23 Oct 2012 12:37:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210231237.q9NCb3Oq063374@svn.freebsd.org> From: John Baldwin Date: Tue, 23 Oct 2012 12:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241928 - stable/9/usr.bin/make X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 12:37:03 -0000 Author: jhb Date: Tue Oct 23 12:37:02 2012 New Revision: 241928 URL: http://svn.freebsd.org/changeset/base/241928 Log: MFC 228157: - Fix segmentation fault when running "+command" when run with -jX -n due to Compat_RunCommand() being called with `cmd' that is not on the node->commands list - Make ellipsis ("..." command) handling consistent: check for "..." command in job make after variables expansion to match compat make behavior - Fix empty command handling (after variables expansion and @+- modifiers are processed): now empty commands are ignored in compat make and are not printed in job make case Modified: stable/9/usr.bin/make/Makefile stable/9/usr.bin/make/job.c Directory Properties: stable/9/usr.bin/make/ (props changed) Modified: stable/9/usr.bin/make/Makefile ============================================================================== --- stable/9/usr.bin/make/Makefile Tue Oct 23 12:03:32 2012 (r241927) +++ stable/9/usr.bin/make/Makefile Tue Oct 23 12:37:02 2012 (r241928) @@ -15,7 +15,7 @@ NO_SHARED?= YES .endif # Version has the RYYYYMMDDX format, where R is from RELENG_ -CFLAGS+=-DMAKE_VERSION=\"9201206140\" +CFLAGS+=-DMAKE_VERSION=\"9201210220\" # There is no obvious performance improvement currently. # CFLAGS+=-DUSE_KQUEUE Modified: stable/9/usr.bin/make/job.c ============================================================================== --- stable/9/usr.bin/make/job.c Tue Oct 23 12:03:32 2012 (r241927) +++ stable/9/usr.bin/make/job.c Tue Oct 23 12:37:02 2012 (r241928) @@ -381,7 +381,7 @@ static int JobStart(GNode *, int, Job *) static void JobDoOutput(Job *, Boolean); static void JobInterrupt(int, int); static void JobRestartJobs(void); -static int Compat_RunCommand(char *, struct GNode *); +static int Compat_RunCommand(LstNode *, struct GNode *); static GNode *curTarg = NULL; static GNode *ENDNode; @@ -647,7 +647,7 @@ JobPassSig(int signo) * numCommands is incremented if the command is actually printed. */ static int -JobPrintCommand(char *cmd, Job *job) +JobPrintCommand(LstNode *cmdNode, Job *job) { Boolean noSpecials; /* true if we shouldn't worry about * inserting special commands into @@ -658,40 +658,30 @@ JobPrintCommand(char *cmd, Job *job) * off before printing the command * and need to turn it back on */ const char *cmdTemplate;/* Template to use when printing the command */ - char *cmdStart; /* Start of expanded command */ - LstNode *cmdNode; /* Node for replacing the command */ + char *cmd; /* Expanded command */ noSpecials = (noExecute && !(job->node->type & OP_MAKE)); - if (strcmp(cmd, "...") == 0) { - job->node->type |= OP_SAVE_CMDS; - if ((job->flags & JOB_IGNDOTS) == 0) { - job->tailCmds = - Lst_Succ(Lst_Member(&job->node->commands, cmd)); - return (1); - } - return (0); - } - #define DBPRINTF(fmt, arg) \ DEBUGF(JOB, (fmt, arg)); \ fprintf(job->cmdFILE, fmt, arg); \ fflush(job->cmdFILE); - numCommands += 1; - /* * For debugging, we replace each command with the result of expanding * the variables in the command. */ - cmdNode = Lst_Member(&job->node->commands, cmd); - - cmd = Buf_Peel(Var_Subst(cmd, job->node, FALSE)); - cmdStart = cmd; - - Lst_Replace(cmdNode, cmdStart); - - cmdTemplate = "%s\n"; + cmd = Buf_Peel(Var_Subst(Lst_Datum(cmdNode), job->node, FALSE)); + if (strcmp(cmd, "...") == 0) { + free(cmd); + job->node->type |= OP_SAVE_CMDS; + if ((job->flags & JOB_IGNDOTS) == 0) { + job->tailCmds = Lst_Succ(cmdNode); + return (1); + } + return (0); + } + Lst_Replace(cmdNode, cmd); /* * Check for leading @', -' or +'s to control echoing, error checking, @@ -715,7 +705,7 @@ JobPrintCommand(char *cmd, Job *job) * but this one needs to be - use compat mode * just for it. */ - Compat_RunCommand(cmd, job->node); + Compat_RunCommand(cmdNode, job->node); return (0); } break; @@ -726,6 +716,16 @@ JobPrintCommand(char *cmd, Job *job) while (isspace((unsigned char)*cmd)) cmd++; + /* + * Ignore empty commands + */ + if (*cmd == '\0') { + return (0); + } + + cmdTemplate = "%s\n"; + numCommands += 1; + if (shutUp) { if (!(job->flags & JOB_SILENT) && !noSpecials && commandShell->hasEchoCtl) { @@ -1670,7 +1670,7 @@ JobStart(GNode *gn, int flags, Job *prev Lst_Succ(gn->compat_command); if (gn->compat_command == NULL || - JobPrintCommand(Lst_Datum(gn->compat_command), job)) + JobPrintCommand(gn->compat_command, job)) noExec = TRUE; if (noExec && !(job->flags & JOB_FIRST)) { @@ -1694,7 +1694,7 @@ JobStart(GNode *gn, int flags, Job *prev */ numCommands = 0; LST_FOREACH(ln, &gn->commands) { - if (JobPrintCommand(Lst_Datum(ln), job)) + if (JobPrintCommand(ln, job)) break; } @@ -1728,7 +1728,7 @@ JobStart(GNode *gn, int flags, Job *prev */ if (cmdsOK) { LST_FOREACH(ln, &gn->commands) { - if (JobPrintCommand(Lst_Datum(ln), job)) + if (JobPrintCommand(ln, job)) break; } } @@ -2814,7 +2814,7 @@ CompatInterrupt(int signo) gn = Targ_FindNode(".INTERRUPT", TARG_NOCREATE); if (gn != NULL) { LST_FOREACH(ln, &gn->commands) { - if (Compat_RunCommand(Lst_Datum(ln), gn)) + if (Compat_RunCommand(ln, gn)) break; } } @@ -2889,16 +2889,15 @@ shellneed(ArgArray *aa, char *cmd) * The node's 'made' field may be set to ERROR. */ static int -Compat_RunCommand(char *cmd, GNode *gn) +Compat_RunCommand(LstNode *cmdNode, GNode *gn) { ArgArray aa; - char *cmdStart; /* Start of expanded command */ + char *cmd; /* Expanded command */ Boolean silent; /* Don't print command */ Boolean doit; /* Execute even in -n */ Boolean errCheck; /* Check errors */ int reason; /* Reason for child's death */ int status; /* Description of child's death */ - LstNode *cmdNode; /* Node where current cmd is located */ char **av; /* Argument vector for thing to exec */ ProcStuff ps; @@ -2906,31 +2905,16 @@ Compat_RunCommand(char *cmd, GNode *gn) errCheck = !(gn->type & OP_IGNORE); doit = FALSE; - cmdNode = Lst_Member(&gn->commands, cmd); - cmdStart = Buf_Peel(Var_Subst(cmd, gn, FALSE)); - - /* - * brk_string will return an argv with a NULL in av[0], thus causing - * execvp() to choke and die horribly. Besides, how can we execute a - * null command? In any case, we warn the user that the command - * expanded to nothing (is this the right thing to do?). - */ - if (*cmdStart == '\0') { - free(cmdStart); - Error("%s expands to empty string", cmd); - return (0); - } else { - cmd = cmdStart; - } - Lst_Replace(cmdNode, cmdStart); - + cmd = Buf_Peel(Var_Subst(Lst_Datum(cmdNode), gn, FALSE)); if ((gn->type & OP_SAVE_CMDS) && (gn != ENDNode)) { - Lst_AtEnd(&ENDNode->commands, cmdStart); + Lst_AtEnd(&ENDNode->commands, cmd); return (0); - } else if (strcmp(cmdStart, "...") == 0) { + } else if (strcmp(cmd, "...") == 0) { + free(cmd); gn->type |= OP_SAVE_CMDS; return (0); } + Lst_Replace(cmdNode, cmd); while (*cmd == '@' || *cmd == '-' || *cmd == '+') { switch (*cmd) { @@ -2954,6 +2938,13 @@ Compat_RunCommand(char *cmd, GNode *gn) cmd++; /* + * Ignore empty commands + */ + if (*cmd == '\0') { + return (0); + } + + /* * Print the command before echoing if we're not supposed to be quiet * for this one. We also print the command if -n given, but not if '+'. */ @@ -3027,7 +3018,8 @@ Compat_RunCommand(char *cmd, GNode *gn) * therefore do not free it when debugging. */ if (!DEBUG(GRAPH2)) { - free(cmdStart); + free(Lst_Datum(cmdNode)); + Lst_Replace(cmdNode, NULL); } /* @@ -3173,8 +3165,7 @@ Compat_Make(GNode *gn, GNode *pgn) if (!touchFlag) { curTarg = gn; LST_FOREACH(ln, &gn->commands) { - if (Compat_RunCommand(Lst_Datum(ln), - gn)) + if (Compat_RunCommand(ln, gn)) break; } curTarg = NULL; @@ -3352,7 +3343,7 @@ Compat_Run(Lst *targs) gn = Targ_FindNode(".BEGIN", TARG_NOCREATE); if (gn != NULL) { LST_FOREACH(ln, &gn->commands) { - if (Compat_RunCommand(Lst_Datum(ln), gn)) + if (Compat_RunCommand(ln, gn)) break; } if (gn->made == ERROR) { @@ -3393,7 +3384,7 @@ Compat_Run(Lst *targs) */ if (makeErrors == 0) { LST_FOREACH(ln, &ENDNode->commands) { - if (Compat_RunCommand(Lst_Datum(ln), ENDNode)) + if (Compat_RunCommand(ln, ENDNode)) break; } } From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 12:37:45 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 999167BB; Tue, 23 Oct 2012 12:37:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 822F28FC18; Tue, 23 Oct 2012 12:37: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 q9NCbjsp063527; Tue, 23 Oct 2012 12:37:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NCbjUp063525; Tue, 23 Oct 2012 12:37:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210231237.q9NCbjUp063525@svn.freebsd.org> From: John Baldwin Date: Tue, 23 Oct 2012 12:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241929 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 12:37:45 -0000 Author: jhb Date: Tue Oct 23 12:37:44 2012 New Revision: 241929 URL: http://svn.freebsd.org/changeset/base/241929 Log: Update the make version required to use an empty command for CTFCONVERT_CMD to require the most recent MFC to 9. Modified: stable/9/share/mk/bsd.own.mk Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Tue Oct 23 12:37:02 2012 (r241928) +++ stable/9/share/mk/bsd.own.mk Tue Oct 23 12:37:44 2012 (r241929) @@ -642,7 +642,7 @@ MK_${vv:H}:= ${MK_${vv:T}} .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.elif ${MAKE_VERSION} >= 5201111300 +.elif ${MAKE_VERSION} >= 9201210220 CTFCONVERT_CMD= .else CTFCONVERT_CMD= @: From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:15:17 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3CFF2AC8; Tue, 23 Oct 2012 15:15:17 +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 244668FC19; Tue, 23 Oct 2012 15:15: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 q9NFFGbF093982; Tue, 23 Oct 2012 15:15:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFFG5S093980; Tue, 23 Oct 2012 15:15:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231515.q9NFFG5S093980@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241935 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:15:17 -0000 Author: mav Date: Tue Oct 23 15:15:16 2012 New Revision: 241935 URL: http://svn.freebsd.org/changeset/base/241935 Log: MFC r241028: Change queue overflow checks from DIAGNOSTIC+panic() to KASSERT() to make them enabled on HEAD by default. It is probably better to do single compare then hunt for unexpected memory corruption. Modified: stable/9/sys/cam/cam_queue.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_queue.c ============================================================================== --- stable/9/sys/cam/cam_queue.c Tue Oct 23 15:03:25 2012 (r241934) +++ stable/9/sys/cam/cam_queue.c Tue Oct 23 15:15:16 2012 (r241935) @@ -121,11 +121,9 @@ camq_resize(struct camq *queue, int new_ { cam_pinfo **new_array; -#ifdef DIAGNOSTIC - if (new_size < queue->entries) - panic("camq_resize: New queue size can't accomodate " - "queued entries."); -#endif + KASSERT(new_size >= queue->entries, ("camq_resize: " + "New queue size can't accomodate queued entries (%d < %d).", + new_size, queue->entries)); new_array = (cam_pinfo **)malloc(new_size * sizeof(cam_pinfo *), M_CAMQ, M_NOWAIT); if (new_array == NULL) { @@ -156,10 +154,10 @@ camq_resize(struct camq *queue, int new_ void camq_insert(struct camq *queue, cam_pinfo *new_entry) { -#ifdef DIAGNOSTIC - if (queue->entries >= queue->array_size) - panic("camq_insert: Attempt to insert into a full queue"); -#endif + + KASSERT(queue->entries < queue->array_size, + ("camq_insert: Attempt to insert into a full queue (%d >= %d)", + queue->entries, queue->array_size)); queue->entries++; queue->queue_array[queue->entries] = new_entry; new_entry->index = queue->entries; From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:16:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A000D66; Tue, 23 Oct 2012 15:16:51 +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 30FBE8FC0C; Tue, 23 Oct 2012 15:16:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NFGpXr094404; Tue, 23 Oct 2012 15:16:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFGoub094392; Tue, 23 Oct 2012 15:16:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231516.q9NFGoub094392@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241937 - in stable/9/sys/cam: ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:16:51 -0000 Author: mav Date: Tue Oct 23 15:16:50 2012 New Revision: 241937 URL: http://svn.freebsd.org/changeset/base/241937 Log: MFC r241404: Remove 'periph == NULL' check from bunch of periph drivers. This condition can never be true as functions are called from single place and the checks just pollute the code and confuse Clang Static Analyzer. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_pmp.c stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_ch.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_pass.c stable/9/sys/cam/scsi/scsi_sa.c stable/9/sys/cam/scsi/scsi_sg.c stable/9/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/ata/ata_da.c Tue Oct 23 15:16:50 2012 (r241937) @@ -943,11 +943,6 @@ adaregister(struct cam_periph *periph, v int legacy_id, quirks; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("adaregister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("adaregister: no getdev CCB, can't register device\n"); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/ata/ata_pmp.c Tue Oct 23 15:16:50 2012 (r241937) @@ -367,11 +367,6 @@ pmpregister(struct cam_periph *periph, v struct ccb_getdev *cgd; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("pmpregister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("pmpregister: no getdev CCB, can't register device\n"); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/ata/ata_xpt.c Tue Oct 23 15:16:50 2012 (r241937) @@ -224,11 +224,6 @@ proberegister(struct cam_periph *periph, probe_softc *softc; request_ccb = (union ccb *)arg; - if (periph == NULL) { - printf("proberegister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (request_ccb == NULL) { printf("proberegister: no probe CCB, " "can't register device\n"); Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_cd.c Tue Oct 23 15:16:50 2012 (r241937) @@ -641,10 +641,6 @@ cdregister(struct cam_periph *periph, vo caddr_t match; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("cdregister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } if (cgd == NULL) { printf("cdregister: no getdev CCB, can't register device\n"); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_ch.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_ch.c Tue Oct 23 15:16:50 2012 (r241937) @@ -324,11 +324,6 @@ chregister(struct cam_periph *periph, vo struct ccb_pathinq cpi; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("chregister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("chregister: no getdev CCB, can't register device\n"); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_da.c Tue Oct 23 15:16:50 2012 (r241937) @@ -1550,11 +1550,6 @@ daregister(struct cam_periph *periph, vo caddr_t match; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("daregister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("daregister: no getdev CCB, can't register device\n"); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_pass.c Tue Oct 23 15:16:50 2012 (r241937) @@ -312,11 +312,6 @@ passregister(struct cam_periph *periph, int no_tags; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("%s: periph was NULL!!\n", __func__); - return(CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("%s: no getdev CCB, can't register device\n", __func__); return(CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sa.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_sa.c Tue Oct 23 15:16:50 2012 (r241937) @@ -1445,11 +1445,6 @@ saregister(struct cam_periph *periph, vo int i; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("saregister: periph was NULL!!\n"); - return (CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("saregister: no getdev CCB, can't register device\n"); return (CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sg.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_sg.c Tue Oct 23 15:16:50 2012 (r241937) @@ -261,11 +261,6 @@ sgregister(struct cam_periph *periph, vo int no_tags; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("sgregister: periph was NULL!!\n"); - return (CAM_REQ_CMP_ERR); - } - if (cgd == NULL) { printf("sgregister: no getdev CCB, can't register device\n"); return (CAM_REQ_CMP_ERR); Modified: stable/9/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_xpt.c Tue Oct 23 15:16:40 2012 (r241936) +++ stable/9/sys/cam/scsi/scsi_xpt.c Tue Oct 23 15:16:50 2012 (r241937) @@ -615,11 +615,6 @@ proberegister(struct cam_periph *periph, probe_softc *softc; request_ccb = (union ccb *)arg; - if (periph == NULL) { - printf("proberegister: periph was NULL!!\n"); - return(CAM_REQ_CMP_ERR); - } - if (request_ccb == NULL) { printf("proberegister: no probe CCB, " "can't register device\n"); From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:18:16 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF158F37; Tue, 23 Oct 2012 15:18:16 +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 969148FC08; Tue, 23 Oct 2012 15:18:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NFIGhM094781; Tue, 23 Oct 2012 15:18:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFIGjG094779; Tue, 23 Oct 2012 15:18:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231518.q9NFIGjG094779@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241938 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:18:16 -0000 Author: mav Date: Tue Oct 23 15:18:16 2012 New Revision: 241938 URL: http://svn.freebsd.org/changeset/base/241938 Log: MFC r241405: Really handle xpt_compile_path() error in xpt_bus_register() instead of print error message and probably crash just after it on NULL dereference. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:16:50 2012 (r241937) +++ stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:18:16 2012 (r241938) @@ -3898,8 +3898,11 @@ xpt_bus_register(struct cam_sim *sim, de status = xpt_compile_path(path, /*periph*/NULL, sim->path_id, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); - if (status != CAM_REQ_CMP) - printf("xpt_compile_path returned %d\n", status); + if (status != CAM_REQ_CMP) { + xpt_release_bus(new_bus); + free(path, M_CAMXPT); + return (CAM_RESRC_UNAVAIL); + } xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); cpi.ccb_h.func_code = XPT_PATH_INQ; From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:21:00 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E69C1DF; Tue, 23 Oct 2012 15:21: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 0675D8FC17; Tue, 23 Oct 2012 15:21: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 q9NFKxrH095420; Tue, 23 Oct 2012 15:20:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFKx7N095418; Tue, 23 Oct 2012 15:20:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231520.q9NFKx7N095418@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241939 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:21:00 -0000 Author: mav Date: Tue Oct 23 15:20:59 2012 New Revision: 241939 URL: http://svn.freebsd.org/changeset/base/241939 Log: MFC r241410: There are SCSI conditions that are not an errors. In those cases cderror() returns zero while request status is not CAM_REQ_CMP. That could cause partial device attach or other unexpected results. Modified: stable/9/sys/cam/scsi/scsi_cd.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Tue Oct 23 15:18:16 2012 (r241938) +++ stable/9/sys/cam/scsi/scsi_cd.c Tue Oct 23 15:20:59 2012 (r241939) @@ -1661,6 +1661,7 @@ cddone(struct cam_periph *periph, union * bytes. */ struct cd_params *cdp; + int error; cdp = &softc->params; @@ -1669,28 +1670,26 @@ cddone(struct cam_periph *periph, union cdp->disksize = scsi_4btoul (rdcap->addr) + 1; cdp->blksize = scsi_4btoul (rdcap->length); - if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + /* + * Retry any UNIT ATTENTION type errors. They + * are expected at boot. + */ + if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP || + (error = cderror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA | SF_NO_PRINT)) == 0) { snprintf(announce_buf, sizeof(announce_buf), "cd present [%lu x %lu byte records]", cdp->disksize, (u_long)cdp->blksize); } else { - int error; - /* - * Retry any UNIT ATTENTION type errors. They - * are expected at boot. - */ - error = cderror(done_ccb, CAM_RETRY_SELTO, - SF_RETRY_UA | SF_NO_PRINT); if (error == ERESTART) { /* * A retry was scheuled, so * just return. */ return; - } else if (error != 0) { - + } else { struct scsi_sense_data *sense; int asc, ascq; int sense_key, error_code; From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:22:12 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D7964C0; Tue, 23 Oct 2012 15:22:12 +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 EE7CD8FC1C; Tue, 23 Oct 2012 15:22:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NFMBJV095788; Tue, 23 Oct 2012 15:22:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFMB5O095783; Tue, 23 Oct 2012 15:22:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231522.q9NFMB5O095783@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241940 - in stable/9/sys/cam: . ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:22:12 -0000 Author: mav Date: Tue Oct 23 15:22:11 2012 New Revision: 241940 URL: http://svn.freebsd.org/changeset/base/241940 Log: MFC r241455: Don't duplicate path/ccb allocation code, use existing functions. Modified: stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Tue Oct 23 15:20:59 2012 (r241939) +++ stable/9/sys/cam/ata/ata_xpt.c Tue Oct 23 15:22:11 2012 (r241940) @@ -1450,29 +1450,20 @@ ata_scan_lun(struct cam_periph *periph, } if (request_ccb == NULL) { - request_ccb = malloc(sizeof(union ccb), M_CAMXPT, M_NOWAIT); + request_ccb = xpt_alloc_ccb_nowait(); if (request_ccb == NULL) { xpt_print(path, "xpt_scan_lun: can't allocate CCB, " "can't continue\n"); return; } - new_path = malloc(sizeof(*new_path), M_CAMXPT, M_NOWAIT); - if (new_path == NULL) { - xpt_print(path, "xpt_scan_lun: can't allocate path, " - "can't continue\n"); - free(request_ccb, M_CAMXPT); - return; - } - status = xpt_compile_path(new_path, xpt_periph, + status = xpt_create_path(&new_path, xpt_periph, path->bus->path_id, path->target->target_id, path->device->lun_id); - if (status != CAM_REQ_CMP) { - xpt_print(path, "xpt_scan_lun: can't compile path, " + xpt_print(path, "xpt_scan_lun: can't create path, " "can't continue\n"); - free(request_ccb, M_CAMXPT); - free(new_path, M_CAMXPT); + xpt_free_ccb(request_ccb); return; } xpt_setup_ccb(&request_ccb->ccb_h, new_path, CAM_PRIORITY_XPT); @@ -1512,9 +1503,9 @@ ata_scan_lun(struct cam_periph *periph, static void xptscandone(struct cam_periph *periph, union ccb *done_ccb) { - xpt_release_path(done_ccb->ccb_h.path); - free(done_ccb->ccb_h.path, M_CAMXPT); - free(done_ccb, M_CAMXPT); + + xpt_free_path(done_ccb->ccb_h.path); + xpt_free_ccb(done_ccb); } static struct cam_ed * Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:20:59 2012 (r241939) +++ stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:22:11 2012 (r241940) @@ -3857,12 +3857,6 @@ xpt_bus_register(struct cam_sim *sim, de /* Couldn't satisfy request */ return (CAM_RESRC_UNAVAIL); } - path = (struct cam_path *)malloc(sizeof(*path), M_CAMXPT, M_NOWAIT); - if (path == NULL) { - free(new_bus, M_CAMXPT); - return (CAM_RESRC_UNAVAIL); - } - if (strcmp(sim->sim_name, "xpt") != 0) { sim->path_id = xptpathid(sim->sim_name, sim->unit_number, sim->bus_id); @@ -3896,7 +3890,7 @@ xpt_bus_register(struct cam_sim *sim, de */ new_bus->xport = &xport_default; - status = xpt_compile_path(path, /*periph*/NULL, sim->path_id, + status = xpt_create_path(&path, /*periph*/NULL, sim->path_id, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { xpt_release_bus(new_bus); Modified: stable/9/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_xpt.c Tue Oct 23 15:20:59 2012 (r241939) +++ stable/9/sys/cam/scsi/scsi_xpt.c Tue Oct 23 15:22:11 2012 (r241940) @@ -2243,29 +2243,20 @@ scsi_scan_lun(struct cam_periph *periph, } if (request_ccb == NULL) { - request_ccb = malloc(sizeof(union ccb), M_CAMXPT, M_NOWAIT); + request_ccb = xpt_alloc_ccb_nowait(); if (request_ccb == NULL) { xpt_print(path, "scsi_scan_lun: can't allocate CCB, " "can't continue\n"); return; } - new_path = malloc(sizeof(*new_path), M_CAMXPT, M_NOWAIT); - if (new_path == NULL) { - xpt_print(path, "scsi_scan_lun: can't allocate path, " - "can't continue\n"); - free(request_ccb, M_CAMXPT); - return; - } - status = xpt_compile_path(new_path, xpt_periph, + status = xpt_create_path(&new_path, xpt_periph, path->bus->path_id, path->target->target_id, path->device->lun_id); - if (status != CAM_REQ_CMP) { - xpt_print(path, "scsi_scan_lun: can't compile path, " + xpt_print(path, "scsi_scan_lun: can't create path, " "can't continue\n"); - free(request_ccb, M_CAMXPT); - free(new_path, M_CAMXPT); + xpt_free_ccb(request_ccb); return; } xpt_setup_ccb(&request_ccb->ccb_h, new_path, CAM_PRIORITY_XPT); @@ -2304,9 +2295,9 @@ scsi_scan_lun(struct cam_periph *periph, static void xptscandone(struct cam_periph *periph, union ccb *done_ccb) { - xpt_release_path(done_ccb->ccb_h.path); - free(done_ccb->ccb_h.path, M_CAMXPT); - free(done_ccb, M_CAMXPT); + + xpt_free_path(done_ccb->ccb_h.path); + xpt_free_ccb(done_ccb); } static struct cam_ed * From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:25:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B51C0663; Tue, 23 Oct 2012 15:25:19 +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 9D3908FC17; Tue, 23 Oct 2012 15:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NFPJKc096567; Tue, 23 Oct 2012 15:25:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFPJna096564; Tue, 23 Oct 2012 15:25:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231525.q9NFPJna096564@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241941 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:25:19 -0000 Author: mav Date: Tue Oct 23 15:25:19 2012 New Revision: 241941 URL: http://svn.freebsd.org/changeset/base/241941 Log: MFC r241456: Use separate malloc buckets for CAM devices, CCBs and paths. This will make it easier to track down the source of any use after free problems. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:22:11 2012 (r241940) +++ stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:25:19 2012 (r241941) @@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$"); /* Datastructures internal to the xpt layer */ MALLOC_DEFINE(M_CAMXPT, "CAM XPT", "CAM XPT buffers"); +MALLOC_DEFINE(M_CAMDEV, "CAM DEV", "CAM devices"); +MALLOC_DEFINE(M_CAMCCB, "CAM CCB", "CAM CCBs"); +MALLOC_DEFINE(M_CAMPATH, "CAM path", "CAM paths"); /* Object for defering XPT actions to a taskqueue */ struct xpt_task { @@ -3397,7 +3400,7 @@ xpt_create_path(struct cam_path **new_pa struct cam_path *path; cam_status status; - path = (struct cam_path *)malloc(sizeof(*path), M_CAMXPT, M_NOWAIT); + path = (struct cam_path *)malloc(sizeof(*path), M_CAMPATH, M_NOWAIT); if (path == NULL) { status = CAM_RESRC_UNAVAIL; @@ -3405,7 +3408,7 @@ xpt_create_path(struct cam_path **new_pa } status = xpt_compile_path(path, perph, path_id, target_id, lun_id); if (status != CAM_REQ_CMP) { - free(path, M_CAMXPT); + free(path, M_CAMPATH); path = NULL; } *new_path_ptr = path; @@ -3422,7 +3425,7 @@ xpt_create_path_unlocked(struct cam_path cam_status status; int need_unlock = 0; - path = (struct cam_path *)malloc(sizeof(*path), M_CAMXPT, M_WAITOK); + path = (struct cam_path *)malloc(sizeof(*path), M_CAMPATH, M_WAITOK); if (path_id != CAM_BUS_WILDCARD) { bus = xpt_find_bus(path_id); @@ -3437,7 +3440,7 @@ xpt_create_path_unlocked(struct cam_path xpt_release_bus(bus); } if (status != CAM_REQ_CMP) { - free(path, M_CAMXPT); + free(path, M_CAMPATH); path = NULL; } *new_path_ptr = path; @@ -3540,7 +3543,7 @@ xpt_free_path(struct cam_path *path) CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_free_path\n")); xpt_release_path(path); - free(path, M_CAMXPT); + free(path, M_CAMPATH); } void @@ -4376,7 +4379,7 @@ xpt_alloc_ccb() { union ccb *new_ccb; - new_ccb = malloc(sizeof(*new_ccb), M_CAMXPT, M_ZERO|M_WAITOK); + new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_ZERO|M_WAITOK); return (new_ccb); } @@ -4385,14 +4388,14 @@ xpt_alloc_ccb_nowait() { union ccb *new_ccb; - new_ccb = malloc(sizeof(*new_ccb), M_CAMXPT, M_ZERO|M_NOWAIT); + new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_ZERO|M_NOWAIT); return (new_ccb); } void xpt_free_ccb(union ccb *free_ccb) { - free(free_ccb, M_CAMXPT); + free(free_ccb, M_CAMCCB); } @@ -4544,7 +4547,7 @@ xpt_alloc_device(struct cam_eb *bus, str device = NULL; } else { device = (struct cam_ed *)malloc(sizeof(*device), - M_CAMXPT, M_NOWAIT|M_ZERO); + M_CAMDEV, M_NOWAIT|M_ZERO); } if (device != NULL) { @@ -4557,13 +4560,13 @@ xpt_alloc_device(struct cam_eb *bus, str device->sim = bus->sim; /* Initialize our queues */ if (camq_init(&device->drvq, 0) != 0) { - free(device, M_CAMXPT); + free(device, M_CAMDEV); return (NULL); } if (cam_ccbq_init(&device->ccbq, bus->sim->max_dev_openings) != 0) { camq_fini(&device->drvq); - free(device, M_CAMXPT); + free(device, M_CAMDEV); return (NULL); } SLIST_INIT(&device->asyncs); @@ -4616,7 +4619,7 @@ xpt_release_device(struct cam_ed *device camq_fini(&device->drvq); cam_ccbq_fini(&device->ccbq); xpt_release_target(device->target); - free(device, M_CAMXPT); + free(device, M_CAMDEV); } else device->refcount--; } From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:27:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 535ED970; Tue, 23 Oct 2012 15:27:33 +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 382468FC14; Tue, 23 Oct 2012 15:27: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 q9NFRXPf097179; Tue, 23 Oct 2012 15:27:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFRWER097174; Tue, 23 Oct 2012 15:27:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231527.q9NFRWER097174@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241943 - in stable/9/sys/cam: . ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:27:33 -0000 Author: mav Date: Tue Oct 23 15:27:32 2012 New Revision: 241943 URL: http://svn.freebsd.org/changeset/base/241943 Log: MFC r241485: Protect xpt_getattr() calls with the SIM lock and assert that. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_pass.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Tue Oct 23 15:25:48 2012 (r241942) +++ stable/9/sys/cam/ata/ata_da.c Tue Oct 23 15:27:32 2012 (r241943) @@ -914,17 +914,17 @@ adasysctlinit(void *context, int pending static int adagetattr(struct bio *bp) { - int ret = -1; + int ret; struct cam_periph *periph; - if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) - return ENXIO; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph->path == NULL) - return ENXIO; + if (periph == NULL) + return (ENXIO); + cam_periph_lock(periph); ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute, periph->path); + cam_periph_unlock(periph); if (ret == 0) bp->bio_completed = bp->bio_length; return ret; Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:25:48 2012 (r241942) +++ stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:27:32 2012 (r241943) @@ -1111,6 +1111,8 @@ xpt_getattr(char *buf, size_t len, const int ret = -1; struct ccb_dev_advinfo cdai; + mtx_assert(path->bus->sim->mtx, MA_OWNED); + memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Tue Oct 23 15:25:48 2012 (r241942) +++ stable/9/sys/cam/scsi/scsi_da.c Tue Oct 23 15:27:32 2012 (r241943) @@ -1213,17 +1213,17 @@ dadump(void *arg, void *virtual, vm_offs static int dagetattr(struct bio *bp) { - int ret = -1; + int ret; struct cam_periph *periph; - if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) - return ENXIO; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph->path == NULL) - return ENXIO; + if (periph == NULL) + return (ENXIO); + cam_periph_lock(periph); ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute, periph->path); + cam_periph_unlock(periph); if (ret == 0) bp->bio_completed = bp->bio_length; return ret; Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Tue Oct 23 15:25:48 2012 (r241942) +++ stable/9/sys/cam/scsi/scsi_pass.c Tue Oct 23 15:27:32 2012 (r241943) @@ -212,27 +212,26 @@ pass_add_physpath(void *context, int pen */ periph = context; softc = periph->softc; + physpath = malloc(MAXPATHLEN, M_DEVBUF, M_WAITOK); cam_periph_lock(periph); if (periph->flags & CAM_PERIPH_INVALID) { cam_periph_unlock(periph); - return; + goto out; } - cam_periph_unlock(periph); - physpath = malloc(MAXPATHLEN, M_DEVBUF, M_WAITOK); if (xpt_getattr(physpath, MAXPATHLEN, "GEOM::physpath", periph->path) == 0 && strlen(physpath) != 0) { + cam_periph_unlock(periph); make_dev_physpath_alias(MAKEDEV_WAITOK, &softc->alias_dev, softc->dev, softc->alias_dev, physpath); + cam_periph_lock(periph); } - free(physpath, M_DEVBUF); /* * Now that we've made our alias, we no longer have to have a * reference to the device. */ - cam_periph_lock(periph); if ((softc->flags & PASS_FLAG_INITIAL_PHYSPATH) == 0) { softc->flags |= PASS_FLAG_INITIAL_PHYSPATH; cam_periph_unlock(periph); @@ -240,6 +239,9 @@ pass_add_physpath(void *context, int pen } else cam_periph_unlock(periph); + +out: + free(physpath, M_DEVBUF); } static void From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:31:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2EBB4C7D; Tue, 23 Oct 2012 15:31:51 +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 F083E8FC16; Tue, 23 Oct 2012 15:31: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 q9NFVoNx098295; Tue, 23 Oct 2012 15:31:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFVodf098293; Tue, 23 Oct 2012 15:31:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231531.q9NFVodf098293@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241944 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:31:51 -0000 Author: mav Date: Tue Oct 23 15:31:50 2012 New Revision: 241944 URL: http://svn.freebsd.org/changeset/base/241944 Log: MFC r241504: Fix XPT_DEBUG paths operations locking: - Extend the lock to cover xpt_path_release() for the new path. - While xpt_action() is called while holding right SIM lock for the new bus, the old path release may require different SIM lock. So we have to temporary drop the new lock and get the old one. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:27:32 2012 (r241943) +++ stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:31:50 2012 (r241944) @@ -533,9 +533,9 @@ xptioctl(struct cdev *dev, u_long cmd, c xpt_merge_ccb(&ccb, inccb); ccb.ccb_h.cbfcnp = xptdone; xpt_action(&ccb); - CAM_SIM_UNLOCK(bus->sim); bcopy(&ccb, inccb, sizeof(union ccb)); xpt_free_path(ccb.ccb_h.path); + CAM_SIM_UNLOCK(bus->sim); break; } @@ -2981,34 +2981,42 @@ xpt_action_default(union ccb *start_ccb) break; } case XPT_DEBUG: { + struct cam_path *oldpath; + struct cam_sim *oldsim; + /* Check that all request bits are supported. */ if (start_ccb->cdbg.flags & ~(CAM_DEBUG_COMPILE)) { start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; break; } - cam_dflags = start_ccb->cdbg.flags; + cam_dflags = CAM_DEBUG_NONE; if (cam_dpath != NULL) { - xpt_free_path(cam_dpath); + /* To release the old path we must hold proper lock. */ + oldpath = cam_dpath; cam_dpath = NULL; + oldsim = xpt_path_sim(oldpath); + CAM_SIM_UNLOCK(xpt_path_sim(start_ccb->ccb_h.path)); + CAM_SIM_LOCK(oldsim); + xpt_free_path(oldpath); + CAM_SIM_UNLOCK(oldsim); + CAM_SIM_LOCK(xpt_path_sim(start_ccb->ccb_h.path)); } - if (cam_dflags != CAM_DEBUG_NONE) { + if (start_ccb->cdbg.flags != CAM_DEBUG_NONE) { if (xpt_create_path(&cam_dpath, xpt_periph, start_ccb->ccb_h.path_id, start_ccb->ccb_h.target_id, start_ccb->ccb_h.target_lun) != CAM_REQ_CMP) { start_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; - cam_dflags = CAM_DEBUG_NONE; } else { + cam_dflags = start_ccb->cdbg.flags; start_ccb->ccb_h.status = CAM_REQ_CMP; xpt_print(cam_dpath, "debugging flags now %x\n", cam_dflags); } - } else { - cam_dpath = NULL; + } else start_ccb->ccb_h.status = CAM_REQ_CMP; - } break; } case XPT_FREEZE_QUEUE: From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:33:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60AE5E96; Tue, 23 Oct 2012 15:33:33 +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 2F0348FC0C; Tue, 23 Oct 2012 15:33: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 q9NFXXj5098799; Tue, 23 Oct 2012 15:33:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFXWiK098797; Tue, 23 Oct 2012 15:33:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231533.q9NFXWiK098797@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241945 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:33:33 -0000 Author: mav Date: Tue Oct 23 15:33:32 2012 New Revision: 241945 URL: http://svn.freebsd.org/changeset/base/241945 Log: MFC r241508: Extend SIM lock coverage during the bus registration process. Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Oct 23 15:31:50 2012 (r241944) +++ stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Tue Oct 23 15:33:32 2012 (r241945) @@ -175,8 +175,8 @@ cfcs_init(void) if (retval != 0) { printf("%s: ctl_frontend_register() failed with error %d!\n", __func__, retval); - retval = 1; - goto bailout; + mtx_destroy(&softc->lock); + return (1); } /* @@ -207,7 +207,7 @@ cfcs_init(void) softc->wwpn = fe->wwpn; } - + mtx_lock(&softc->lock); softc->devq = cam_simq_alloc(fe->num_requested_ctl_io); if (softc->devq == NULL) { printf("%s: error allocating devq\n", __func__); @@ -224,9 +224,7 @@ cfcs_init(void) goto bailout; } - mtx_lock(&softc->lock); if (xpt_bus_register(softc->sim, NULL, 0) != CAM_SUCCESS) { - mtx_unlock(&softc->lock); printf("%s: error registering SIM\n", __func__); retval = ENOMEM; goto bailout; @@ -236,15 +234,12 @@ cfcs_init(void) cam_sim_path(softc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - mtx_unlock(&softc->lock); printf("%s: error creating path\n", __func__); xpt_bus_deregister(cam_sim_path(softc->sim)); retval = 1; goto bailout; } - mtx_unlock(&softc->lock); - xpt_setup_ccb(&csa.ccb_h, softc->path, /*priority*/ 5); csa.ccb_h.func_code = XPT_SASYNC_CB; csa.event_enable = AC_LOST_DEVICE; @@ -252,6 +247,8 @@ cfcs_init(void) csa.callback_arg = softc->sim; xpt_action((union ccb *)&csa); + mtx_unlock(&softc->lock); + return (retval); bailout: @@ -259,6 +256,8 @@ bailout: cam_sim_free(softc->sim, /*free_devq*/ TRUE); else if (softc->devq) cam_simq_free(softc->devq); + mtx_unlock(&softc->lock); + mtx_destroy(&softc->lock); return (retval); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:34:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7C8D1F5; Tue, 23 Oct 2012 15:34:51 +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 CF8C68FC12; Tue, 23 Oct 2012 15:34:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NFYp4G099297; Tue, 23 Oct 2012 15:34:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFYpGG099295; Tue, 23 Oct 2012 15:34:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231534.q9NFYpGG099295@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241947 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:34:52 -0000 Author: mav Date: Tue Oct 23 15:34:51 2012 New Revision: 241947 URL: http://svn.freebsd.org/changeset/base/241947 Log: MFC r241509: Use xpt_create_path_unlocked() for initial debug path compilation because we are not holding respective SIM lock. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:33:40 2012 (r241946) +++ stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:34:51 2012 (r241947) @@ -4777,12 +4777,7 @@ xpt_config(void *arg) /* Setup debugging path */ if (cam_dflags != CAM_DEBUG_NONE) { - /* - * Locking is specifically omitted here. No SIMs have - * registered yet, so xpt_create_path will only be searching - * empty lists of targets and devices. - */ - if (xpt_create_path(&cam_dpath, xpt_periph, + if (xpt_create_path_unlocked(&cam_dpath, xpt_periph, CAM_DEBUG_BUS, CAM_DEBUG_TARGET, CAM_DEBUG_LUN) != CAM_REQ_CMP) { printf("xpt_config: xpt_create_path() failed for debug" From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:36:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CDC7443; Tue, 23 Oct 2012 15:36:24 +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 44AE48FC0A; Tue, 23 Oct 2012 15:36:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NFaOIc099669; Tue, 23 Oct 2012 15:36:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFaOqO099667; Tue, 23 Oct 2012 15:36:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231536.q9NFaOqO099667@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241948 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:36:24 -0000 Author: mav Date: Tue Oct 23 15:36:23 2012 New Revision: 241948 URL: http://svn.freebsd.org/changeset/base/241948 Log: MFC r241510: Don't exclude XPT SIM from locking in xpt_create_path_unlocked(). We don't want xpt periph, device, target or bus disappeared because of incorrect reference counting. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:34:51 2012 (r241947) +++ stable/9/sys/cam/cam_xpt.c Tue Oct 23 15:36:23 2012 (r241948) @@ -3433,19 +3433,14 @@ xpt_create_path_unlocked(struct cam_path struct cam_path *path; struct cam_eb *bus = NULL; cam_status status; - int need_unlock = 0; path = (struct cam_path *)malloc(sizeof(*path), M_CAMPATH, M_WAITOK); - if (path_id != CAM_BUS_WILDCARD) { - bus = xpt_find_bus(path_id); - if (bus != NULL) { - need_unlock = 1; - CAM_SIM_LOCK(bus->sim); - } - } + bus = xpt_find_bus(path_id); + if (bus != NULL) + CAM_SIM_LOCK(bus->sim); status = xpt_compile_path(path, periph, path_id, target_id, lun_id); - if (need_unlock) { + if (bus != NULL) { CAM_SIM_UNLOCK(bus->sim); xpt_release_bus(bus); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:37:58 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 032995B7; Tue, 23 Oct 2012 15:37:58 +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 DF0AC8FC08; Tue, 23 Oct 2012 15:37: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 q9NFbv7D000132; Tue, 23 Oct 2012 15:37:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFbvve000126; Tue, 23 Oct 2012 15:37:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231537.q9NFbvve000126@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241949 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:37:58 -0000 Author: mav Date: Tue Oct 23 15:37:57 2012 New Revision: 241949 URL: http://svn.freebsd.org/changeset/base/241949 Log: MFC r241536: Add explicit check for not set time inside cam_periph_freeze_after_event(). System time is set later on boot process then initial bus scan by CAM. Until that moment microtime() is equal to microuptime(), and if system boots quickly, the value can be close to zero. That causes settle time waiting even for buses that don't use reset during probe. On my test system this reduces boot time by 1 second if USB enabled, or by 4 seconds if USB disabled. CAM waited for ctl2cam0 bus "settle". Modified: stable/9/sys/cam/cam_periph.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Tue Oct 23 15:36:23 2012 (r241948) +++ stable/9/sys/cam/cam_periph.c Tue Oct 23 15:37:57 2012 (r241949) @@ -1257,6 +1257,9 @@ cam_periph_freeze_after_event(struct cam struct timeval delta; struct timeval duration_tv; + if (!timevalisset(event_time)) + return; + microtime(&delta); timevalsub(&delta, event_time); duration_tv.tv_sec = duration_ms / 1000; From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:46:02 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97BB38D6; Tue, 23 Oct 2012 15:46:02 +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 7CA438FC14; Tue, 23 Oct 2012 15:46: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 q9NFk2K9001892; Tue, 23 Oct 2012 15:46:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFk2aM001890; Tue, 23 Oct 2012 15:46:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231546.q9NFk2aM001890@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241950 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:46:02 -0000 Author: mav Date: Tue Oct 23 15:46:02 2012 New Revision: 241950 URL: http://svn.freebsd.org/changeset/base/241950 Log: MFC r239175: Add missing FAILED event to g_raid_subdisk_event2str() to print it properly in debug messages. Modified: stable/9/sys/geom/raid/g_raid.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Tue Oct 23 15:37:57 2012 (r241949) +++ stable/9/sys/geom/raid/g_raid.c Tue Oct 23 15:46:02 2012 (r241950) @@ -222,6 +222,8 @@ g_raid_subdisk_event2str(int event) switch (event) { case G_RAID_SUBDISK_E_NEW: return ("NEW"); + case G_RAID_SUBDISK_E_FAILED: + return ("FAILED"); case G_RAID_SUBDISK_E_DISCONNECTED: return ("DISCONNECTED"); default: From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 15:48:42 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7A10A72; Tue, 23 Oct 2012 15:48:42 +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 BEE6F8FC08; Tue, 23 Oct 2012 15:48:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NFmg3o002386; Tue, 23 Oct 2012 15:48:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NFmguH002384; Tue, 23 Oct 2012 15:48:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210231548.q9NFmguH002384@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Oct 2012 15:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241951 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 15:48:42 -0000 Author: mav Date: Tue Oct 23 15:48:42 2012 New Revision: 241951 URL: http://svn.freebsd.org/changeset/base/241951 Log: MFC r241418: NULL-ify last previously used pointer instead of last possible pointer. This should be only a cosmetic change. Modified: stable/9/sys/geom/raid/md_promise.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_promise.c ============================================================================== --- stable/9/sys/geom/raid/md_promise.c Tue Oct 23 15:46:02 2012 (r241950) +++ stable/9/sys/geom/raid/md_promise.c Tue Oct 23 15:48:42 2012 (r241951) @@ -544,7 +544,7 @@ g_raid_md_promise_purge_disks(struct g_r free(pd->pd_meta[i], M_MD_PROMISE); for (j = i; j < pd->pd_subdisks - 1; j++) pd->pd_meta[j] = pd->pd_meta[j + 1]; - pd->pd_meta[PROMISE_MAX_SUBDISKS - 1] = NULL; + pd->pd_meta[pd->pd_subdisks - 1] = NULL; pd->pd_subdisks--; pd->pd_updated = 1; } @@ -650,7 +650,7 @@ g_raid_md_promise_start_disk(struct g_ra free(pd->pd_meta[sdn], M_MD_PROMISE); for (i = sdn; i < pd->pd_subdisks - 1; i++) pd->pd_meta[i] = pd->pd_meta[i + 1]; - pd->pd_meta[PROMISE_MAX_SUBDISKS - 1] = NULL; + pd->pd_meta[pd->pd_subdisks - 1] = NULL; pd->pd_subdisks--; } /* If we are in the start process, that's all for now. */ @@ -1094,7 +1094,7 @@ g_raid_md_taste_promise(struct g_raid_md free(metaarr[i], M_MD_PROMISE); for (j = i; j < subdisks - 1; j++) metaarr[i] = metaarr[j + 1]; - metaarr[PROMISE_MAX_SUBDISKS - 1] = NULL; + metaarr[subdisks - 1] = NULL; subdisks--; } From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 23 19:04:06 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93B85DB8; Tue, 23 Oct 2012 19:04:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BA078FC08; Tue, 23 Oct 2012 19:04:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9NJ4642035833; Tue, 23 Oct 2012 19:04:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9NJ46rr035831; Tue, 23 Oct 2012 19:04:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201210231904.q9NJ46rr035831@svn.freebsd.org> From: John Baldwin Date: Tue, 23 Oct 2012 19:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241961 - stable/9/sys/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2012 19:04:06 -0000 Author: jhb Date: Tue Oct 23 19:04:05 2012 New Revision: 241961 URL: http://svn.freebsd.org/changeset/base/241961 Log: Update the make version required to use an empty command for NORMAL_CTFCONVERT to require the most recent MFC to 9. Submitted by: Petr Lampa lampa fit vutbr cz Modified: stable/9/sys/conf/kern.pre.mk Modified: stable/9/sys/conf/kern.pre.mk ============================================================================== --- stable/9/sys/conf/kern.pre.mk Tue Oct 23 18:57:20 2012 (r241960) +++ stable/9/sys/conf/kern.pre.mk Tue Oct 23 19:04:05 2012 (r241961) @@ -138,7 +138,7 @@ NORMAL_FWO= ${LD} -b binary --no-warn-mi .if ${MK_CTF} != "no" NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.elif ${MAKE_VERSION} >= 5201111300 +.elif ${MAKE_VERSION} >= 9201210220 NORMAL_CTFCONVERT= .else NORMAL_CTFCONVERT= @: From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 02:00:55 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A7DF7D74; Wed, 24 Oct 2012 02:00:55 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E5D58FC12; Wed, 24 Oct 2012 02:00:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9O20tvU011681; Wed, 24 Oct 2012 02:00:55 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9O20tim011677; Wed, 24 Oct 2012 02:00:55 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201210240200.q9O20tim011677@svn.freebsd.org> From: Ken Smith Date: Wed, 24 Oct 2012 02:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241976 - stable/9/usr.sbin/pkg_install/add X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 02:00:55 -0000 Author: kensmith Date: Wed Oct 24 02:00:54 2012 New Revision: 241976 URL: http://svn.freebsd.org/changeset/base/241976 Log: MFC r241975: Add the release package directory for 9.1-RELEASE. Modified: stable/9/usr.sbin/pkg_install/add/main.c Directory Properties: stable/9/usr.sbin/pkg_install/add/ (props changed) Modified: stable/9/usr.sbin/pkg_install/add/main.c ============================================================================== --- stable/9/usr.sbin/pkg_install/add/main.c Wed Oct 24 01:42:46 2012 (r241975) +++ stable/9/usr.sbin/pkg_install/add/main.c Wed Oct 24 02:00:54 2012 (r241976) @@ -89,6 +89,7 @@ struct { { 802000, 802499, "/packages-8.2-release" }, { 803000, 803499, "/packages-8.3-release" }, { 900000, 900499, "/packages-9.0-release" }, + { 901000, 901499, "/packages-9.1-release" }, { 300000, 399000, "/packages-3-stable" }, { 400000, 499000, "/packages-4-stable" }, { 502100, 502128, "/packages-5-current" }, From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 09:32:34 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED387EC0; Wed, 24 Oct 2012 09:32:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4E1F8FC0A; Wed, 24 Oct 2012 09:32:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9O9WY2k085002; Wed, 24 Oct 2012 09:32:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9O9WYfW085000; Wed, 24 Oct 2012 09:32:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210240932.q9O9WYfW085000@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Oct 2012 09:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241989 - stable/9/sys/dev/sound/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 09:32:35 -0000 Author: glebius Date: Wed Oct 24 09:32:34 2012 New Revision: 241989 URL: http://svn.freebsd.org/changeset/base/241989 Log: Merge r237975 from head: - Call bus_generic_attach() at end of hdspe_attach(). - Use own devclass_t in DRIVER_MODULE(). This fixes operation of hdspe(4) when built as loadable module. Submitted by: Ruslan Bukin
Modified: stable/9/sys/dev/sound/pci/hdspe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/hdspe.c ============================================================================== --- stable/9/sys/dev/sound/pci/hdspe.c Wed Oct 24 08:00:01 2012 (r241988) +++ stable/9/sys/dev/sound/pci/hdspe.c Wed Oct 24 09:32:34 2012 (r241989) @@ -347,7 +347,7 @@ hdspe_attach(device_t dev) hdspe_map_dmabuf(sc); - return 0; + return (bus_generic_attach(dev)); } static void @@ -407,4 +407,6 @@ static driver_t hdspe_driver = { PCM_SOFTC_SIZE, }; -DRIVER_MODULE(snd_hdspe, pci, hdspe_driver, pcm_devclass, 0, 0); +static devclass_t hdspe_devclass; + +DRIVER_MODULE(snd_hdspe, pci, hdspe_driver, hdspe_devclass, 0, 0); From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 09:39:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DAB7202; Wed, 24 Oct 2012 09:39:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9BB68FC08; Wed, 24 Oct 2012 09:39:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9O9d7Xa086114; Wed, 24 Oct 2012 09:39:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9O9d7ml086112; Wed, 24 Oct 2012 09:39:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210240939.q9O9d7ml086112@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Oct 2012 09:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241990 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 09:39:08 -0000 Author: glebius Date: Wed Oct 24 09:39:07 2012 New Revision: 241990 URL: http://svn.freebsd.org/changeset/base/241990 Log: Merge 239090 from head: Add supported device. Modified: stable/9/share/man/man4/umodem.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/umodem.4 ============================================================================== --- stable/9/share/man/man4/umodem.4 Wed Oct 24 09:32:34 2012 (r241989) +++ stable/9/share/man/man4/umodem.4 Wed Oct 24 09:39:07 2012 (r241990) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd August 6, 2012 .Dt UMODEM 4 .Os .Sh NAME @@ -90,6 +90,8 @@ Yamaha Broadband Wireless Router RTW65b ELSA MicroLink 56k USB modem .It Sony Ericsson W810i phone +.It +Sonim XP5300 Force .El .Sh SEE ALSO .Xr tty 4 , From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 09:46:53 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 53E9E48B; Wed, 24 Oct 2012 09:46:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 216748FC12; Wed, 24 Oct 2012 09:46:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9O9kqVd087356; Wed, 24 Oct 2012 09:46:52 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9O9kqok087354; Wed, 24 Oct 2012 09:46:52 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210240946.q9O9kqok087354@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Oct 2012 09:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241991 - stable/9/usr.sbin/arp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 09:46:53 -0000 Author: glebius Date: Wed Oct 24 09:46:52 2012 New Revision: 241991 URL: http://svn.freebsd.org/changeset/base/241991 Log: Merge r240072 from head: Explicitly document all variables in the net.link.ether.inet MIB. Modified: stable/9/usr.sbin/arp/arp.4 Directory Properties: stable/9/usr.sbin/arp/ (props changed) Modified: stable/9/usr.sbin/arp/arp.4 ============================================================================== --- stable/9/usr.sbin/arp/arp.4 Wed Oct 24 09:39:07 2012 (r241990) +++ stable/9/usr.sbin/arp/arp.4 Wed Oct 24 09:46:52 2012 (r241991) @@ -28,7 +28,7 @@ .\" @(#)arp4.4 6.5 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 28, 2007 +.Dd September 3, 2012 .Dt ARP 4 .Os .Sh NAME @@ -119,20 +119,53 @@ branch of the .Xr sysctl 3 MIB. -.Bl -tag +.Bl -tag -width "log_arp_permanent_modify" +.It Va log_arp_movements +Should the kernel log movements of IP addresses from one hardware +address to an other. +See +.Sx DIAGNOSTICS +below. +Turned on by default. +.It Va log_arp_permanent_modify +Should the kernel log attempts of remote host on network to modify a +permanent ARP entry. +See +.Sx DIAGNOSTICS +below. +Turned on by default. +.It Va log_arp_wrong_iface +Should the kernel log attempts to insert an ARP entry on an interface +when the IP network the address belongs to is connected to an other +interface. +See +.Sx DIAGNOSTICS +below. +Turned on by default. .It Va max_age How long an ARP entry is held in the cache until it needs to be refreshed. +Default is 1200 seconds. +.It Va maxhold +How many packets hold in the per-entry output queue while the entry +is being resolved. +Default is one packet. .It Va maxtries Number of retransmits before host is considered down and error is returned. +Default is 5 tries. +.It Va proxyall +Enables ARP proxying for all hosts on net. +Turned off by default. .It Va useloopback If an ARP entry is added for local address, force the traffic to go through the loopback interface. -.It Va proxyall -Enables ARP proxying for all hosts on net. +Turned on by default. +.It Va wait +Lifetime of an incomplete ARP entry. +Default is 20 seconds. .El .Sh DIAGNOSTICS .Bl -diag -.It "arp: %x:%x:%x:%x:%x:%x is using my IP address %d.%d.%d.%d!" +.It "arp: %x:%x:%x:%x:%x:%x is using my IP address %d.%d.%d.%d on %s!" ARP has discovered another host on the local network which responds to mapping requests for its own Internet address with a different Ethernet address, generally indicating that two hosts are attempting to use the From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 09:53:34 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE32985A; Wed, 24 Oct 2012 09:53:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C8AD8FC0A; Wed, 24 Oct 2012 09:53:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9O9rYYr088467; Wed, 24 Oct 2012 09:53:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9O9rYJd088464; Wed, 24 Oct 2012 09:53:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210240953.q9O9rYJd088464@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Oct 2012 09:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241992 - in stable/9: sys/netinet usr.sbin/arp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 09:53:34 -0000 Author: glebius Date: Wed Oct 24 09:53:34 2012 New Revision: 241992 URL: http://svn.freebsd.org/changeset/base/241992 Log: Merge 240073 from head: Provide a sysctl switch that allows to install ARP entries with multicast bit set. FreeBSD refuses to install such entries since 9.0, and this broke installations running Microsoft NLB, which are violating standards. Tested by: Tarasov Oleg Modified: stable/9/sys/netinet/if_ether.c stable/9/usr.sbin/arp/arp.4 Directory Properties: stable/9/sys/ (props changed) stable/9/usr.sbin/arp/ (props changed) Modified: stable/9/sys/netinet/if_ether.c ============================================================================== --- stable/9/sys/netinet/if_ether.c Wed Oct 24 09:46:52 2012 (r241991) +++ stable/9/sys/netinet/if_ether.c Wed Oct 24 09:53:34 2012 (r241992) @@ -481,6 +481,7 @@ arpintr(struct mbuf *m) static int log_arp_wrong_iface = 1; static int log_arp_movements = 1; static int log_arp_permanent_modify = 1; +static int allow_multicast = 0; SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_wrong_iface, CTLFLAG_RW, &log_arp_wrong_iface, 0, @@ -491,7 +492,8 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUT SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_permanent_modify, CTLFLAG_RW, &log_arp_permanent_modify, 0, "log arp replies from MACs different than the one in the permanent arp entry"); - +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, allow_multicast, CTLFLAG_RW, + &allow_multicast, 0, "accept multicast addresses"); static void in_arpinput(struct mbuf *m) @@ -536,8 +538,8 @@ in_arpinput(struct mbuf *m) return; } - if (ETHER_IS_MULTICAST(ar_sha(ah))) { - log(LOG_NOTICE, "in_arp: %*D is multicast\n", + if (allow_multicast == 0 && ETHER_IS_MULTICAST(ar_sha(ah))) { + log(LOG_NOTICE, "arp: %*D is multicast\n", ifp->if_addrlen, (u_char *)ar_sha(ah), ":"); return; } Modified: stable/9/usr.sbin/arp/arp.4 ============================================================================== --- stable/9/usr.sbin/arp/arp.4 Wed Oct 24 09:46:52 2012 (r241991) +++ stable/9/usr.sbin/arp/arp.4 Wed Oct 24 09:53:34 2012 (r241992) @@ -120,6 +120,12 @@ of the .Xr sysctl 3 MIB. .Bl -tag -width "log_arp_permanent_modify" +.It Va allow_multicast +Should the kernel install ARP entries with multicast bit set in +the hardware address. +Installing such entries is RFC 1812 violation, but some prorietary +load balancing techniques require routers on network to do so. +Turned off by default. .It Va log_arp_movements Should the kernel log movements of IP addresses from one hardware address to an other. @@ -203,6 +209,11 @@ entry in the local ARP table. This error will only be logged if the sysctl .Va net.link.ether.inet.log_arp_permanent_modify is set to 1, which is the system's default behaviour. +.It "arp: %x:%x:%x:%x:%x:%x is multicast" +Kernel refused to install an entry with multicast hardware address. +If you really want such addresses being installed, set the sysctl +.Va net.link.ether.inet.allow_multicast +to a positive value. .El .Sh SEE ALSO .Xr inet 4 , From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 10:14:22 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 312EBEDC; Wed, 24 Oct 2012 10:14:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 197D38FC08; Wed, 24 Oct 2012 10:14:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9OAELfm092591; Wed, 24 Oct 2012 10:14:21 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9OAELXn092589; Wed, 24 Oct 2012 10:14:21 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210241014.q9OAELXn092589@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Oct 2012 10:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241993 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 10:14:22 -0000 Author: glebius Date: Wed Oct 24 10:14:21 2012 New Revision: 241993 URL: http://svn.freebsd.org/changeset/base/241993 Log: Merge r240214 from head: Supply the pr_ctloutput method for local datagram sockets, so that setsockopt() and getsockopt() work on them. This makes 'tools/regression/sockets/unix_cmsg -t dgram' more successful. Modified: stable/9/sys/kern/uipc_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_usrreq.c ============================================================================== --- stable/9/sys/kern/uipc_usrreq.c Wed Oct 24 09:53:34 2012 (r241992) +++ stable/9/sys/kern/uipc_usrreq.c Wed Oct 24 10:14:21 2012 (r241993) @@ -305,6 +305,7 @@ static struct protosw localsw[] = { .pr_type = SOCK_DGRAM, .pr_domain = &localdomain, .pr_flags = PR_ATOMIC|PR_ADDR|PR_RIGHTS, + .pr_ctloutput = &uipc_ctloutput, .pr_usrreqs = &uipc_usrreqs_dgram }, { From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 10:28:13 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51560157; Wed, 24 Oct 2012 10:28:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37FC98FC0A; Wed, 24 Oct 2012 10:28: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 q9OASDAi094681; Wed, 24 Oct 2012 10:28:13 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9OASCoV094677; Wed, 24 Oct 2012 10:28:12 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210241028.q9OASCoV094677@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Oct 2012 10:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241994 - stable/9/contrib/bsnmp/snmpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 10:28:13 -0000 Author: glebius Date: Wed Oct 24 10:28:12 2012 New Revision: 241994 URL: http://svn.freebsd.org/changeset/base/241994 Log: Merge r240234, r240271, r240734 from head: r240234: The first part of check_priv() function, that attempts to obtain creds from the control message, actually never worked. This means check_priv() didn't work for local dgram sockets. The SCM_CREDS control messages is received only in two cases: 1) If we did setsockopt(LOCAL_CREDS) on our socket, and in this case the message is struct sockcred. 2) If sender did supplied SCM_CREDS control message in his sendmsg() syscall. In this case the message is struct cmsgcred. We can't rely on 2), so we will use 1) for dgram sockets. For stream sockets it is more reliable to obtain accept-time credentials, since SCM_CREDS control message is attached only on first read. Thus: o Do setsockopt(LOCAL_CREDS) on local dgram sockets. o Split check_priv() into check_priv_stream() and check_priv_dgram(), and call them from recv_stream() and recv_dgram() respectively. o Don't provide space for SCM_CREDS control message in recv_stream(). o Provide space for SCM_CREDS control message in recv_dgram(), but there is no need to initialize anything in it. o In recv_dgram() do not blindly expect that first message is SCM_CREDS, instead use correct search cycle through control messages. r240271: For UDP transport set IP_RECVDSTADDR sockopt on the socket, and provide IP_SENDSRCADDR control with datagram message we reply with. This makes bsnmpd reply from exactly same address that request was sent to, thus successfully bypassing stateful firewalls or other kinds of strict checking. r240734: Re-do r240271: - Set IP_RECVDSTADDR sockopt on the socket only in case if it is INADDR_ANY bound. - Supply IP_SENDSRCADDR control message only if we did receive IP_RECVDSTADDR control message. This fixes operation of snmpd bound to a specific local IP address. PR: bin/171279 Modified: stable/9/contrib/bsnmp/snmpd/main.c stable/9/contrib/bsnmp/snmpd/trans_lsock.c stable/9/contrib/bsnmp/snmpd/trans_udp.c Directory Properties: stable/9/contrib/bsnmp/ (props changed) Modified: stable/9/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/9/contrib/bsnmp/snmpd/main.c Wed Oct 24 10:14:21 2012 (r241993) +++ stable/9/contrib/bsnmp/snmpd/main.c Wed Oct 24 10:28:12 2012 (r241994) @@ -1026,34 +1026,31 @@ snmp_input_consume(struct port_input *pi pi->length -= pi->consumed; } -struct credmsg { - struct cmsghdr hdr; - struct cmsgcred cred; -}; +static void +check_priv_dgram(struct port_input *pi, struct sockcred *cred) +{ + + /* process explicitly sends credentials */ + if (cred) + pi->priv = (cred->sc_euid == 0); + else + pi->priv = 0; +} static void -check_priv(struct port_input *pi, struct msghdr *msg) +check_priv_stream(struct port_input *pi) { - struct credmsg *cmsg; struct xucred ucred; socklen_t ucredlen; - pi->priv = 0; - - if (msg->msg_controllen == sizeof(*cmsg)) { - /* process explicitly sends credentials */ - - cmsg = (struct credmsg *)msg->msg_control; - pi->priv = (cmsg->cred.cmcred_euid == 0); - return; - } - - /* ok, obtain the accept time credentials */ + /* obtain the accept time credentials */ ucredlen = sizeof(ucred); if (getsockopt(pi->fd, 0, LOCAL_PEERCRED, &ucred, &ucredlen) == 0 && ucredlen >= sizeof(ucred) && ucred.cr_version == XUCRED_VERSION) pi->priv = (ucred.cr_uid == 0); + else + pi->priv = 0; } /* @@ -1065,7 +1062,6 @@ recv_stream(struct port_input *pi) struct msghdr msg; struct iovec iov[1]; ssize_t len; - struct credmsg cmsg; if (pi->buf == NULL) { /* no buffer yet - allocate one */ @@ -1084,17 +1080,8 @@ recv_stream(struct port_input *pi) msg.msg_namelen = pi->peerlen; msg.msg_iov = iov; msg.msg_iovlen = 1; - if (pi->cred) { - msg.msg_control = &cmsg; - msg.msg_controllen = sizeof(cmsg); - - cmsg.hdr.cmsg_len = sizeof(cmsg); - cmsg.hdr.cmsg_level = SOL_SOCKET; - cmsg.hdr.cmsg_type = SCM_CREDS; - } else { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } + msg.msg_control = NULL; + msg.msg_controllen = 0; msg.msg_flags = 0; iov[0].iov_base = pi->buf + pi->length; @@ -1109,7 +1096,7 @@ recv_stream(struct port_input *pi) pi->length += len; if (pi->cred) - check_priv(pi, &msg); + check_priv_stream(pi); return (0); } @@ -1119,13 +1106,16 @@ recv_stream(struct port_input *pi) * Each receive should return one datagram. */ static int -recv_dgram(struct port_input *pi) +recv_dgram(struct port_input *pi, struct in_addr *laddr) { u_char embuf[1000]; + char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + + CMSG_SPACE(sizeof(struct in_addr))]; struct msghdr msg; struct iovec iov[1]; ssize_t len; - struct credmsg cmsg; + struct cmsghdr *cmsg; + struct sockcred *cred = NULL; if (pi->buf == NULL) { /* no buffer yet - allocate one */ @@ -1145,17 +1135,9 @@ recv_dgram(struct port_input *pi) msg.msg_namelen = pi->peerlen; msg.msg_iov = iov; msg.msg_iovlen = 1; - if (pi->cred) { - msg.msg_control = &cmsg; - msg.msg_controllen = sizeof(cmsg); - - cmsg.hdr.cmsg_len = sizeof(cmsg); - cmsg.hdr.cmsg_level = SOL_SOCKET; - cmsg.hdr.cmsg_type = SCM_CREDS; - } else { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } + memset(cbuf, 0, sizeof(cbuf)); + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); msg.msg_flags = 0; iov[0].iov_base = pi->buf; @@ -1176,8 +1158,18 @@ recv_dgram(struct port_input *pi) pi->length = (size_t)len; + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == IPPROTO_IP && + cmsg->cmsg_type == IP_RECVDSTADDR) + memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); + if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_CREDS) + cred = (struct sockcred *)CMSG_DATA(cmsg); + } + if (pi->cred) - check_priv(pi, &msg); + check_priv_dgram(pi, cred); return (0); } @@ -1199,12 +1191,35 @@ snmpd_input(struct port_input *pi, struc #ifdef USE_TCPWRAPPERS char client[16]; #endif + struct msghdr msg; + struct iovec iov[1]; + char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; + struct cmsghdr *cmsgp; /* get input depending on the transport */ if (pi->stream) { + msg.msg_control = NULL; + msg.msg_controllen = 0; + ret = recv_stream(pi); } else { - ret = recv_dgram(pi); + struct in_addr *laddr; + + memset(cbuf, 0, CMSG_SPACE(sizeof(struct in_addr))); + msg.msg_control = cbuf; + msg.msg_controllen = CMSG_SPACE(sizeof(struct in_addr)); + cmsgp = CMSG_FIRSTHDR(&msg); + cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + cmsgp->cmsg_level = IPPROTO_IP; + cmsgp->cmsg_type = IP_SENDSRCADDR; + laddr = (struct in_addr *)CMSG_DATA(cmsgp); + + ret = recv_dgram(pi, laddr); + + if (laddr->s_addr == 0) { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } } if (ret == -1) @@ -1349,11 +1364,19 @@ snmpd_input(struct port_input *pi, struc sndbuf, &sndlen, "SNMP", ierr, vi, NULL); if (ferr == SNMPD_INPUT_OK) { - slen = sendto(pi->fd, sndbuf, sndlen, 0, pi->peer, pi->peerlen); + msg.msg_name = pi->peer; + msg.msg_namelen = pi->peerlen; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_flags = 0; + iov[0].iov_base = sndbuf; + iov[0].iov_len = sndlen; + + slen = sendmsg(pi->fd, &msg, 0); if (slen == -1) - syslog(LOG_ERR, "sendto: %m"); + syslog(LOG_ERR, "sendmsg: %m"); else if ((size_t)slen != sndlen) - syslog(LOG_ERR, "sendto: short write %zu/%zu", + syslog(LOG_ERR, "sendmsg: short write %zu/%zu", sndlen, (size_t)slen); } snmp_pdu_free(&pdu); Modified: stable/9/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/9/contrib/bsnmp/snmpd/trans_lsock.c Wed Oct 24 10:14:21 2012 (r241993) +++ stable/9/contrib/bsnmp/snmpd/trans_lsock.c Wed Oct 24 10:28:12 2012 (r241994) @@ -343,6 +343,7 @@ lsock_init_port(struct tport *tp) } } else { struct lsock_peer *peer; + const int on = 1; peer = LIST_FIRST(&p->peers); @@ -351,6 +352,14 @@ lsock_init_port(struct tport *tp) return (SNMP_ERR_RES_UNAVAIL); } + if (setsockopt(peer->input.fd, 0, LOCAL_CREDS, &on, + sizeof(on)) == -1) { + syslog(LOG_ERR, "setsockopt(LOCAL_CREDS): %m"); + close(peer->input.fd); + peer->input.fd = -1; + return (SNMP_ERR_GENERR); + } + strcpy(sa.sun_path, p->name); sa.sun_family = AF_LOCAL; sa.sun_len = strlen(p->name) + Modified: stable/9/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/9/contrib/bsnmp/snmpd/trans_udp.c Wed Oct 24 10:14:21 2012 (r241993) +++ stable/9/contrib/bsnmp/snmpd/trans_udp.c Wed Oct 24 10:28:12 2012 (r241994) @@ -103,6 +103,7 @@ udp_init_port(struct tport *tp) struct udp_port *p = (struct udp_port *)tp; struct sockaddr_in addr; u_int32_t ip; + const int on = 1; if ((p->input.fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) { syslog(LOG_ERR, "creating UDP socket: %m"); @@ -115,6 +116,14 @@ udp_init_port(struct tport *tp) addr.sin_port = htons(p->port); addr.sin_family = AF_INET; addr.sin_len = sizeof(addr); + if (addr.sin_addr.s_addr == INADDR_ANY && + setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, + sizeof(on)) == -1) { + syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); + close(p->input.fd); + p->input.fd = -1; + return (SNMP_ERR_GENERR); + } if (bind(p->input.fd, (struct sockaddr *)&addr, sizeof(addr))) { if (errno == EADDRNOTAVAIL) { close(p->input.fd); From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 10:30:41 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DF302F1; Wed, 24 Oct 2012 10:30:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55C878FC08; Wed, 24 Oct 2012 10:30:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9OAUfvb095116; Wed, 24 Oct 2012 10:30:41 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9OAUfkQ095114; Wed, 24 Oct 2012 10:30:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210241030.q9OAUfkQ095114@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Oct 2012 10:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241995 - stable/9/usr.sbin/bsnmpd/modules/snmp_hostres X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 10:30:41 -0000 Author: glebius Date: Wed Oct 24 10:30:40 2012 New Revision: 241995 URL: http://svn.freebsd.org/changeset/base/241995 Log: Merge r240354 from head: Do not count kernel threads as processes for hrSystemProcesses OID. PR: bin/160494 Submitted by: Jeremy Chadwick Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Directory Properties: stable/9/usr.sbin/bsnmpd/modules/snmp_hostres/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Wed Oct 24 10:28:12 2012 (r241994) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Wed Oct 24 10:30:40 2012 (r241995) @@ -238,7 +238,7 @@ OS_getSystemProcesses(uint32_t *proc_cou if (hr_kd == NULL) return (SNMP_ERR_GENERR); - if (kvm_getprocs(hr_kd, KERN_PROC_ALL, 0, &pc) == NULL) { + if (kvm_getprocs(hr_kd, KERN_PROC_PROC, 0, &pc) == NULL) { syslog(LOG_ERR, "kvm_getprocs failed: %m"); return (SNMP_ERR_GENERR); } From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 10:32:39 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED0B346A; Wed, 24 Oct 2012 10:32:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5A0E8FC0A; Wed, 24 Oct 2012 10:32:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9OAWd4a095462; Wed, 24 Oct 2012 10:32:39 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9OAWdCD095460; Wed, 24 Oct 2012 10:32:39 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210241032.q9OAWdCD095460@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Oct 2012 10:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241996 - stable/9/lib/libc/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 10:32:40 -0000 Author: glebius Date: Wed Oct 24 10:32:39 2012 New Revision: 241996 URL: http://svn.freebsd.org/changeset/base/241996 Log: Merge r240385 from head: Describe in detail required conditions for receiving the SCM_CREDS control message and suggest to use LOCAL_CREDS setsockopt() for reliability. Modified: stable/9/lib/libc/sys/recv.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/recv.2 ============================================================================== --- stable/9/lib/libc/sys/recv.2 Wed Oct 24 10:30:40 2012 (r241995) +++ stable/9/lib/libc/sys/recv.2 Wed Oct 24 10:32:39 2012 (r241996) @@ -28,7 +28,7 @@ .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd December 28, 2006 +.Dd September 12, 2012 .Dt RECV 2 .Os .Sh NAME @@ -252,8 +252,21 @@ struct cmsgcred { }; .Ed .Pp -The kernel will fill in the credential information of the sending process -and deliver it to the receiver. +If a sender supplies ancillary data with enough space for the above struct +tagged as +.Dv SCM_CREDS +control message type to the +.Fn sendmsg +system call, then kernel will fill in the credential information of the +sending process and deliver it to the receiver. +Since receiver usually has no control over a sender, this method of retrieving +credential information isn't reliable. +For reliable retrieval of remote side credentials it is advised to use the +.Dv LOCAL_CREDS +socket option on the receiving socket. +See +.Xr unix 4 +for details. .Pp The .Fa msg_flags @@ -322,7 +335,8 @@ address space. .Xr getsockopt 2 , .Xr read 2 , .Xr select 2 , -.Xr socket 2 +.Xr socket 2 , +.Xr unix 4 .Sh HISTORY The .Fn recv From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 10:36:34 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F8F070A; Wed, 24 Oct 2012 10:36:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 882D88FC0A; Wed, 24 Oct 2012 10:36:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9OAaY5o096087; Wed, 24 Oct 2012 10:36:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9OAaYP2096085; Wed, 24 Oct 2012 10:36:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210241036.q9OAaYP2096085@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Oct 2012 10:36:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241997 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 10:36:34 -0000 Author: glebius Date: Wed Oct 24 10:36:33 2012 New Revision: 241997 URL: http://svn.freebsd.org/changeset/base/241997 Log: Merge r240386, r240735 from head: Document conditions for IP_SENDSRCADDR socket option. Obtained from: r167342 commit message Modified: stable/9/share/man/man4/ip.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ip.4 ============================================================================== --- stable/9/share/man/man4/ip.4 Wed Oct 24 10:32:39 2012 (r241996) +++ stable/9/share/man/man4/ip.4 Wed Oct 24 10:36:33 2012 (r241997) @@ -32,7 +32,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd June 12, 2012 +.Dd September 20, 2012 .Dt IP 4 .Os .Sh NAME @@ -172,9 +172,7 @@ cmsg_type = IP_RECVDSTADDR .Pp The source address to be used for outgoing .Tn UDP -datagrams on a socket that is not bound to a specific -.Tn IP -address can be specified as ancillary data with a type code of +datagrams on a socket can be specified as ancillary data with a type code of .Dv IP_SENDSRCADDR . The msg_control field in the msghdr structure should point to a buffer that contains a @@ -189,6 +187,20 @@ cmsg_level = IPPROTO_IP cmsg_type = IP_SENDSRCADDR .Ed .Pp +The socket should be either bound to +.Dv INADDR_ANY +and a local port, and the address supplied with +.Dv IP_SENDSRCADDR +should't be +.Dv INADDR_ANY , +or the socket should be bound to a local address and the address supplied with +.Dv IP_SENDSRCADDR +should be +.Dv INADDR_ANY . +In the latter case bound address is overriden via generic source address +selection logic, which would choose IP address of interface closest to +destination. +.Pp For convenience, .Dv IP_SENDSRCADDR is defined to have the same value as From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 10:44:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B867A04; Wed, 24 Oct 2012 10:44:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E75A8FC08; Wed, 24 Oct 2012 10:44:08 +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 q9OAi8t7097312; Wed, 24 Oct 2012 10:44:08 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9OAi80e097310; Wed, 24 Oct 2012 10:44:08 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210241044.q9OAi80e097310@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 24 Oct 2012 10:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241998 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 10:44:08 -0000 Author: glebius Date: Wed Oct 24 10:44:07 2012 New Revision: 241998 URL: http://svn.freebsd.org/changeset/base/241998 Log: Merge r241482, r241491 from head: Be more explicit on how "intact" incoming packets in raw sockets are. Modified: stable/9/share/man/man4/ip.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ip.4 ============================================================================== --- stable/9/share/man/man4/ip.4 Wed Oct 24 10:36:33 2012 (r241997) +++ stable/9/share/man/man4/ip.4 Wed Oct 24 10:44:07 2012 (r241998) @@ -32,7 +32,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd September 20, 2012 +.Dd October 12, 2012 .Dt IP 4 .Os .Sh NAME @@ -763,7 +763,11 @@ unless the option has been set. Incoming packets are received with .Tn IP -header and options intact. +header and options intact, except for +.Va ip_len +and +.Va ip_off +fields converted to host byte order. .Pp .Dv IP_HDRINCL indicates the complete IP header is included with the data From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 19:04:18 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C995E7; Wed, 24 Oct 2012 19:04:18 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EFFD8FC0C; Wed, 24 Oct 2012 19:04: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 q9OJ4ITT076878; Wed, 24 Oct 2012 19:04:18 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9OJ4Hbr076861; Wed, 24 Oct 2012 19:04:17 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201210241904.q9OJ4Hbr076861@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 24 Oct 2012 19:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242015 - in stable/9/sys: dev/alc dev/bge dev/cxgb dev/cxgbe dev/e1000 dev/et dev/jme dev/pci dev/re ofed/include/linux powerpc/mpc85xx X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 19:04:18 -0000 Author: gavin Date: Wed Oct 24 19:04:17 2012 New Revision: 242015 URL: http://svn.freebsd.org/changeset/base/242015 Log: Merge r240680 from head: Align the PCI Express #defines with the style used for the PCI-X #defines. This has the advantage that it makes the names more compact, and also allows us to correct the non-uniform naming of the PCIM_LINK_* defines, making them all consistent amongst themselves. This is a mostly mechanical rename: s/PCIR_EXPRESS_/PCIER_/g s/PCIM_EXP_/PCIEM_/g s/PCIM_LINK_/PCIEM_LINK_/g In this MFC, #defines have been added for the old names to assist out-of-tree drivers. Modified: stable/9/sys/dev/alc/if_alc.c stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/cxgb/cxgb_main.c stable/9/sys/dev/cxgb/cxgb_osdep.h stable/9/sys/dev/cxgbe/osdep.h stable/9/sys/dev/cxgbe/t4_main.c stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/et/if_et.c stable/9/sys/dev/jme/if_jme.c stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcireg.h stable/9/sys/dev/re/if_re.c stable/9/sys/ofed/include/linux/pci.h stable/9/sys/powerpc/mpc85xx/pci_fdt.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) Modified: stable/9/sys/dev/alc/if_alc.c ============================================================================== --- stable/9/sys/dev/alc/if_alc.c Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/alc/if_alc.c Wed Oct 24 19:04:17 2012 (r242015) @@ -683,7 +683,7 @@ alc_aspm(struct alc_softc *sc, int media if ((sc->alc_flags & (ALC_FLAG_APS | ALC_FLAG_PCIE)) == (ALC_FLAG_APS | ALC_FLAG_PCIE)) linkcfg = CSR_READ_2(sc, sc->alc_expcap + - PCIR_EXPRESS_LINK_CTL); + PCIER_LINK_CTL); else linkcfg = 0; pmcfg &= ~PM_CFG_SERDES_PD_EX_L1; @@ -698,7 +698,7 @@ alc_aspm(struct alc_softc *sc, int media if (sc->alc_ident->deviceid == DEVICEID_ATHEROS_AR8152_B && sc->alc_rev == ATHEROS_AR8152_B_V10) linkcfg |= 0x80; - CSR_WRITE_2(sc, sc->alc_expcap + PCIR_EXPRESS_LINK_CTL, + CSR_WRITE_2(sc, sc->alc_expcap + PCIER_LINK_CTL, linkcfg); pmcfg &= ~(PM_CFG_EN_BUFS_RX_L0S | PM_CFG_SA_DLY_ENB | PM_CFG_HOTRST); @@ -798,10 +798,10 @@ alc_attach(device_t dev) if (pci_find_cap(dev, PCIY_EXPRESS, &base) == 0) { sc->alc_flags |= ALC_FLAG_PCIE; sc->alc_expcap = base; - burst = CSR_READ_2(sc, base + PCIR_EXPRESS_DEVICE_CTL); + burst = CSR_READ_2(sc, base + PCIER_DEVICE_CTL); sc->alc_dma_rd_burst = - (burst & PCIM_EXP_CTL_MAX_READ_REQUEST) >> 12; - sc->alc_dma_wr_burst = (burst & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5; + (burst & PCIEM_CTL_MAX_READ_REQUEST) >> 12; + sc->alc_dma_wr_burst = (burst & PCIEM_CTL_MAX_PAYLOAD) >> 5; if (bootverbose) { device_printf(dev, "Read request size : %u bytes.\n", alc_dma_burst[sc->alc_dma_rd_burst]); @@ -831,9 +831,9 @@ alc_attach(device_t dev) CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val); } /* Disable ASPM L0S and L1. */ - cap = CSR_READ_2(sc, base + PCIR_EXPRESS_LINK_CAP); - if ((cap & PCIM_LINK_CAP_ASPM) != 0) { - ctl = CSR_READ_2(sc, base + PCIR_EXPRESS_LINK_CTL); + cap = CSR_READ_2(sc, base + PCIER_LINK_CAP); + if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { + ctl = CSR_READ_2(sc, base + PCIER_LINK_CTL); if ((ctl & 0x08) != 0) sc->alc_rcb = DMA_CFG_RCB_128; if (bootverbose) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/bge/if_bge.c Wed Oct 24 19:04:17 2012 (r242015) @@ -3650,17 +3650,17 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, 0xC4, val | (1 << 15), 4); } devctl = pci_read_config(dev, - sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + sc->bge_expcap + PCIER_DEVICE_CTL, 2); /* Clear enable no snoop and disable relaxed ordering. */ - devctl &= ~(PCIM_EXP_CTL_RELAXED_ORD_ENABLE | - PCIM_EXP_CTL_NOSNOOP_ENABLE); - pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, + devctl &= ~(PCIEM_CTL_RELAXED_ORD_ENABLE | + PCIEM_CTL_NOSNOOP_ENABLE); + pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_CTL, devctl, 2); /* Clear error status. */ - pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_STA, - PCIM_EXP_STA_CORRECTABLE_ERROR | - PCIM_EXP_STA_NON_FATAL_ERROR | PCIM_EXP_STA_FATAL_ERROR | - PCIM_EXP_STA_UNSUPPORTED_REQ, 2); + pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_STA, + PCIEM_STA_CORRECTABLE_ERROR | + PCIEM_STA_NON_FATAL_ERROR | PCIEM_STA_FATAL_ERROR | + PCIEM_STA_UNSUPPORTED_REQ, 2); } /* Reset some of the PCI state that got zapped by reset. */ Modified: stable/9/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_main.c Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/cxgb/cxgb_main.c Wed Oct 24 19:04:17 2012 (r242015) @@ -476,8 +476,8 @@ cxgb_controller_attach(device_t dev) if (pci_find_cap(dev, PCIY_EXPRESS, ®) == 0) { uint16_t lnk; - lnk = pci_read_config(dev, reg + PCIR_EXPRESS_LINK_STA, 2); - sc->link_width = (lnk & PCIM_LINK_STA_WIDTH) >> 4; + lnk = pci_read_config(dev, reg + PCIER_LINK_STA, 2); + sc->link_width = (lnk & PCIEM_LINK_STA_WIDTH) >> 4; if (sc->link_width < 8 && (ai->caps & SUPPORTED_10000baseT_Full)) { device_printf(sc->dev, Modified: stable/9/sys/dev/cxgb/cxgb_osdep.h ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_osdep.h Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/cxgb/cxgb_osdep.h Wed Oct 24 19:04:17 2012 (r242015) @@ -215,11 +215,11 @@ static const int debug_flags = DBG_RX; #define PCI_VPD_DATA PCIR_VPD_DATA #define PCI_CAP_ID_EXP PCIY_EXPRESS -#define PCI_EXP_DEVCTL PCIR_EXPRESS_DEVICE_CTL -#define PCI_EXP_DEVCTL_PAYLOAD PCIM_EXP_CTL_MAX_PAYLOAD -#define PCI_EXP_DEVCTL_READRQ PCIM_EXP_CTL_MAX_READ_REQUEST -#define PCI_EXP_LNKCTL PCIR_EXPRESS_LINK_CTL -#define PCI_EXP_LNKSTA PCIR_EXPRESS_LINK_STA +#define PCI_EXP_DEVCTL PCIER_DEVICE_CTL +#define PCI_EXP_DEVCTL_PAYLOAD PCIEM_CTL_MAX_PAYLOAD +#define PCI_EXP_DEVCTL_READRQ PCIEM_CTL_MAX_READ_REQUEST +#define PCI_EXP_LNKCTL PCIER_LINK_CTL +#define PCI_EXP_LNKSTA PCIER_LINK_STA /* * Linux compatibility macros Modified: stable/9/sys/dev/cxgbe/osdep.h ============================================================================== --- stable/9/sys/dev/cxgbe/osdep.h Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/cxgbe/osdep.h Wed Oct 24 19:04:17 2012 (r242015) @@ -118,13 +118,13 @@ typedef boolean_t bool; #define PCI_VPD_DATA PCIR_VPD_DATA #define PCI_CAP_ID_EXP PCIY_EXPRESS -#define PCI_EXP_DEVCTL PCIR_EXPRESS_DEVICE_CTL -#define PCI_EXP_DEVCTL_PAYLOAD PCIM_EXP_CTL_MAX_PAYLOAD -#define PCI_EXP_DEVCTL_READRQ PCIM_EXP_CTL_MAX_READ_REQUEST -#define PCI_EXP_LNKCTL PCIR_EXPRESS_LINK_CTL -#define PCI_EXP_LNKSTA PCIR_EXPRESS_LINK_STA -#define PCI_EXP_LNKSTA_CLS PCIM_LINK_STA_SPEED -#define PCI_EXP_LNKSTA_NLW PCIM_LINK_STA_WIDTH +#define PCI_EXP_DEVCTL PCIER_DEVICE_CTL +#define PCI_EXP_DEVCTL_PAYLOAD PCIEM_CTL_MAX_PAYLOAD +#define PCI_EXP_DEVCTL_READRQ PCIEM_CTL_MAX_READ_REQUEST +#define PCI_EXP_LNKCTL PCIER_LINK_CTL +#define PCI_EXP_LNKSTA PCIER_LINK_STA +#define PCI_EXP_LNKSTA_CLS PCIEM_LINK_STA_SPEED +#define PCI_EXP_LNKSTA_NLW PCIEM_LINK_STA_WIDTH #define PCI_EXP_DEVCTL2 0x28 static inline int Modified: stable/9/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/9/sys/dev/cxgbe/t4_main.c Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/cxgbe/t4_main.c Wed Oct 24 19:04:17 2012 (r242015) @@ -430,9 +430,9 @@ t4_attach(device_t dev) uint32_t v; pci_set_max_read_req(dev, 4096); - v = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); - v |= PCIM_EXP_CTL_RELAXED_ORD_ENABLE; - pci_write_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, v, 2); + v = pci_read_config(dev, i + PCIER_DEVICE_CTL, 2); + v |= PCIEM_CTL_RELAXED_ORD_ENABLE; + pci_write_config(dev, i + PCIER_DEVICE_CTL, v, 2); } snprintf(sc->lockname, sizeof(sc->lockname), "%s", Modified: stable/9/sys/dev/e1000/if_em.c ============================================================================== --- stable/9/sys/dev/e1000/if_em.c Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/e1000/if_em.c Wed Oct 24 19:04:17 2012 (r242015) @@ -5111,11 +5111,11 @@ em_disable_aspm(struct adapter *adapter) } if (pci_find_cap(dev, PCIY_EXPRESS, &base) != 0) return; - reg = base + PCIR_EXPRESS_LINK_CAP; + reg = base + PCIER_LINK_CAP; link_cap = pci_read_config(dev, reg, 2); - if ((link_cap & PCIM_LINK_CAP_ASPM) == 0) + if ((link_cap & PCIEM_LINK_CAP_ASPM) == 0) return; - reg = base + PCIR_EXPRESS_LINK_CTL; + reg = base + PCIER_LINK_CTL; link_ctrl = pci_read_config(dev, reg, 2); link_ctrl &= 0xFFFC; /* turn off bit 1 and 2 */ pci_write_config(dev, reg, link_ctrl, 2); Modified: stable/9/sys/dev/et/if_et.c ============================================================================== --- stable/9/sys/dev/et/if_et.c Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/et/if_et.c Wed Oct 24 19:04:17 2012 (r242015) @@ -700,8 +700,8 @@ et_bus_config(struct et_softc *sc) * max playload size */ val = pci_read_config(sc->dev, - sc->sc_expcap + PCIR_EXPRESS_DEVICE_CAP, 4); - max_plsz = val & PCIM_EXP_CAP_MAX_PAYLOAD; + sc->sc_expcap + PCIER_DEVICE_CAP, 4); + max_plsz = val & PCIEM_CAP_MAX_PAYLOAD; switch (max_plsz) { case ET_PCIV_DEVICE_CAPS_PLSZ_128: @@ -732,7 +732,7 @@ et_bus_config(struct et_softc *sc) * Set L0s and L1 latency timer to 2us */ val = pci_read_config(sc->dev, ET_PCIR_L0S_L1_LATENCY, 4); - val &= ~(PCIM_LINK_CAP_L0S_EXIT | PCIM_LINK_CAP_L1_EXIT); + val &= ~(PCIEM_LINK_CAP_L0S_EXIT | PCIEM_LINK_CAP_L1_EXIT); /* L0s exit latency : 2us */ val |= 0x00005000; /* L1 exit latency : 2us */ Modified: stable/9/sys/dev/jme/if_jme.c ============================================================================== --- stable/9/sys/dev/jme/if_jme.c Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/jme/if_jme.c Wed Oct 24 19:04:17 2012 (r242015) @@ -778,7 +778,7 @@ jme_attach(device_t dev) /* Set max allowable DMA size. */ if (pci_find_cap(dev, PCIY_EXPRESS, &i) == 0) { sc->jme_flags |= JME_FLAG_PCIE; - burst = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); + burst = pci_read_config(dev, i + PCIER_DEVICE_CTL, 2); if (bootverbose) { device_printf(dev, "Read request size : %d bytes.\n", 128 << ((burst >> 12) & 0x07)); Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/pci/pci.c Wed Oct 24 19:04:17 2012 (r242015) @@ -1722,8 +1722,8 @@ pci_get_max_read_req(device_t dev) if (pci_find_cap(dev, PCIY_EXPRESS, &cap) != 0) return (0); - val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2); - val &= PCIM_EXP_CTL_MAX_READ_REQUEST; + val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); + val &= PCIEM_CTL_MAX_READ_REQUEST; val >>= 12; return (1 << (val + 7)); } @@ -1741,10 +1741,10 @@ pci_set_max_read_req(device_t dev, int s if (size > 4096) size = 4096; size = (1 << (fls(size) - 1)); - val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2); - val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; + val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); + val &= ~PCIEM_CTL_MAX_READ_REQUEST; val |= (fls(size) - 8) << 12; - pci_write_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, val, 2); + pci_write_config(dev, cap + PCIER_DEVICE_CTL, val, 2); return (size); } Modified: stable/9/sys/dev/pci/pcireg.h ============================================================================== --- stable/9/sys/dev/pci/pcireg.h Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/pci/pcireg.h Wed Oct 24 19:04:17 2012 (r242015) @@ -620,56 +620,258 @@ #define PCIR_SUBVENDCAP_ID 0x4 /* PCI Express definitions */ -#define PCIR_EXPRESS_FLAGS 0x2 -#define PCIM_EXP_FLAGS_VERSION 0x000F -#define PCIM_EXP_FLAGS_TYPE 0x00F0 -#define PCIM_EXP_TYPE_ENDPOINT 0x0000 -#define PCIM_EXP_TYPE_LEGACY_ENDPOINT 0x0010 -#define PCIM_EXP_TYPE_ROOT_PORT 0x0040 -#define PCIM_EXP_TYPE_UPSTREAM_PORT 0x0050 -#define PCIM_EXP_TYPE_DOWNSTREAM_PORT 0x0060 -#define PCIM_EXP_TYPE_PCI_BRIDGE 0x0070 -#define PCIM_EXP_TYPE_PCIE_BRIDGE 0x0080 -#define PCIM_EXP_TYPE_ROOT_INT_EP 0x0090 -#define PCIM_EXP_TYPE_ROOT_EC 0x00a0 -#define PCIM_EXP_FLAGS_SLOT 0x0100 -#define PCIM_EXP_FLAGS_IRQ 0x3e00 -#define PCIR_EXPRESS_DEVICE_CAP 0x4 -#define PCIM_EXP_CAP_MAX_PAYLOAD 0x0007 -#define PCIR_EXPRESS_DEVICE_CTL 0x8 -#define PCIM_EXP_CTL_NFER_ENABLE 0x0002 -#define PCIM_EXP_CTL_FER_ENABLE 0x0004 -#define PCIM_EXP_CTL_URR_ENABLE 0x0008 -#define PCIM_EXP_CTL_RELAXED_ORD_ENABLE 0x0010 -#define PCIM_EXP_CTL_MAX_PAYLOAD 0x00e0 -#define PCIM_EXP_CTL_NOSNOOP_ENABLE 0x0800 -#define PCIM_EXP_CTL_MAX_READ_REQUEST 0x7000 -#define PCIR_EXPRESS_DEVICE_STA 0xa -#define PCIM_EXP_STA_CORRECTABLE_ERROR 0x0001 -#define PCIM_EXP_STA_NON_FATAL_ERROR 0x0002 -#define PCIM_EXP_STA_FATAL_ERROR 0x0004 -#define PCIM_EXP_STA_UNSUPPORTED_REQ 0x0008 -#define PCIM_EXP_STA_AUX_POWER 0x0010 -#define PCIM_EXP_STA_TRANSACTION_PND 0x0020 -#define PCIR_EXPRESS_LINK_CAP 0xc -#define PCIM_LINK_CAP_MAX_SPEED 0x0000000f -#define PCIM_LINK_CAP_MAX_WIDTH 0x000003f0 -#define PCIM_LINK_CAP_ASPM 0x00000c00 -#define PCIM_LINK_CAP_L0S_EXIT 0x00007000 -#define PCIM_LINK_CAP_L1_EXIT 0x00038000 -#define PCIM_LINK_CAP_PORT 0xff000000 -#define PCIR_EXPRESS_LINK_CTL 0x10 -#define PCIR_EXPRESS_LINK_STA 0x12 -#define PCIM_LINK_STA_SPEED 0x000f -#define PCIM_LINK_STA_WIDTH 0x03f0 -#define PCIM_LINK_STA_TRAINING_ERROR 0x0400 -#define PCIM_LINK_STA_TRAINING 0x0800 -#define PCIM_LINK_STA_SLOT_CLOCK 0x1000 -#define PCIR_EXPRESS_SLOT_CAP 0x14 -#define PCIR_EXPRESS_SLOT_CTL 0x18 -#define PCIR_EXPRESS_SLOT_STA 0x1a -#define PCIR_EXPRESS_ROOT_CTL 0x1c -#define PCIR_EXPRESS_ROOT_STA 0x20 +#define PCIER_FLAGS 0x2 +#define PCIEM_FLAGS_VERSION 0x000F +#define PCIEM_FLAGS_TYPE 0x00F0 +#define PCIEM_TYPE_ENDPOINT 0x0000 +#define PCIEM_TYPE_LEGACY_ENDPOINT 0x0010 +#define PCIEM_TYPE_ROOT_PORT 0x0040 +#define PCIEM_TYPE_UPSTREAM_PORT 0x0050 +#define PCIEM_TYPE_DOWNSTREAM_PORT 0x0060 +#define PCIEM_TYPE_PCI_BRIDGE 0x0070 +#define PCIEM_TYPE_PCIE_BRIDGE 0x0080 +#define PCIEM_TYPE_ROOT_INT_EP 0x0090 +#define PCIEM_TYPE_ROOT_EC 0x00a0 +#define PCIEM_FLAGS_SLOT 0x0100 +#define PCIEM_FLAGS_IRQ 0x3e00 +#define PCIER_DEVICE_CAP 0x4 +#define PCIEM_CAP_MAX_PAYLOAD 0x00000007 +#define PCIEM_CAP_PHANTHOM_FUNCS 0x00000018 +#define PCIEM_CAP_EXT_TAG_FIELD 0x00000020 +#define PCIEM_CAP_L0S_LATENCY 0x000001c0 +#define PCIEM_CAP_L1_LATENCY 0x00000e00 +#define PCIEM_CAP_ROLE_ERR_RPT 0x00008000 +#define PCIEM_CAP_SLOT_PWR_LIM_VAL 0x03fc0000 +#define PCIEM_CAP_SLOT_PWR_LIM_SCALE 0x0c000000 +#define PCIEM_CAP_FLR 0x10000000 +#define PCIER_DEVICE_CTL 0x8 +#define PCIEM_CTL_COR_ENABLE 0x0001 +#define PCIEM_CTL_NFER_ENABLE 0x0002 +#define PCIEM_CTL_FER_ENABLE 0x0004 +#define PCIEM_CTL_URR_ENABLE 0x0008 +#define PCIEM_CTL_RELAXED_ORD_ENABLE 0x0010 +#define PCIEM_CTL_MAX_PAYLOAD 0x00e0 +#define PCIEM_CTL_EXT_TAG_FIELD 0x0100 +#define PCIEM_CTL_PHANTHOM_FUNCS 0x0200 +#define PCIEM_CTL_AUX_POWER_PM 0x0400 +#define PCIEM_CTL_NOSNOOP_ENABLE 0x0800 +#define PCIEM_CTL_MAX_READ_REQUEST 0x7000 +#define PCIEM_CTL_BRDG_CFG_RETRY 0x8000 /* PCI-E - PCI/PCI-X bridges */ +#define PCIEM_CTL_INITIATE_FLR 0x8000 /* FLR capable endpoints */ +#define PCIER_DEVICE_STA 0xa +#define PCIEM_STA_CORRECTABLE_ERROR 0x0001 +#define PCIEM_STA_NON_FATAL_ERROR 0x0002 +#define PCIEM_STA_FATAL_ERROR 0x0004 +#define PCIEM_STA_UNSUPPORTED_REQ 0x0008 +#define PCIEM_STA_AUX_POWER 0x0010 +#define PCIEM_STA_TRANSACTION_PND 0x0020 +#define PCIER_LINK_CAP 0xc +#define PCIEM_LINK_CAP_MAX_SPEED 0x0000000f +#define PCIEM_LINK_CAP_MAX_WIDTH 0x000003f0 +#define PCIEM_LINK_CAP_ASPM 0x00000c00 +#define PCIEM_LINK_CAP_L0S_EXIT 0x00007000 +#define PCIEM_LINK_CAP_L1_EXIT 0x00038000 +#define PCIEM_LINK_CAP_CLOCK_PM 0x00040000 +#define PCIEM_LINK_CAP_SURPRISE_DOWN 0x00080000 +#define PCIEM_LINK_CAP_DL_ACTIVE 0x00100000 +#define PCIEM_LINK_CAP_LINK_BW_NOTIFY 0x00200000 +#define PCIEM_LINK_CAP_ASPM_COMPLIANCE 0x00400000 +#define PCIEM_LINK_CAP_PORT 0xff000000 +#define PCIER_LINK_CTL 0x10 +#define PCIEM_LINK_CTL_ASPMC_DIS 0x0000 +#define PCIEM_LINK_CTL_ASPMC_L0S 0x0001 +#define PCIEM_LINK_CTL_ASPMC_L1 0x0002 +#define PCIEM_LINK_CTL_ASPMC 0x0003 +#define PCIEM_LINK_CTL_RCB 0x0008 +#define PCIEM_LINK_CTL_LINK_DIS 0x0010 +#define PCIEM_LINK_CTL_RETRAIN_LINK 0x0020 +#define PCIEM_LINK_CTL_COMMON_CLOCK 0x0040 +#define PCIEM_LINK_CTL_EXTENDED_SYNC 0x0080 +#define PCIEM_LINK_CTL_ECPM 0x0100 +#define PCIEM_LINK_CTL_HAWD 0x0200 +#define PCIEM_LINK_CTL_LBMIE 0x0400 +#define PCIEM_LINK_CTL_LABIE 0x0800 +#define PCIER_LINK_STA 0x12 +#define PCIEM_LINK_STA_SPEED 0x000f +#define PCIEM_LINK_STA_WIDTH 0x03f0 +#define PCIEM_LINK_STA_TRAINING_ERROR 0x0400 +#define PCIEM_LINK_STA_TRAINING 0x0800 +#define PCIEM_LINK_STA_SLOT_CLOCK 0x1000 +#define PCIEM_LINK_STA_DL_ACTIVE 0x2000 +#define PCIEM_LINK_STA_LINK_BW_MGMT 0x4000 +#define PCIEM_LINK_STA_LINK_AUTO_BW 0x8000 +#define PCIER_SLOT_CAP 0x14 +#define PCIEM_SLOT_CAP_APB 0x00000001 +#define PCIEM_SLOT_CAP_PCP 0x00000002 +#define PCIEM_SLOT_CAP_MRLSP 0x00000004 +#define PCIEM_SLOT_CAP_AIP 0x00000008 +#define PCIEM_SLOT_CAP_PIP 0x00000010 +#define PCIEM_SLOT_CAP_HPS 0x00000020 +#define PCIEM_SLOT_CAP_HPC 0x00000040 +#define PCIEM_SLOT_CAP_SPLV 0x00007f80 +#define PCIEM_SLOT_CAP_SPLS 0x00018000 +#define PCIEM_SLOT_CAP_EIP 0x00020000 +#define PCIEM_SLOT_CAP_NCCS 0x00040000 +#define PCIEM_SLOT_CAP_PSN 0xfff80000 +#define PCIER_SLOT_CTL 0x18 +#define PCIEM_SLOT_CTL_ABPE 0x0001 +#define PCIEM_SLOT_CTL_PFDE 0x0002 +#define PCIEM_SLOT_CTL_MRLSCE 0x0004 +#define PCIEM_SLOT_CTL_PDCE 0x0008 +#define PCIEM_SLOT_CTL_CCIE 0x0010 +#define PCIEM_SLOT_CTL_HPIE 0x0020 +#define PCIEM_SLOT_CTL_AIC 0x00c0 +#define PCIEM_SLOT_CTL_PIC 0x0300 +#define PCIEM_SLOT_CTL_PCC 0x0400 +#define PCIEM_SLOT_CTL_EIC 0x0800 +#define PCIEM_SLOT_CTL_DLLSCE 0x1000 +#define PCIER_SLOT_STA 0x1a +#define PCIEM_SLOT_STA_ABP 0x0001 +#define PCIEM_SLOT_STA_PFD 0x0002 +#define PCIEM_SLOT_STA_MRLSC 0x0004 +#define PCIEM_SLOT_STA_PDC 0x0008 +#define PCIEM_SLOT_STA_CC 0x0010 +#define PCIEM_SLOT_STA_MRLSS 0x0020 +#define PCIEM_SLOT_STA_PDS 0x0040 +#define PCIEM_SLOT_STA_EIS 0x0080 +#define PCIEM_SLOT_STA_DLLSC 0x0100 +#define PCIER_ROOT_CTL 0x1c +#define PCIER_ROOT_CAP 0x1e +#define PCIER_ROOT_STA 0x20 +#define PCIER_DEVICE_CAP2 0x24 +#define PCIER_DEVICE_CTL2 0x28 +#define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f +#define PCIEM_CTL2_COMP_TIMEOUT_DIS 0x0010 +#define PCIEM_CTL2_ARI 0x0020 +#define PCIEM_CTL2_ATOMIC_REQ_ENABLE 0x0040 +#define PCIEM_CTL2_ATOMIC_EGR_BLOCK 0x0080 +#define PCIEM_CTL2_ID_ORDERED_REQ_EN 0x0100 +#define PCIEM_CTL2_ID_ORDERED_CMP_EN 0x0200 +#define PCIEM_CTL2_LTR_ENABLE 0x0400 +#define PCIEM_CTL2_OBFF 0x6000 +#define PCIEM_OBFF_DISABLE 0x0000 +#define PCIEM_OBFF_MSGA_ENABLE 0x2000 +#define PCIEM_OBFF_MSGB_ENABLE 0x4000 +#define PCIEM_OBFF_WAKE_ENABLE 0x6000 +#define PCIEM_CTL2_END2END_TLP 0x8000 +#define PCIER_DEVICE_STA2 0x2a +#define PCIER_LINK_CAP2 0x2c +#define PCIER_LINK_CTL2 0x30 +#define PCIER_LINK_STA2 0x32 +#define PCIER_SLOT_CAP2 0x34 +#define PCIER_SLOT_CTL2 0x38 +#define PCIER_SLOT_STA2 0x3a + +/* Old compatibility definitions for PCI Express registers */ +#define PCIR_EXPRESS_FLAGS PCIER_FLAGS +#define PCIM_EXP_FLAGS_VERSION PCIEM_FLAGS_VERSION +#define PCIM_EXP_FLAGS_TYPE PCIEM_FLAGS_TYPE +#define PCIM_EXP_TYPE_ENDPOINT PCIEM_TYPE_ENDPOINT +#define PCIM_EXP_TYPE_LEGACY_ENDPOINT PCIEM_TYPE_LEGACY_ENDPOINT +#define PCIM_EXP_TYPE_ROOT_PORT PCIEM_TYPE_ROOT_PORT +#define PCIM_EXP_TYPE_UPSTREAM_PORT PCIEM_TYPE_UPSTREAM_PORT +#define PCIM_EXP_TYPE_DOWNSTREAM_PORT PCIEM_TYPE_DOWNSTREAM_PORT +#define PCIM_EXP_TYPE_PCI_BRIDGE PCIEM_TYPE_PCI_BRIDGE +#define PCIM_EXP_TYPE_PCIE_BRIDGE PCIEM_TYPE_PCIE_BRIDGE +#define PCIM_EXP_TYPE_ROOT_INT_EP PCIEM_TYPE_ROOT_INT_EP +#define PCIM_EXP_TYPE_ROOT_EC PCIEM_TYPE_ROOT_EC +#define PCIM_EXP_FLAGS_SLOT PCIEM_FLAGS_SLOT +#define PCIM_EXP_FLAGS_IRQ PCIEM_FLAGS_IRQ +#define PCIR_EXPRESS_DEVICE_CAP PCIER_DEVICE_CAP +#define PCIM_EXP_CAP_MAX_PAYLOAD PCIEM_CAP_MAX_PAYLOAD +#define PCIM_EXP_CAP_PHANTHOM_FUNCS PCIEM_CAP_PHANTHOM_FUNCS +#define PCIM_EXP_CAP_EXT_TAG_FIELD PCIEM_CAP_EXT_TAG_FIELD +#define PCIM_EXP_CAP_L0S_LATENCY PCIEM_CAP_L0S_LATENCY +#define PCIM_EXP_CAP_L1_LATENCY PCIEM_CAP_L1_LATENCY +#define PCIM_EXP_CAP_ROLE_ERR_RPT PCIEM_CAP_ROLE_ERR_RPT +#define PCIM_EXP_CAP_SLOT_PWR_LIM_VAL PCIEM_CAP_SLOT_PWR_LIM_VAL +#define PCIM_EXP_CAP_SLOT_PWR_LIM_SCALE PCIEM_CAP_SLOT_PWR_LIM_SCALE +#define PCIM_EXP_CAP_FLR PCIEM_CAP_FLR +#define PCIR_EXPRESS_DEVICE_CTL PCIER_DEVICE_CTL +#define PCIM_EXP_CTL_COR_ENABLE PCIEM_CTL_COR_ENABLE +#define PCIM_EXP_CTL_NFER_ENABLE PCIEM_CTL_NFER_ENABLE +#define PCIM_EXP_CTL_FER_ENABLE PCIEM_CTL_FER_ENABLE +#define PCIM_EXP_CTL_URR_ENABLE PCIEM_CTL_URR_ENABLE +#define PCIM_EXP_CTL_RELAXED_ORD_ENABLE PCIEM_CTL_RELAXED_ORD_ENABLE +#define PCIM_EXP_CTL_MAX_PAYLOAD PCIEM_CTL_MAX_PAYLOAD +#define PCIM_EXP_CTL_EXT_TAG_FIELD PCIEM_CTL_EXT_TAG_FIELD +#define PCIM_EXP_CTL_PHANTHOM_FUNCS PCIEM_CTL_PHANTHOM_FUNCS +#define PCIM_EXP_CTL_AUX_POWER_PM PCIEM_CTL_AUX_POWER_PM +#define PCIM_EXP_CTL_NOSNOOP_ENABLE PCIEM_CTL_NOSNOOP_ENABLE +#define PCIM_EXP_CTL_MAX_READ_REQUEST PCIEM_CTL_MAX_READ_REQUEST +#define PCIM_EXP_CTL_BRDG_CFG_RETRY PCIEM_CTL_BRDG_CFG_RETRY +#define PCIM_EXP_CTL_INITIATE_FLR PCIEM_CTL_INITIATE_FLR +#define PCIR_EXPRESS_DEVICE_STA PCIER_DEVICE_STA +#define PCIM_EXP_STA_CORRECTABLE_ERROR PCIEM_STA_CORRECTABLE_ERROR +#define PCIM_EXP_STA_NON_FATAL_ERROR PCIEM_STA_NON_FATAL_ERROR +#define PCIM_EXP_STA_FATAL_ERROR PCIEM_STA_FATAL_ERROR +#define PCIM_EXP_STA_UNSUPPORTED_REQ PCIEM_STA_UNSUPPORTED_REQ +#define PCIM_EXP_STA_AUX_POWER PCIEM_STA_AUX_POWER +#define PCIM_EXP_STA_TRANSACTION_PND PCIEM_STA_TRANSACTION_PND +#define PCIR_EXPRESS_LINK_CAP PCIER_LINK_CAP +#define PCIM_LINK_CAP_MAX_SPEED PCIEM_LINK_CAP_MAX_SPEED +#define PCIM_LINK_CAP_MAX_WIDTH PCIEM_LINK_CAP_MAX_WIDTH +#define PCIM_LINK_CAP_ASPM PCIEM_LINK_CAP_ASPM +#define PCIM_LINK_CAP_L0S_EXIT PCIEM_LINK_CAP_L0S_EXIT +#define PCIM_LINK_CAP_L1_EXIT PCIEM_LINK_CAP_L1_EXIT +#define PCIM_LINK_CAP_CLOCK_PM PCIEM_LINK_CAP_CLOCK_PM +#define PCIM_LINK_CAP_SURPRISE_DOWN PCIEM_LINK_CAP_SURPRISE_DOWN +#define PCIM_LINK_CAP_DL_ACTIVE PCIEM_LINK_CAP_DL_ACTIVE +#define PCIM_LINK_CAP_LINK_BW_NOTIFY PCIEM_LINK_CAP_LINK_BW_NOTIFY +#define PCIM_LINK_CAP_ASPM_COMPLIANCE PCIEM_LINK_CAP_ASPM_COMPLIANCE +#define PCIM_LINK_CAP_PORT PCIEM_LINK_CAP_PORT +#define PCIR_EXPRESS_LINK_CTL PCIER_LINK_CTL +#define PCIM_EXP_LINK_CTL_ASPMC_DIS PCIEM_LINK_CTL_ASPMC_DIS +#define PCIM_EXP_LINK_CTL_ASPMC_L0S PCIEM_LINK_CTL_ASPMC_L0S +#define PCIM_EXP_LINK_CTL_ASPMC_L1 PCIEM_LINK_CTL_ASPMC_L1 +#define PCIM_EXP_LINK_CTL_ASPMC PCIEM_LINK_CTL_ASPMC +#define PCIM_EXP_LINK_CTL_RCB PCIEM_LINK_CTL_RCB +#define PCIM_EXP_LINK_CTL_LINK_DIS PCIEM_LINK_CTL_LINK_DIS +#define PCIM_EXP_LINK_CTL_RETRAIN_LINK PCIEM_LINK_CTL_RETRAIN_LINK +#define PCIM_EXP_LINK_CTL_COMMON_CLOCK PCIEM_LINK_CTL_COMMON_CLOCK +#define PCIM_EXP_LINK_CTL_EXTENDED_SYNC PCIEM_LINK_CTL_EXTENDED_SYNC +#define PCIM_EXP_LINK_CTL_ECPM PCIEM_LINK_CTL_ECPM +#define PCIM_EXP_LINK_CTL_HAWD PCIEM_LINK_CTL_HAWD +#define PCIM_EXP_LINK_CTL_LBMIE PCIEM_LINK_CTL_LBMIE +#define PCIM_EXP_LINK_CTL_LABIE PCIEM_LINK_CTL_LABIE +#define PCIR_EXPRESS_LINK_STA PCIER_LINK_STA +#define PCIM_LINK_STA_SPEED PCIEM_LINK_STA_SPEED +#define PCIM_LINK_STA_WIDTH PCIEM_LINK_STA_WIDTH +#define PCIM_LINK_STA_TRAINING_ERROR PCIEM_LINK_STA_TRAINING_ERROR +#define PCIM_LINK_STA_TRAINING PCIEM_LINK_STA_TRAINING +#define PCIM_LINK_STA_SLOT_CLOCK PCIEM_LINK_STA_SLOT_CLOCK +#define PCIM_LINK_STA_DL_ACTIVE PCIEM_LINK_STA_DL_ACTIVE +#define PCIM_LINK_STA_LINK_BW_MGMT PCIEM_LINK_STA_LINK_BW_MGMT +#define PCIM_LINK_STA_LINK_AUTO_BW PCIEM_LINK_STA_LINK_AUTO_BW +#define PCIR_EXPRESS_SLOT_CAP PCIER_SLOT_CAP +#define PCIR_EXPRESS_SLOT_CTL PCIER_SLOT_CTL +#define PCIR_EXPRESS_SLOT_STA PCIER_SLOT_STA +#define PCIR_EXPRESS_ROOT_CTL PCIER_ROOT_CTL +#define PCIR_EXPRESS_ROOT_CAP PCIER_ROOT_CAP +#define PCIR_EXPRESS_ROOT_STA PCIER_ROOT_STA +#define PCIR_EXPRESS_DEVICE_CAP2 PCIER_DEVICE_CAP2 +#define PCIR_EXPRESS_DEVICE_CTL2 PCIER_DEVICE_CTL2 +#define PCIM_EXP_CTL2_COMP_TIMEOUT_VAL PCIEM_CTL2_COMP_TIMEOUT_VAL +#define PCIM_EXP_CTL2_COMP_TIMEOUT_DIS PCIEM_CTL2_COMP_TIMEOUT_DIS +#define PCIM_EXP_CTL2_ARI PCIEM_CTL2_ARI +#define PCIM_EXP_CTL2_ATOMIC_REQ_ENABLE PCIEM_CTL2_ATOMIC_REQ_ENABLE +#define PCIM_EXP_CTL2_ATOMIC_EGR_BLOCK PCIEM_CTL2_ATOMIC_EGR_BLOCK +#define PCIM_EXP_CTL2_ID_ORDERED_REQ_EN PCIEM_CTL2_ID_ORDERED_REQ_EN +#define PCIM_EXP_CTL2_ID_ORDERED_CMP_EN PCIEM_CTL2_ID_ORDERED_CMP_EN +#define PCIM_EXP_CTL2_LTR_ENABLE PCIEM_CTL2_LTR_ENABLE +#define PCIM_EXP_CTL2_OBFF PCIEM_CTL2_OBFF +#define PCIM_EXP_OBFF_DISABLE PCIEM_OBFF_DISABLE +#define PCIM_EXP_OBFF_MSGA_ENABLE PCIEM_OBFF_MSGA_ENABLE +#define PCIM_EXP_OBFF_MSGB_ENABLE PCIEM_OBFF_MSGB_ENABLE +#define PCIM_EXP_OBFF_WAKE_ENABLE PCIEM_OBFF_WAKE_ENABLE +#define PCIM_EXP_CTL2_END2END_TLP PCIEM_CTL2_END2END_TLP +#define PCIR_EXPRESS_DEVICE_STA2 PCIER_DEVICE_STA2 +#define PCIR_EXPRESS_LINK_CAP2 PCIER_LINK_CAP2 +#define PCIR_EXPRESS_LINK_CTL2 PCIER_LINK_CTL2 +#define PCIR_EXPRESS_LINK_STA2 PCIER_LINK_STA2 +#define PCIR_EXPRESS_SLOT_CAP2 PCIER_SLOT_CAP2 +#define PCIR_EXPRESS_SLOT_CTL2 PCIER_SLOT_CTL2 +#define PCIR_EXPRESS_SLOT_STA2 PCIER_SLOT_STA2 /* MSI-X definitions */ #define PCIR_MSIX_CTRL 0x2 Modified: stable/9/sys/dev/re/if_re.c ============================================================================== --- stable/9/sys/dev/re/if_re.c Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/dev/re/if_re.c Wed Oct 24 19:04:17 2012 (r242015) @@ -1343,14 +1343,14 @@ re_attach(device_t dev) /* Disable ASPM L0S/L1. */ if (sc->rl_expcap != 0) { cap = pci_read_config(dev, sc->rl_expcap + - PCIR_EXPRESS_LINK_CAP, 2); - if ((cap & PCIM_LINK_CAP_ASPM) != 0) { + PCIER_LINK_CAP, 2); + if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { ctl = pci_read_config(dev, sc->rl_expcap + - PCIR_EXPRESS_LINK_CTL, 2); + PCIER_LINK_CTL, 2); if ((ctl & 0x0003) != 0) { ctl &= ~0x0003; pci_write_config(dev, sc->rl_expcap + - PCIR_EXPRESS_LINK_CTL, ctl, 2); + PCIER_LINK_CTL, ctl, 2); device_printf(dev, "ASPM disabled\n"); } } else Modified: stable/9/sys/ofed/include/linux/pci.h ============================================================================== --- stable/9/sys/ofed/include/linux/pci.h Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/ofed/include/linux/pci.h Wed Oct 24 19:04:17 2012 (r242015) @@ -82,8 +82,8 @@ struct pci_device_id { #define PCI_VENDOR_ID PCIR_DEVVENDOR #define PCI_COMMAND PCIR_COMMAND -#define PCI_EXP_DEVCTL PCIR_EXPRESS_DEVICE_CTL -#define PCI_EXP_LNKCTL PCIR_EXPRESS_LINK_CTL +#define PCI_EXP_DEVCTL PCIER_DEVICE_CTL +#define PCI_EXP_LNKCTL PCIER_LINK_CTL #define IORESOURCE_MEM SYS_RES_MEMORY #define IORESOURCE_IO SYS_RES_IOPORT Modified: stable/9/sys/powerpc/mpc85xx/pci_fdt.c ============================================================================== --- stable/9/sys/powerpc/mpc85xx/pci_fdt.c Wed Oct 24 18:36:41 2012 (r242014) +++ stable/9/sys/powerpc/mpc85xx/pci_fdt.c Wed Oct 24 19:04:17 2012 (r242015) @@ -843,10 +843,10 @@ fsl_pcib_err_init(device_t dev) 0xffffffff); dsr = fsl_pcib_cfgread(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_STA, 2); + sc->sc_pcie_capreg + PCIER_DEVICE_STA, 2); if (dsr) fsl_pcib_cfgwrite(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_STA, + sc->sc_pcie_capreg + PCIER_DEVICE_STA, 0xffff, 2); /* Enable all errors reporting */ @@ -856,11 +856,11 @@ fsl_pcib_err_init(device_t dev) /* Enable error reporting: URR, FER, NFER */ dcr = fsl_pcib_cfgread(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_CTL, 4); - dcr |= PCIM_EXP_CTL_URR_ENABLE | PCIM_EXP_CTL_FER_ENABLE | - PCIM_EXP_CTL_NFER_ENABLE; + sc->sc_pcie_capreg + PCIER_DEVICE_CTL, 4); + dcr |= PCIEM_CTL_URR_ENABLE | PCIEM_CTL_FER_ENABLE | + PCIEM_CTL_NFER_ENABLE; fsl_pcib_cfgwrite(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_CTL, dcr, 4); + sc->sc_pcie_capreg + PCIER_DEVICE_CTL, dcr, 4); } } From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 24 19:22:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90337FDC; Wed, 24 Oct 2012 19:22:44 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8498FC08; Wed, 24 Oct 2012 19:22: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 q9OJMisq079642; Wed, 24 Oct 2012 19:22:44 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9OJMi76079639; Wed, 24 Oct 2012 19:22:44 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201210241922.q9OJMi76079639@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 24 Oct 2012 19:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242016 - stable/9/usr.sbin/pciconf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 19:22:44 -0000 Author: gavin Date: Wed Oct 24 19:22:43 2012 New Revision: 242016 URL: http://svn.freebsd.org/changeset/base/242016 Log: Merge r240680 from head: Align the PCI Express #defines with the style used for the PCI-X #defines. This has the advantage that it makes the names more compact, and also allows us to correct the non-uniform naming of the PCIM_LINK_* defines, making them all consistent amongst themselves. This is a mostly mechanical rename: s/PCIR_EXPRESS_/PCIER_/g s/PCIM_EXP_/PCIEM_/g s/PCIM_LINK_/PCIEM_LINK_/g In this MFC, #defines have been added for the old names to assist out-of-tree drivers. Modified: stable/9/usr.sbin/pciconf/cap.c stable/9/usr.sbin/pciconf/err.c Directory Properties: stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/9/usr.sbin/pciconf/cap.c ============================================================================== --- stable/9/usr.sbin/pciconf/cap.c Wed Oct 24 19:04:17 2012 (r242015) +++ stable/9/usr.sbin/pciconf/cap.c Wed Oct 24 19:22:43 2012 (r242016) @@ -369,53 +369,53 @@ cap_express(int fd, struct pci_conf *p, uint32_t val; uint16_t flags; - flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_FLAGS, 2); - printf("PCI-Express %d ", flags & PCIM_EXP_FLAGS_VERSION); - switch (flags & PCIM_EXP_FLAGS_TYPE) { - case PCIM_EXP_TYPE_ENDPOINT: + flags = read_config(fd, &p->pc_sel, ptr + PCIER_FLAGS, 2); + printf("PCI-Express %d ", flags & PCIEM_FLAGS_VERSION); + switch (flags & PCIEM_FLAGS_TYPE) { + case PCIEM_TYPE_ENDPOINT: printf("endpoint"); break; - case PCIM_EXP_TYPE_LEGACY_ENDPOINT: + case PCIEM_TYPE_LEGACY_ENDPOINT: printf("legacy endpoint"); break; - case PCIM_EXP_TYPE_ROOT_PORT: + case PCIEM_TYPE_ROOT_PORT: printf("root port"); break; - case PCIM_EXP_TYPE_UPSTREAM_PORT: + case PCIEM_TYPE_UPSTREAM_PORT: printf("upstream port"); break; - case PCIM_EXP_TYPE_DOWNSTREAM_PORT: + case PCIEM_TYPE_DOWNSTREAM_PORT: printf("downstream port"); break; - case PCIM_EXP_TYPE_PCI_BRIDGE: + case PCIEM_TYPE_PCI_BRIDGE: printf("PCI bridge"); break; - case PCIM_EXP_TYPE_PCIE_BRIDGE: + case PCIEM_TYPE_PCIE_BRIDGE: printf("PCI to PCIe bridge"); break; - case PCIM_EXP_TYPE_ROOT_INT_EP: + case PCIEM_TYPE_ROOT_INT_EP: printf("root endpoint"); break; - case PCIM_EXP_TYPE_ROOT_EC: + case PCIEM_TYPE_ROOT_EC: printf("event collector"); break; default: - printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 4); + printf("type %d", (flags & PCIEM_FLAGS_TYPE) >> 4); break; } - if (flags & PCIM_EXP_FLAGS_SLOT) + if (flags & PCIEM_FLAGS_SLOT) printf(" slot"); - if (flags & PCIM_EXP_FLAGS_IRQ) - printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 9); - val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CAP, 4); - flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CTL, 2); + if (flags & PCIEM_FLAGS_IRQ) + printf(" IRQ %d", (flags & PCIEM_FLAGS_IRQ) >> 9); + val = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CTL, 2); printf(" max data %d(%d)", - MAX_PAYLOAD((flags & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5), - MAX_PAYLOAD(val & PCIM_EXP_CAP_MAX_PAYLOAD)); - val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_LINK_CAP, 4); - flags = read_config(fd, &p->pc_sel, ptr+ PCIR_EXPRESS_LINK_STA, 2); - printf(" link x%d(x%d)", (flags & PCIM_LINK_STA_WIDTH) >> 4, - (val & PCIM_LINK_CAP_MAX_WIDTH) >> 4); + MAX_PAYLOAD((flags & PCIEM_CTL_MAX_PAYLOAD) >> 5), + MAX_PAYLOAD(val & PCIEM_CAP_MAX_PAYLOAD)); + val = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr+ PCIER_LINK_STA, 2); + printf(" link x%d(x%d)", (flags & PCIEM_LINK_STA_WIDTH) >> 4, + (val & PCIEM_LINK_CAP_MAX_WIDTH) >> 4); } static void Modified: stable/9/usr.sbin/pciconf/err.c ============================================================================== --- stable/9/usr.sbin/pciconf/err.c Wed Oct 24 19:04:17 2012 (r242015) +++ stable/9/usr.sbin/pciconf/err.c Wed Oct 24 19:22:43 2012 (r242016) @@ -63,18 +63,18 @@ static struct bit_table pci_status[] = { /* Error indicators in the PCI-Express device status register. */ static struct bit_table pcie_device_status[] = { - { PCIM_EXP_STA_CORRECTABLE_ERROR, "Correctable Error Detected" }, - { PCIM_EXP_STA_NON_FATAL_ERROR, "Non-Fatal Error Detected" }, - { PCIM_EXP_STA_FATAL_ERROR, "Fatal Error Detected" }, - { PCIM_EXP_STA_UNSUPPORTED_REQ, "Unsupported Request Detected" }, + { PCIEM_STA_CORRECTABLE_ERROR, "Correctable Error Detected" }, + { PCIEM_STA_NON_FATAL_ERROR, "Non-Fatal Error Detected" }, + { PCIEM_STA_FATAL_ERROR, "Fatal Error Detected" }, + { PCIEM_STA_UNSUPPORTED_REQ, "Unsupported Request Detected" }, { 0, NULL }, }; /* Valid error indicator bits in the PCI-Express device status register. */ -#define PCIE_ERRORS (PCIM_EXP_STA_CORRECTABLE_ERROR | \ - PCIM_EXP_STA_NON_FATAL_ERROR | \ - PCIM_EXP_STA_FATAL_ERROR | \ - PCIM_EXP_STA_UNSUPPORTED_REQ) +#define PCIE_ERRORS (PCIEM_STA_CORRECTABLE_ERROR | \ + PCIEM_STA_NON_FATAL_ERROR | \ + PCIEM_STA_FATAL_ERROR | \ + PCIEM_STA_UNSUPPORTED_REQ) /* AER Uncorrected errors. */ static struct bit_table aer_uc[] = { @@ -147,7 +147,7 @@ list_errors(int fd, struct pci_conf *p) return; /* Check for PCI-e errors. */ - sta = read_config(fd, &p->pc_sel, pcie + PCIR_EXPRESS_DEVICE_STA, 2); + sta = read_config(fd, &p->pc_sel, pcie + PCIER_DEVICE_STA, 2); print_bits("PCI-e errors", pcie_device_status, sta & PCIE_ERRORS); /* See if this device supports AER. */ From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 00:45:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12DE0B46; Thu, 25 Oct 2012 00:45:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E90758FC17; Thu, 25 Oct 2012 00:45:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P0jp2w033685; Thu, 25 Oct 2012 00:45:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P0jp1Z033683; Thu, 25 Oct 2012 00:45:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201210250045.q9P0jp1Z033683@svn.freebsd.org> From: Rick Macklem Date: Thu, 25 Oct 2012 00:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242017 - stable/9/sys/rpc/rpcsec_gss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 00:45:52 -0000 Author: rmacklem Date: Thu Oct 25 00:45:51 2012 New Revision: 242017 URL: http://svn.freebsd.org/changeset/base/242017 Log: MFC: r241582 Add a comment describing why r241097 was done. Modified: stable/9/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- stable/9/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Wed Oct 24 19:22:43 2012 (r242016) +++ stable/9/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Thu Oct 25 00:45:51 2012 (r242017) @@ -1024,6 +1024,17 @@ svc_rpc_gss_validate(struct svc_rpc_gss_ if (maj_stat != GSS_S_COMPLETE) { rpc_gss_log_status("gss_verify_mic", client->cl_mech, maj_stat, min_stat); + /* + * Attila Bogar and Herbert Poeckl reported similar problems + * w.r.t. a Linux NFS client doing a krb5 NFS mount against the + * FreeBSD server. We determined this was a Linux bug: + * http://www.spinics.net/lists/linux-nfs/msg32466.html, where + * the mount failed to work because a Destroy operation with a + * bogus encrypted checksum destroyed the authenticator handle. + * Since the checksum is bogus (gss_verify_mic() failed), it + * doesn't make sense to destroy the handle and not doing so + * fixes the Linux mount. + */ if (gcproc != RPCSEC_GSS_DESTROY) client->cl_state = CLIENT_STALE; return (FALSE); From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 01:19:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A40544D; Thu, 25 Oct 2012 01:19:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61F3B8FC12; Thu, 25 Oct 2012 01:19:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P1J3es039101; Thu, 25 Oct 2012 01:19:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P1J324039099; Thu, 25 Oct 2012 01:19:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250119.q9P1J324039099@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 01:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242019 - stable/9/usr.bin/csup X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 01:19:03 -0000 Author: eadler Date: Thu Oct 25 01:19:02 2012 New Revision: 242019 URL: http://svn.freebsd.org/changeset/base/242019 Log: MFC r241835: Fix conditional expression: previously a bitvector would be operated on by a logical not. Approved by: cperciva (implicit) Modified: stable/9/usr.bin/csup/lister.c Directory Properties: stable/9/usr.bin/csup/ (props changed) Modified: stable/9/usr.bin/csup/lister.c ============================================================================== --- stable/9/usr.bin/csup/lister.c Thu Oct 25 00:50:14 2012 (r242018) +++ stable/9/usr.bin/csup/lister.c Thu Oct 25 01:19:02 2012 (r242019) @@ -530,7 +530,7 @@ lister_dorcsdead(struct lister *l, struc return (0); config = l->config; wr = l->wr; - if (!coll->co_options & CO_TRUSTSTATUSFILE) { + if (!(coll->co_options & CO_TRUSTSTATUSFILE)) { path = cvspath(coll->co_prefix, sr->sr_file, 1); if (path == NULL) { spath = coll_statuspath(coll); From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 01:20:20 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6724371E; Thu, 25 Oct 2012 01:20:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F49C8FC17; Thu, 25 Oct 2012 01:20:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P1KKEO039418; Thu, 25 Oct 2012 01:20:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P1KKMP039413; Thu, 25 Oct 2012 01:20:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250120.q9P1KKMP039413@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 01:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242022 - stable/9/usr.sbin/memcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 01:20:20 -0000 Author: eadler Date: Thu Oct 25 01:20:19 2012 New Revision: 242022 URL: http://svn.freebsd.org/changeset/base/242022 Log: MFC r241829: Fix conditional expression: previously a bit vector was being operated on by a logical not instead of the entire expression. Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/memcontrol/memcontrol.c Directory Properties: stable/9/usr.sbin/memcontrol/ (props changed) Modified: stable/9/usr.sbin/memcontrol/memcontrol.c ============================================================================== --- stable/9/usr.sbin/memcontrol/memcontrol.c Thu Oct 25 01:20:19 2012 (r242021) +++ stable/9/usr.sbin/memcontrol/memcontrol.c Thu Oct 25 01:20:19 2012 (r242022) @@ -235,7 +235,7 @@ setfunc(int memfd, int argc, char *argv[ while(argc--) { for (i = 0; attrnames[i].name != NULL; i++) { if (!strcmp(attrnames[i].name, argv[0])) { - if (!attrnames[i].kind & MDF_SETTABLE) + if (!(attrnames[i].kind & MDF_SETTABLE)) help("flags"); mrd.mr_flags |= attrnames[i].val; break; From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 01:23:41 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E312AB88; Thu, 25 Oct 2012 01:23:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB3168FC12; Thu, 25 Oct 2012 01:23:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P1Nf8d040033; Thu, 25 Oct 2012 01:23:41 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P1NfJB040025; Thu, 25 Oct 2012 01:23:41 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250123.q9P1NfJB040025@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 01:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242025 - stable/9/usr.bin/netstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 01:23:42 -0000 Author: eadler Date: Thu Oct 25 01:23:41 2012 New Revision: 242025 URL: http://svn.freebsd.org/changeset/base/242025 Log: MFC r241838: Remove unused variable. Newer versions of gcc care. Approved by: cperciva (implicit) Modified: stable/9/usr.bin/netstat/route.c Directory Properties: stable/9/usr.bin/netstat/ (props changed) Modified: stable/9/usr.bin/netstat/route.c ============================================================================== --- stable/9/usr.bin/netstat/route.c Thu Oct 25 01:23:41 2012 (r242024) +++ stable/9/usr.bin/netstat/route.c Thu Oct 25 01:23:41 2012 (r242025) @@ -1104,10 +1104,8 @@ ipx_phost(struct sockaddr *sa) struct sockaddr_ipx work; static union ipx_net ipx_zeronet; char *p; - struct ipx_addr in; work = *sipx; - in = work.sipx_addr; work.sipx_addr.x_port = 0; work.sipx_addr.x_net = ipx_zeronet; From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 01:27:02 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B9EA1EE; Thu, 25 Oct 2012 01:27:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 430CE8FC1A; Thu, 25 Oct 2012 01:27: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 q9P1R2Za040681; Thu, 25 Oct 2012 01:27:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P1R2Xd040679; Thu, 25 Oct 2012 01:27:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250127.q9P1R2Xd040679@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 01:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242028 - stable/9/sys/xen/interface/foreign X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 01:27:02 -0000 Author: eadler Date: Thu Oct 25 01:27:01 2012 New Revision: 242028 URL: http://svn.freebsd.org/changeset/base/242028 Log: MFC r241833: Make xen python scripts work with python3 Approved by: cperciva (implicit) Modified: stable/9/sys/xen/interface/foreign/mkheader.py Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/xen/interface/foreign/mkheader.py ============================================================================== --- stable/9/sys/xen/interface/foreign/mkheader.py Thu Oct 25 01:27:01 2012 (r242027) +++ stable/9/sys/xen/interface/foreign/mkheader.py Thu Oct 25 01:27:01 2012 (r242028) @@ -155,7 +155,7 @@ for struct in structs: output = re.sub("\\b(%s)_t\\b" % struct, "\\1_%s_t" % arch, output); # replace: integer types -integers = inttypes[arch].keys(); +integers = list(inttypes[arch].keys()); integers.sort(lambda a, b: cmp(len(b),len(a))); for type in integers: output = re.sub("\\b%s\\b" % type, inttypes[arch][type], output); From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:11:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78D6BF04; Thu, 25 Oct 2012 03:11:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F3928FC18; Thu, 25 Oct 2012 03:11:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P3BJk5057778; Thu, 25 Oct 2012 03:11:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3BJZW057775; Thu, 25 Oct 2012 03:11:19 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250311.q9P3BJZW057775@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242032 - stable/9/lib/libfetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:11:19 -0000 Author: eadler Date: Thu Oct 25 03:11:18 2012 New Revision: 242032 URL: http://svn.freebsd.org/changeset/base/242032 Log: MFC r241839: Be a bit more lenient in the maximum number of redirects allowed. Chrome and Firefox have a limit of 20. IE has a limit of 8. Approved by: cperciva (implicit) Modified: stable/9/lib/libfetch/http.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Thu Oct 25 02:38:05 2012 (r242031) +++ stable/9/lib/libfetch/http.c Thu Oct 25 03:11:18 2012 (r242032) @@ -86,7 +86,7 @@ __FBSDID("$FreeBSD$"); #include "httperr.h" /* Maximum number of redirects to follow */ -#define MAX_REDIRECT 5 +#define MAX_REDIRECT 20 /* Symbolic names for reply codes we care about */ #define HTTP_OK 200 From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:12:20 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 942B039E; Thu, 25 Oct 2012 03:12:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79CDA8FC08; Thu, 25 Oct 2012 03:12:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P3CK5j058025; Thu, 25 Oct 2012 03:12:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3CKG3058022; Thu, 25 Oct 2012 03:12:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250312.q9P3CKG3058022@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242035 - stable/9/games/fortune/tools X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:12:20 -0000 Author: eadler Date: Thu Oct 25 03:12:20 2012 New Revision: 242035 URL: http://svn.freebsd.org/changeset/base/242035 Log: MFC r241834: Make do_uniq work with python3 Approved by: cperciva (implicit) Modified: stable/9/games/fortune/tools/do_uniq.py Directory Properties: stable/9/games/fortune/ (props changed) Modified: stable/9/games/fortune/tools/do_uniq.py ============================================================================== --- stable/9/games/fortune/tools/do_uniq.py Thu Oct 25 03:11:18 2012 (r242034) +++ stable/9/games/fortune/tools/do_uniq.py Thu Oct 25 03:12:20 2012 (r242035) @@ -34,26 +34,26 @@ def edit(datfile): for line in file(datfile): if line == "%\n": key = hash(fortune) - if not dups.has_key(key): + if key not in dups: dups[key] = [] dups[key].append(fortune) fortunes.append(fortune) fortune = "" else: fortune += line - for key in dups.keys(): + for key in list(dups.keys()): if len(dups[key]) == 1: del dups[key] o = file(datfile + '~', "w") for fortune in fortunes: key = hash(fortune) if key in dups: - print '\n' * 50 + print('\n' * 50) for f in dups[key]: if f != fortune: - print f, '%' - print fortune, '%' - if raw_input("Remove last fortune? ") == 'y': + print(f, '%') + print(fortune, '%') + if input("Remove last fortune? ") == 'y': del dups[key] continue o.write(fortune + "%\n") From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:14:18 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 417847E7; Thu, 25 Oct 2012 03:14:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 292F28FC0C; Thu, 25 Oct 2012 03:14: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 q9P3EICu058560; Thu, 25 Oct 2012 03:14:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3EHGR058558; Thu, 25 Oct 2012 03:14:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250314.q9P3EHGR058558@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242039 - stable/9/usr.sbin/nfsd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:14:18 -0000 Author: eadler Date: Thu Oct 25 03:14:17 2012 New Revision: 242039 URL: http://svn.freebsd.org/changeset/base/242039 Log: MFC r241849: Fix typo in error when unable to create TCP socket PR: bin/172490 Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/nfsd/nfsd.c Directory Properties: stable/9/usr.sbin/nfsd/ (props changed) Modified: stable/9/usr.sbin/nfsd/nfsd.c ============================================================================== --- stable/9/usr.sbin/nfsd/nfsd.c Thu Oct 25 03:14:17 2012 (r242038) +++ stable/9/usr.sbin/nfsd/nfsd.c Thu Oct 25 03:14:17 2012 (r242039) @@ -590,7 +590,7 @@ main(int argc, char **argv) if ((tcpsock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { syslog(LOG_ERR, - "can't create tpc socket"); + "can't create tcp socket"); nfsd_exit(1); } if (setsockopt(tcpsock, SOL_SOCKET, From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:15:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E124AD3D; Thu, 25 Oct 2012 03:15:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C859C8FC0C; Thu, 25 Oct 2012 03:15:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P3FOmK058846; Thu, 25 Oct 2012 03:15:24 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3FOT1058844; Thu, 25 Oct 2012 03:15:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250315.q9P3FOT1058844@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242041 - stable/9/tools/regression/netinet/ip_id_period X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:15:25 -0000 Author: eadler Date: Thu Oct 25 03:15:24 2012 New Revision: 242041 URL: http://svn.freebsd.org/changeset/base/242041 Log: MFC r241832: Covert regression test to python 3 Approved by: cperciva (implicit) Modified: stable/9/tools/regression/netinet/ip_id_period/ip_id_period.py Directory Properties: stable/9/tools/regression/netinet/ (props changed) Modified: stable/9/tools/regression/netinet/ip_id_period/ip_id_period.py ============================================================================== --- stable/9/tools/regression/netinet/ip_id_period/ip_id_period.py Thu Oct 25 03:14:17 2012 (r242040) +++ stable/9/tools/regression/netinet/ip_id_period/ip_id_period.py Thu Oct 25 03:15:24 2012 (r242041) @@ -51,26 +51,26 @@ id_minperiod = {} count = 0 for line in open('results.txt').readlines(): id = int(line.split(' id ')[1].split(',')[0]) - if id_lastseen.has_key(id): + if id in id_lastseen: period = count - id_lastseen[id] - if not id_minperiod.has_key(id) or period < id_minperiod[id]: + if id not in id_minperiod or period < id_minperiod[id]: id_minperiod[id] = period id_lastseen[id] = count count += 1 -sorted_minperiod = zip(*reversed(zip(*id_minperiod.items()))) +sorted_minperiod = list(zip(*reversed(list(zip(*list(id_minperiod.items())))))) sorted_minperiod.sort() -print "Lowest 10 ID periods detected:" +print("Lowest 10 ID periods detected:") x = 0 while x < 10: id_tuple = sorted_minperiod.pop(0) - print "id: %d period: %d" % (id_tuple[1], id_tuple[0]) + print("id: %d period: %d" % (id_tuple[1], id_tuple[0])) x += 1 -print "Highest 10 ID periods detected:" +print("Highest 10 ID periods detected:") x = 0 while x < 10: id_tuple = sorted_minperiod.pop() - print "id: %d period: %d" % (id_tuple[1], id_tuple[0]) + print("id: %d period: %d" % (id_tuple[1], id_tuple[0])) x += 1 From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:17:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5F60478; Thu, 25 Oct 2012 03:17:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47CDF8FC0C; Thu, 25 Oct 2012 03:17:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P3H3fx059238; Thu, 25 Oct 2012 03:17:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3H33F059235; Thu, 25 Oct 2012 03:17:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250317.q9P3H33F059235@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242044 - stable/9/share/misc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:17:03 -0000 Author: eadler Date: Thu Oct 25 03:17:02 2012 New Revision: 242044 URL: http://svn.freebsd.org/changeset/base/242044 Log: MFC r241893: Update re members to reality Approved by: cperciva (implicit) Modified: stable/9/share/misc/organization.dot Directory Properties: stable/9/share/misc/ (props changed) Modified: stable/9/share/misc/organization.dot ============================================================================== --- stable/9/share/misc/organization.dot Thu Oct 25 03:17:02 2012 (r242043) +++ stable/9/share/misc/organization.dot Thu Oct 25 03:17:02 2012 (r242044) @@ -32,7 +32,7 @@ doceng [label="Documentation Engineering portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] portmgr [label="Port Management Team\nportmgr@FreeBSD.org\ntabthorpe, marcus, bapt, beat,\nerwin, linimon, pav,\nitetcu, miwi"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\ntabthorpe"] -re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith,\nrwatson, bz"] +re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] secteam [label="Security Team\nsecteam@FreeBSD.org\nsimon, qingli, delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"] portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\nmiwi, rea, swills, wxs,\njgh, sbz, eadler, zi, remko, simon"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:20:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3D28B5A4; Thu, 25 Oct 2012 03:20:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24DE28FC16; Thu, 25 Oct 2012 03:20:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P3K0mb059963; Thu, 25 Oct 2012 03:20:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3K0ID059957; Thu, 25 Oct 2012 03:20:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250320.q9P3K0ID059957@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242047 - in stable/9/games: bcd caesar X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:20:01 -0000 Author: eadler Date: Thu Oct 25 03:20:00 2012 New Revision: 242047 URL: http://svn.freebsd.org/changeset/base/242047 Log: MFC r241846: bcd isn't installed setuid. caesar isn't installed setuid. For the archaeologists: it seems this call originally came from NetBSD PR 5970 and 5945 PR: 172566 Approved by: cperciva (implicit) Modified: stable/9/games/bcd/bcd.c stable/9/games/caesar/caesar.c Directory Properties: stable/9/games/bcd/ (props changed) stable/9/games/caesar/ (props changed) Modified: stable/9/games/bcd/bcd.c ============================================================================== --- stable/9/games/bcd/bcd.c Thu Oct 25 03:20:00 2012 (r242046) +++ stable/9/games/bcd/bcd.c Thu Oct 25 03:20:00 2012 (r242047) @@ -129,9 +129,6 @@ main(int argc, char **argv) { char cardline[80]; - /* revoke setgid privileges */ - setgid(getgid()); - /* * The original bcd prompts with a "%" when reading from stdin, * but this seems kind of silly. So this one doesn't. Modified: stable/9/games/caesar/caesar.c ============================================================================== --- stable/9/games/caesar/caesar.c Thu Oct 25 03:20:00 2012 (r242046) +++ stable/9/games/caesar/caesar.c Thu Oct 25 03:20:00 2012 (r242047) @@ -82,9 +82,6 @@ main(int argc, char **argv) char *inbuf; int obs[26], try, winner; - /* revoke setgid privileges */ - setgid(getgid()); - if (argc > 1) printit(argv[1]); From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:21:43 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B51C79FA; Thu, 25 Oct 2012 03:21:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0378FC16; Thu, 25 Oct 2012 03:21:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P3LhMW060321; Thu, 25 Oct 2012 03:21:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3Lhhj060319; Thu, 25 Oct 2012 03:21:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250321.q9P3Lhhj060319@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242049 - stable/9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:21:43 -0000 Author: eadler Date: Thu Oct 25 03:21:43 2012 New Revision: 242049 URL: http://svn.freebsd.org/changeset/base/242049 Log: MFC r241837: Fix build if COMPAT_43 is defined without one of COMPAT_FREEBSD[4567] Approved by: cperciva (implicit) Modified: stable/9/sys/sys/ipc.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/ipc.h ============================================================================== --- stable/9/sys/sys/ipc.h Thu Oct 25 03:20:01 2012 (r242048) +++ stable/9/sys/sys/ipc.h Thu Oct 25 03:21:43 2012 (r242049) @@ -70,7 +70,8 @@ typedef __uid_t uid_t; #endif #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ - defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) + defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) || \ + defined(COMPAT_43) struct ipc_perm_old { unsigned short cuid; /* creator user id */ unsigned short cgid; /* creator group id */ From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:24:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA998D05; Thu, 25 Oct 2012 03:24:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1A258FC08; Thu, 25 Oct 2012 03:24:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P3OOR6060827; Thu, 25 Oct 2012 03:24:24 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3OOuE060825; Thu, 25 Oct 2012 03:24:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250324.q9P3OOuE060825@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242051 - stable/9/sbin/dumpfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:24:24 -0000 Author: eadler Date: Thu Oct 25 03:24:24 2012 New Revision: 242051 URL: http://svn.freebsd.org/changeset/base/242051 Log: MFC r241842: Add support for gjournal to dumpfs PR: 165821 Approved by: cperciva (implicit) Modified: stable/9/sbin/dumpfs/dumpfs.c Directory Properties: stable/9/sbin/dumpfs/ (props changed) Modified: stable/9/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/9/sbin/dumpfs/dumpfs.c Thu Oct 25 03:21:46 2012 (r242050) +++ stable/9/sbin/dumpfs/dumpfs.c Thu Oct 25 03:24:24 2012 (r242051) @@ -419,6 +419,8 @@ marshal(const char *name) /* -i is dumb */ if (fs->fs_flags & FS_SUJ) printf("-j "); + if (fs->fs_flags & FS_GJOURNAL) + printf("-J "); /* -k..l unimplemented */ printf("-m %d ", fs->fs_minfree); /* -n unimplemented */ From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:27:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65952EAA; Thu, 25 Oct 2012 03:27:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D90E8FC0C; Thu, 25 Oct 2012 03:27:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P3Rsac061496; Thu, 25 Oct 2012 03:27:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3Rsh8061486; Thu, 25 Oct 2012 03:27:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250327.q9P3Rsh8061486@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242053 - stable/9/games/random X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:27:54 -0000 Author: eadler Date: Thu Oct 25 03:27:53 2012 New Revision: 242053 URL: http://svn.freebsd.org/changeset/base/242053 Log: MFC r241847: Free buf when its no longer used. This helps eliminate a static analysis warning. PR: ports/172566 Approved by: cperciva (implicit) Modified: stable/9/games/random/randomize_fd.c Directory Properties: stable/9/games/random/ (props changed) Modified: stable/9/games/random/randomize_fd.c ============================================================================== --- stable/9/games/random/randomize_fd.c Thu Oct 25 03:27:53 2012 (r242052) +++ stable/9/games/random/randomize_fd.c Thu Oct 25 03:27:53 2012 (r242053) @@ -207,6 +207,8 @@ randomize_fd(int fd, int type, int uniqu goto make_token; } + free(buf); + for (i = numnode; i > 0; i--) { selected = random() % numnode; From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:29:10 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 794B134D; Thu, 25 Oct 2012 03:29:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 622108FC0A; Thu, 25 Oct 2012 03:29: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 q9P3TArb061806; Thu, 25 Oct 2012 03:29:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3TAsI061804; Thu, 25 Oct 2012 03:29:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250329.q9P3TAsI061804@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242056 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:29:10 -0000 Author: eadler Date: Thu Oct 25 03:29:09 2012 New Revision: 242056 URL: http://svn.freebsd.org/changeset/base/242056 Log: MFC r241825: Print flags as hex instead of an integer. PR: kern/168210 Approved by: cperciva (implicit) Modified: stable/9/sys/vm/uma_core.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/uma_core.c ============================================================================== --- stable/9/sys/vm/uma_core.c Thu Oct 25 03:29:08 2012 (r242055) +++ stable/9/sys/vm/uma_core.c Thu Oct 25 03:29:09 2012 (r242056) @@ -1384,7 +1384,7 @@ keg_ctor(void *mem, int size, void *udat hash_alloc(&keg->uk_hash); #ifdef UMA_DEBUG - printf("UMA: %s(%p) size %d(%d) flags %d ipers %d ppera %d out %d free %d\n", + printf("UMA: %s(%p) size %d(%d) flags %#x ipers %d ppera %d out %d free %d\n", zone->uz_name, zone, keg->uk_size, keg->uk_rsize, keg->uk_flags, keg->uk_ipers, keg->uk_ppera, (keg->uk_ipers * keg->uk_pages) - keg->uk_free, keg->uk_free); @@ -3116,7 +3116,7 @@ uma_print_keg(uma_keg_t keg) { uma_slab_t slab; - printf("keg: %s(%p) size %d(%d) flags %d ipers %d ppera %d " + printf("keg: %s(%p) size %d(%d) flags %#x ipers %d ppera %d " "out %d free %d limit %d\n", keg->uk_name, keg, keg->uk_size, keg->uk_rsize, keg->uk_flags, keg->uk_ipers, keg->uk_ppera, @@ -3140,7 +3140,7 @@ uma_print_zone(uma_zone_t zone) uma_klink_t kl; int i; - printf("zone: %s(%p) size %d flags %d\n", + printf("zone: %s(%p) size %d flags %#x\n", zone->uz_name, zone, zone->uz_size, zone->uz_flags); LIST_FOREACH(kl, &zone->uz_kegs, kl_link) uma_print_keg(kl->kl_keg); From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 03:30:07 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A844617; Thu, 25 Oct 2012 03:30:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 021878FC0C; Thu, 25 Oct 2012 03:30:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9P3U662062057; Thu, 25 Oct 2012 03:30:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9P3U6KF062055; Thu, 25 Oct 2012 03:30:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210250330.q9P3U6KF062055@svn.freebsd.org> From: Eitan Adler Date: Thu, 25 Oct 2012 03:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242057 - stable/9/usr.bin/ar X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 03:30:07 -0000 Author: eadler Date: Thu Oct 25 03:30:06 2012 New Revision: 242057 URL: http://svn.freebsd.org/changeset/base/242057 Log: MFC r241827: Mark bsdar_errc as __dead2 to help code analysis tools. PR: bin/172636 Approved by: cperciva (implicit) Modified: stable/9/usr.bin/ar/ar.h Directory Properties: stable/9/usr.bin/ar/ (props changed) Modified: stable/9/usr.bin/ar/ar.h ============================================================================== --- stable/9/usr.bin/ar/ar.h Thu Oct 25 03:29:09 2012 (r242056) +++ stable/9/usr.bin/ar/ar.h Thu Oct 25 03:30:06 2012 (r242057) @@ -111,7 +111,7 @@ struct bsdar { }; void bsdar_errc(struct bsdar *, int _eval, int _code, - const char *fmt, ...); + const char *fmt, ...) __dead2; void bsdar_warnc(struct bsdar *, int _code, const char *fmt, ...); void ar_mode_d(struct bsdar *bsdar); void ar_mode_m(struct bsdar *bsdar); From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 20:45:58 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A55F9DF; Thu, 25 Oct 2012 20:45:58 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 121B68FC0A; Thu, 25 Oct 2012 20:45:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9PKjve3042040; Thu, 25 Oct 2012 20:45:57 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9PKjvGB042036; Thu, 25 Oct 2012 20:45:57 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201210252045.q9PKjvGB042036@svn.freebsd.org> From: Nick Hibma Date: Thu, 25 Oct 2012 20:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242095 - stable/9/usr.sbin/ppp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 20:45:58 -0000 Author: n_hibma Date: Thu Oct 25 20:45:57 2012 New Revision: 242095 URL: http://svn.freebsd.org/changeset/base/242095 Log: MFC 241496: Some 3G modems return the wrong signature in echo packets and make it impossible to use LQR/ECHO. They return want_magic instead. With this change it is now possible to use enable lqr set lqrperiod 5 enable echo set echoperiod 5 in your ppp.conf file. Modified: stable/9/usr.sbin/ppp/lqr.c Directory Properties: stable/9/usr.sbin/ppp/ (props changed) Modified: stable/9/usr.sbin/ppp/lqr.c ============================================================================== --- stable/9/usr.sbin/ppp/lqr.c Thu Oct 25 20:34:44 2012 (r242094) +++ stable/9/usr.sbin/ppp/lqr.c Thu Oct 25 20:45:57 2012 (r242095) @@ -108,7 +108,8 @@ lqr_RecvEcho(struct fsm *fp, struct mbuf * die as a result. */ } - if (lqr.signature == SIGNATURE) { + if (lqr.signature == SIGNATURE + || lqr.signature == lcp->want_magic) { /* some implementations return the wrong magic */ /* careful not to update lqm.echo.seq_recv with older values */ if ((hdlc->lqm.echo.seq_recv > (u_int32_t)0 - 5 && lqr.sequence < 5) || (hdlc->lqm.echo.seq_recv <= (u_int32_t)0 - 5 && From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 25 21:22:05 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF49CF3A; Thu, 25 Oct 2012 21:22:05 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C54358FC14; Thu, 25 Oct 2012 21:22:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9PLM5CJ048930; Thu, 25 Oct 2012 21:22:05 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9PLM5O4048928; Thu, 25 Oct 2012 21:22:05 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201210252122.q9PLM5O4048928@svn.freebsd.org> From: Nick Hibma Date: Thu, 25 Oct 2012 21:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242100 - stable/9/sys/dev/usb/serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 21:22:06 -0000 Author: n_hibma Date: Thu Oct 25 21:22:05 2012 New Revision: 242100 URL: http://svn.freebsd.org/changeset/base/242100 Log: MFC 241555: Implement modem control in u3g. Tested on Option GTM382W, Huawei E220, and Sierra Wireless MC8790V. Also implement the .ucom_poll method. Note: It resolves ppp hanging during the PPp> phase. Modified: stable/9/sys/dev/usb/serial/u3g.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Thu Oct 25 21:09:42 2012 (r242099) +++ stable/9/sys/dev/usb/serial/u3g.c Thu Oct 25 21:22:05 2012 (r242100) @@ -53,6 +53,7 @@ #include #include #include +#include #include "usbdevs.h" #define USB_DEBUG_VAR u3g_debug @@ -99,6 +100,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, enum { U3G_BULK_WR, U3G_BULK_RD, + U3G_INTR, U3G_N_TRANSFER, }; @@ -107,12 +109,15 @@ struct u3g_softc { struct ucom_softc sc_ucom[U3G_MAXPORTS]; struct usb_xfer *sc_xfer[U3G_MAXPORTS][U3G_N_TRANSFER]; + uint8_t sc_iface[U3G_MAXPORTS]; /* local status register */ + uint8_t sc_lsr[U3G_MAXPORTS]; /* local status register */ + uint8_t sc_msr[U3G_MAXPORTS]; /* u3g status register */ + uint16_t sc_line[U3G_MAXPORTS]; /* line status */ + struct usb_device *sc_udev; struct mtx sc_mtx; - uint8_t sc_lsr; /* local status register */ - uint8_t sc_msr; /* U3G status register */ - uint8_t sc_numports; + uint8_t sc_numports; }; static device_probe_t u3g_probe; @@ -122,12 +127,17 @@ static void u3g_free_softc(struct u3g_so static usb_callback_t u3g_write_callback; static usb_callback_t u3g_read_callback; +static usb_callback_t u3g_intr_callback; -static void u3g_free(struct ucom_softc *ucom); +static void u3g_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); +static void u3g_cfg_set_dtr(struct ucom_softc *, uint8_t); +static void u3g_cfg_set_rts(struct ucom_softc *, uint8_t); static void u3g_start_read(struct ucom_softc *ucom); static void u3g_stop_read(struct ucom_softc *ucom); static void u3g_start_write(struct ucom_softc *ucom); static void u3g_stop_write(struct ucom_softc *ucom); +static void u3g_poll(struct ucom_softc *ucom); +static void u3g_free(struct ucom_softc *ucom); static void u3g_test_autoinst(void *, struct usb_device *, @@ -155,13 +165,26 @@ static const struct usb_config u3g_confi .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = &u3g_read_callback, }, + + [U3G_INTR] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,.no_pipe_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &u3g_intr_callback, + }, }; static const struct ucom_callback u3g_callback = { + .ucom_cfg_get_status = &u3g_cfg_get_status, + .ucom_cfg_set_dtr = &u3g_cfg_set_dtr, + .ucom_cfg_set_rts = &u3g_cfg_set_rts, .ucom_start_read = &u3g_start_read, .ucom_stop_read = &u3g_stop_read, .ucom_start_write = &u3g_start_write, .ucom_stop_write = &u3g_stop_write, + .ucom_poll = &u3g_poll, .ucom_free = &u3g_free, }; @@ -849,6 +872,15 @@ u3g_attach(device_t dev) continue; } + iface = usbd_get_iface(uaa->device, i); + id = usbd_get_interface_descriptor(iface); + sc->sc_iface[nports] = id->bInterfaceNumber; + + if (bootverbose && sc->sc_xfer[nports][U3G_INTR]) { + device_printf(dev, "port %d supports modem control", + nports); + } + /* set stall by default */ mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[nports][U3G_BULK_WR]); @@ -926,6 +958,9 @@ u3g_start_read(struct ucom_softc *ucom) { struct u3g_softc *sc = ucom->sc_parent; + /* start interrupt endpoint (if configured) */ + usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_INTR]); + /* start read endpoint */ usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]); } @@ -935,6 +970,9 @@ u3g_stop_read(struct ucom_softc *ucom) { struct u3g_softc *sc = ucom->sc_parent; + /* stop interrupt endpoint (if configured) */ + usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_INTR]); + /* stop read endpoint */ usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]); } @@ -1012,3 +1050,134 @@ tr_setup: break; } } + +static void +u3g_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr) +{ + struct u3g_softc *sc = ucom->sc_parent; + + *lsr = sc->sc_lsr[ucom->sc_subunit]; + *msr = sc->sc_msr[ucom->sc_subunit]; +} + +static void +u3g_cfg_set_line(struct ucom_softc *ucom) +{ + struct u3g_softc *sc = ucom->sc_parent; + struct usb_device_request req; + + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = UCDC_SET_CONTROL_LINE_STATE; + USETW(req.wValue, sc->sc_line[ucom->sc_subunit]); + req.wIndex[0] = sc->sc_iface[ucom->sc_subunit]; + req.wIndex[1] = 0; + USETW(req.wLength, 0); + + ucom_cfg_do_request(sc->sc_udev, ucom, + &req, NULL, 0, 1000); +} + +static void +u3g_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff) +{ + struct u3g_softc *sc = ucom->sc_parent; + + DPRINTF("onoff = %d\n", onoff); + + if (onoff) + sc->sc_line[ucom->sc_subunit] |= UCDC_LINE_DTR; + else + sc->sc_line[ucom->sc_subunit] &= ~UCDC_LINE_DTR; + + u3g_cfg_set_line(ucom); +} + +static void +u3g_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff) +{ + struct u3g_softc *sc = ucom->sc_parent; + + DPRINTF("onoff = %d\n", onoff); + + if (onoff) + sc->sc_line[ucom->sc_subunit] |= UCDC_LINE_RTS; + else + sc->sc_line[ucom->sc_subunit] &= ~UCDC_LINE_RTS; + + u3g_cfg_set_line(ucom); +} + +static void +u3g_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct ucom_softc *ucom = usbd_xfer_softc(xfer); + struct u3g_softc *sc = ucom->sc_parent; + struct usb_page_cache *pc; + struct usb_cdc_notification pkt; + int actlen; + uint16_t wLen; + uint8_t mstatus; + + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + if (actlen < 8) { /* usb_cdc_notification with 2 data bytes */ + DPRINTF("message too short (expected 8, received %d)\n", actlen); + goto tr_setup; + } + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_out(pc, 0, &pkt, actlen); + + wLen = UGETW(pkt.wLength); + if (wLen < 2) { + DPRINTF("message too short (expected 2 data bytes, received %d)\n", wLen); + goto tr_setup; + } + + if (pkt.bmRequestType == UCDC_NOTIFICATION + && pkt.bNotification == UCDC_N_SERIAL_STATE) { + /* + * Set the serial state in ucom driver based on + * the bits from the notify message + */ + DPRINTF("notify bytes = 0x%02x, 0x%02x\n", + pkt.data[0], pkt.data[1]); + + /* currently, lsr is always zero. */ + sc->sc_lsr[ucom->sc_subunit] = 0; + sc->sc_msr[ucom->sc_subunit] = 0; + + mstatus = pkt.data[0]; + + if (mstatus & UCDC_N_SERIAL_RI) + sc->sc_msr[ucom->sc_subunit] |= SER_RI; + if (mstatus & UCDC_N_SERIAL_DSR) + sc->sc_msr[ucom->sc_subunit] |= SER_DSR; + if (mstatus & UCDC_N_SERIAL_DCD) + sc->sc_msr[ucom->sc_subunit] |= SER_DCD; + ucom_status_change(ucom); + } + + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + return; + + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + } +} + +static void +u3g_poll(struct ucom_softc *ucom) +{ + struct u3g_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer[ucom->sc_subunit], U3G_N_TRANSFER); +} From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 00:28:30 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17D942E7; Fri, 26 Oct 2012 00:28:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 001628FC17; Fri, 26 Oct 2012 00:28:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9Q0SToS081188; Fri, 26 Oct 2012 00:28:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9Q0STY9081186; Fri, 26 Oct 2012 00:28:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201210260028.q9Q0STY9081186@svn.freebsd.org> From: Xin LI Date: Fri, 26 Oct 2012 00:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242105 - stable/9/sys/dev/hptmv X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 00:28:30 -0000 Author: delphij Date: Fri Oct 26 00:28:29 2012 New Revision: 242105 URL: http://svn.freebsd.org/changeset/base/242105 Log: MFC r240210: It seems that what the code really meant is that when a write is completed, do a BUS_DMASYNC_POSTWRITE over the DMA map. The way it currently is would only do POSTREAD for read transactions. Submitted by: Sascha Wildner Modified: stable/9/sys/dev/hptmv/entry.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hptmv/entry.c ============================================================================== --- stable/9/sys/dev/hptmv/entry.c Fri Oct 26 00:08:50 2012 (r242104) +++ stable/9/sys/dev/hptmv/entry.c Fri Oct 26 00:28:29 2012 (r242105) @@ -3046,7 +3046,7 @@ fOsCommandDone(_VBUS_ARG PCommand pCmd) if (pCmd->cf_data_in) { bus_dmamap_sync(pAdapter->io_dma_parent, pmap->dma_map, BUS_DMASYNC_POSTREAD); } - else if (pCmd->cf_data_in) { + else if (pCmd->cf_data_out) { bus_dmamap_sync(pAdapter->io_dma_parent, pmap->dma_map, BUS_DMASYNC_POSTWRITE); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 00:34:28 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 230309C3; Fri, 26 Oct 2012 00:34:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B1C68FC0C; Fri, 26 Oct 2012 00:34: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 q9Q0YR3E082299; Fri, 26 Oct 2012 00:34:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9Q0YRmY082297; Fri, 26 Oct 2012 00:34:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210260034.q9Q0YRmY082297@svn.freebsd.org> From: Eitan Adler Date: Fri, 26 Oct 2012 00:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242109 - stable/9/games/fortune/datfiles X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 00:34:28 -0000 Author: eadler Date: Fri Oct 26 00:34:27 2012 New Revision: 242109 URL: http://svn.freebsd.org/changeset/base/242109 Log: MFC r241845,r241934: Sysinstall has been removed from base. Approved by: cperciva (implicit) Modified: stable/9/games/fortune/datfiles/freebsd-tips Directory Properties: stable/9/games/fortune/ (props changed) Modified: stable/9/games/fortune/datfiles/freebsd-tips ============================================================================== --- stable/9/games/fortune/datfiles/freebsd-tips Fri Oct 26 00:32:28 2012 (r242108) +++ stable/9/games/fortune/datfiles/freebsd-tips Fri Oct 26 00:34:27 2012 (r242109) @@ -40,7 +40,7 @@ Having trouble using fetch through a fir variable FTP_PASSIVE_MODE to yes, and see fetch(3) for more details. % If other operating systems have damaged your Master Boot Record, you can -reinstall it either with /usr/sbin/sysinstall or with boot0cfg(8). See +reinstall it with boot0cfg(8). See "man boot0cfg" for details. % If you accidentally end up inside vi, you can quit it by pressing Escape, colon From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 00:44:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2CF65D7; Fri, 26 Oct 2012 00:44:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 135778FC0A; Fri, 26 Oct 2012 00:44: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 q9Q0iWHW084290; Fri, 26 Oct 2012 00:44:32 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9Q0iW7G084283; Fri, 26 Oct 2012 00:44:32 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210260044.q9Q0iW7G084283@svn.freebsd.org> From: Eitan Adler Date: Fri, 26 Oct 2012 00:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242112 - in stable/9: . sys/modules/3dfx sys/modules/cmx sys/modules/filemon tools/tools/sysdoc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 00:44:33 -0000 Author: eadler Date: Fri Oct 26 00:44:32 2012 New Revision: 242112 URL: http://svn.freebsd.org/changeset/base/242112 Log: MFC r241828,r241891: Finish migration of MAINTAINER entries Approved by: cperciva (implicit) Modified: stable/9/MAINTAINERS (contents, props changed) stable/9/sys/modules/3dfx/Makefile stable/9/sys/modules/cmx/Makefile stable/9/sys/modules/filemon/Makefile stable/9/tools/tools/sysdoc/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) stable/9/tools/tools/sysdoc/ (props changed) Modified: stable/9/MAINTAINERS ============================================================================== --- stable/9/MAINTAINERS Fri Oct 26 00:35:30 2012 (r242111) +++ stable/9/MAINTAINERS Fri Oct 26 00:44:32 2012 (r242112) @@ -127,16 +127,7 @@ sysinstall randi Please contact about an they can be co-ordinated. sbin/routed bms Pre-commit review; notify vendor at rhyolite.com isci(4) jimharris Pre-commit review requested. - -Following are the entries from the Makefiles, and a few other sources. -Please remove stale entries from both their origin, and this file. - -Please also consider removing the lines from the files listed below and -stating your preferences here instead. - -List below generated with: -$ cd /usr/src; find */* -type f|xargs egrep 'MAINTAINER[ ]*=' - -sys/modules/3dfx/Makefile:MAINTAINER= cokane@FreeBSD.org -sys/modules/urio/Makefile:MAINTAINER= Iwasa Kazmi -tools/tools/sysdoc/Makefile:MAINTAINER= trhodes@FreeBSD.org +3dfx cokane Pre-commit review preferred. +cmx daniel@roe.ch Pre-commit review preferred. +filemon obrien Pre-commit review preferred. +sysdoc trhodes Pre-commit review preferred. Modified: stable/9/sys/modules/3dfx/Makefile ============================================================================== --- stable/9/sys/modules/3dfx/Makefile Fri Oct 26 00:35:30 2012 (r242111) +++ stable/9/sys/modules/3dfx/Makefile Fri Oct 26 00:44:32 2012 (r242112) @@ -1,7 +1,5 @@ # $FreeBSD$ -MAINTAINER= cokane@FreeBSD.org - .PATH: $(.CURDIR)/../../dev/tdfx KMOD= 3dfx Modified: stable/9/sys/modules/cmx/Makefile ============================================================================== --- stable/9/sys/modules/cmx/Makefile Fri Oct 26 00:35:30 2012 (r242111) +++ stable/9/sys/modules/cmx/Makefile Fri Oct 26 00:44:32 2012 (r242112) @@ -1,7 +1,5 @@ # $FreeBSD$ # -MAINTAINER= daniel@roe.ch - .PATH: ${.CURDIR}/../../dev/cmx KMOD= cmx Modified: stable/9/sys/modules/filemon/Makefile ============================================================================== --- stable/9/sys/modules/filemon/Makefile Fri Oct 26 00:35:30 2012 (r242111) +++ stable/9/sys/modules/filemon/Makefile Fri Oct 26 00:44:32 2012 (r242112) @@ -1,7 +1,5 @@ # $FreeBSD$ -MAINTAINER= obrien@FreeBSD.org - .PATH: ${.CURDIR}/../../dev/filemon KMOD= filemon Modified: stable/9/tools/tools/sysdoc/Makefile ============================================================================== --- stable/9/tools/tools/sysdoc/Makefile Fri Oct 26 00:35:30 2012 (r242111) +++ stable/9/tools/tools/sysdoc/Makefile Fri Oct 26 00:44:32 2012 (r242112) @@ -1,7 +1,5 @@ # $FreeBSD$ -MAINTAINER= trhodes@FreeBSD.org - sysctl.5: sh ${.CURDIR}/sysdoc.sh -k /boot/kernel From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 10:18:07 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 313CB497; Fri, 26 Oct 2012 10:18:07 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.78]) by mx1.freebsd.org (Postfix) with ESMTP id A52BF8FC08; Fri, 26 Oct 2012 10:18:05 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1TRgkQ-0000hs-Cd; Fri, 26 Oct 2012 12:02:38 +0200 Received: from [81.21.138.17] (helo=ronaldradial.versatec.local) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1TRgkP-0000z9-2M; Fri, 26 Oct 2012 12:02:37 +0200 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org, "Eitan Adler" Subject: Re: svn commit: r242109 - stable/9/games/fortune/datfiles References: <201210260034.q9Q0YRmY082297@svn.freebsd.org> Date: Fri, 26 Oct 2012 12:02:37 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <201210260034.q9Q0YRmY082297@svn.freebsd.org> User-Agent: Opera Mail/12.02 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: 0.0 X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 autolearn=disabled version=3.2.5 X-Scan-Signature: 2394e6fd9f1e9f86011669f8146dc264 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 10:18:07 -0000 Will sysinstall also be removed on stable/9? Although I don't really care about sysinstall I'm curious. Ronald. On Fri, 26 Oct 2012 02:34:27 +0200, Eitan Adler wrote: > Author: eadler > Date: Fri Oct 26 00:34:27 2012 > New Revision: 242109 > URL: http://svn.freebsd.org/changeset/base/242109 > > Log: > MFC r241845,r241934: > Sysinstall has been removed from base. > Approved by: cperciva (implicit) > > Modified: > stable/9/games/fortune/datfiles/freebsd-tips > Directory Properties: > stable/9/games/fortune/ (props changed) > > Modified: stable/9/games/fortune/datfiles/freebsd-tips > ============================================================================== > --- stable/9/games/fortune/datfiles/freebsd-tips Fri Oct 26 00:32:28 > 2012 (r242108) > +++ stable/9/games/fortune/datfiles/freebsd-tips Fri Oct 26 00:34:27 > 2012 (r242109) > @@ -40,7 +40,7 @@ Having trouble using fetch through a fir > variable FTP_PASSIVE_MODE to yes, and see fetch(3) for more details. > % > If other operating systems have damaged your Master Boot Record, you can > -reinstall it either with /usr/sbin/sysinstall or with boot0cfg(8). See > +reinstall it with boot0cfg(8). See > "man boot0cfg" for details. > % > If you accidentally end up inside vi, you can quit it by pressing > Escape, colon > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 11:57:36 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 26F3FC9D for ; Fri, 26 Oct 2012 11:57:36 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id D93178FC08 for ; Fri, 26 Oct 2012 11:57:35 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so2007120pad.13 for ; Fri, 26 Oct 2012 04:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=Dxdj7Rz+jBwp3WtwbmD6wKRKh+BjiQdCxAV4Lt5l+So=; b=KYNYxIOoeyx+SPDBoFeRggyIMd1KKF/WXJksPJXcULUstfRVy+nWG9H2E30jTrdNBI MjOcWn0KO32rpLjRUreUi/jYH+heSJ0n3JYOWZy15JpiChjqIJt/krngdlgnFfAHlX08 nkT2S72LGCh+/yjsdgXOpY4/aNAJf2bzOVG08= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=Dxdj7Rz+jBwp3WtwbmD6wKRKh+BjiQdCxAV4Lt5l+So=; b=XlzT0perqqDigPXhwqaE/XDvX1awtCIA0xhPvCiVidBZ87t9nnY0Hhg4nuI8ZDS2Sg Vm0ukGdNFf71te83mWcQjdhIQlSnwqputSr7I5qRvaxt+VUgL1biVPK4AoGpxwUyTeYR r86IBJJCN2/LrNAAL20E9cboV7/SAY1JOhw4i7LfM8Pc9qaJ/DB/a16rl3mBM6MHdOxJ g2r+doTLVD1Gaf6G5nSSTo6gIjDxV8b+2RYg+QwLl3TJEBY2KhXg50VZ9USVk5w4m5lD U9sOfoNfdMpGx0pLKg/fQ4QVim+Wwx+raeSaPMlqUiNKMvbceDSFgSeZQlbtsikB3nq6 7Dyw== Received: by 10.68.222.105 with SMTP id ql9mr68595831pbc.97.1351252649692; Fri, 26 Oct 2012 04:57:29 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.161.163 with HTTP; Fri, 26 Oct 2012 04:56:59 -0700 (PDT) In-Reply-To: References: <201210260034.q9Q0YRmY082297@svn.freebsd.org> From: Eitan Adler Date: Fri, 26 Oct 2012 07:56:59 -0400 X-Google-Sender-Auth: vaDFsffH5nKwMcamFJnLJ_CRhW8 Message-ID: Subject: Re: svn commit: r242109 - stable/9/games/fortune/datfiles To: Ronald Klop Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnSBoEmb2VlSNB8lhf7tkH2sarLwajnkb9h4HesgKUAEG6SL/YkD9up8aKT4ruNPBe+h5KF Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 11:57:36 -0000 On 26 October 2012 06:02, Ronald Klop wrote: > Will sysinstall also be removed on stable/9? Although I don't really care > about sysinstall I'm curious. Not AFAIK. I MFCed this change to avoid pointless divergence when MFCing future changes. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 14:10:26 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4657B7F2; Fri, 26 Oct 2012 14:10:26 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id D58F08FC18; Fri, 26 Oct 2012 14:10:25 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0MCI007047D7FL00@smtpauth3.wiscmail.wisc.edu>; Fri, 26 Oct 2012 09:10:19 -0500 (CDT) Received: from comporellon.tachypleus.net (adsl-71-150-249-157.dsl.mdsnwi.sbcglobal.net [71.150.249.157]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0MCI00K9V7D0B720@smtpauth3.wiscmail.wisc.edu>; Fri, 26 Oct 2012 09:10:13 -0500 (CDT) Date: Fri, 26 Oct 2012 09:10:11 -0500 From: Nathan Whitehorn Subject: Re: svn commit: r242109 - stable/9/games/fortune/datfiles In-reply-to: To: Ronald Klop Message-id: <508A99C3.20705@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=71.150.249.157 X-Spam-PmxInfo: Server=avs-15, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.10.26.140026, SenderIP=71.150.249.157 References: <201210260034.q9Q0YRmY082297@svn.freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121019 Thunderbird/16.0.1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 14:10:26 -0000 No. It is staying for the duration of the branch. So this MFC may have been premature. -Nathan On 10/26/12 05:02, Ronald Klop wrote: > Will sysinstall also be removed on stable/9? Although I don't really > care about sysinstall I'm curious. > > Ronald. > > On Fri, 26 Oct 2012 02:34:27 +0200, Eitan Adler > wrote: > >> Author: eadler >> Date: Fri Oct 26 00:34:27 2012 >> New Revision: 242109 >> URL: http://svn.freebsd.org/changeset/base/242109 >> >> Log: >> MFC r241845,r241934: >> Sysinstall has been removed from base. >> Approved by: cperciva (implicit) >> >> Modified: >> stable/9/games/fortune/datfiles/freebsd-tips >> Directory Properties: >> stable/9/games/fortune/ (props changed) >> >> Modified: stable/9/games/fortune/datfiles/freebsd-tips >> ============================================================================== >> >> --- stable/9/games/fortune/datfiles/freebsd-tips Fri Oct 26 >> 00:32:28 2012 (r242108) >> +++ stable/9/games/fortune/datfiles/freebsd-tips Fri Oct 26 >> 00:34:27 2012 (r242109) >> @@ -40,7 +40,7 @@ Having trouble using fetch through a fir >> variable FTP_PASSIVE_MODE to yes, and see fetch(3) for more details. >> % >> If other operating systems have damaged your Master Boot Record, you >> can >> -reinstall it either with /usr/sbin/sysinstall or with boot0cfg(8). See >> +reinstall it with boot0cfg(8). See >> "man boot0cfg" for details. >> % >> If you accidentally end up inside vi, you can quit it by pressing >> Escape, colon >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 15:23:49 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 145CB350 for ; Fri, 26 Oct 2012 15:23:49 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id B8B7D8FC12 for ; Fri, 26 Oct 2012 15:23:48 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so3042840pbb.13 for ; Fri, 26 Oct 2012 08:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=8xhmbqN2+5VezHnxvoOuPuyOlSQOGHoLXZLmnGDcIuc=; b=EtP4aYz3+3Z9a/eGd/tzDaRY8ilCo9ZWiJlCVUO+kPv4dTPu1vNxfiy0ilnAKGzVM0 xIWcOUP66GV7XcgWUvl5fNbqLPYyLAVae2duVzBjmHUD2hQhIapYzYVlDo/jPfwD9MsB LnL52zENFULuZiYhLTWKXQL726nHb0g7QST7Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=8xhmbqN2+5VezHnxvoOuPuyOlSQOGHoLXZLmnGDcIuc=; b=i+cMn59F8sFDIYPgp+HTRg4ZATdvLIrcDrQLKTQ/2NlkG1l/FX+OelMkgcTYTVabx0 U9XhLVXSX/SExiYVjSMAug7Bbahs5xolUSVecagL97QZgwCC4eWp4mc2Z8NO8OUuVnDZ GS//G3XhsF05QfoobXlcp3JF4XtFM105nL9Po+QCugw96lfHGLSoQIq8/1gUFGPrdD3T YNshtwEJ2wKQFwxdoiy7pGDqvYVVfuI//TECHXM6EB+8L5wXvEIFk8VOhEN04Vwl4T9B t8a1juETRHTgO/vufse7jpYm+n+gv6cB5X08KcqWJ3YK50mH1GWZsICoLDG9IX4nT/Hr L7FA== Received: by 10.68.129.72 with SMTP id nu8mr70308461pbb.29.1351265028006; Fri, 26 Oct 2012 08:23:48 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.161.163 with HTTP; Fri, 26 Oct 2012 08:23:17 -0700 (PDT) In-Reply-To: <508A99C3.20705@freebsd.org> References: <201210260034.q9Q0YRmY082297@svn.freebsd.org> <508A99C3.20705@freebsd.org> From: Eitan Adler Date: Fri, 26 Oct 2012 11:23:17 -0400 X-Google-Sender-Auth: DNro5PdMZyabR_nwy5zuHO0PStM Message-ID: Subject: Re: svn commit: r242109 - stable/9/games/fortune/datfiles To: Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnWdd1g78BiZbyL2JNpvMtnzmGdAeUIM4cSXS2B42wuVhHuuLYiZ1+DvWvlvGDAJI/8tnT1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org, Ronald Klop X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 15:23:49 -0000 On 26 October 2012 10:10, Nathan Whitehorn wrote: > No. It is staying for the duration of the branch. So this MFC may have been > premature. As I said previously: I MFCed this because it is a low-impact change and it makes future MFCs easier in the event that the fortune file changes again. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 16:07:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42500397; Fri, 26 Oct 2012 16:07:54 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 278D28FC12; Fri, 26 Oct 2012 16:07:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9QG7sEq035741; Fri, 26 Oct 2012 16:07:54 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9QG7raE035736; Fri, 26 Oct 2012 16:07:53 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201210261607.q9QG7raE035736@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 26 Oct 2012 16:07:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242142 - in stable/9: sys/dev/filemon tools/regression/filemon X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 16:07:54 -0000 Author: obrien Date: Fri Oct 26 16:07:53 2012 New Revision: 242142 URL: http://svn.freebsd.org/changeset/base/242142 Log: MFC: r242137: Iterate rather than use recursion. We can blow out the kernel stack if there is a long chain of fork(2)s. Added: stable/9/tools/regression/filemon/timed-forkb.c - copied unchanged from r242137, head/tools/regression/filemon/timed-forkb.c Modified: stable/9/sys/dev/filemon/filemon_wrapper.c stable/9/tools/regression/filemon/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/tools/ (props changed) Modified: stable/9/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- stable/9/sys/dev/filemon/filemon_wrapper.c Fri Oct 26 16:06:26 2012 (r242141) +++ stable/9/sys/dev/filemon/filemon_wrapper.c Fri Oct 26 16:07:53 2012 (r242142) @@ -82,15 +82,14 @@ filemon_pid_check(struct proc *p) { struct filemon *filemon; - TAILQ_FOREACH(filemon, &filemons_inuse, link) { - if (p->p_pid == filemon->pid) - return (filemon); + while (p->p_pptr) { + TAILQ_FOREACH(filemon, &filemons_inuse, link) { + if (p->p_pid == filemon->pid) + return (filemon); + } + p = p->p_pptr; } - - if (p->p_pptr == NULL) - return (NULL); - - return (filemon_pid_check(p->p_pptr)); + return (NULL); } static void Modified: stable/9/tools/regression/filemon/Makefile ============================================================================== --- stable/9/tools/regression/filemon/Makefile Fri Oct 26 16:06:26 2012 (r242141) +++ stable/9/tools/regression/filemon/Makefile Fri Oct 26 16:07:53 2012 (r242142) @@ -1,15 +1,33 @@ # $FreeBSD$ -PROG= filemontest +BINS= \ + filemontest \ + timed-forkb + +bins: filemontest timed-forkb +all: bins NO_MAN= WARNS?= 6 CFLAGS+= -I${.CURDIR}/../../../sys +# Should be "WITHOUT_CTF=" below, but stupid infastrurture fails: +# "/usr/share/mk/bsd.own.mk", line 489: WITH_CTF and WITHOUT_CTF can't both be set. +WITHOUT_CDDL= + +CLEANFILES+= ${BINS} + +tests: bins + kldstat | grep filemon + ${MAKE} test + ./timed-forkb + @echo "filemon(4) tests passed." + # Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in . -test: ${PROG} clean-test -.for BIN in ${PROG} ${PROG}32 +#FILEMONTEST32= filemontest32 +test: filemontest clean-test +.for BIN in filemontest ${FILEMONTEST32} cd ${.CURDIR} ; \ for A in 1 2 3 4 5 6 7 8 9 0; do \ for B in 1 2 3 4 5 6 7 8 9 0; do \ Copied: stable/9/tools/regression/filemon/timed-forkb.c (from r242137, head/tools/regression/filemon/timed-forkb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/filemon/timed-forkb.c Fri Oct 26 16:07:53 2012 (r242142, copy of r242137, head/tools/regression/filemon/timed-forkb.c) @@ -0,0 +1,177 @@ +/*- + * Copyright (c) 2012 David O'Brien + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef SLEEP +#define SLEEP 20 /* seconds */ +#endif + +int verbose; + +static void +usage(void) +{ + fprintf(stderr, "usage: %s\n", getprogname()); + fprintf(stderr, "\t\t-n : length of fork(2) chain\n"); + fprintf(stderr, "\t\t-t : limit run-time seconds\n"); + exit(1); + /* NOTREACHED */ +} + +void term(int); +void +term(int signum) +{ + + if (getpid() == getpgrp() || verbose) { + fprintf(stderr, + "pid %d pgroup %d (ppid %d): Received SIGTERM(%d), exiting...\n", + getpid(), getpgrp(), getppid(), signum); + } + exit(1); +} + +void angel_of_mercy(int); +void +angel_of_mercy(int sig __unused) +{ + + signal(SIGALRM, SIG_IGN); /* ignore this signal */ + printf("Master process: alarmed waking up\n"); + killpg(0, SIGTERM); + return; +} + +int bombing_run(unsigned, int); +int +bombing_run(unsigned chainlen, int stime) +{ + struct rusage ru; + pid_t pid, cpid; + int status; + + if (chainlen) { + switch (pid = fork()) { + case -1: + errx(1, "%s: can't fork", __func__); + + case 0: + /* This is the code the child runs. */ + bombing_run(--chainlen, stime); + break; + + default: + /* This is the code the parent runs. */ + if (getpid() == getpgrp()) { + signal(SIGALRM, angel_of_mercy); + alarm(stime); // time for bombing run... + cpid = wait4(pid, &status, 0, &ru); + alarm(0); + printf( + "Cleanly shutting down - pid %d pgroup %d (ppid %d)\n", + getpid(), getpgrp(), getppid()); + } else { + cpid = wait4(pid, &status, 0, &ru); + } + } + } + + return 0; +} + +int +main(int argc, char *argv[]) +{ + time_t start /*,tvec*/; + char *endptr, *ctm; + size_t len; + int nflag, tflag; + int ch, k, maxprocperuid; + + (void)signal(SIGTERM, term); + + nflag = 0; + tflag = SLEEP; + + start = time(NULL); + ctm = ctime(&start); + ctm[24] = '\0'; // see: man 3 ctime + fprintf(stderr, "*** fork() generation started on \"%s\" ***\n", ctm); + + while ((ch = getopt(argc, argv, "n:t:v")) != -1) + switch (ch) { + case 'n': + nflag = strtol(optarg, &endptr, 10); + if (nflag <= 0 || *endptr != '\0') + errx(1, "illegal number, -n argument -- %s", + optarg); + break; + case 't': + tflag = strtol(optarg, &endptr, 10); + if (tflag <= 0 || *endptr != '\0') + errx(1, "illegal number, -t argument -- %s", + optarg); + break; + case 'v': + ++verbose; + break; + default: + usage(); + } + argv += optind; + + if (!nflag) { + len = sizeof(maxprocperuid); + k = sysctlbyname("kern.maxprocperuid", &maxprocperuid, &len, + NULL, 0); + assert(k != ENOMEM); + /* Try to allow a shell to still be started. */ + nflag = maxprocperuid - 10; + } + + // Ensure a unique process group to make killing all children easier. + setpgrp(0,0); + printf(" pid %d pgroup %d (ppid %d), %d fork chain over %d sec\n", + getpid(), getpgrp(), getppid(), nflag - 1, tflag); + + return bombing_run(nflag, tflag); +} From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 16:21:06 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18E37760 for ; Fri, 26 Oct 2012 16:21:06 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-ye0-f182.google.com (mail-ye0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id AF7B28FC08 for ; Fri, 26 Oct 2012 16:21:05 +0000 (UTC) Received: by mail-ye0-f182.google.com with SMTP id l8so547017yen.13 for ; Fri, 26 Oct 2012 09:20:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=WubDYeuIkQFM55o7OXJMJe5o0Rt4LISNAKbYNn97d8I=; b=UFNvn4TyxdnLBS0fzH5PDV7ht+GmqhKuBFtUVY4KkVILH+UDjdpGJpDW8mNzb4xWbz VzkoWGiMcon3+2jJVUiWitT9ZdNtlkpkHuHZsPVVtoyj3/OLGbvOFAoOfsU3y4VZMFHV lkTy65IQwEkDgdBZ1YVhMqp2jpAoVAuh5L+sA2lZx9WDTmTm5FIQITNEHBcVk+r7u6+r +s3wIJv68O94LV1Nwyz4HkDZXk12BOXRkZ7pkxlWvMhXm1hlrPtXxmf+ng3rIKuQZy7m gHz7tTXAxX1jh+UcNp52Tw0eXINKugp2Y/HJD0jjmY883YIhkqilryuf58UdY3RMi+WN Q+3w== Received: by 10.236.190.194 with SMTP id e42mr22715177yhn.28.1351268459717; Fri, 26 Oct 2012 09:20:59 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.146.227.39 with HTTP; Fri, 26 Oct 2012 09:20:39 -0700 (PDT) In-Reply-To: <201210261607.q9QG7raE035736@svn.freebsd.org> References: <201210261607.q9QG7raE035736@svn.freebsd.org> From: Juli Mallett Date: Fri, 26 Oct 2012 09:20:39 -0700 X-Google-Sender-Auth: CodnZBYfa6O5UwN-dzYagHacHgA Message-ID: Subject: Re: svn commit: r242142 - in stable/9: sys/dev/filemon tools/regression/filemon To: "David E. O'Brien" Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnrGd3XDAkTqvMj5aR+TdS2/ZtRbqDrf2ZBNgV/4OfL1Ak84xUsFeL8bp7wePoKnz6XiSas Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 16:21:06 -0000 On Fri, Oct 26, 2012 at 9:07 AM, David E. O'Brien wrote: > Author: obrien > Date: Fri Oct 26 16:07:53 2012 > New Revision: 242142 > URL: http://svn.freebsd.org/changeset/base/242142 > > Log: > MFC: r242137: Iterate rather than use recursion. We can blow out the > kernel stack if there is a long chain of fork(2)s. Under half an hour of MFC time seems rather too quick. If this was being insta-MFC'd because of some kind of security concern, then it would be nice to have seen it signed off by SO, and treated like a security issue. From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 16:30:50 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F9C3A4E; Fri, 26 Oct 2012 16:30:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBCCB8FC08; Fri, 26 Oct 2012 16:30: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 q9QGUnls039994; Fri, 26 Oct 2012 16:30:49 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9QGUnM4039992; Fri, 26 Oct 2012 16:30:49 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201210261630.q9QGUnM4039992@svn.freebsd.org> From: Dimitry Andric Date: Fri, 26 Oct 2012 16:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242143 - stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 16:30:50 -0000 Author: dim Date: Fri Oct 26 16:30:49 2012 New Revision: 242143 URL: http://svn.freebsd.org/changeset/base/242143 Log: MFC r241895: Pull in r165878 from upstream llvm trunk: X86: Disable long nops for all cpus prior to pentiumpro/i686. This is the safest approach for now. If you think long nops matter a lot for performance, compile with -march=i686 or higher. :) Modified: stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp Fri Oct 26 16:07:53 2012 (r242142) +++ stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp Fri Oct 26 16:30:49 2012 (r242143) @@ -307,7 +307,9 @@ bool X86AsmBackend::writeNopData(uint64_ }; // This CPU doesnt support long nops. If needed add more. - if (CPU == "geode") { + // FIXME: Can we get this from the subtarget somehow? + if (CPU == "generic" || CPU == "i386" || CPU == "i486" || CPU == "i586" || + CPU == "pentium" || CPU == "pentium-mmx" || CPU == "geode") { for (uint64_t i = 0; i < Count; ++i) OW->Write8(0x90); return true; From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 16:40:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 664) id 21C8F3A6; Fri, 26 Oct 2012 16:40:04 +0000 (UTC) Date: Fri, 26 Oct 2012 09:40:03 -0700 From: David O'Brien To: Juli Mallett Subject: Re: svn commit: r242142 - in stable/9: sys/dev/filemon tools/regression/filemon Message-ID: <20121026164003.GG43045@dragon.NUXI.org> References: <201210261607.q9QG7raE035736@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: obrien@freebsd.org List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 16:40:04 -0000 On Fri, Oct 26, 2012 at 09:20:39AM -0700, Juli Mallett wrote: > Under half an hour of MFC time seems rather too quick. If this was > being insta-MFC'd because of some kind of security concern, then it > would be nice to have seen it signed off by SO, and treated like a > security issue. It paniced several boxes at work, and I'm asking RE@ if its possible to get into 9.1-R for some new deployments we'd like to do (and trying to track stock FreeBSD for). Getting into stable/9 is a 1st requirement. [ I expect a "NO" from RE@, but I want to try and thus need to submit the request with 'svn merged' patch. ] -- -- David From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 16:42:00 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6609D689; Fri, 26 Oct 2012 16:42:00 +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 CAF128FC16; Fri, 26 Oct 2012 16:41:59 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q9QGg8OA030207; Fri, 26 Oct 2012 19:42:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q9QGfu6j049457; Fri, 26 Oct 2012 19:41:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q9QGfuWX049456; Fri, 26 Oct 2012 19:41:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 26 Oct 2012 19:41:56 +0300 From: Konstantin Belousov To: "David O'Brien" Subject: Re: svn commit: r242142 - in stable/9: sys/dev/filemon tools/regression/filemon Message-ID: <20121026164156.GR35915@deviant.kiev.zoral.com.ua> References: <201210261607.q9QG7raE035736@svn.freebsd.org> <20121026164003.GG43045@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4Y2Rj1EjdQE2iTVT" Content-Disposition: inline In-Reply-To: <20121026164003.GG43045@dragon.NUXI.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Juli Mallett , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 16:42:00 -0000 --4Y2Rj1EjdQE2iTVT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 26, 2012 at 09:40:03AM -0700, David O'Brien wrote: > On Fri, Oct 26, 2012 at 09:20:39AM -0700, Juli Mallett wrote: > > Under half an hour of MFC time seems rather too quick. If this was > > being insta-MFC'd because of some kind of security concern, then it > > would be nice to have seen it signed off by SO, and treated like a > > security issue. >=20 > It paniced several boxes at work, and I'm asking RE@ if its possible to > get into 9.1-R for some new deployments we'd like to do (and trying to > track stock FreeBSD for). Getting into stable/9 is a 1st requirement. >=20 > [ I expect a "NO" from RE@, but I want to try and thus need to submit the > request with 'svn merged' patch. ] This cannot be a valid reason for insta-MFC. Juli is absolutely right. --4Y2Rj1EjdQE2iTVT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlCKvVQACgkQC3+MBN1Mb4i97wCfd+YX6FeQTt4VdFb8Q5NIBUZP ELcAn1VEbnY0rqOC3U/6C1vqj4nm5NNS =u8Pd -----END PGP SIGNATURE----- --4Y2Rj1EjdQE2iTVT-- From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 26 18:06:50 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 671238BE; Fri, 26 Oct 2012 18:06:50 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A8DC8FC12; Fri, 26 Oct 2012 18:06: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 q9QI6oWK059004; Fri, 26 Oct 2012 18:06:50 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9QI6nJB058974; Fri, 26 Oct 2012 18:06:49 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201210261806.q9QI6nJB058974@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 26 Oct 2012 18:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242153 - stable/9/etc/rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2012 18:06:50 -0000 Author: obrien Date: Fri Oct 26 18:06:49 2012 New Revision: 242153 URL: http://svn.freebsd.org/changeset/base/242153 Log: MFC: r240336: Simply things so that "#REQUIRE: FILESYSTEMS" means the file systems are fully "ready to go". 'FILESYSTEMS' states: "This is a dummy dependency, for services which require file systems to be mounted before starting." However, we have 'var' which is was run after 'FILESYSTEMS' and can mount /var if it already isn't mounted. Furthermore, several scripts cannot use /var until 'cleanvar' has done its thing. Thus "FILESYSTEMS" hasn't really meant all critical file systems are fully usable. Modified: stable/9/etc/rc.d/FILESYSTEMS stable/9/etc/rc.d/addswap stable/9/etc/rc.d/amd stable/9/etc/rc.d/cleanvar stable/9/etc/rc.d/cron stable/9/etc/rc.d/dmesg stable/9/etc/rc.d/ftpd stable/9/etc/rc.d/inetd stable/9/etc/rc.d/ipmon stable/9/etc/rc.d/jail stable/9/etc/rc.d/ldconfig stable/9/etc/rc.d/mixer stable/9/etc/rc.d/mountcritremote stable/9/etc/rc.d/moused stable/9/etc/rc.d/mrouted stable/9/etc/rc.d/named stable/9/etc/rc.d/netif stable/9/etc/rc.d/newsyslog stable/9/etc/rc.d/ntpd stable/9/etc/rc.d/pflog stable/9/etc/rc.d/random stable/9/etc/rc.d/rarpd stable/9/etc/rc.d/resolv stable/9/etc/rc.d/sendmail stable/9/etc/rc.d/sshd stable/9/etc/rc.d/syslogd stable/9/etc/rc.d/var stable/9/etc/rc.d/watchdogd Directory Properties: stable/9/ (props changed) stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/FILESYSTEMS ============================================================================== --- stable/9/etc/rc.d/FILESYSTEMS Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/FILESYSTEMS Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: FILESYSTEMS -# REQUIRE: root mountcritlocal zfs +# REQUIRE: root mountcritlocal cleanvar zfs # This is a dummy dependency, for services which require file systems # to be mounted before starting. It also serves as the default early / Modified: stable/9/etc/rc.d/addswap ============================================================================== --- stable/9/etc/rc.d/addswap Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/addswap Fri Oct 26 18:06:49 2012 (r242153) @@ -7,6 +7,7 @@ # PROVIDE: addswap # REQUIRE: FILESYSTEMS kld +# BEFORE: netif # KEYWORD: nojail . /etc/rc.subr Modified: stable/9/etc/rc.d/amd ============================================================================== --- stable/9/etc/rc.d/amd Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/amd Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: amd -# REQUIRE: rpcbind ypset nfsclient cleanvar ldconfig +# REQUIRE: rpcbind ypset nfsclient FILESYSTEMS ldconfig # BEFORE: DAEMON # KEYWORD: nojail shutdown Modified: stable/9/etc/rc.d/cleanvar ============================================================================== --- stable/9/etc/rc.d/cleanvar Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/cleanvar Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: cleanvar -# REQUIRE: FILESYSTEMS var +# REQUIRE: var . /etc/rc.subr Modified: stable/9/etc/rc.d/cron ============================================================================== --- stable/9/etc/rc.d/cron Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/cron Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: cron -# REQUIRE: LOGIN cleanvar +# REQUIRE: LOGIN FILESYSTEMS # BEFORE: securelevel # KEYWORD: shutdown Modified: stable/9/etc/rc.d/dmesg ============================================================================== --- stable/9/etc/rc.d/dmesg Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/dmesg Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: dmesg -# REQUIRE: mountcritremote cleanvar +# REQUIRE: mountcritremote FILESYSTEMS # BEFORE: DAEMON # KEYWORD: nojail Modified: stable/9/etc/rc.d/ftpd ============================================================================== --- stable/9/etc/rc.d/ftpd Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/ftpd Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: ftpd -# REQUIRE: LOGIN cleanvar +# REQUIRE: LOGIN FILESYSTEMS # KEYWORD: shutdown . /etc/rc.subr Modified: stable/9/etc/rc.d/inetd ============================================================================== --- stable/9/etc/rc.d/inetd Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/inetd Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: inetd -# REQUIRE: DAEMON LOGIN cleanvar +# REQUIRE: DAEMON LOGIN FILESYSTEMS # KEYWORD: shutdown . /etc/rc.subr Modified: stable/9/etc/rc.d/ipmon ============================================================================== --- stable/9/etc/rc.d/ipmon Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/ipmon Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: ipmon -# REQUIRE: FILESYSTEMS hostname sysctl cleanvar ipfilter +# REQUIRE: FILESYSTEMS hostname sysctl FILESYSTEMS ipfilter # BEFORE: SERVERS # KEYWORD: nojail Modified: stable/9/etc/rc.d/jail ============================================================================== --- stable/9/etc/rc.d/jail Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/jail Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: jail -# REQUIRE: LOGIN cleanvar +# REQUIRE: LOGIN FILESYSTEMS # BEFORE: securelevel # KEYWORD: nojail shutdown Modified: stable/9/etc/rc.d/ldconfig ============================================================================== --- stable/9/etc/rc.d/ldconfig Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/ldconfig Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: ldconfig -# REQUIRE: mountcritremote cleanvar +# REQUIRE: mountcritremote FILESYSTEMS # BEFORE: DAEMON . /etc/rc.subr Modified: stable/9/etc/rc.d/mixer ============================================================================== --- stable/9/etc/rc.d/mixer Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/mixer Fri Oct 26 18:06:49 2012 (r242153) @@ -28,7 +28,7 @@ # # PROVIDE: mixer -# REQUIRE: cleanvar +# REQUIRE: FILESYSTEMS # KEYWORD: nojail shutdown . /etc/rc.subr Modified: stable/9/etc/rc.d/mountcritremote ============================================================================== --- stable/9/etc/rc.d/mountcritremote Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/mountcritremote Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: mountcritremote -# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec netwait +# REQUIRE: NETWORKING FILESYSTEMS ipsec netwait # KEYWORD: nojail . /etc/rc.subr Modified: stable/9/etc/rc.d/moused ============================================================================== --- stable/9/etc/rc.d/moused Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/moused Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: moused -# REQUIRE: DAEMON cleanvar +# REQUIRE: DAEMON FILESYSTEMS # KEYWORD: nojail shutdown . /etc/rc.subr Modified: stable/9/etc/rc.d/mrouted ============================================================================== --- stable/9/etc/rc.d/mrouted Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/mrouted Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: mrouted -# REQUIRE: netif routing cleanvar +# REQUIRE: netif routing FILESYSTEMS # KEYWORD: nojail . /etc/rc.subr Modified: stable/9/etc/rc.d/named ============================================================================== --- stable/9/etc/rc.d/named Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/named Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: named -# REQUIRE: SERVERS cleanvar +# REQUIRE: SERVERS FILESYSTEMS # KEYWORD: shutdown . /etc/rc.subr Modified: stable/9/etc/rc.d/netif ============================================================================== --- stable/9/etc/rc.d/netif Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/netif Fri Oct 26 18:06:49 2012 (r242153) @@ -26,7 +26,7 @@ # # PROVIDE: netif -# REQUIRE: atm1 cleanvar FILESYSTEMS serial sppp sysctl +# REQUIRE: atm1 FILESYSTEMS serial sppp sysctl # REQUIRE: ipfilter ipfs # KEYWORD: nojail Modified: stable/9/etc/rc.d/newsyslog ============================================================================== --- stable/9/etc/rc.d/newsyslog Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/newsyslog Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: newsyslog -# REQUIRE: cleanvar mountcritremote +# REQUIRE: FILESYSTEMS mountcritremote . /etc/rc.subr Modified: stable/9/etc/rc.d/ntpd ============================================================================== --- stable/9/etc/rc.d/ntpd Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/ntpd Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: ntpd -# REQUIRE: DAEMON ntpdate cleanvar devfs +# REQUIRE: DAEMON ntpdate FILESYSTEMS devfs # BEFORE: LOGIN # KEYWORD: nojail shutdown Modified: stable/9/etc/rc.d/pflog ============================================================================== --- stable/9/etc/rc.d/pflog Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/pflog Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: pflog -# REQUIRE: FILESYSTEMS netif cleanvar +# REQUIRE: FILESYSTEMS netif FILESYSTEMS # KEYWORD: nojail . /etc/rc.subr Modified: stable/9/etc/rc.d/random ============================================================================== --- stable/9/etc/rc.d/random Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/random Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: random -# REQUIRE: var initrandom +# REQUIRE: initrandom FILESYSTEMS # BEFORE: netif # KEYWORD: nojail shutdown Modified: stable/9/etc/rc.d/rarpd ============================================================================== --- stable/9/etc/rc.d/rarpd Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/rarpd Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: rarpd -# REQUIRE: DAEMON cleanvar +# REQUIRE: DAEMON FILESYSTEMS # BEFORE: LOGIN # KEYWORD: nojail Modified: stable/9/etc/rc.d/resolv ============================================================================== --- stable/9/etc/rc.d/resolv Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/resolv Fri Oct 26 18:06:49 2012 (r242153) @@ -28,7 +28,7 @@ # # PROVIDE: resolv -# REQUIRE: netif var +# REQUIRE: netif FILESYSTEMS # KEYWORD: nojail . /etc/rc.subr Modified: stable/9/etc/rc.d/sendmail ============================================================================== --- stable/9/etc/rc.d/sendmail Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/sendmail Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: mail -# REQUIRE: LOGIN cleanvar +# REQUIRE: LOGIN FILESYSTEMS # we make mail start late, so that things like .forward's are not # processed until the system is fully operational # KEYWORD: shutdown Modified: stable/9/etc/rc.d/sshd ============================================================================== --- stable/9/etc/rc.d/sshd Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/sshd Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: sshd -# REQUIRE: LOGIN cleanvar +# REQUIRE: LOGIN FILESYSTEMS # KEYWORD: shutdown . /etc/rc.subr Modified: stable/9/etc/rc.d/syslogd ============================================================================== --- stable/9/etc/rc.d/syslogd Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/syslogd Fri Oct 26 18:06:49 2012 (r242153) @@ -4,7 +4,7 @@ # # PROVIDE: syslogd -# REQUIRE: mountcritremote cleanvar newsyslog +# REQUIRE: mountcritremote FILESYSTEMS newsyslog # BEFORE: SERVERS . /etc/rc.subr Modified: stable/9/etc/rc.d/var ============================================================================== --- stable/9/etc/rc.d/var Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/var Fri Oct 26 18:06:49 2012 (r242153) @@ -28,7 +28,9 @@ # # PROVIDE: var -# REQUIRE: FILESYSTEMS kld addswap +# REQUIRE: mountcritlocal zfs + +# NFS /var is not supported, unless NFS /var is part of diskless NFS / . /etc/rc.subr Modified: stable/9/etc/rc.d/watchdogd ============================================================================== --- stable/9/etc/rc.d/watchdogd Fri Oct 26 17:51:05 2012 (r242152) +++ stable/9/etc/rc.d/watchdogd Fri Oct 26 18:06:49 2012 (r242153) @@ -28,7 +28,7 @@ # # PROVIDE: watchdogd -# REQUIRE: FILESYSTEMS cleanvar syslogd +# REQUIRE: FILESYSTEMS syslogd # KEYWORD: nojail shutdown . /etc/rc.subr From owner-svn-src-stable-9@FreeBSD.ORG Sat Oct 27 01:20:49 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 825B91CF; Sat, 27 Oct 2012 01:20:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 606EB8FC1A; Sat, 27 Oct 2012 01:20: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 q9R1Knco051350; Sat, 27 Oct 2012 01:20:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9R1Knc4051338; Sat, 27 Oct 2012 01:20:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210270120.q9R1Knc4051338@svn.freebsd.org> From: Eitan Adler Date: Sat, 27 Oct 2012 01:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242166 - in stable/9: libexec/tftpd sbin/ccdconfig sbin/restore usr.bin/lock usr.bin/msgs usr.bin/wall usr.sbin/edquota usr.sbin/kgmon X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2012 01:20:49 -0000 Author: eadler Date: Sat Oct 27 01:20:48 2012 New Revision: 242166 URL: http://svn.freebsd.org/changeset/base/242166 Log: MFC r241848: Check the return error of set[e][ug]id. While this can never fail in the current version of FreeBSD, this isn't guarenteed by the API. Custom security modules, or future implementations of the setuid and setgid may fail. Approved by: cperciva (implicit) Modified: stable/9/libexec/tftpd/tftpd.c stable/9/sbin/ccdconfig/ccdconfig.c stable/9/sbin/restore/tape.c stable/9/usr.bin/lock/lock.c stable/9/usr.bin/msgs/msgs.c stable/9/usr.bin/wall/wall.c stable/9/usr.sbin/edquota/edquota.c stable/9/usr.sbin/kgmon/kgmon.c Directory Properties: stable/9/libexec/tftpd/ (props changed) stable/9/sbin/ccdconfig/ (props changed) stable/9/sbin/restore/ (props changed) stable/9/usr.bin/lock/ (props changed) stable/9/usr.bin/msgs/ (props changed) stable/9/usr.bin/wall/ (props changed) stable/9/usr.sbin/edquota/ (props changed) stable/9/usr.sbin/kgmon/ (props changed) stable/9/usr.sbin/lpr/ (props changed) Modified: stable/9/libexec/tftpd/tftpd.c ============================================================================== --- stable/9/libexec/tftpd/tftpd.c Sat Oct 27 01:20:48 2012 (r242165) +++ stable/9/libexec/tftpd/tftpd.c Sat Oct 27 01:20:48 2012 (r242166) @@ -371,7 +371,10 @@ main(int argc, char *argv[]) } chdir("/"); setgroups(1, &nobody->pw_gid); - setuid(nobody->pw_uid); + if (setuid(nobody->pw_uid) != 0) { + tftp_log(LOG_ERR, "setuid failed"); + exit(1); + } } len = sizeof(me_sock); Modified: stable/9/sbin/ccdconfig/ccdconfig.c ============================================================================== --- stable/9/sbin/ccdconfig/ccdconfig.c Sat Oct 27 01:20:48 2012 (r242165) +++ stable/9/sbin/ccdconfig/ccdconfig.c Sat Oct 27 01:20:48 2012 (r242166) @@ -288,13 +288,16 @@ do_all(int action) rval = 0; egid = getegid(); - setegid(getgid()); + if (setegid(getgid()) != 0) + err(1, "setegid failed"); if ((f = fopen(ccdconf, "r")) == NULL) { - setegid(egid); + if (setegid(egid) != 0) + err(1, "setegid failed"); warn("fopen: %s", ccdconf); return (1); } - setegid(egid); + if (setegid(egid) != 0) + err(1, "setegid failed"); while (fgets(line, sizeof(line), f) != NULL) { argc = 0; Modified: stable/9/sbin/restore/tape.c ============================================================================== --- stable/9/sbin/restore/tape.c Sat Oct 27 01:20:48 2012 (r242165) +++ stable/9/sbin/restore/tape.c Sat Oct 27 01:20:48 2012 (r242166) @@ -164,7 +164,11 @@ setinput(char *source, int ispipecommand } pipein++; } - setuid(getuid()); /* no longer need or want root privileges */ + /* no longer need or want root privileges */ + if (setuid(getuid()) != 0) { + fprintf(stderr, "setuid failed\n"); + done(1); + } magtape = strdup(source); if (magtape == NULL) { fprintf(stderr, "Cannot allocate space for magtape buffer\n"); Modified: stable/9/usr.bin/lock/lock.c ============================================================================== --- stable/9/usr.bin/lock/lock.c Sat Oct 27 01:20:48 2012 (r242165) +++ stable/9/usr.bin/lock/lock.c Sat Oct 27 01:20:48 2012 (r242166) @@ -129,7 +129,9 @@ main(int argc, char **argv) } timeout.tv_sec = sectimeout * 60; - setuid(getuid()); /* discard privs */ + /* discard privs */ + if (setuid(getuid()) != 0) + errx(1, "setuid failed"); if (tcgetattr(0, &tty)) /* get information for header */ exit(1); Modified: stable/9/usr.bin/msgs/msgs.c ============================================================================== --- stable/9/usr.bin/msgs/msgs.c Sat Oct 27 01:20:48 2012 (r242165) +++ stable/9/usr.bin/msgs/msgs.c Sat Oct 27 01:20:48 2012 (r242166) @@ -175,7 +175,8 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); time(&t); - setuid(uid = getuid()); + if (setuid(uid = getuid()) != 0) + err(1, "setuid failed"); ruptible = (signal(SIGINT, SIG_IGN) == SIG_DFL); if (ruptible) signal(SIGINT, SIG_DFL); Modified: stable/9/usr.bin/wall/wall.c ============================================================================== --- stable/9/usr.bin/wall/wall.c Sat Oct 27 01:20:48 2012 (r242165) +++ stable/9/usr.bin/wall/wall.c Sat Oct 27 01:20:48 2012 (r242166) @@ -240,7 +240,8 @@ makemsg(char *fname) setegid(getgid()); if (freopen(fname, "r", stdin) == NULL) err(1, "can't read %s", fname); - setegid(egid); + if (setegid(egid) != 0) + err(1, "setegid failed"); } cnt = 0; while (fgetws(lbuf, sizeof(lbuf)/sizeof(wchar_t), stdin)) { Modified: stable/9/usr.sbin/edquota/edquota.c ============================================================================== --- stable/9/usr.sbin/edquota/edquota.c Sat Oct 27 01:20:48 2012 (r242165) +++ stable/9/usr.sbin/edquota/edquota.c Sat Oct 27 01:20:48 2012 (r242166) @@ -453,8 +453,10 @@ editit(char *tmpf) const char *ed; sigsetmask(omask); - setgid(getgid()); - setuid(getuid()); + if (setgid(getgid()) != 0) + err(1, "setgid failed"); + if (setuid(getuid()) != 0) + err(1, "setuid failed"); if ((ed = getenv("EDITOR")) == (char *)0) ed = _PATH_VI; execlp(ed, ed, tmpf, (char *)0); Modified: stable/9/usr.sbin/kgmon/kgmon.c ============================================================================== --- stable/9/usr.sbin/kgmon/kgmon.c Sat Oct 27 01:20:48 2012 (r242165) +++ stable/9/usr.sbin/kgmon/kgmon.c Sat Oct 27 01:20:48 2012 (r242166) @@ -90,7 +90,9 @@ main(int argc, char **argv) struct kvmvars kvmvars; char *system, *kmemf; - seteuid(getuid()); + if (seteuid(getuid()) != 0) { + err(1, "seteuid failed\n"); + } kmemf = NULL; system = NULL; while ((ch = getopt(argc, argv, "M:N:Bbhpr")) != -1) { From owner-svn-src-stable-9@FreeBSD.ORG Sat Oct 27 01:24:26 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E84E57E9; Sat, 27 Oct 2012 01:24:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF8FD8FC16; Sat, 27 Oct 2012 01:24: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 q9R1OPiK052051; Sat, 27 Oct 2012 01:24:25 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9R1OPSO052047; Sat, 27 Oct 2012 01:24:25 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210270124.q9R1OPSO052047@svn.freebsd.org> From: Eitan Adler Date: Sat, 27 Oct 2012 01:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242168 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2012 01:24:26 -0000 Author: eadler Date: Sat Oct 27 01:24:25 2012 New Revision: 242168 URL: http://svn.freebsd.org/changeset/base/242168 Log: MFC r241784: Adds 4K quirks for the some SSD's which all perform better when 4K aligned and only except 4K deletes (TRIM). PR: kern/169974 Approved by: cperciva (implicit) Modified: stable/9/sys/cam/ata/ata_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Sat Oct 27 01:24:24 2012 (r242167) +++ stable/9/sys/cam/ata/ata_da.c Sat Oct 27 01:24:25 2012 (r242168) @@ -269,6 +269,116 @@ static struct ada_quirk_entry ada_quirk_ /*quirks*/ADA_Q_4K }, { + /* + * Corsair Force 2 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair CSSD-F*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Corsair Force 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair Force 3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Agility 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-AGILITY3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Vertex 2 SSDs (inc pro series) + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ?VERTEX2*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Vertex 3 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * SuperTalent TeraDrive CT SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "FTM??CT25H*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Crucial RealSSD C300 SSDs + * 4k optimised + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "C300-CTFDDAC???MAG*", + "*" }, /*quirks*/ADA_Q_4K + }, + { + /* + * XceedIOPS SATA SSDs + * 4k optimised + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SG9XCS2D*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Intel 330 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2ct*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Deneva R Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "DENRSTE251M45*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Kingston HyperX 3k SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + * Submitted by: Steven Hartland + * PR: 169974 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "KINGSTON SH103S3*", "*" }, + /*quirks*/ADA_Q_4K + }, + { /* Default */ { T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED, From owner-svn-src-stable-9@FreeBSD.ORG Sat Oct 27 04:45:26 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 879BF627; Sat, 27 Oct 2012 04:45:26 +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 6BF7C8FC12; Sat, 27 Oct 2012 04:45:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9R4jQef088160; Sat, 27 Oct 2012 04:45:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9R4jQ7R088158; Sat, 27 Oct 2012 04:45:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210270445.q9R4jQ7R088158@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 27 Oct 2012 04:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242172 - stable/9/sys/i386/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2012 04:45:26 -0000 Author: kib Date: Sat Oct 27 04:45:25 2012 New Revision: 242172 URL: http://svn.freebsd.org/changeset/base/242172 Log: MFC r242010: Add missed sched_pin(). Modified: stable/9/sys/i386/i386/pmap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/i386/pmap.c ============================================================================== --- stable/9/sys/i386/i386/pmap.c Sat Oct 27 04:02:12 2012 (r242171) +++ stable/9/sys/i386/i386/pmap.c Sat Oct 27 04:45:25 2012 (r242172) @@ -3228,6 +3228,7 @@ resume: PMAP_UNLOCK(pmap); goto resume; } + sched_pin(); } if (!pmap_demote_pde(pmap, &pmap->pm_pdir[pdirindex], sva)) { From owner-svn-src-stable-9@FreeBSD.ORG Sat Oct 27 19:37:27 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 901C1F8E; Sat, 27 Oct 2012 19:37:27 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76B5B8FC08; Sat, 27 Oct 2012 19:37:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9RJbRWS043814; Sat, 27 Oct 2012 19:37:27 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9RJbRVD043811; Sat, 27 Oct 2012 19:37:27 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201210271937.q9RJbRVD043811@svn.freebsd.org> From: Hiroki Sato Date: Sat, 27 Oct 2012 19:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242185 - stable/9/release X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2012 19:37:27 -0000 Author: hrs Date: Sat Oct 27 19:37:26 2012 New Revision: 242185 URL: http://svn.freebsd.org/changeset/base/242185 Log: MFC of 240586 and 240587 to unbreak release building: Update generate-release.sh script: - Use svn for ports and doc trees - When installing a binary textproc/docproj package, switch pkg_add(1) to pkg(8) [1] Modified: stable/9/release/generate-release.sh Directory Properties: stable/9/release/ (props changed) stable/9/release/doc/ (props changed) Modified: stable/9/release/generate-release.sh ============================================================================== --- stable/9/release/generate-release.sh Sat Oct 27 19:09:09 2012 (r242184) +++ stable/9/release/generate-release.sh Sat Oct 27 19:37:26 2012 (r242185) @@ -3,14 +3,10 @@ # generate-release.sh: check out source trees, and build release components with # totally clean, fresh trees. # -# Usage: generate-release.sh svn-branch scratch-dir +# Usage: generate-release.sh [-r revision] [-d docrevision] \ +# [-p portsrevision] svn-branch scratch-dir # # Environment variables: -# CVSUP_HOST: Host of a cvsup server to obtain the ports and documentation -# trees. This or CVSROOT must be set to include ports and documentation. -# CVSROOT: CVS root to obtain the ports and documentation trees. This or -# CVSUP_HOST must be set to include ports and documentation. -# CVS_TAG: CVS tag for ports and documentation (HEAD by default) # SVNROOT: SVN URL to FreeBSD source repository (by default, # svn://svn.freebsd.org/base) # MAKE_FLAGS: optional flags to pass to make (e.g. -j) @@ -20,26 +16,42 @@ # $FreeBSD$ # -mkdir -p $2/usr/src +usage() +{ + echo "Usage: $0 [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir" + exit 1 +} + +REVISION= +DOCREVISION= +PORTSREVISION= +while getopts d:r:p: opt; do + case $opt in + d) + DOCREVISION="-r $OPTARG" + ;; + r) + REVISION="-r $OPTARG" + ;; + p) + PORTSREVISION="-r $OPTARG" + ;; + \?) + usage + ;; + esac +done +shift $(($OPTIND - 1)) + +if [ $# -lt 2 ]; then + usage +fi + set -e # Everything must succeed svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src -if [ ! -z $CVSUP_HOST ]; then - cat > $2/docports-supfile << EOF - *default host=$CVSUP_HOST - *default base=/var/db - *default prefix=/usr - *default release=cvs tag=${CVS_TAG:-.} - *default delete use-rel-suffix - *default compress - ports-all - doc-all -EOF -elif [ ! -z $CVSROOT ]; then - cd $2/usr - cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} ports - cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} doc -fi +svn co ${SVNROOT:-svn://svn.freebsd.org/doc}/head $2/usr/doc $DOCREVISION +svn co ${SVNROOT:-svn://svn.freebsd.org/ports}/head $2/usr/ports $PORTSREVISION cd $2/usr/src make $MAKE_FLAGS buildworld @@ -47,18 +59,11 @@ make installworld distribution DESTDIR=$ mount -t devfs devfs $2/dev trap "umount $2/dev" EXIT # Clean up devfs mount on exit -if [ ! -z $CVSUP_HOST ]; then - cp /etc/resolv.conf $2/etc/resolv.conf - - # Checkout ports and doc trees - chroot $2 /usr/bin/csup /docports-supfile -fi - if [ -d $2/usr/doc ]; then cp /etc/resolv.conf $2/etc/resolv.conf - # Build ports to build release documentation - chroot $2 /bin/sh -c 'pkg_add -r docproj || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' + # Install docproj to build release documentation + chroot $2 /bin/sh -c '(export ASSUME_ALWAYS_YES=1 && /usr/sbin/pkg install -y docproj) || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' fi chroot $2 make -C /usr/src $MAKE_FLAGS buildworld buildkernel From owner-svn-src-stable-9@FreeBSD.ORG Sat Oct 27 19:49:16 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AAAC6E6; Sat, 27 Oct 2012 19:49:16 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00A988FC08; Sat, 27 Oct 2012 19:49: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 q9RJnFd7045935; Sat, 27 Oct 2012 19:49:15 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9RJnFKk045933; Sat, 27 Oct 2012 19:49:15 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201210271949.q9RJnFKk045933@svn.freebsd.org> From: Hiroki Sato Date: Sat, 27 Oct 2012 19:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242187 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2012 19:49:16 -0000 Author: hrs Date: Sat Oct 27 19:49:15 2012 New Revision: 242187 URL: http://svn.freebsd.org/changeset/base/242187 Log: MFC r242181: Fix an issue when ipv6_enable=YES && ipv6_gateway_enable=YES which could prevent rtadvd(8) from working as intended. Spotted by: brian Discussed with: brian Modified: stable/9/etc/network.subr Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/network.subr ============================================================================== --- stable/9/etc/network.subr Sat Oct 27 19:40:25 2012 (r242186) +++ stable/9/etc/network.subr Sat Oct 27 19:49:15 2012 (r242187) @@ -109,7 +109,9 @@ ifconfig_up() # backward compatibility: $ipv6_enable case $ipv6_enable in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - _ipv6_opts="${_ipv6_opts} accept_rtadv" + if ! checkyesno ipv6_gateway_enable; then + _ipv6_opts="${_ipv6_opts} accept_rtadv" + fi ;; esac @@ -488,7 +490,11 @@ ipv6_autoconfif() # backward compatibility: $ipv6_enable case $ipv6_enable in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - return 0 + if checkyesno ipv6_gateway_enable; then + return 1 + else + return 0 + fi ;; esac From owner-svn-src-stable-9@FreeBSD.ORG Sat Oct 27 23:12:06 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93FF5BE7; Sat, 27 Oct 2012 23:12:06 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79FC68FC08; Sat, 27 Oct 2012 23:12:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9RNC6xY078550; Sat, 27 Oct 2012 23:12:06 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9RNC64v078548; Sat, 27 Oct 2012 23:12:06 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201210272312.q9RNC64v078548@svn.freebsd.org> From: Davide Italiano Date: Sat, 27 Oct 2012 23:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242196 - stable/9/sys/dev/bce X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2012 23:12:06 -0000 Author: davide Date: Sat Oct 27 23:12:05 2012 New Revision: 242196 URL: http://svn.freebsd.org/changeset/base/242196 Log: MFC r239110: Remove a spurious brace which causes build fail in case BCE_DEBUG option is turned on. Modified: stable/9/sys/dev/bce/if_bce.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bce/if_bce.c ============================================================================== --- stable/9/sys/dev/bce/if_bce.c Sat Oct 27 22:58:02 2012 (r242195) +++ stable/9/sys/dev/bce/if_bce.c Sat Oct 27 23:12:05 2012 (r242196) @@ -10513,7 +10513,7 @@ bce_dump_ftqs(struct bce_softc *sc) (BCE_HC_STAT_GEN_SEL_0_GEN_SEL_0_CPQ_VALID_CNT << 8) | (BCE_HC_STAT_GEN_SEL_0_GEN_SEL_0_MGMQ_VALID_CNT); - if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) + if (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) val = val | (BCE_HC_STAT_GEN_SEL_0_GEN_SEL_0_RV2PCSQ_VALID_CNT_XI << 24); From owner-svn-src-stable-9@FreeBSD.ORG Sat Oct 27 23:30:47 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A902329; Sat, 27 Oct 2012 23:30:47 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC7FB8FC08; Sat, 27 Oct 2012 23:30:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9RNUkFJ081483; Sat, 27 Oct 2012 23:30:46 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9RNUkpM081480; Sat, 27 Oct 2012 23:30:46 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201210272330.q9RNUkpM081480@svn.freebsd.org> From: Davide Italiano Date: Sat, 27 Oct 2012 23:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r242199 - in stable/9/sys: conf kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2012 23:30:47 -0000 Author: davide Date: Sat Oct 27 23:30:46 2012 New Revision: 242199 URL: http://svn.freebsd.org/changeset/base/242199 Log: MFCr238925: Until now KTR_ENTRIES, which defines the size of circular buffer used in ktr(4), was constrained to be a power of two. Remove this constraint and update sys/conf/NOTES accordingly. Modified: stable/9/sys/conf/NOTES stable/9/sys/kern/kern_ktr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Sat Oct 27 23:17:22 2012 (r242198) +++ stable/9/sys/conf/NOTES Sat Oct 27 23:30:46 2012 (r242199) @@ -435,7 +435,7 @@ options KTRACE_REQUEST_POOL=101 # # KTR is a kernel tracing facility imported from BSD/OS. It is # enabled with the KTR option. KTR_ENTRIES defines the number of -# entries in the circular trace buffer; it must be a power of two. +# entries in the circular trace buffer; it may be an arbitrary number. # KTR_COMPILE defines the mask of events to compile into the kernel as # defined by the KTR_* constants in . KTR_MASK defines the # initial value of the ktr_mask variable which determines at runtime Modified: stable/9/sys/kern/kern_ktr.c ============================================================================== --- stable/9/sys/kern/kern_ktr.c Sat Oct 27 23:17:22 2012 (r242198) +++ stable/9/sys/kern/kern_ktr.c Sat Oct 27 23:30:46 2012 (r242199) @@ -283,7 +283,7 @@ ktr_tracepoint(u_int mask, const char *f { do { saveindex = ktr_idx; - newindex = (saveindex + 1) & (KTR_ENTRIES - 1); + newindex = (saveindex + 1) % KTR_ENTRIES; } while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) == 0); entry = &ktr_buf[saveindex]; } @@ -338,7 +338,7 @@ static int db_mach_vtrace(void); DB_SHOW_COMMAND(ktr, db_ktr_all) { - tstate.cur = (ktr_idx - 1) & (KTR_ENTRIES - 1); + tstate.cur = (ktr_idx - 1) % KTR_ENTRIES; tstate.first = -1; db_ktr_verbose = 0; db_ktr_verbose |= (index(modif, 'v') != NULL) ? 2 : 0;