From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 04:27:18 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FF771065679; Sun, 7 Feb 2010 04:27:18 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7428C8FC0A; Sun, 7 Feb 2010 04:27:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o174RIp7037280; Sun, 7 Feb 2010 04:27:18 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o174RITV037278; Sun, 7 Feb 2010 04:27:18 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201002070427.o174RITV037278@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 7 Feb 2010 04:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203598 - stable/8/lib/libc/string X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 04:27:18 -0000 Author: ume Date: Sun Feb 7 04:27:18 2010 New Revision: 203598 URL: http://svn.freebsd.org/changeset/base/203598 Log: MFC r202916: Make strsignal(3) thread-safe. Modified: stable/8/lib/libc/string/strsignal.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/string/strsignal.c ============================================================================== --- stable/8/lib/libc/string/strsignal.c Sun Feb 7 04:24:10 2010 (r203597) +++ stable/8/lib/libc/string/strsignal.c Sun Feb 7 04:27:18 2010 (r203598) @@ -33,22 +33,64 @@ static char sccsid[] = "@(#)strerror.c 8 #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #if defined(NLS) #include #endif - #include #include +#include #include #include +#include "reentrant.h" +#include "un-namespace.h" #define UPREFIX "Unknown signal" +static char sig_ebuf[NL_TEXTMAX]; +static char sig_ebuf_err[NL_TEXTMAX]; +static once_t sig_init_once = ONCE_INITIALIZER; +static thread_key_t sig_key; +static int sig_keycreated = 0; + +static void +sig_keycreate(void) +{ + sig_keycreated = (thr_keycreate(&sig_key, free) == 0); +} + +static char * +sig_tlsalloc(void) +{ + char *ebuf = NULL; + + if (thr_main() != 0) + ebuf = sig_ebuf; + else { + if (thr_once(&sig_init_once, sig_keycreate) != 0 || + !sig_keycreated) + goto thr_err; + if ((ebuf = thr_getspecific(sig_key)) == NULL) { + if ((ebuf = malloc(sizeof(sig_ebuf))) == NULL) + goto thr_err; + if (thr_setspecific(sig_key, ebuf) != 0) { + free(ebuf); + ebuf = NULL; + goto thr_err; + } + } + } +thr_err: + if (ebuf == NULL) + ebuf = sig_ebuf_err; + return (ebuf); +} + /* XXX: negative 'num' ? (REGR) */ char * strsignal(int num) { - static char ebuf[NL_TEXTMAX]; + char *ebuf; char tmp[20]; size_t n; int signum; @@ -60,6 +102,8 @@ strsignal(int num) catd = catopen("libc", NL_CAT_LOCALE); #endif + ebuf = sig_tlsalloc(); + if (num > 0 && num < sys_nsig) { n = strlcpy(ebuf, #if defined(NLS) @@ -67,7 +111,7 @@ strsignal(int num) #else sys_siglist[num], #endif - sizeof(ebuf)); + sizeof(sig_ebuf)); } else { n = strlcpy(ebuf, #if defined(NLS) @@ -75,7 +119,7 @@ strsignal(int num) #else UPREFIX, #endif - sizeof(ebuf)); + sizeof(sig_ebuf)); } signum = num; From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 06:22:29 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AAF91065672; Sun, 7 Feb 2010 06:22:29 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184DA8FC15; Sun, 7 Feb 2010 06:22:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o176MSX1063098; Sun, 7 Feb 2010 06:22:28 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o176MSJP063096; Sun, 7 Feb 2010 06:22:28 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002070622.o176MSJP063096@svn.freebsd.org> From: Ruslan Ermilov Date: Sun, 7 Feb 2010 06:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203603 - stable/8/sbin/ifconfig X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 06:22:29 -0000 Author: ru Date: Sun Feb 7 06:22:28 2010 New Revision: 203603 URL: http://svn.freebsd.org/changeset/base/203603 Log: MFC: r203486: Shortening a passphrase caused wrong authentication key to be used. Modified: stable/8/sbin/ifconfig/ifcarp.c Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/ifcarp.c ============================================================================== --- stable/8/sbin/ifconfig/ifcarp.c Sun Feb 7 05:50:00 2010 (r203602) +++ stable/8/sbin/ifconfig/ifcarp.c Sun Feb 7 06:22:28 2010 (r203603) @@ -96,6 +96,7 @@ setcarp_passwd(const char *val, int d, i if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1) err(1, "SIOCGVH"); + memset(carpr.carpr_key, 0, sizeof(carpr.carpr_key)); /* XXX Should hash the password into the key here, perhaps? */ strlcpy(carpr.carpr_key, val, CARP_KEY_LEN); From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 09:00:22 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA63A10656C5; Sun, 7 Feb 2010 09:00:22 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9914B8FC13; Sun, 7 Feb 2010 09:00:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1790M6k097690; Sun, 7 Feb 2010 09:00:22 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1790MER097673; Sun, 7 Feb 2010 09:00:22 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201002070900.o1790MER097673@svn.freebsd.org> From: Julian Elischer Date: Sun, 7 Feb 2010 09:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203605 - in stable/8/sys: net netgraph netinet netinet/ipfw netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 09:00:22 -0000 Author: julian Date: Sun Feb 7 09:00:22 2010 New Revision: 203605 URL: http://svn.freebsd.org/changeset/base/203605 Log: MFC of 197952 and 198075 Virtualize the pfil hooks so that different jails may chose different packet filters. ALso allows ipfw to be enabled on on ejail and disabled on another. In 8.0 it's a global setting. and Unbreak the VIMAGE build with IPSEC, broken with r197952 by virtualizing the pfil hooks. For consistency add the V_ to virtualize the pfil hooks in here as well. Modified: stable/8/sys/net/if_bridge.c stable/8/sys/net/if_enc.c stable/8/sys/net/if_ethersubr.c stable/8/sys/net/pfil.c stable/8/sys/netgraph/ng_bridge.c stable/8/sys/netinet/ip_fastfwd.c stable/8/sys/netinet/ip_input.c stable/8/sys/netinet/ip_output.c stable/8/sys/netinet/ip_var.h stable/8/sys/netinet/ipfw/ip_fw2.c stable/8/sys/netinet/ipfw/ip_fw_pfil.c stable/8/sys/netinet/raw_ip.c stable/8/sys/netinet6/ip6_forward.c stable/8/sys/netinet6/ip6_input.c stable/8/sys/netinet6/ip6_output.c stable/8/sys/netinet6/ip6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/if_bridge.c ============================================================================== --- stable/8/sys/net/if_bridge.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/net/if_bridge.c Sun Feb 7 09:00:22 2010 (r203605) @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* for struct arpcom */ #include @@ -1800,9 +1801,9 @@ bridge_dummynet(struct mbuf *m, struct i return; } - if (PFIL_HOOKED(&inet_pfil_hook) + if (PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif ) { if (bridge_pfil(&m, sc->sc_ifp, ifp, PFIL_OUT) != 0) @@ -2062,9 +2063,9 @@ bridge_forward(struct bridge_softc *sc, ETHER_BPF_MTAP(ifp, m); /* run the packet filter */ - if (PFIL_HOOKED(&inet_pfil_hook) + if (PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif ) { BRIDGE_UNLOCK(sc); @@ -2102,9 +2103,9 @@ bridge_forward(struct bridge_softc *sc, BRIDGE_UNLOCK(sc); - if (PFIL_HOOKED(&inet_pfil_hook) + if (PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif ) { if (bridge_pfil(&m, ifp, dst_if, PFIL_OUT) != 0) @@ -2243,7 +2244,7 @@ bridge_input(struct ifnet *ifp, struct m #ifdef INET6 # define OR_PFIL_HOOKED_INET6 \ - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #else # define OR_PFIL_HOOKED_INET6 #endif @@ -2260,7 +2261,7 @@ bridge_input(struct ifnet *ifp, struct m iface->if_ipackets++; \ /* Filter on the physical interface. */ \ if (pfil_local_phys && \ - (PFIL_HOOKED(&inet_pfil_hook) \ + (PFIL_HOOKED(&V_inet_pfil_hook) \ OR_PFIL_HOOKED_INET6)) { \ if (bridge_pfil(&m, NULL, ifp, \ PFIL_IN) != 0 || m == NULL) { \ @@ -2349,9 +2350,9 @@ bridge_broadcast(struct bridge_softc *sc } /* Filter on the bridge interface before broadcasting */ - if (runfilt && (PFIL_HOOKED(&inet_pfil_hook) + if (runfilt && (PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif )) { if (bridge_pfil(&m, sc->sc_ifp, NULL, PFIL_OUT) != 0) @@ -2396,9 +2397,9 @@ bridge_broadcast(struct bridge_softc *sc * pointer so we do not redundantly filter on the bridge for * each interface we broadcast on. */ - if (runfilt && (PFIL_HOOKED(&inet_pfil_hook) + if (runfilt && (PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif )) { if (used == 0) { @@ -3037,7 +3038,7 @@ bridge_pfil(struct mbuf **mp, struct ifn goto bad; } - if (ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { + if (V_ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { struct dn_pkt_tag *dn_tag; error = -1; @@ -3057,7 +3058,7 @@ bridge_pfil(struct mbuf **mp, struct ifn args.next_hop = NULL; args.eh = &eh2; args.inp = NULL; /* used by ipfw uid/gid/jail rules */ - i = ip_fw_chk_ptr(&args); + i = V_ip_fw_chk_ptr(&args); *mp = args.m; if (*mp == NULL) @@ -3109,21 +3110,21 @@ ipfwpass: * in_if -> bridge_if -> out_if */ if (pfil_bridge && dir == PFIL_OUT && bifp != NULL) - error = pfil_run_hooks(&inet_pfil_hook, mp, bifp, + error = pfil_run_hooks(&V_inet_pfil_hook, mp, bifp, dir, NULL); if (*mp == NULL || error != 0) /* filter may consume */ break; if (pfil_member && ifp != NULL) - error = pfil_run_hooks(&inet_pfil_hook, mp, ifp, + error = pfil_run_hooks(&V_inet_pfil_hook, mp, ifp, dir, NULL); if (*mp == NULL || error != 0) /* filter may consume */ break; if (pfil_bridge && dir == PFIL_IN && bifp != NULL) - error = pfil_run_hooks(&inet_pfil_hook, mp, bifp, + error = pfil_run_hooks(&V_inet_pfil_hook, mp, bifp, dir, NULL); if (*mp == NULL || error != 0) /* filter may consume */ @@ -3163,21 +3164,21 @@ ipfwpass: #ifdef INET6 case ETHERTYPE_IPV6: if (pfil_bridge && dir == PFIL_OUT && bifp != NULL) - error = pfil_run_hooks(&inet6_pfil_hook, mp, bifp, + error = pfil_run_hooks(&V_inet6_pfil_hook, mp, bifp, dir, NULL); if (*mp == NULL || error != 0) /* filter may consume */ break; if (pfil_member && ifp != NULL) - error = pfil_run_hooks(&inet6_pfil_hook, mp, ifp, + error = pfil_run_hooks(&V_inet6_pfil_hook, mp, ifp, dir, NULL); if (*mp == NULL || error != 0) /* filter may consume */ break; if (pfil_bridge && dir == PFIL_IN && bifp != NULL) - error = pfil_run_hooks(&inet6_pfil_hook, mp, bifp, + error = pfil_run_hooks(&V_inet6_pfil_hook, mp, bifp, dir, NULL); break; #endif Modified: stable/8/sys/net/if_enc.c ============================================================================== --- stable/8/sys/net/if_enc.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/net/if_enc.c Sun Feb 7 09:00:22 2010 (r203605) @@ -243,9 +243,9 @@ ipsec_filter(struct mbuf **mp, int dir, } /* Skip pfil(9) if no filters are loaded */ - if (!(PFIL_HOOKED(&inet_pfil_hook) + if (!(PFIL_HOOKED(&V_inet_pfil_hook) #ifdef INET6 - || PFIL_HOOKED(&inet6_pfil_hook) + || PFIL_HOOKED(&V_inet6_pfil_hook) #endif )) { return (0); @@ -271,7 +271,7 @@ ipsec_filter(struct mbuf **mp, int dir, ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); - error = pfil_run_hooks(&inet_pfil_hook, mp, + error = pfil_run_hooks(&V_inet_pfil_hook, mp, encif, dir, NULL); if (*mp == NULL || error != 0) @@ -285,7 +285,7 @@ ipsec_filter(struct mbuf **mp, int dir, #ifdef INET6 case 6: - error = pfil_run_hooks(&inet6_pfil_hook, mp, + error = pfil_run_hooks(&V_inet6_pfil_hook, mp, encif, dir, NULL); break; #endif Modified: stable/8/sys/net/if_ethersubr.c ============================================================================== --- stable/8/sys/net/if_ethersubr.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/net/if_ethersubr.c Sun Feb 7 09:00:22 2010 (r203605) @@ -434,7 +434,7 @@ ether_output_frame(struct ifnet *ifp, st { #if defined(INET) || defined(INET6) - if (ip_fw_chk_ptr && V_ether_ipfw != 0) { + if (V_ip_fw_chk_ptr && V_ether_ipfw != 0) { if (ether_ipfw_chk(&m, ifp, 0) == 0) { if (m) { m_freem(m); @@ -502,7 +502,7 @@ ether_ipfw_chk(struct mbuf **m0, struct args.next_hop = NULL; /* we do not support forward yet */ args.eh = &save_eh; /* MAC header for bridged/MAC packets */ args.inp = NULL; /* used by ipfw uid/gid/jail rules */ - i = ip_fw_chk_ptr(&args); + i = V_ip_fw_chk_ptr(&args); m = args.m; if (m != NULL) { /* @@ -775,7 +775,7 @@ ether_demux(struct ifnet *ifp, struct mb * Allow dummynet and/or ipfw to claim the frame. * Do not do this for PROMISC frames in case we are re-entered. */ - if (ip_fw_chk_ptr && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { + if (V_ip_fw_chk_ptr && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { if (ether_ipfw_chk(&m, NULL, 0) == 0) { if (m) m_freem(m); /* dropped; free mbuf chain */ Modified: stable/8/sys/net/pfil.c ============================================================================== --- stable/8/sys/net/pfil.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/net/pfil.c Sun Feb 7 09:00:22 2010 (r203605) @@ -58,8 +58,9 @@ static int pfil_list_remove(pfil_list_t int (*)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), void *); -LIST_HEAD(, pfil_head) pfil_head_list = - LIST_HEAD_INITIALIZER(&pfil_head_list); +LIST_HEAD(pfilheadhead, pfil_head); +VNET_DEFINE(struct pfilheadhead, pfil_head_list); +#define V_pfil_head_list VNET(pfil_head_list) /* * pfil_run_hooks() runs the specified packet filter hooks. @@ -99,7 +100,7 @@ pfil_head_register(struct pfil_head *ph) struct pfil_head *lph; PFIL_LIST_LOCK(); - LIST_FOREACH(lph, &pfil_head_list, ph_list) { + LIST_FOREACH(lph, &V_pfil_head_list, ph_list) { if (ph->ph_type == lph->ph_type && ph->ph_un.phu_val == lph->ph_un.phu_val) { PFIL_LIST_UNLOCK(); @@ -110,7 +111,7 @@ pfil_head_register(struct pfil_head *ph) ph->ph_nhooks = 0; TAILQ_INIT(&ph->ph_in); TAILQ_INIT(&ph->ph_out); - LIST_INSERT_HEAD(&pfil_head_list, ph, ph_list); + LIST_INSERT_HEAD(&V_pfil_head_list, ph, ph_list); PFIL_LIST_UNLOCK(); return (0); } @@ -145,7 +146,7 @@ pfil_head_get(int type, u_long val) struct pfil_head *ph; PFIL_LIST_LOCK(); - LIST_FOREACH(ph, &pfil_head_list, ph_list) + LIST_FOREACH(ph, &V_pfil_head_list, ph_list) if (ph->ph_type == type && ph->ph_un.phu_val == val) break; PFIL_LIST_UNLOCK(); @@ -284,3 +285,45 @@ pfil_list_remove(pfil_list_t *list, } return (ENOENT); } + +/**************** + * Stuff that must be initialized for every instance + * (including the first of course). + */ +static int +vnet_pfil_init(const void *unused) +{ + LIST_INIT(&V_pfil_head_list); + return (0); +} + +/*********************** + * Called for the removal of each instance. + */ +static int +vnet_pfil_uninit(const void *unused) +{ + /* XXX should panic if list is not empty */ + return 0; +} + +/* Define startup order. */ +#define PFIL_SYSINIT_ORDER SI_SUB_PROTO_BEGIN +#define PFIL_MODEVENT_ORDER (SI_ORDER_FIRST) /* On boot slot in here. */ +#define PFIL_VNET_ORDER (PFIL_MODEVENT_ORDER + 2) /* Later still. */ + +/* + * Starting up. + * VNET_SYSINIT is called for each existing vnet and each new vnet. + */ +VNET_SYSINIT(vnet_pfil_init, PFIL_SYSINIT_ORDER, PFIL_VNET_ORDER, + vnet_pfil_init, NULL); + +/* + * Closing up shop. These are done in REVERSE ORDER, + * Not called on reboot. + * VNET_SYSUNINIT is called for each exiting vnet as it exits. + */ +VNET_SYSUNINIT(vnet_pfil_uninit, PFIL_SYSINIT_ORDER, PFIL_VNET_ORDER, + vnet_pfil_uninit, NULL); + Modified: stable/8/sys/netgraph/ng_bridge.c ============================================================================== --- stable/8/sys/netgraph/ng_bridge.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netgraph/ng_bridge.c Sun Feb 7 09:00:22 2010 (r203605) @@ -634,7 +634,7 @@ ng_bridge_rcvdata(hook_p hook, item_p it /* Run packet through ipfw processing, if enabled */ #if 0 - if (priv->conf.ipfw[linkNum] && V_fw_enable && ip_fw_chk_ptr != NULL) { + if (priv->conf.ipfw[linkNum] && V_fw_enable && V_ip_fw_chk_ptr != NULL) { /* XXX not implemented yet */ } #endif Modified: stable/8/sys/netinet/ip_fastfwd.c ============================================================================== --- stable/8/sys/netinet/ip_fastfwd.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ip_fastfwd.c Sun Feb 7 09:00:22 2010 (r203605) @@ -351,10 +351,11 @@ ip_fastforward(struct mbuf *m) /* * Run through list of ipfilter hooks for input packets */ - if (!PFIL_HOOKED(&inet_pfil_hook)) + if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passin; - if (pfil_run_hooks(&inet_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN, NULL) || + if (pfil_run_hooks( + &V_inet_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN, NULL) || m == NULL) goto drop; @@ -438,10 +439,10 @@ passin: /* * Run through list of hooks for output packets. */ - if (!PFIL_HOOKED(&inet_pfil_hook)) + if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passout; - if (pfil_run_hooks(&inet_pfil_hook, &m, ifp, PFIL_OUT, NULL) || m == NULL) { + if (pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, NULL) || m == NULL) { goto drop; } Modified: stable/8/sys/netinet/ip_input.c ============================================================================== --- stable/8/sys/netinet/ip_input.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ip_input.c Sun Feb 7 09:00:22 2010 (r203605) @@ -170,7 +170,7 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, &VNET_NAME(ip_checkinterface), 0, "Verify packet arrives on correct interface"); -struct pfil_head inet_pfil_hook; /* Packet filter hooks */ +VNET_DEFINE(struct pfil_head, inet_pfil_hook); /* Packet filter hooks */ static struct netisr_handler ip_nh = { .nh_name = "ip", @@ -318,6 +318,13 @@ ip_init(void) NULL, UMA_ALIGN_PTR, 0); maxnipq_update(); + /* Initialize packet filter hooks. */ + V_inet_pfil_hook.ph_type = PFIL_TYPE_AF; + V_inet_pfil_hook.ph_af = AF_INET; + if ((i = pfil_head_register(&V_inet_pfil_hook)) != 0) + printf("%s: WARNING: unable to register pfil hook, " + "error %d\n", __func__, i); + #ifdef FLOWTABLE TUNABLE_INT_FETCH("net.inet.ip.output_flowtable_size", &V_ip_output_flowtable_size); @@ -348,13 +355,6 @@ ip_init(void) ip_protox[pr->pr_protocol] = pr - inetsw; } - /* Initialize packet filter hooks. */ - inet_pfil_hook.ph_type = PFIL_TYPE_AF; - inet_pfil_hook.ph_af = AF_INET; - if ((i = pfil_head_register(&inet_pfil_hook)) != 0) - printf("%s: WARNING: unable to register pfil hook, " - "error %d\n", __func__, i); - /* Start ipport_tick. */ callout_init(&ipport_tick_callout, CALLOUT_MPSAFE); callout_reset(&ipport_tick_callout, 1, ipport_tick, NULL); @@ -510,11 +510,11 @@ tooshort: */ /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED(&inet_pfil_hook)) + if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passin; odst = ip->ip_dst; - if (pfil_run_hooks(&inet_pfil_hook, &m, ifp, PFIL_IN, NULL) != 0) + if (pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_IN, NULL) != 0) return; if (m == NULL) /* consumed by filter */ return; Modified: stable/8/sys/netinet/ip_output.c ============================================================================== --- stable/8/sys/netinet/ip_output.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ip_output.c Sun Feb 7 09:00:22 2010 (r203605) @@ -489,12 +489,12 @@ sendit: #endif /* IPSEC */ /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED(&inet_pfil_hook)) + if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passout; /* Run through list of hooks for output packets. */ odst.s_addr = ip->ip_dst.s_addr; - error = pfil_run_hooks(&inet_pfil_hook, &m, ifp, PFIL_OUT, inp); + error = pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, inp); if (error != 0 || m == NULL) goto done; Modified: stable/8/sys/netinet/ip_var.h ============================================================================== --- stable/8/sys/netinet/ip_var.h Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ip_var.h Sun Feb 7 09:00:22 2010 (r203605) @@ -244,14 +244,20 @@ extern int (*ip_rsvp_vif)(struct socket extern void (*ip_rsvp_force_done)(struct socket *); extern void (*rsvp_input_p)(struct mbuf *m, int off); -extern struct pfil_head inet_pfil_hook; /* packet filter hooks */ +VNET_DECLARE(struct pfil_head, inet_pfil_hook); /* packet filter hooks */ +#define V_inet_pfil_hook VNET(inet_pfil_hook) void in_delayed_cksum(struct mbuf *m); /* ipfw and dummynet hooks. Most are declared in raw_ip.c */ struct ip_fw_args; -extern int (*ip_fw_chk_ptr)(struct ip_fw_args *args); -extern int (*ip_fw_ctl_ptr)(struct sockopt *); +typedef int (*ip_fw_chk_ptr_t)(struct ip_fw_args *args); +typedef int (*ip_fw_ctl_ptr_t)(struct sockopt *); +VNET_DECLARE(ip_fw_chk_ptr_t, ip_fw_chk_ptr); +VNET_DECLARE(ip_fw_ctl_ptr_t, ip_fw_ctl_ptr); +#define V_ip_fw_chk_ptr VNET(ip_fw_chk_ptr) +#define V_ip_fw_ctl_ptr VNET(ip_fw_ctl_ptr) + extern int (*ip_dn_ctl_ptr)(struct sockopt *); extern int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa); extern void (*ip_dn_ruledel_ptr)(void *); /* in ip_fw2.c */ Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Sun Feb 7 09:00:22 2010 (r203605) @@ -2581,6 +2581,10 @@ do { \ } IPFW_RLOCK(chain); + if (! V_ipfw_vnet_ready) { /* shutting down, leave NOW. */ + IPFW_RUNLOCK(chain); + return (IP_FW_PASS); /* accept */ + } mtag = m_tag_find(m, PACKET_TAG_DIVERT, NULL); if (args->rule) { /* @@ -4760,29 +4764,21 @@ ipfw_init(void) printf("limited to %d packets/entry by default\n", V_verbose_limit); - /* - * Hook us up to pfil. - * Eventually pfil will be per vnet. - */ - if ((error = ipfw_hook()) != 0) { - printf("ipfw_hook() error\n"); - return (error); - } -#ifdef INET6 - if ((error = ipfw6_hook()) != 0) { - printf("ipfw6_hook() error\n"); - return (error); - } -#endif - /* - * Other things that are only done the first time. - * (now that we a re cuaranteed of success). - */ - ip_fw_ctl_ptr = ipfw_ctl; - ip_fw_chk_ptr = ipfw_chk; return (error); } +/********************** + * Called for the removal of the last instance only on module unload. + */ +static void +ipfw_destroy(void) +{ + + uma_zdestroy(ipfw_dyn_rule_zone); + IPFW_DYN_LOCK_DESTROY(); + printf("IP firewall unloaded\n"); +} + /**************** * Stuff that must be initialized for every instance * (including the first of course). @@ -4866,19 +4862,30 @@ vnet_ipfw_init(const void *unused) /* First set up some values that are compile time options */ V_ipfw_vnet_ready = 1; /* Open for business */ - return (0); -} -/********************** - * Called for the removal of the last instance only on module unload. - */ -static void -ipfw_destroy(void) -{ + /* Hook up the raw inputs */ + V_ip_fw_ctl_ptr = ipfw_ctl; + V_ip_fw_chk_ptr = ipfw_chk; - uma_zdestroy(ipfw_dyn_rule_zone); - IPFW_DYN_LOCK_DESTROY(); - printf("IP firewall unloaded\n"); + /* + * Hook us up to pfil. + */ + if (V_fw_enable) { + if ((error = ipfw_hook()) != 0) { + printf("ipfw_hook() error\n"); + return (error); + } + } +#ifdef INET6 + if (V_fw6_enable) { + if ((error = ipfw6_hook()) != 0) { + printf("ipfw6_hook() error\n"); + /* XXX should we unhook everything else? */ + return (error); + } + } +#endif + return (0); } /*********************** @@ -4890,9 +4897,18 @@ vnet_ipfw_uninit(const void *unused) struct ip_fw *reap; V_ipfw_vnet_ready = 0; /* tell new callers to go away */ - callout_drain(&V_ipfw_timeout); + ipfw_unhook(); +#ifdef INET6 + ipfw6_unhook(); +#endif + /* layer2 and other entrypoints still come in this way. */ + V_ip_fw_chk_ptr = NULL; + V_ip_fw_ctl_ptr = NULL; + IPFW_WLOCK(&V_layer3_chain); /* We wait on the wlock here until the last user leaves */ + IPFW_WUNLOCK(&V_layer3_chain); IPFW_WLOCK(&V_layer3_chain); + callout_drain(&V_ipfw_timeout); flush_tables(&V_layer3_chain); V_layer3_chain.reap = NULL; free_chain(&V_layer3_chain, 1 /* kill default rule */); @@ -4926,21 +4942,10 @@ ipfw_modevent(module_t mod, int type, vo /* Called once at module load or * system boot if compiled in. */ break; - case MOD_UNLOAD: - break; case MOD_QUIESCE: - /* Yes, the unhooks can return errors, we can safely ignore - * them. Eventually these will be done per jail as they - * shut down. We will wait on each vnet's l3 lock as existing - * callers go away. - */ - ipfw_unhook(); -#ifdef INET6 - ipfw6_unhook(); -#endif - /* layer2 and other entrypoints still come in this way. */ - ip_fw_chk_ptr = NULL; - ip_fw_ctl_ptr = NULL; + /* Called before unload. May veto unloading. */ + break; + case MOD_UNLOAD: /* Called during unload. */ break; case MOD_SHUTDOWN: @@ -4989,4 +4994,3 @@ SYSUNINIT(ipfw_destroy, IPFW_SI_SUB_FIRE VNET_SYSUNINIT(vnet_ipfw_uninit, IPFW_SI_SUB_FIREWALL, IPFW_VNET_ORDER, vnet_ipfw_uninit, NULL); - Modified: stable/8/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_pfil.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/ipfw/ip_fw_pfil.c Sun Feb 7 09:00:22 2010 (r203605) @@ -515,42 +515,54 @@ ipfw6_unhook(void) int ipfw_chg_hook(SYSCTL_HANDLER_ARGS) { - int enable = *(int *)arg1; + int enable; + int oldenable; int error; -#ifdef VIMAGE /* Since enabling is global, only let base do it. */ - if (! IS_DEFAULT_VNET(curvnet)) - return (EPERM); + if (arg1 == &VNET_NAME(fw_enable)) { + enable = V_fw_enable; + } +#ifdef INET6 + else if (arg1 == &VNET_NAME(fw6_enable)) { + enable = V_fw6_enable; + } #endif + else + return (EINVAL); + + oldenable = enable; + error = sysctl_handle_int(oidp, &enable, 0, req); + if (error) return (error); enable = (enable) ? 1 : 0; - if (enable == *(int *)arg1) + if (enable == oldenable) return (0); - if (arg1 == &V_fw_enable) { + if (arg1 == &VNET_NAME(fw_enable)) { if (enable) error = ipfw_hook(); else error = ipfw_unhook(); + if (error) + return (error); + V_fw_enable = enable; } #ifdef INET6 - if (arg1 == &V_fw6_enable) { + else if (arg1 == &VNET_NAME(fw6_enable)) { if (enable) error = ipfw6_hook(); else error = ipfw6_unhook(); + if (error) + return (error); + V_fw6_enable = enable; } #endif - if (error) - return (error); - - *(int *)arg1 = enable; - return (0); } Modified: stable/8/sys/netinet/raw_ip.c ============================================================================== --- stable/8/sys/netinet/raw_ip.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet/raw_ip.c Sun Feb 7 09:00:22 2010 (r203605) @@ -84,9 +84,9 @@ VNET_DEFINE(struct inpcbinfo, ripcbinfo) * The data hooks are not used here but it is convenient * to keep them all in one place. */ -int (*ip_fw_ctl_ptr)(struct sockopt *) = NULL; +VNET_DEFINE(ip_fw_chk_ptr_t, ip_fw_chk_ptr) = NULL; +VNET_DEFINE(ip_fw_ctl_ptr_t, ip_fw_ctl_ptr) = NULL; int (*ip_dn_ctl_ptr)(struct sockopt *) = NULL; -int (*ip_fw_chk_ptr)(struct ip_fw_args *args) = NULL; int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa) = NULL; /* @@ -542,8 +542,8 @@ rip_ctloutput(struct socket *so, struct case IP_FW_TABLE_LIST: case IP_FW_NAT_GET_CONFIG: case IP_FW_NAT_GET_LOG: - if (ip_fw_ctl_ptr != NULL) - error = ip_fw_ctl_ptr(sopt); + if (V_ip_fw_ctl_ptr != NULL) + error = V_ip_fw_ctl_ptr(sopt); else error = ENOPROTOOPT; break; @@ -605,8 +605,8 @@ rip_ctloutput(struct socket *so, struct case IP_FW_TABLE_FLUSH: case IP_FW_NAT_CFG: case IP_FW_NAT_DEL: - if (ip_fw_ctl_ptr != NULL) - error = ip_fw_ctl_ptr(sopt); + if (V_ip_fw_ctl_ptr != NULL) + error = V_ip_fw_ctl_ptr(sopt); else error = ENOPROTOOPT; break; Modified: stable/8/sys/netinet6/ip6_forward.c ============================================================================== --- stable/8/sys/netinet6/ip6_forward.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet6/ip6_forward.c Sun Feb 7 09:00:22 2010 (r203605) @@ -551,11 +551,11 @@ skip_routing: in6_clearscope(&ip6->ip6_dst); /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED(&inet6_pfil_hook)) + if (!PFIL_HOOKED(&V_inet6_pfil_hook)) goto pass; /* Run through list of hooks for output packets. */ - error = pfil_run_hooks(&inet6_pfil_hook, &m, rt->rt_ifp, PFIL_OUT, NULL); + error = pfil_run_hooks(&V_inet6_pfil_hook, &m, rt->rt_ifp, PFIL_OUT, NULL); if (error != 0) goto senderr; if (m == NULL) Modified: stable/8/sys/netinet6/ip6_input.c ============================================================================== --- stable/8/sys/netinet6/ip6_input.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet6/ip6_input.c Sun Feb 7 09:00:22 2010 (r203605) @@ -152,7 +152,7 @@ VNET_DECLARE(int, udp6_recvspace); struct rwlock in6_ifaddr_lock; RW_SYSINIT(in6_ifaddr_lock, &in6_ifaddr_lock, "in6_ifaddr_lock"); -struct pfil_head inet6_pfil_hook; +VNET_DEFINE (struct pfil_head, inet6_pfil_hook); static void ip6_init2(void *); static struct ip6aux *ip6_setdstifaddr(struct mbuf *, struct in6_ifaddr *); @@ -247,6 +247,13 @@ ip6_init(void) V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR; + /* Initialize packet filter hooks. */ + V_inet6_pfil_hook.ph_type = PFIL_TYPE_AF; + V_inet6_pfil_hook.ph_af = AF_INET6; + if ((i = pfil_head_register(&V_inet6_pfil_hook)) != 0) + printf("%s: WARNING: unable to register pfil hook, " + "error %d\n", __func__, i); + /* Skip global initialization stuff for non-default instances. */ if (!IS_DEFAULT_VNET(curvnet)) return; @@ -275,13 +282,6 @@ ip6_init(void) ip6_protox[pr->pr_protocol] = pr - inet6sw; } - /* Initialize packet filter hooks. */ - inet6_pfil_hook.ph_type = PFIL_TYPE_AF; - inet6_pfil_hook.ph_af = AF_INET6; - if ((i = pfil_head_register(&inet6_pfil_hook)) != 0) - printf("%s: WARNING: unable to register pfil hook, " - "error %d\n", __func__, i); - netisr_register(&ip6_nh); } @@ -515,10 +515,11 @@ ip6_input(struct mbuf *m) odst = ip6->ip6_dst; /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED(&inet6_pfil_hook)) + if (!PFIL_HOOKED(&V_inet6_pfil_hook)) goto passin; - if (pfil_run_hooks(&inet6_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN, NULL)) + if (pfil_run_hooks(&V_inet6_pfil_hook, &m, + m->m_pkthdr.rcvif, PFIL_IN, NULL)) return; if (m == NULL) /* consumed by filter */ return; Modified: stable/8/sys/netinet6/ip6_output.c ============================================================================== --- stable/8/sys/netinet6/ip6_output.c Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet6/ip6_output.c Sun Feb 7 09:00:22 2010 (r203605) @@ -805,12 +805,12 @@ again: } /* Jump over all PFIL processing if hooks are not active. */ - if (!PFIL_HOOKED(&inet6_pfil_hook)) + if (!PFIL_HOOKED(&V_inet6_pfil_hook)) goto passout; odst = ip6->ip6_dst; /* Run through list of hooks for output packets. */ - error = pfil_run_hooks(&inet6_pfil_hook, &m, ifp, PFIL_OUT, inp); + error = pfil_run_hooks(&V_inet6_pfil_hook, &m, ifp, PFIL_OUT, inp); if (error != 0 || m == NULL) goto done; ip6 = mtod(m, struct ip6_hdr *); Modified: stable/8/sys/netinet6/ip6_var.h ============================================================================== --- stable/8/sys/netinet6/ip6_var.h Sun Feb 7 07:50:41 2010 (r203604) +++ stable/8/sys/netinet6/ip6_var.h Sun Feb 7 09:00:22 2010 (r203605) @@ -358,7 +358,8 @@ VNET_DECLARE(int, ip6_use_defzone); /* W #endif #define V_ip6_use_defzone VNET(ip6_use_defzone) -extern struct pfil_head inet6_pfil_hook; /* packet filter hooks */ +VNET_DECLARE (struct pfil_head, inet6_pfil_hook); /* packet filter hooks */ +#define V_inet6_pfil_hook VNET(inet6_pfil_hook) extern struct pr_usrreqs rip6_usrreqs; struct sockopt; From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 10:44:45 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AD81106566B; Sun, 7 Feb 2010 10:44:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F030D8FC12; Sun, 7 Feb 2010 10:44:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17AiiQM046034; Sun, 7 Feb 2010 10:44:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17AiiDE045959; Sun, 7 Feb 2010 10:44:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002071044.o17AiiDE045959@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 7 Feb 2010 10:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203606 - in stable/8/sys: kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 10:44:45 -0000 Author: kib Date: Sun Feb 7 10:44:44 2010 New Revision: 203606 URL: http://svn.freebsd.org/changeset/base/203606 Log: MFC r202528: Add vunref(9). Modified: stable/8/sys/kern/vfs_subr.c stable/8/sys/sys/vnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Sun Feb 7 09:00:22 2010 (r203605) +++ stable/8/sys/kern/vfs_subr.c Sun Feb 7 10:44:44 2010 (r203606) @@ -2149,37 +2149,44 @@ vrefcnt(struct vnode *vp) return (usecnt); } +#define VPUTX_VRELE 1 +#define VPUTX_VPUT 2 +#define VPUTX_VUNREF 3 -/* - * Vnode put/release. - * If count drops to zero, call inactive routine and return to freelist. - */ -void -vrele(struct vnode *vp) +static void +vputx(struct vnode *vp, int func) { - struct thread *td = curthread; /* XXX */ + int error; - KASSERT(vp != NULL, ("vrele: null vp")); + KASSERT(vp != NULL, ("vputx: null vp")); + if (func == VPUTX_VUNREF) + ASSERT_VOP_ELOCKED(vp, "vunref"); + else if (func == VPUTX_VPUT) + ASSERT_VOP_LOCKED(vp, "vput"); + else + KASSERT(func == VPUTX_VRELE, ("vputx: wrong func")); VFS_ASSERT_GIANT(vp->v_mount); - + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); VI_LOCK(vp); /* Skip this v_writecount check if we're going to panic below. */ VNASSERT(vp->v_writecount < vp->v_usecount || vp->v_usecount < 1, vp, - ("vrele: missed vn_close")); - CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + ("vputx: missed vn_close")); + error = 0; if (vp->v_usecount > 1 || ((vp->v_iflag & VI_DOINGINACT) && vp->v_usecount == 1)) { + if (func == VPUTX_VPUT) + VOP_UNLOCK(vp, 0); v_decr_usecount(vp); return; } + if (vp->v_usecount != 1) { #ifdef DIAGNOSTIC - vprint("vrele: negative ref count", vp); + vprint("vputx: negative ref count", vp); #endif - VI_UNLOCK(vp); - panic("vrele: negative ref cnt"); + panic("vputx: negative ref cnt"); } CTR2(KTR_VFS, "%s: return vnode %p to the freelist", __func__, vp); /* @@ -2193,22 +2200,36 @@ vrele(struct vnode *vp) * as VI_DOINGINACT to avoid recursion. */ vp->v_iflag |= VI_OWEINACT; - if (vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK) == 0) { + if (func == VPUTX_VRELE) { + error = vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK); VI_LOCK(vp); - if (vp->v_usecount > 0) - vp->v_iflag &= ~VI_OWEINACT; - if (vp->v_iflag & VI_OWEINACT) - vinactive(vp, td); - VOP_UNLOCK(vp, 0); - } else { + } else if (func == VPUTX_VPUT && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + error = VOP_LOCK(vp, LK_UPGRADE | LK_INTERLOCK | LK_NOWAIT); VI_LOCK(vp); - if (vp->v_usecount > 0) - vp->v_iflag &= ~VI_OWEINACT; + } + if (vp->v_usecount > 0) + vp->v_iflag &= ~VI_OWEINACT; + if (error == 0) { + if (vp->v_iflag & VI_OWEINACT) + vinactive(vp, curthread); + if (func != VPUTX_VUNREF) + VOP_UNLOCK(vp, 0); } vdropl(vp); } /* + * Vnode put/release. + * If count drops to zero, call inactive routine and return to freelist. + */ +void +vrele(struct vnode *vp) +{ + + vputx(vp, VPUTX_VRELE); +} + +/* * Release an already locked vnode. This give the same effects as * unlock+vrele(), but takes less time and avoids releasing and * re-aquiring the lock (as vrele() acquires the lock internally.) @@ -2216,56 +2237,18 @@ vrele(struct vnode *vp) void vput(struct vnode *vp) { - struct thread *td = curthread; /* XXX */ - int error; - KASSERT(vp != NULL, ("vput: null vp")); - ASSERT_VOP_LOCKED(vp, "vput"); - VFS_ASSERT_GIANT(vp->v_mount); - CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - VI_LOCK(vp); - /* Skip this v_writecount check if we're going to panic below. */ - VNASSERT(vp->v_writecount < vp->v_usecount || vp->v_usecount < 1, vp, - ("vput: missed vn_close")); - error = 0; + vputx(vp, VPUTX_VPUT); +} - if (vp->v_usecount > 1 || ((vp->v_iflag & VI_DOINGINACT) && - vp->v_usecount == 1)) { - VOP_UNLOCK(vp, 0); - v_decr_usecount(vp); - return; - } +/* + * Release an exclusively locked vnode. Do not unlock the vnode lock. + */ +void +vunref(struct vnode *vp) +{ - if (vp->v_usecount != 1) { -#ifdef DIAGNOSTIC - vprint("vput: negative ref count", vp); -#endif - panic("vput: negative ref cnt"); - } - CTR2(KTR_VFS, "%s: return to freelist the vnode %p", __func__, vp); - /* - * We want to hold the vnode until the inactive finishes to - * prevent vgone() races. We drop the use count here and the - * hold count below when we're done. - */ - v_decr_useonly(vp); - vp->v_iflag |= VI_OWEINACT; - if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { - error = VOP_LOCK(vp, LK_UPGRADE|LK_INTERLOCK|LK_NOWAIT); - VI_LOCK(vp); - if (error) { - if (vp->v_usecount > 0) - vp->v_iflag &= ~VI_OWEINACT; - goto done; - } - } - if (vp->v_usecount > 0) - vp->v_iflag &= ~VI_OWEINACT; - if (vp->v_iflag & VI_OWEINACT) - vinactive(vp, td); - VOP_UNLOCK(vp, 0); -done: - vdropl(vp); + vputx(vp, VPUTX_VUNREF); } /* Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Sun Feb 7 09:00:22 2010 (r203605) +++ stable/8/sys/sys/vnode.h Sun Feb 7 10:44:44 2010 (r203606) @@ -629,6 +629,7 @@ void vholdl(struct vnode *); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); int vtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td, off_t length, int blksize); +void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); #define vprint(label, vp) vn_printf((vp), "%s\n", (label)) int vrecycle(struct vnode *vp, struct thread *td); From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 10:51:17 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA565106566C; Sun, 7 Feb 2010 10:51:17 +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 938828FC1B; Sun, 7 Feb 2010 10:51:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17ApHcX098147; Sun, 7 Feb 2010 10:51:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17ApHJK098144; Sun, 7 Feb 2010 10:51:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002071051.o17ApHJK098144@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 7 Feb 2010 10:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203607 - stable/8/sys/vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 10:51:17 -0000 Author: kib Date: Sun Feb 7 10:51:17 2010 New Revision: 203607 URL: http://svn.freebsd.org/changeset/base/203607 Log: MFC r202529: vunref() the vnode in vm object deallocation code for OBJT_VNODE appropriate number of times to prevent possible vnode reference leak. Modified: stable/8/sys/vm/vm_pageout.c stable/8/sys/vm/vnode_pager.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/vm/vm_pageout.c ============================================================================== --- stable/8/sys/vm/vm_pageout.c Sun Feb 7 10:44:44 2010 (r203606) +++ stable/8/sys/vm/vm_pageout.c Sun Feb 7 10:51:17 2010 (r203607) @@ -951,6 +951,8 @@ rescan0: vnodes_skipped++; goto unlock_and_continue; } + KASSERT(mp != NULL, + ("vp %p with NULL v_mount", vp)); vm_page_unlock_queues(); vm_object_reference_locked(object); VM_OBJECT_UNLOCK(object); Modified: stable/8/sys/vm/vnode_pager.c ============================================================================== --- stable/8/sys/vm/vnode_pager.c Sun Feb 7 10:44:44 2010 (r203606) +++ stable/8/sys/vm/vnode_pager.c Sun Feb 7 10:51:17 2010 (r203607) @@ -250,13 +250,16 @@ static void vnode_pager_dealloc(object) vm_object_t object; { - struct vnode *vp = object->handle; + struct vnode *vp; + int refs; + vp = object->handle; if (vp == NULL) panic("vnode_pager_dealloc: pager already dealloced"); VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); vm_object_pip_wait(object, "vnpdea"); + refs = object->ref_count; object->handle = NULL; object->type = OBJT_DEAD; @@ -267,6 +270,8 @@ vnode_pager_dealloc(object) ASSERT_VOP_ELOCKED(vp, "vnode_pager_dealloc"); vp->v_object = NULL; vp->v_vflag &= ~VV_TEXT; + while (refs-- > 0) + vunref(vp); } static boolean_t From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 11:37:39 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1754C106566B; Sun, 7 Feb 2010 11:37:39 +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 076DB8FC08; Sun, 7 Feb 2010 11:37:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17BbdOk008537; Sun, 7 Feb 2010 11:37:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17BbcxP008531; Sun, 7 Feb 2010 11:37:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002071137.o17BbcxP008531@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 7 Feb 2010 11:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203608 - in stable/8/sys: amd64/amd64 amd64/ia32 i386/i386 kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 11:37:39 -0000 Author: kib Date: Sun Feb 7 11:37:38 2010 New Revision: 203608 URL: http://svn.freebsd.org/changeset/base/203608 Log: MFC r202882: For i386, amd64 and ia32 on amd64 MD syscall(), reread syscall number and arguments after ptracestop(), if debugger modified anything in the process environment. Modified: stable/8/sys/amd64/amd64/trap.c stable/8/sys/amd64/ia32/ia32_syscall.c stable/8/sys/i386/i386/trap.c stable/8/sys/kern/sys_process.c stable/8/sys/sys/proc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/trap.c ============================================================================== --- stable/8/sys/amd64/amd64/trap.c Sun Feb 7 10:51:17 2010 (r203607) +++ stable/8/sys/amd64/amd64/trap.c Sun Feb 7 11:37:38 2010 (r203608) @@ -884,95 +884,131 @@ dblfault_handler(struct trapframe *frame panic("double fault"); } -/* - * syscall - system call request C handler - * - * A system call is essentially treated as a trap. - */ -void -syscall(struct trapframe *frame) -{ - caddr_t params; +struct syscall_args { + u_int code; struct sysent *callp; - struct thread *td = curthread; - struct proc *p = td->td_proc; - register_t orig_tf_rflags; - int error; - int narg; register_t args[8]; register_t *argp; - u_int code; - int reg, regcnt; - ksiginfo_t ksi; - - PCPU_INC(cnt.v_syscall); + int narg; +}; -#ifdef DIAGNOSTIC - if (ISPL(frame->tf_cs) != SEL_UPL) { - panic("syscall"); - /* NOT REACHED */ - } -#endif +static int +fetch_syscall_args(struct thread *td, struct syscall_args *sa) +{ + struct proc *p; + struct trapframe *frame; + caddr_t params; + int reg, regcnt, error; + p = td->td_proc; + frame = td->td_frame; reg = 0; regcnt = 6; - td->td_pticks = 0; - td->td_frame = frame; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); + params = (caddr_t)frame->tf_rsp + sizeof(register_t); - code = frame->tf_rax; - orig_tf_rflags = frame->tf_rflags; + sa->code = frame->tf_rax; if (p->p_sysent->sv_prepsyscall) { - (*p->p_sysent->sv_prepsyscall)(frame, (int *)args, &code, ¶ms); + (*p->p_sysent->sv_prepsyscall)(frame, (int *)sa->args, + &sa->code, ¶ms); } else { - if (code == SYS_syscall || code == SYS___syscall) { - code = frame->tf_rdi; + if (sa->code == SYS_syscall || sa->code == SYS___syscall) { + sa->code = frame->tf_rdi; reg++; regcnt--; } } - if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; + sa->code &= p->p_sysent->sv_mask; - if (code >= p->p_sysent->sv_size) - callp = &p->p_sysent->sv_table[0]; + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; else - callp = &p->p_sysent->sv_table[code]; + sa->callp = &p->p_sysent->sv_table[sa->code]; - narg = callp->sy_narg; - KASSERT(narg <= sizeof(args) / sizeof(args[0]), + sa->narg = sa->callp->sy_narg; + KASSERT(sa->narg <= sizeof(sa->args) / sizeof(sa->args[0]), ("Too many syscall arguments!")); error = 0; - argp = &frame->tf_rdi; - argp += reg; - bcopy(argp, args, sizeof(args[0]) * regcnt); - if (narg > regcnt) { + sa->argp = &frame->tf_rdi; + sa->argp += reg; + bcopy(sa->argp, sa->args, sizeof(sa->args[0]) * regcnt); + if (sa->narg > regcnt) { KASSERT(params != NULL, ("copyin args with no params!")); - error = copyin(params, &args[regcnt], - (narg - regcnt) * sizeof(args[0])); + error = copyin(params, &sa->args[regcnt], + (sa->narg - regcnt) * sizeof(sa->args[0])); } - argp = &args[0]; + sa->argp = &sa->args[0]; + /* + * This may result in two records if debugger modified + * registers or memory during sleep at stop/ptrace point. + */ #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(code, narg, argp); + ktrsyscall(sa->code, sa->narg, sa->argp); #endif + return (error); +} - CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, code); +/* + * syscall - system call request C handler + * + * A system call is essentially treated as a trap. + */ +void +syscall(struct trapframe *frame) +{ + struct thread *td; + struct proc *p; + struct syscall_args sa; + register_t orig_tf_rflags; + int error; + ksiginfo_t ksi; + PCPU_INC(cnt.v_syscall); + td = curthread; + p = td->td_proc; td->td_syscalls++; +#ifdef DIAGNOSTIC + if (ISPL(frame->tf_cs) != SEL_UPL) { + panic("syscall"); + /* NOT REACHED */ + } +#endif + + td->td_pticks = 0; + td->td_frame = frame; + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); + orig_tf_rflags = frame->tf_rflags; + if (p->p_flag & P_TRACED) { + PROC_LOCK(p); + td->td_dbgflags &= ~TDB_USERWR; + PROC_UNLOCK(p); + } + error = fetch_syscall_args(td, &sa); + + CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, + td->td_proc->p_pid, td->td_name, sa.code); + if (error == 0) { td->td_retval[0] = 0; td->td_retval[1] = frame->tf_rdx; - STOPEVENT(p, S_SCE, narg); - + STOPEVENT(p, S_SCE, sa.narg); PTRACESTOP_SC(p, td, S_PT_SCE); + if (td->td_dbgflags & TDB_USERWR) { + /* + * Reread syscall number and arguments if + * debugger modified registers or memory. + */ + error = fetch_syscall_args(td, &sa); + if (error != 0) + goto retval; + td->td_retval[1] = frame->tf_rdx; + } #ifdef KDTRACE_HOOKS /* @@ -980,13 +1016,13 @@ syscall(struct trapframe *frame) * callback and if there is a probe active for the * syscall 'entry', process the probe. */ - if (systrace_probe_func != NULL && callp->sy_entry != 0) - (*systrace_probe_func)(callp->sy_entry, code, callp, - args); + if (systrace_probe_func != NULL && sa.callp->sy_entry != 0) + (*systrace_probe_func)(sa.callp->sy_entry, sa.code, + sa.callp, sa.args); #endif - AUDIT_SYSCALL_ENTER(code, td); - error = (*callp->sy_call)(td, argp); + AUDIT_SYSCALL_ENTER(sa.code, td); + error = (*sa.callp->sy_call)(td, sa.argp); AUDIT_SYSCALL_EXIT(error, td); /* Save the latest error return value. */ @@ -998,12 +1034,12 @@ syscall(struct trapframe *frame) * callback and if there is a probe active for the * syscall 'return', process the probe. */ - if (systrace_probe_func != NULL && callp->sy_return != 0) - (*systrace_probe_func)(callp->sy_return, code, callp, - args); + if (systrace_probe_func != NULL && sa.callp->sy_return != 0) + (*systrace_probe_func)(sa.callp->sy_return, sa.code, + sa.callp, sa.args); #endif } - + retval: cpu_set_syscall_retval(td, error); /* @@ -1022,14 +1058,16 @@ syscall(struct trapframe *frame) * Check for misbehavior. */ WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???"); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???"); KASSERT(td->td_critnest == 0, ("System call %s returning in a critical section", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???")); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???")); KASSERT(td->td_locks == 0, ("System call %s returning with %d locks held", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???", - td->td_locks)); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???", td->td_locks)); /* * Handle reschedule and other end-of-syscall issues @@ -1037,11 +1075,11 @@ syscall(struct trapframe *frame) userret(td, frame); CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, code); + td->td_proc->p_pid, td->td_name, sa.code); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(code, error, td->td_retval[0]); + ktrsysret(sa.code, error, td->td_retval[0]); #endif /* @@ -1049,7 +1087,7 @@ syscall(struct trapframe *frame) * register set. If we ever support an emulation where this * is not the case, this code will need to be revisited. */ - STOPEVENT(p, S_SCX, code); + STOPEVENT(p, S_SCX, sa.code); PTRACESTOP_SC(p, td, S_PT_SCX); } Modified: stable/8/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_syscall.c Sun Feb 7 10:51:17 2010 (r203607) +++ stable/8/sys/amd64/ia32/ia32_syscall.c Sun Feb 7 11:37:38 2010 (r203608) @@ -88,101 +88,136 @@ extern const char *freebsd32_syscallname void ia32_syscall(struct trapframe *frame); /* Called from asm code */ -void -ia32_syscall(struct trapframe *frame) -{ +struct ia32_syscall_args { + u_int code; caddr_t params; - int i; struct sysent *callp; - struct thread *td = curthread; - struct proc *p = td->td_proc; - register_t orig_tf_rflags; - int error; + u_int64_t args64[8]; int narg; +}; + +static int +fetch_ia32_syscall_args(struct thread *td, struct ia32_syscall_args *sa) +{ + struct proc *p; + struct trapframe *frame; u_int32_t args[8]; - u_int64_t args64[8]; - u_int code; - ksiginfo_t ksi; + int error, i; - PCPU_INC(cnt.v_syscall); - td->td_pticks = 0; - td->td_frame = frame; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); - params = (caddr_t)frame->tf_rsp + sizeof(u_int32_t); - code = frame->tf_rax; - orig_tf_rflags = frame->tf_rflags; + p = td->td_proc; + frame = td->td_frame; + + sa->params = (caddr_t)frame->tf_rsp + sizeof(u_int32_t); + sa->code = frame->tf_rax; if (p->p_sysent->sv_prepsyscall) { /* * The prep code is MP aware. */ - (*p->p_sysent->sv_prepsyscall)(frame, args, &code, ¶ms); + (*p->p_sysent->sv_prepsyscall)(frame, args, &sa->code, + &sa->params); } else { /* * Need to check if this is a 32 bit or 64 bit syscall. * fuword is MP aware. */ - if (code == SYS_syscall) { + if (sa->code == SYS_syscall) { /* * Code is first argument, followed by actual args. */ - code = fuword32(params); - params += sizeof(int); - } else if (code == SYS___syscall) { + sa->code = fuword32(sa->params); + sa->params += sizeof(int); + } else if (sa->code == SYS___syscall) { /* * Like syscall, but code is a quad, so as to maintain * quad alignment for the rest of the arguments. * We use a 32-bit fetch in case params is not * aligned. */ - code = fuword32(params); - params += sizeof(quad_t); + sa->code = fuword32(sa->params); + sa->params += sizeof(quad_t); } } - if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; - - if (code >= p->p_sysent->sv_size) - callp = &p->p_sysent->sv_table[0]; + sa->code &= p->p_sysent->sv_mask; + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; else - callp = &p->p_sysent->sv_table[code]; - - narg = callp->sy_narg; + sa->callp = &p->p_sysent->sv_table[sa->code]; + sa->narg = sa->callp->sy_narg; - /* - * copyin and the ktrsyscall()/ktrsysret() code is MP-aware - */ - if (params != NULL && narg != 0) - error = copyin(params, (caddr_t)args, - (u_int)(narg * sizeof(int))); + if (sa->params != NULL && sa->narg != 0) + error = copyin(sa->params, (caddr_t)args, + (u_int)(sa->narg * sizeof(int))); else error = 0; - for (i = 0; i < narg; i++) - args64[i] = args[i]; + for (i = 0; i < sa->narg; i++) + sa->args64[i] = args[i]; #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(code, narg, args64); + ktrsyscall(sa->code, sa->narg, sa->args64); #endif + + return (error); +} + +void +ia32_syscall(struct trapframe *frame) +{ + struct thread *td; + struct proc *p; + struct ia32_syscall_args sa; + register_t orig_tf_rflags; + int error; + ksiginfo_t ksi; + + PCPU_INC(cnt.v_syscall); + td = curthread; + p = td->td_proc; + td->td_syscalls++; + + td->td_pticks = 0; + td->td_frame = frame; + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); + orig_tf_rflags = frame->tf_rflags; + if (p->p_flag & P_TRACED) { + PROC_LOCK(p); + td->td_dbgflags &= ~TDB_USERWR; + PROC_UNLOCK(p); + } + error = fetch_ia32_syscall_args(td, &sa); + CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_proc->p_comm, code); + td->td_proc->p_pid, td->td_name, sa.code); if (error == 0) { td->td_retval[0] = 0; td->td_retval[1] = frame->tf_rdx; - STOPEVENT(p, S_SCE, narg); - + STOPEVENT(p, S_SCE, sa.narg); PTRACESTOP_SC(p, td, S_PT_SCE); + if (td->td_dbgflags & TDB_USERWR) { + /* + * Reread syscall number and arguments if + * debugger modified registers or memory. + */ + error = fetch_ia32_syscall_args(td, &sa); + if (error != 0) + goto retval; + td->td_retval[1] = frame->tf_rdx; + } - AUDIT_SYSCALL_ENTER(code, td); - error = (*callp->sy_call)(td, args64); + AUDIT_SYSCALL_ENTER(sa.code, td); + error = (*sa.callp->sy_call)(td, sa.args64); AUDIT_SYSCALL_EXIT(error, td); - } + /* Save the latest error return value. */ + td->td_errno = error; + } + retval: cpu_set_syscall_retval(td, error); /* @@ -201,14 +236,16 @@ ia32_syscall(struct trapframe *frame) * Check for misbehavior. */ WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (code >= 0 && code < SYS_MAXSYSCALL) ? freebsd32_syscallnames[code] : "???"); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + freebsd32_syscallnames[sa.code] : "???"); KASSERT(td->td_critnest == 0, ("System call %s returning in a critical section", - (code >= 0 && code < SYS_MAXSYSCALL) ? freebsd32_syscallnames[code] : "???")); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + freebsd32_syscallnames[sa.code] : "???")); KASSERT(td->td_locks == 0, ("System call %s returning with %d locks held", - (code >= 0 && code < SYS_MAXSYSCALL) ? freebsd32_syscallnames[code] : "???", - td->td_locks)); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + freebsd32_syscallnames[sa.code] : "???", td->td_locks)); /* * Handle reschedule and other end-of-syscall issues @@ -216,10 +253,10 @@ ia32_syscall(struct trapframe *frame) userret(td, frame); CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_proc->p_comm, code); + td->td_proc->p_pid, td->td_proc->p_comm, sa.code); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(code, error, td->td_retval[0]); + ktrsysret(sa.code, error, td->td_retval[0]); #endif /* @@ -227,7 +264,7 @@ ia32_syscall(struct trapframe *frame) * register set. If we ever support an emulation where this * is not the case, this code will need to be revisited. */ - STOPEVENT(p, S_SCX, code); + STOPEVENT(p, S_SCX, sa.code); PTRACESTOP_SC(p, td, S_PT_SCX); } Modified: stable/8/sys/i386/i386/trap.c ============================================================================== --- stable/8/sys/i386/i386/trap.c Sun Feb 7 10:51:17 2010 (r203607) +++ stable/8/sys/i386/i386/trap.c Sun Feb 7 11:37:38 2010 (r203608) @@ -971,97 +971,130 @@ dblfault_handler() panic("double fault"); } -/* - * syscall - system call request C handler - * - * A system call is essentially treated as a trap. - */ -void -syscall(struct trapframe *frame) -{ - caddr_t params; +struct syscall_args { + u_int code; struct sysent *callp; - struct thread *td = curthread; - struct proc *p = td->td_proc; - register_t orig_tf_eflags; - int error; - int narg; int args[8]; - u_int code; - ksiginfo_t ksi; + register_t *argp; + int narg; +}; - PCPU_INC(cnt.v_syscall); +static int +fetch_syscall_args(struct thread *td, struct syscall_args *sa) +{ + struct proc *p; + struct trapframe *frame; + caddr_t params; + int error; -#ifdef DIAGNOSTIC - if (ISPL(frame->tf_cs) != SEL_UPL) { - panic("syscall"); - /* NOT REACHED */ - } -#endif + p = td->td_proc; + frame = td->td_frame; - td->td_pticks = 0; - td->td_frame = frame; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); params = (caddr_t)frame->tf_esp + sizeof(int); - code = frame->tf_eax; - orig_tf_eflags = frame->tf_eflags; + sa->code = frame->tf_eax; if (p->p_sysent->sv_prepsyscall) { - (*p->p_sysent->sv_prepsyscall)(frame, args, &code, ¶ms); + (*p->p_sysent->sv_prepsyscall)(frame, sa->args, &sa->code, + ¶ms); } else { /* * Need to check if this is a 32 bit or 64 bit syscall. */ - if (code == SYS_syscall) { + if (sa->code == SYS_syscall) { /* * Code is first argument, followed by actual args. */ - code = fuword(params); + sa->code = fuword(params); params += sizeof(int); - } else if (code == SYS___syscall) { + } else if (sa->code == SYS___syscall) { /* * Like syscall, but code is a quad, so as to maintain * quad alignment for the rest of the arguments. */ - code = fuword(params); + sa->code = fuword(params); params += sizeof(quad_t); } } if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; - - if (code >= p->p_sysent->sv_size) - callp = &p->p_sysent->sv_table[0]; + sa->code &= p->p_sysent->sv_mask; + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; else - callp = &p->p_sysent->sv_table[code]; + sa->callp = &p->p_sysent->sv_table[sa->code]; + sa->narg = sa->callp->sy_narg; - narg = callp->sy_narg; - - if (params != NULL && narg != 0) - error = copyin(params, (caddr_t)args, - (u_int)(narg * sizeof(int))); + if (params != NULL && sa->narg != 0) + error = copyin(params, (caddr_t)sa->args, + (u_int)(sa->narg * sizeof(int))); else error = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(code, narg, args); + ktrsyscall(sa->code, sa->narg, sa->args); #endif + return (error); +} - CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, code); +/* + * syscall - system call request C handler + * + * A system call is essentially treated as a trap. + */ +void +syscall(struct trapframe *frame) +{ + struct thread *td; + struct proc *p; + struct syscall_args sa; + register_t orig_tf_eflags; + int error; + ksiginfo_t ksi; + PCPU_INC(cnt.v_syscall); + td = curthread; + p = td->td_proc; td->td_syscalls++; +#ifdef DIAGNOSTIC + if (ISPL(frame->tf_cs) != SEL_UPL) { + panic("syscall"); + /* NOT REACHED */ + } +#endif + + td->td_pticks = 0; + td->td_frame = frame; + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); + orig_tf_eflags = frame->tf_eflags; + if (p->p_flag & P_TRACED) { + PROC_LOCK(p); + td->td_dbgflags &= ~TDB_USERWR; + PROC_UNLOCK(p); + } + error = fetch_syscall_args(td, &sa); + + CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, + td->td_proc->p_pid, td->td_name, sa.code); + if (error == 0) { td->td_retval[0] = 0; td->td_retval[1] = frame->tf_edx; - STOPEVENT(p, S_SCE, narg); - + STOPEVENT(p, S_SCE, sa.narg); PTRACESTOP_SC(p, td, S_PT_SCE); + if (td->td_dbgflags & TDB_USERWR) { + /* + * Reread syscall number and arguments if + * debugger modified registers or memory. + */ + error = fetch_syscall_args(td, &sa); + if (error != 0) + goto retval; + td->td_retval[1] = frame->tf_edx; + } #ifdef KDTRACE_HOOKS /* @@ -1069,13 +1102,13 @@ syscall(struct trapframe *frame) * callback and if there is a probe active for the * syscall 'entry', process the probe. */ - if (systrace_probe_func != NULL && callp->sy_entry != 0) - (*systrace_probe_func)(callp->sy_entry, code, callp, - args); + if (systrace_probe_func != NULL && sa.callp->sy_entry != 0) + (*systrace_probe_func)(sa.callp->sy_entry, sa.code, + sa.callp, sa.args); #endif - AUDIT_SYSCALL_ENTER(code, td); - error = (*callp->sy_call)(td, args); + AUDIT_SYSCALL_ENTER(sa.code, td); + error = (*sa.callp->sy_call)(td, sa.args); AUDIT_SYSCALL_EXIT(error, td); /* Save the latest error return value. */ @@ -1087,12 +1120,12 @@ syscall(struct trapframe *frame) * callback and if there is a probe active for the * syscall 'return', process the probe. */ - if (systrace_probe_func != NULL && callp->sy_return != 0) - (*systrace_probe_func)(callp->sy_return, code, callp, - args); + if (systrace_probe_func != NULL && sa.callp->sy_return != 0) + (*systrace_probe_func)(sa.callp->sy_return, sa.code, + sa.callp, sa.args); #endif } - + retval: cpu_set_syscall_retval(td, error); /* @@ -1111,14 +1144,16 @@ syscall(struct trapframe *frame) * Check for misbehavior. */ WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???"); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???"); KASSERT(td->td_critnest == 0, ("System call %s returning in a critical section", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???")); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???")); KASSERT(td->td_locks == 0, ("System call %s returning with %d locks held", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???", - td->td_locks)); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???", td->td_locks)); /* * Handle reschedule and other end-of-syscall issues @@ -1126,11 +1161,11 @@ syscall(struct trapframe *frame) userret(td, frame); CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, - td->td_proc->p_pid, td->td_name, code); + td->td_proc->p_pid, td->td_name, sa.code); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(code, error, td->td_retval[0]); + ktrsysret(sa.code, error, td->td_retval[0]); #endif /* @@ -1138,7 +1173,7 @@ syscall(struct trapframe *frame) * register set. If we ever support an emulation where this * is not the case, this code will need to be revisited. */ - STOPEVENT(p, S_SCX, code); + STOPEVENT(p, S_SCX, sa.code); PTRACESTOP_SC(p, td, S_PT_SCX); } Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Sun Feb 7 10:51:17 2010 (r203607) +++ stable/8/sys/kern/sys_process.c Sun Feb 7 11:37:38 2010 (r203608) @@ -809,6 +809,7 @@ kern_ptrace(struct thread *td, int req, case PT_WRITE_I: case PT_WRITE_D: + td2->td_dbgflags |= TDB_USERWR; write = 1; /* FALLTHROUGH */ case PT_READ_I: @@ -877,6 +878,7 @@ kern_ptrace(struct thread *td, int req, break; case PIOD_WRITE_D: case PIOD_WRITE_I: + td2->td_dbgflags |= TDB_USERWR; uio.uio_rw = UIO_WRITE; break; default: @@ -899,6 +901,7 @@ kern_ptrace(struct thread *td, int req, goto sendsig; /* in PT_CONTINUE above */ case PT_SETREGS: + td2->td_dbgflags |= TDB_USERWR; error = PROC_WRITE(regs, td2, addr); break; @@ -907,6 +910,7 @@ kern_ptrace(struct thread *td, int req, break; case PT_SETFPREGS: + td2->td_dbgflags |= TDB_USERWR; error = PROC_WRITE(fpregs, td2, addr); break; @@ -915,6 +919,7 @@ kern_ptrace(struct thread *td, int req, break; case PT_SETDBREGS: + td2->td_dbgflags |= TDB_USERWR; error = PROC_WRITE(dbregs, td2, addr); break; Modified: stable/8/sys/sys/proc.h ============================================================================== --- stable/8/sys/sys/proc.h Sun Feb 7 10:51:17 2010 (r203607) +++ stable/8/sys/sys/proc.h Sun Feb 7 11:37:38 2010 (r203608) @@ -343,6 +343,7 @@ do { \ /* Userland debug flags */ #define TDB_SUSPEND 0x00000001 /* Thread is suspended by debugger */ #define TDB_XSIG 0x00000002 /* Thread is exchanging signal under trace */ +#define TDB_USERWR 0x00000004 /* Debugger modified memory or registers */ /* * "Private" flags kept in td_pflags: From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 11:59:55 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD6E6106566B; Sun, 7 Feb 2010 11:59:55 +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 CD28D8FC08; Sun, 7 Feb 2010 11:59:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17BxtcW013470; Sun, 7 Feb 2010 11:59:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17BxtZF013468; Sun, 7 Feb 2010 11:59:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002071159.o17BxtZF013468@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Feb 2010 11:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203609 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 11:59:56 -0000 Author: marius Date: Sun Feb 7 11:59:55 2010 New Revision: 203609 URL: http://svn.freebsd.org/changeset/base/203609 Log: MFC: r202900 Merge r203608 from amd64/i386: In syscall(), reread syscall number and arguments after ptracestop(), if debugger modified anything in the process environment. Modified: stable/8/sys/sparc64/sparc64/trap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/trap.c Sun Feb 7 11:37:38 2010 (r203608) +++ stable/8/sys/sparc64/sparc64/trap.c Sun Feb 7 11:59:55 2010 (r203609) @@ -93,9 +93,18 @@ __FBSDID("$FreeBSD$"); #include #include +struct syscall_args { + u_long code; + struct sysent *callp; + register_t args[8]; + register_t *argp; + int narg; +}; + void trap(struct trapframe *tf); void syscall(struct trapframe *tf); +static int fetch_syscall_args(struct thread *td, struct syscall_args *sa); static int trap_pfault(struct thread *td, struct trapframe *tf); extern char copy_fault[]; @@ -525,137 +534,163 @@ trap_pfault(struct thread *td, struct tr /* Maximum number of arguments that can be passed via the out registers. */ #define REG_MAXARGS 6 -/* - * Syscall handler. The arguments to the syscall are passed in the o registers - * by the caller, and are saved in the trap frame. The syscall number is passed - * in %g1 (and also saved in the trap frame). - */ -void -syscall(struct trapframe *tf) +static int +fetch_syscall_args(struct thread *td, struct syscall_args *sa) { - struct sysent *callp; - struct thread *td; - register_t args[8]; - register_t *argp; + struct trapframe *tf; struct proc *p; - u_long code; int reg; int regcnt; - int narg; int error; - td = curthread; - KASSERT(td != NULL, ("trap: curthread NULL")); - KASSERT(td->td_proc != NULL, ("trap: curproc NULL")); - p = td->td_proc; - - PCPU_INC(cnt.v_syscall); - - td->td_pticks = 0; - td->td_frame = tf; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); - code = tf->tf_global[1]; - - /* - * For syscalls, we don't want to retry the faulting instruction - * (usually), instead we need to advance one instruction. - */ - td->td_pcb->pcb_tpc = tf->tf_tpc; - TF_DONE(tf); - + tf = td->td_frame; reg = 0; regcnt = REG_MAXARGS; + + sa->code = tf->tf_global[1]; + if (p->p_sysent->sv_prepsyscall) { - /* - * The prep code is MP aware. - */ #if 0 - (*p->p_sysent->sv_prepsyscall)(tf, args, &code, ¶ms); + (*p->p_sysent->sv_prepsyscall)(tf, sa->args, &sa->code, + ¶ms); #endif - } else if (code == SYS_syscall || code == SYS___syscall) { - code = tf->tf_out[reg++]; + } else if (sa->code == SYS_syscall || sa->code == SYS___syscall) { + sa->code = tf->tf_out[reg++]; regcnt--; } if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; + sa->code &= p->p_sysent->sv_mask; - if (code >= p->p_sysent->sv_size) - callp = &p->p_sysent->sv_table[0]; + if (sa->code >= p->p_sysent->sv_size) + sa->callp = &p->p_sysent->sv_table[0]; else - callp = &p->p_sysent->sv_table[code]; - - narg = callp->sy_narg; + sa->callp = &p->p_sysent->sv_table[sa->code]; - KASSERT(narg <= sizeof(args) / sizeof(args[0]), + sa->narg = sa->callp->sy_narg; + KASSERT(sa->narg <= sizeof(sa->args) / sizeof(sa->args[0]), ("Too many syscall arguments!")); error = 0; - argp = args; - bcopy(&tf->tf_out[reg], args, sizeof(args[0]) * regcnt); - if (narg > regcnt) + sa->argp = sa->args; + bcopy(&tf->tf_out[reg], sa->args, sizeof(sa->args[0]) * regcnt); + if (sa->narg > regcnt) error = copyin((void *)(tf->tf_out[6] + SPOFF + - offsetof(struct frame, fr_pad[6])), - &args[regcnt], (narg - regcnt) * sizeof(args[0])); - - CTR5(KTR_SYSC, "syscall: td=%p %s(%#lx, %#lx, %#lx)", td, - syscallnames[code], argp[0], argp[1], argp[2]); + offsetof(struct frame, fr_pad[6])), &sa->args[regcnt], + (sa->narg - regcnt) * sizeof(sa->args[0])); + /* + * This may result in two records if debugger modified + * registers or memory during sleep at stop/ptrace point. + */ #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(code, narg, argp); + ktrsyscall(sa->code, sa->narg, sa->argp); #endif + return (error); +} +/* + * Syscall handler + * The arguments to the syscall are passed in the out registers by the caller, + * and are saved in the trap frame. The syscall number is passed in %g1 (and + * also saved in the trap frame). + */ +void +syscall(struct trapframe *tf) +{ + struct syscall_args sa; + struct thread *td; + struct proc *p; + int error; + + td = curthread; + KASSERT(td != NULL, ("trap: curthread NULL")); + KASSERT(td->td_proc != NULL, ("trap: curproc NULL")); + + PCPU_INC(cnt.v_syscall); + p = td->td_proc; td->td_syscalls++; + td->td_pticks = 0; + td->td_frame = tf; + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); + if ((p->p_flag & P_TRACED) != 0) { + PROC_LOCK(p); + td->td_dbgflags &= ~TDB_USERWR; + PROC_UNLOCK(p); + } + + /* + * For syscalls, we don't want to retry the faulting instruction + * (usually), instead we need to advance one instruction. + */ + td->td_pcb->pcb_tpc = tf->tf_tpc; + TF_DONE(tf); + + error = fetch_syscall_args(td, &sa); + CTR5(KTR_SYSC, "syscall: td=%p %s(%#lx, %#lx, %#lx)", td, + syscallnames[sa.code], sa.argp[0], sa.argp[1], sa.argp[2]); + if (error == 0) { td->td_retval[0] = 0; td->td_retval[1] = 0; - STOPEVENT(p, S_SCE, narg); /* MP aware */ - + STOPEVENT(p, S_SCE, sa.narg); PTRACESTOP_SC(p, td, S_PT_SCE); + if ((td->td_dbgflags & TDB_USERWR) != 0) { + /* + * Reread syscall number and arguments if + * debugger modified registers or memory. + */ + error = fetch_syscall_args(td, &sa); + if (error != 0) + goto retval; + td->td_retval[1] = 0; + } - AUDIT_SYSCALL_ENTER(code, td); - error = (*callp->sy_call)(td, argp); + AUDIT_SYSCALL_ENTER(sa.code, td); + error = (*sa.callp->sy_call)(td, sa.argp); AUDIT_SYSCALL_EXIT(error, td); - CTR5(KTR_SYSC, "syscall: p=%p error=%d %s return %#lx %#lx ", p, - error, syscallnames[code], td->td_retval[0], + CTR5(KTR_SYSC, "syscall: p=%p error=%d %s return %#lx %#lx", + p, error, syscallnames[sa.code], td->td_retval[0], td->td_retval[1]); } - + retval: cpu_set_syscall_retval(td, error); /* * Check for misbehavior. */ WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???"); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???"); KASSERT(td->td_critnest == 0, ("System call %s returning in a critical section", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???")); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???")); KASSERT(td->td_locks == 0, ("System call %s returning with %d locks held", - (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???", - td->td_locks)); + (sa.code >= 0 && sa.code < SYS_MAXSYSCALL) ? + syscallnames[sa.code] : "???", td->td_locks)); /* - * Handle reschedule and other end-of-syscall issues + * Handle reschedule and other end-of-syscall issues. */ userret(td, tf); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(code, error, td->td_retval[0]); + ktrsysret(sa.code, error, td->td_retval[0]); #endif /* * This works because errno is findable through the * register set. If we ever support an emulation where this * is not the case, this code will need to be revisited. */ - STOPEVENT(p, S_SCX, code); + STOPEVENT(p, S_SCX, sa.code); PTRACESTOP_SC(p, td, S_PT_SCX); } From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 16:55:45 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D03C6106566C; Sun, 7 Feb 2010 16:55:45 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C068B8FC08; Sun, 7 Feb 2010 16:55:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17GtjWW078414; Sun, 7 Feb 2010 16:55:45 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17GtjWr078412; Sun, 7 Feb 2010 16:55:45 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002071655.o17GtjWr078412@svn.freebsd.org> From: Ruslan Ermilov Date: Sun, 7 Feb 2010 16:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203612 - stable/7/sbin/ifconfig X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 16:55:45 -0000 Author: ru Date: Sun Feb 7 16:55:45 2010 New Revision: 203612 URL: http://svn.freebsd.org/changeset/base/203612 Log: MFC: r203486: Shortening a passphrase caused wrong authentication key to be used. Approved by: re (kib) Modified: stable/7/sbin/ifconfig/ifcarp.c Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifcarp.c ============================================================================== --- stable/7/sbin/ifconfig/ifcarp.c Sun Feb 7 15:42:15 2010 (r203611) +++ stable/7/sbin/ifconfig/ifcarp.c Sun Feb 7 16:55:45 2010 (r203612) @@ -96,6 +96,7 @@ setcarp_passwd(const char *val, int d, i if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1) err(1, "SIOCGVH"); + memset(carpr.carpr_key, 0, sizeof(carpr.carpr_key)); /* XXX Should hash the password into the key here, perhaps? */ strlcpy(carpr.carpr_key, val, CARP_KEY_LEN); From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 20:26:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18F99106566C; Sun, 7 Feb 2010 20:26:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E27138FC12; Sun, 7 Feb 2010 20:26:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17KQjpu025809; Sun, 7 Feb 2010 20:26:45 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17KQj8h025804; Sun, 7 Feb 2010 20:26:45 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201002072026.o17KQj8h025804@svn.freebsd.org> From: Doug Barton Date: Sun, 7 Feb 2010 20:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203634 - in stable/8/lib/bind/dns: . dns X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 20:26:46 -0000 Author: dougb Date: Sun Feb 7 20:26:45 2010 New Revision: 203634 URL: http://svn.freebsd.org/changeset/base/203634 Log: MFC 202960: Copyright-only changes to generated files as part of the 9.6.1-P3 update Modified: stable/8/lib/bind/dns/code.h stable/8/lib/bind/dns/dns/enumclass.h stable/8/lib/bind/dns/dns/enumtype.h stable/8/lib/bind/dns/dns/rdatastruct.h Directory Properties: stable/8/lib/bind/ (props changed) Modified: stable/8/lib/bind/dns/code.h ============================================================================== --- stable/8/lib/bind/dns/code.h Sun Feb 7 20:01:52 2010 (r203633) +++ stable/8/lib/bind/dns/code.h Sun Feb 7 20:26:45 2010 (r203634) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any Modified: stable/8/lib/bind/dns/dns/enumclass.h ============================================================================== --- stable/8/lib/bind/dns/dns/enumclass.h Sun Feb 7 20:01:52 2010 (r203633) +++ stable/8/lib/bind/dns/dns/enumclass.h Sun Feb 7 20:26:45 2010 (r203634) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any Modified: stable/8/lib/bind/dns/dns/enumtype.h ============================================================================== --- stable/8/lib/bind/dns/dns/enumtype.h Sun Feb 7 20:01:52 2010 (r203633) +++ stable/8/lib/bind/dns/dns/enumtype.h Sun Feb 7 20:26:45 2010 (r203634) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any Modified: stable/8/lib/bind/dns/dns/rdatastruct.h ============================================================================== --- stable/8/lib/bind/dns/dns/rdatastruct.h Sun Feb 7 20:01:52 2010 (r203633) +++ stable/8/lib/bind/dns/dns/rdatastruct.h Sun Feb 7 20:26:45 2010 (r203634) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 20:28:25 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 788431065679; Sun, 7 Feb 2010 20:28:25 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 650C88FC1C; Sun, 7 Feb 2010 20:28:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17KSPYU026226; Sun, 7 Feb 2010 20:28:25 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17KSPVN026213; Sun, 7 Feb 2010 20:28:25 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201002072028.o17KSPVN026213@svn.freebsd.org> From: Doug Barton Date: Sun, 7 Feb 2010 20:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203635 - in stable/8/contrib/bind9: . bin/dnssec bin/named doc/arm lib/dns lib/dns/include/dns lib/lwres/man X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 20:28:25 -0000 Author: dougb Date: Sun Feb 7 20:28:24 2010 New Revision: 203635 URL: http://svn.freebsd.org/changeset/base/203635 Log: MFC 202961: Upgrade to BIND 9.6.1-P3. This version address the following vulnerabilities: BIND 9 Cache Update from Additional Section https://www.isc.org/advisories/CVE-2009-4022v6 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-4022 A nameserver with DNSSEC validation enabled may incorrectly add unauthenticated records to its cache that are received during the resolution of a recursive client query BIND 9 DNSSEC validation code could cause bogus NXDOMAIN responses https://www.isc.org/advisories/CVE-2010-0097 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-0097 There was an error in the DNSSEC NSEC/NSEC3 validation code that could cause bogus NXDOMAIN responses (that is, NXDOMAIN responses for records proven by NSEC or NSEC3 to exist) to be cached as if they had validated correctly These issues only affect systems with DNSSEC validation enabled. Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/FAQ stable/8/contrib/bind9/FAQ.xml stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.8 stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.html stable/8/contrib/bind9/bin/named/query.c stable/8/contrib/bind9/doc/arm/Bv9ARM.pdf stable/8/contrib/bind9/doc/arm/man.dnssec-signzone.html stable/8/contrib/bind9/doc/arm/man.named-checkconf.html stable/8/contrib/bind9/doc/arm/man.named-checkzone.html stable/8/contrib/bind9/doc/arm/man.named.html stable/8/contrib/bind9/doc/arm/man.nsupdate.html stable/8/contrib/bind9/doc/arm/man.rndc-confgen.html stable/8/contrib/bind9/doc/arm/man.rndc.conf.html stable/8/contrib/bind9/doc/arm/man.rndc.html stable/8/contrib/bind9/lib/dns/include/dns/db.h stable/8/contrib/bind9/lib/dns/include/dns/ncache.h stable/8/contrib/bind9/lib/dns/include/dns/types.h stable/8/contrib/bind9/lib/dns/rbtdb.c stable/8/contrib/bind9/lib/dns/resolver.c stable/8/contrib/bind9/lib/dns/validator.c stable/8/contrib/bind9/lib/lwres/man/lwres.html stable/8/contrib/bind9/lib/lwres/man/lwres_buffer.html stable/8/contrib/bind9/lib/lwres/man/lwres_config.html stable/8/contrib/bind9/lib/lwres/man/lwres_context.html stable/8/contrib/bind9/lib/lwres/man/lwres_gabn.html stable/8/contrib/bind9/lib/lwres/man/lwres_gai_strerror.html stable/8/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.html stable/8/contrib/bind9/lib/lwres/man/lwres_gethostent.html stable/8/contrib/bind9/lib/lwres/man/lwres_getipnode.html stable/8/contrib/bind9/lib/lwres/man/lwres_getnameinfo.html stable/8/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.html stable/8/contrib/bind9/lib/lwres/man/lwres_gnba.html stable/8/contrib/bind9/lib/lwres/man/lwres_hstrerror.html stable/8/contrib/bind9/lib/lwres/man/lwres_inetntop.html stable/8/contrib/bind9/lib/lwres/man/lwres_noop.html stable/8/contrib/bind9/lib/lwres/man/lwres_packet.html stable/8/contrib/bind9/lib/lwres/man/lwres_resutil.html stable/8/contrib/bind9/version Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/CHANGES Sun Feb 7 20:28:24 2010 (r203635) @@ -1,3 +1,15 @@ + --- 9.6.1-P3 released --- + +2831. [security] Do not attempt to validate or cache + out-of-bailiwick data returned with a secure + answer; it must be re-fetched from its original + source and validated in that context. [RT #20819] + +2828. [security] Cached CNAME or DNAME RR could be returned to clients + without DNSSEC validation. [RT #20737] + +2827. [security] Bogus NXDOMAIN could be cached as if valid. [RT #20712] + --- 9.6.1-P2 released --- 2772. [security] When validating, track whether pending data was from Modified: stable/8/contrib/bind9/FAQ ============================================================================== --- stable/8/contrib/bind9/FAQ Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/FAQ Sun Feb 7 20:28:24 2010 (r203635) @@ -153,24 +153,29 @@ A: BIND 9.3 and later: Use TSIG to selec Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { - match-clients { !key external; 10.0.1/24; }; + match-clients { !key external; // reject message ment for the + // external view. + 10.0.1/24; }; // accept from these addresses. ... }; view "external" { match-clients { key external; any; }; - server 10.0.1.2 { keys external; }; + server 10.0.1.2 { keys external; }; // tag messages from the + // external view to the + // other servers for the + // view. recursion no; ... }; Slave 10.0.1.2: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { match-clients { !key external; 10.0.1/24; }; @@ -220,13 +225,13 @@ A: You choose one view to be master and Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; key "mykey" { - algorithm hmac-md5; - secret "yyyyyyyy"; + algorithm hmac-sha256; + secret "yyyyyyyyyyyyyyyyyyyyyyyy"; }; view "internal" { @@ -239,7 +244,7 @@ A: You choose one view to be master and type master; file "internal/example.db"; allow-update { key mykey; }; - notify-also { 10.0.1.1; }; + also-notify { 10.0.1.1; }; }; }; @@ -249,7 +254,7 @@ A: You choose one view to be master and type slave; file "external/example.db"; masters { 10.0.1.1; }; - transfer-source { 10.0.1.1; }; + transfer-source 10.0.1.1; // allow-update-forwarding { any; }; // allow-notify { ... }; }; Modified: stable/8/contrib/bind9/FAQ.xml ============================================================================== --- stable/8/contrib/bind9/FAQ.xml Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/FAQ.xml Sun Feb 7 20:28:24 2010 (r203635) @@ -17,7 +17,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> - +
Frequently Asked Questions about BIND 9 @@ -319,24 +319,29 @@ Slave: 10.0.1.3 (internal), 10.0.1.4 (ex Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { - match-clients { !key external; 10.0.1/24; }; + match-clients { !key external; // reject message ment for the + // external view. + 10.0.1/24; }; // accept from these addresses. ... }; view "external" { match-clients { key external; any; }; - server 10.0.1.2 { keys external; }; + server 10.0.1.2 { keys external; }; // tag messages from the + // external view to the + // other servers for the + // view. recursion no; ... }; Slave 10.0.1.2: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; view "internal" { match-clients { !key external; 10.0.1/24; }; @@ -424,13 +429,13 @@ named-checkzone example.com tmp Master 10.0.1.1: key "external" { - algorithm hmac-md5; - secret "xxxxxxxx"; + algorithm hmac-sha256; + secret "xxxxxxxxxxxxxxxxxxxxxxxx"; }; key "mykey" { - algorithm hmac-md5; - secret "yyyyyyyy"; + algorithm hmac-sha256; + secret "yyyyyyyyyyyyyyyyyyyyyyyy"; }; view "internal" { @@ -443,7 +448,7 @@ Master 10.0.1.1: type master; file "internal/example.db"; allow-update { key mykey; }; - notify-also { 10.0.1.1; }; + also-notify { 10.0.1.1; }; }; }; @@ -453,7 +458,7 @@ Master 10.0.1.1: type slave; file "external/example.db"; masters { 10.0.1.1; }; - transfer-source { 10.0.1.1; }; + transfer-source 10.0.1.1; // allow-update-forwarding { any; }; // allow-notify { ... }; }; Modified: stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.8 ============================================================================== --- stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.8 Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.8 Sun Feb 7 20:28:24 2010 (r203635) @@ -13,163 +13,287 @@ .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" -.\" $Id: dnssec-signzone.8,v 1.47.44.4 2009/06/09 01:47:19 each Exp $ +.\" $Id: dnssec-signzone.8,v 1.47.44.4.8.1 2009/12/31 23:17:46 tbox Exp $ .\" .hy 0 .ad l -.\"Generated by db2man.xsl. Don't modify this, modify the source. -.de Sh \" Subsection -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Ip \" List item -.br -.ie \\n(.$>=3 .ne \\$3 -.el .ne 3 -.IP "\\$1" \\$2 -.. -.TH "DNSSEC-SIGNZONE" 8 "June 08, 2009" "" "" -.SH NAME -dnssec-signzone \- DNSSEC zone signing tool +.\" Title: dnssec\-signzone +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.71.1 +.\" Date: June 08, 2009 +.\" Manual: BIND9 +.\" Source: BIND9 +.\" +.TH "DNSSEC\-SIGNZONE" "8" "June 08, 2009" "BIND9" "BIND9" +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.SH "NAME" +dnssec\-signzone \- DNSSEC zone signing tool .SH "SYNOPSIS" .HP 16 -\fBdnssec\-signzone\fR [\fB\-a\fR] [\fB\-c\ \fIclass\fR\fR] [\fB\-d\ \fIdirectory\fR\fR] [\fB\-e\ \fIend\-time\fR\fR] [\fB\-f\ \fIoutput\-file\fR\fR] [\fB\-g\fR] [\fB\-h\fR] [\fB\-k\ \fIkey\fR\fR] [\fB\-l\ \fIdomain\fR\fR] [\fB\-i\ \fIinterval\fR\fR] [\fB\-I\ \fIinput\-format\fR\fR] [\fB\-j\ \fIjitter\fR\fR] [\fB\-N\ \fIsoa\-serial\-format\fR\fR] [\fB\-o\ \fIorigin\fR\fR] [\fB\-O\ \fIoutput\-format\fR\fR] [\fB\-p\fR] [\fB\-r\ \fIrandomdev\fR\fR] [\fB\-s\ \fIstart\-time\fR\fR] [\fB\-t\fR] [\fB\-v\ \fIlevel\fR\fR] [\fB\-z\fR] [\fB\-3\ \fIsalt\fR\fR] [\fB\-H\ \fIiterations\fR\fR] [\fB\-A\fR] {zonefile} [key...] +\fBdnssec\-signzone\fR [\fB\-a\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-d\ \fR\fB\fIdirectory\fR\fR] [\fB\-e\ \fR\fB\fIend\-time\fR\fR] [\fB\-f\ \fR\fB\fIoutput\-file\fR\fR] [\fB\-g\fR] [\fB\-h\fR] [\fB\-k\ \fR\fB\fIkey\fR\fR] [\fB\-l\ \fR\fB\fIdomain\fR\fR] [\fB\-i\ \fR\fB\fIinterval\fR\fR] [\fB\-I\ \fR\fB\fIinput\-format\fR\fR] [\fB\-j\ \fR\fB\fIjitter\fR\fR] [\fB\-N\ \fR\fB\fIsoa\-serial\-format\fR\fR] [\fB\-o\ \fR\fB\fIorigin\fR\fR] [\fB\-O\ \fR\fB\fIoutput\-format\fR\fR] [\fB\-p\fR] [\fB\-r\ \fR\fB\fIrandomdev\fR\fR] [\fB\-s\ \fR\fB\fIstart\-time\fR\fR] [\fB\-t\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-z\fR] [\fB\-3\ \fR\fB\fIsalt\fR\fR] [\fB\-H\ \fR\fB\fIiterations\fR\fR] [\fB\-A\fR] {zonefile} [key...] .SH "DESCRIPTION" .PP -\fBdnssec\-signzone\fR signs a zone\&. It generates NSEC and RRSIG records and produces a signed version of the zone\&. The security status of delegations from the signed zone (that is, whether the child zones are secure or not) is determined by the presence or absence of a \fIkeyset\fR file for each child zone\&. +\fBdnssec\-signzone\fR +signs a zone. It generates NSEC and RRSIG records and produces a signed version of the zone. The security status of delegations from the signed zone (that is, whether the child zones are secure or not) is determined by the presence or absence of a +\fIkeyset\fR +file for each child zone. .SH "OPTIONS" -.TP +.PP \-a -Verify all generated signatures\&. -.TP +.RS 4 +Verify all generated signatures. +.RE +.PP \-c \fIclass\fR -Specifies the DNS class of the zone\&. -.TP +.RS 4 +Specifies the DNS class of the zone. +.RE +.PP \-k \fIkey\fR -Treat specified key as a key signing key ignoring any key flags\&. This option may be specified multiple times\&. -.TP +.RS 4 +Treat specified key as a key signing key ignoring any key flags. This option may be specified multiple times. +.RE +.PP \-l \fIdomain\fR -Generate a DLV set in addition to the key (DNSKEY) and DS sets\&. The domain is appended to the name of the records\&. -.TP +.RS 4 +Generate a DLV set in addition to the key (DNSKEY) and DS sets. The domain is appended to the name of the records. +.RE +.PP \-d \fIdirectory\fR -Look for \fIkeyset\fR files in \fBdirectory\fR as the directory -.TP +.RS 4 +Look for +\fIkeyset\fR +files in +\fBdirectory\fR +as the directory +.RE +.PP \-g -Generate DS records for child zones from keyset files\&. Existing DS records will be removed\&. -.TP +.RS 4 +Generate DS records for child zones from keyset files. Existing DS records will be removed. +.RE +.PP \-s \fIstart\-time\fR -Specify the date and time when the generated RRSIG records become valid\&. This can be either an absolute or relative time\&. An absolute start time is indicated by a number in YYYYMMDDHHMMSS notation; 20000530144500 denotes 14:45:00 UTC on May 30th, 2000\&. A relative start time is indicated by +N, which is N seconds from the current time\&. If no \fBstart\-time\fR is specified, the current time minus 1 hour (to allow for clock skew) is used\&. -.TP +.RS 4 +Specify the date and time when the generated RRSIG records become valid. This can be either an absolute or relative time. An absolute start time is indicated by a number in YYYYMMDDHHMMSS notation; 20000530144500 denotes 14:45:00 UTC on May 30th, 2000. A relative start time is indicated by +N, which is N seconds from the current time. If no +\fBstart\-time\fR +is specified, the current time minus 1 hour (to allow for clock skew) is used. +.RE +.PP \-e \fIend\-time\fR -Specify the date and time when the generated RRSIG records expire\&. As with \fBstart\-time\fR, an absolute time is indicated in YYYYMMDDHHMMSS notation\&. A time relative to the start time is indicated with +N, which is N seconds from the start time\&. A time relative to the current time is indicated with now+N\&. If no \fBend\-time\fR is specified, 30 days from the start time is used as a default\&. -.TP +.RS 4 +Specify the date and time when the generated RRSIG records expire. As with +\fBstart\-time\fR, an absolute time is indicated in YYYYMMDDHHMMSS notation. A time relative to the start time is indicated with +N, which is N seconds from the start time. A time relative to the current time is indicated with now+N. If no +\fBend\-time\fR +is specified, 30 days from the start time is used as a default. +.RE +.PP \-f \fIoutput\-file\fR -The name of the output file containing the signed zone\&. The default is to append \fI\&.signed\fR to the input filename\&. -.TP +.RS 4 +The name of the output file containing the signed zone. The default is to append +\fI.signed\fR +to the input filename. +.RE +.PP \-h -Prints a short summary of the options and arguments to \fBdnssec\-signzone\fR\&. -.TP +.RS 4 +Prints a short summary of the options and arguments to +\fBdnssec\-signzone\fR. +.RE +.PP \-i \fIinterval\fR -When a previously\-signed zone is passed as input, records may be resigned\&. The \fBinterval\fR option specifies the cycle interval as an offset from the current time (in seconds)\&. If a RRSIG record expires after the cycle interval, it is retained\&. Otherwise, it is considered to be expiring soon, and it will be replaced\&. -The default cycle interval is one quarter of the difference between the signature end and start times\&. So if neither \fBend\-time\fR or \fBstart\-time\fR are specified, \fBdnssec\-signzone\fR generates signatures that are valid for 30 days, with a cycle interval of 7\&.5 days\&. Therefore, if any existing RRSIG records are due to expire in less than 7\&.5 days, they would be replaced\&. -.TP +.RS 4 +When a previously\-signed zone is passed as input, records may be resigned. The +\fBinterval\fR +option specifies the cycle interval as an offset from the current time (in seconds). If a RRSIG record expires after the cycle interval, it is retained. Otherwise, it is considered to be expiring soon, and it will be replaced. +.sp +The default cycle interval is one quarter of the difference between the signature end and start times. So if neither +\fBend\-time\fR +or +\fBstart\-time\fR +are specified, +\fBdnssec\-signzone\fR +generates signatures that are valid for 30 days, with a cycle interval of 7.5 days. Therefore, if any existing RRSIG records are due to expire in less than 7.5 days, they would be replaced. +.RE +.PP \-I \fIinput\-format\fR -The format of the input zone file\&. Possible formats are \fB"text"\fR (default) and \fB"raw"\fR\&. This option is primarily intended to be used for dynamic signed zones so that the dumped zone file in a non\-text format containing updates can be signed directly\&. The use of this option does not make much sense for non\-dynamic zones\&. -.TP +.RS 4 +The format of the input zone file. Possible formats are +\fB"text"\fR +(default) and +\fB"raw"\fR. This option is primarily intended to be used for dynamic signed zones so that the dumped zone file in a non\-text format containing updates can be signed directly. The use of this option does not make much sense for non\-dynamic zones. +.RE +.PP \-j \fIjitter\fR -When signing a zone with a fixed signature lifetime, all RRSIG records issued at the time of signing expires simultaneously\&. If the zone is incrementally signed, i\&.e\&. a previously\-signed zone is passed as input to the signer, all expired signatures have to be regenerated at about the same time\&. The \fBjitter\fR option specifies a jitter window that will be used to randomize the signature expire time, thus spreading incremental signature regeneration over time\&. -Signature lifetime jitter also to some extent benefits validators and servers by spreading out cache expiration, i\&.e\&. if large numbers of RRSIGs don't expire at the same time from all caches there will be less congestion than if all validators need to refetch at mostly the same time\&. -.TP +.RS 4 +When signing a zone with a fixed signature lifetime, all RRSIG records issued at the time of signing expires simultaneously. If the zone is incrementally signed, i.e. a previously\-signed zone is passed as input to the signer, all expired signatures have to be regenerated at about the same time. The +\fBjitter\fR +option specifies a jitter window that will be used to randomize the signature expire time, thus spreading incremental signature regeneration over time. +.sp +Signature lifetime jitter also to some extent benefits validators and servers by spreading out cache expiration, i.e. if large numbers of RRSIGs don't expire at the same time from all caches there will be less congestion than if all validators need to refetch at mostly the same time. +.RE +.PP \-n \fIncpus\fR -Specifies the number of threads to use\&. By default, one thread is started for each detected CPU\&. -.TP +.RS 4 +Specifies the number of threads to use. By default, one thread is started for each detected CPU. +.RE +.PP \-N \fIsoa\-serial\-format\fR -The SOA serial number format of the signed zone\&. Possible formats are \fB"keep"\fR (default), \fB"increment"\fR and \fB"unixtime"\fR\&. -.RS -.TP +.RS 4 +The SOA serial number format of the signed zone. Possible formats are +\fB"keep"\fR +(default), +\fB"increment"\fR +and +\fB"unixtime"\fR. +.RS 4 +.PP \fB"keep"\fR -Do not modify the SOA serial number\&. -.TP +.RS 4 +Do not modify the SOA serial number. +.RE +.PP \fB"increment"\fR -Increment the SOA serial number using RFC 1982 arithmetics\&. -.TP +.RS 4 +Increment the SOA serial number using RFC 1982 arithmetics. +.RE +.PP \fB"unixtime"\fR -Set the SOA serial number to the number of seconds since epoch\&. +.RS 4 +Set the SOA serial number to the number of seconds since epoch. .RE -.IP -.TP +.RE +.RE +.PP \-o \fIorigin\fR -The zone origin\&. If not specified, the name of the zone file is assumed to be the origin\&. -.TP +.RS 4 +The zone origin. If not specified, the name of the zone file is assumed to be the origin. +.RE +.PP \-O \fIoutput\-format\fR -The format of the output file containing the signed zone\&. Possible formats are \fB"text"\fR (default) and \fB"raw"\fR\&. -.TP +.RS 4 +The format of the output file containing the signed zone. Possible formats are +\fB"text"\fR +(default) and +\fB"raw"\fR. +.RE +.PP \-p -Use pseudo\-random data when signing the zone\&. This is faster, but less secure, than using real random data\&. This option may be useful when signing large zones or when the entropy source is limited\&. -.TP +.RS 4 +Use pseudo\-random data when signing the zone. This is faster, but less secure, than using real random data. This option may be useful when signing large zones or when the entropy source is limited. +.RE +.PP \-r \fIrandomdev\fR -Specifies the source of randomness\&. If the operating system does not provide a \fI/dev/random\fR or equivalent device, the default source of randomness is keyboard input\&. \fIrandomdev\fR specifies the name of a character device or file containing random data to be used instead of the default\&. The special value \fIkeyboard\fR indicates that keyboard input should be used\&. -.TP +.RS 4 +Specifies the source of randomness. If the operating system does not provide a +\fI/dev/random\fR +or equivalent device, the default source of randomness is keyboard input. +\fIrandomdev\fR +specifies the name of a character device or file containing random data to be used instead of the default. The special value +\fIkeyboard\fR +indicates that keyboard input should be used. +.RE +.PP \-t -Print statistics at completion\&. -.TP +.RS 4 +Print statistics at completion. +.RE +.PP \-v \fIlevel\fR -Sets the debugging level\&. -.TP +.RS 4 +Sets the debugging level. +.RE +.PP \-z -Ignore KSK flag on key when determining what to sign\&. -.TP +.RS 4 +Ignore KSK flag on key when determining what to sign. +.RE +.PP \-3 \fIsalt\fR -Generate a NSEC3 chain with the given hex encoded salt\&. A dash (\fIsalt\fR) can be used to indicate that no salt is to be used when generating the NSEC3 chain\&. -.TP +.RS 4 +Generate a NSEC3 chain with the given hex encoded salt. A dash (\fIsalt\fR) can be used to indicate that no salt is to be used when generating the NSEC3 chain. +.RE +.PP \-H \fIiterations\fR -When generating a NSEC3 chain use this many interations\&. The default is 100\&. -.TP +.RS 4 +When generating a NSEC3 chain use this many interations. The default is 100. +.RE +.PP \-A -When generating a NSEC3 chain set the OPTOUT flag on all NSEC3 records and do not generate NSEC3 records for insecure delegations\&. -.TP +.RS 4 +When generating a NSEC3 chain set the OPTOUT flag on all NSEC3 records and do not generate NSEC3 records for insecure delegations. +.RE +.PP zonefile -The file containing the zone to be signed\&. -.TP +.RS 4 +The file containing the zone to be signed. +.RE +.PP key -Specify which keys should be used to sign the zone\&. If no keys are specified, then the zone will be examined for DNSKEY records at the zone apex\&. If these are found and there are matching private keys, in the current directory, then these will be used for signing\&. +.RS 4 +Specify which keys should be used to sign the zone. If no keys are specified, then the zone will be examined for DNSKEY records at the zone apex. If these are found and there are matching private keys, in the current directory, then these will be used for signing. +.RE .SH "EXAMPLE" .PP -The following command signs the \fBexample\&.com\fR zone with the DSA key generated by \fBdnssec\-keygen\fR (Kexample\&.com\&.+003+17247)\&. The zone's keys must be in the master file (\fIdb\&.example\&.com\fR)\&. This invocation looks for \fIkeyset\fR files, in the current directory, so that DS records can be generated from them (\fB\-g\fR)\&. +The following command signs the +\fBexample.com\fR +zone with the DSA key generated by +\fBdnssec\-keygen\fR +(Kexample.com.+003+17247). The zone's keys must be in the master file (\fIdb.example.com\fR). This invocation looks for +\fIkeyset\fR +files, in the current directory, so that DS records can be generated from them (\fB\-g\fR). +.sp +.RS 4 .nf -% dnssec\-signzone \-g \-o example\&.com db\&.example\&.com \\ -Kexample\&.com\&.+003+17247 -db\&.example\&.com\&.signed +% dnssec\-signzone \-g \-o example.com db.example.com \\ +Kexample.com.+003+17247 +db.example.com.signed % .fi +.RE .PP -In the above example, \fBdnssec\-signzone\fR creates the file \fIdb\&.example\&.com\&.signed\fR\&. This file should be referenced in a zone statement in a \fInamed\&.conf\fR file\&. -.PP -This example re\-signs a previously signed zone with default parameters\&. The private keys are assumed to be in the current directory\&. +In the above example, +\fBdnssec\-signzone\fR +creates the file +\fIdb.example.com.signed\fR. This file should be referenced in a zone statement in a +\fInamed.conf\fR +file. +.PP +This example re\-signs a previously signed zone with default parameters. The private keys are assumed to be in the current directory. +.sp +.RS 4 .nf -% cp db\&.example\&.com\&.signed db\&.example\&.com -% dnssec\-signzone \-o example\&.com db\&.example\&.com -db\&.example\&.com\&.signed +% cp db.example.com.signed db.example.com +% dnssec\-signzone \-o example.com db.example.com +db.example.com.signed % .fi +.RE .SH "KNOWN BUGS" .PP - \fBdnssec\-signzone\fR was designed so that it could sign a zone partially, using only a subset of the DNSSEC keys needed to produce a fully\-signed zone\&. This permits a zone administrator, for example, to sign a zone with one key on one machine, move the resulting partially\-signed zone to a second machine, and sign it again with a second key\&. -.PP -An unfortunate side\-effect of this flexibility is that \fBdnssec\-signzone\fR does not check to make sure it's signing a zone with any valid keys at all\&. An attempt to sign a zone without any keys will appear to succeed, producing a "signed" zone with no signatures\&. There is no warning issued when a zone is not fully signed\&. +\fBdnssec\-signzone\fR +was designed so that it could sign a zone partially, using only a subset of the DNSSEC keys needed to produce a fully\-signed zone. This permits a zone administrator, for example, to sign a zone with one key on one machine, move the resulting partially\-signed zone to a second machine, and sign it again with a second key. .PP -This will be corrected in a future release\&. In the meantime, ISC recommends examining the output of \fBdnssec\-signzone\fR to confirm that the zone is properly signed by all keys before using it\&. +An unfortunate side\-effect of this flexibility is that +\fBdnssec\-signzone\fR +does not check to make sure it's signing a zone with any valid keys at all. An attempt to sign a zone without any keys will appear to succeed, producing a "signed" zone with no signatures. There is no warning issued when a zone is not fully signed. +.PP +This will be corrected in a future release. In the meantime, ISC recommends examining the output of +\fBdnssec\-signzone\fR +to confirm that the zone is properly signed by all keys before using it. .SH "SEE ALSO" .PP -\fBdnssec\-keygen\fR(8), BIND 9 Administrator Reference Manual, RFC 4033\&. +\fBdnssec\-keygen\fR(8), +BIND 9 Administrator Reference Manual, +RFC 4033. .SH "AUTHOR" .PP -Internet Systems Consortium +Internet Systems Consortium +.SH "COPYRIGHT" +Copyright \(co 2004\-2009 Internet Systems Consortium, Inc. ("ISC") +.br +Copyright \(co 2000\-2003 Internet Software Consortium. +.br Modified: stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.html ============================================================================== --- stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,12 +14,12 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + dnssec-signzone - +
@@ -32,7 +32,7 @@

dnssec-signzone [-a] [-c class] [-d directory] [-e end-time] [-f output-file] [-g] [-h] [-k key] [-l domain] [-i interval] [-I input-format] [-j jitter] [-N soa-seria l-format] [-o origin] [-O output-format] [-p] [-r randomdev] [-s start-time] [-t] [-v level] [-z] [-3 salt] [-H iterations] [-A] {zonefile} [key...]

-

DESCRIPTION

+

DESCRIPTION

dnssec-signzone signs a zone. It generates NSEC and RRSIG records and produces a signed version of the @@ -43,7 +43,7 @@

-

OPTIONS

+

OPTIONS

-a

@@ -258,7 +258,7 @@

-

EXAMPLE

+

EXAMPLE

The following command signs the example.com zone with the DSA key generated by dnssec-keygen @@ -287,7 +287,7 @@ db.example.com.signed %

-

KNOWN BUGS

+

KNOWN BUGS

dnssec-signzone was designed so that it could sign a zone partially, using only a subset of the DNSSEC keys @@ -312,14 +312,14 @@ db.example.com.signed

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), BIND 9 Administrator Reference Manual, RFC 4033.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: stable/8/contrib/bind9/bin/named/query.c ============================================================================== --- stable/8/contrib/bind9/bin/named/query.c Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/bin/named/query.c Sun Feb 7 20:28:24 2010 (r203635) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.313.20.7.12.1 2009/11/18 23:58:04 marka Exp $ */ +/* $Id: query.c,v 1.313.20.7.12.4 2009/12/31 22:53:03 each Exp $ */ /*! \file */ @@ -1160,7 +1160,8 @@ query_addadditional(void *arg, dns_name_ goto cleanup; } result = dns_db_find(db, name, version, type, - client->query.dboptions | DNS_DBFIND_GLUEOK, + client->query.dboptions | + DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK, client->now, &node, fname, rdataset, sigrdataset); if (result == DNS_R_GLUE && @@ -1645,7 +1646,8 @@ query_addadditional2(void *arg, dns_name goto try_glue; result = dns_db_find(db, name, version, type, - client->query.dboptions | DNS_DBFIND_GLUEOK, + client->query.dboptions | + DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK, client->now, &node, fname, NULL, NULL); if (result == ISC_R_SUCCESS) goto found; @@ -3718,8 +3720,6 @@ query_find(ns_client_t *client, dns_fetc dns_rdataset_t *noqname; isc_boolean_t resuming; int line = -1; - dns_rdataset_t tmprdataset; - unsigned int dboptions; CTRACE("query_find"); @@ -3937,49 +3937,9 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ - dboptions = client->query.dboptions; - if (sigrdataset == NULL && client->view->enablednssec) { - /* - * If the client doesn't want DNSSEC we still want to - * look for any data pending validation to save a remote - * lookup if possible. - */ - dns_rdataset_init(&tmprdataset); - sigrdataset = &tmprdataset; - dboptions |= DNS_DBFIND_PENDINGOK; - } - refind: result = dns_db_find(db, client->query.qname, version, type, - dboptions, client->now, &node, fname, - rdataset, sigrdataset); - /* - * If we have found pending data try to validate it. - * If the data does not validate as secure and we can't - * use the unvalidated data requery the database with - * pending disabled to prevent infinite looping. - */ - if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) - goto validation_done; - if (validate(client, db, fname, rdataset, sigrdataset)) - goto validation_done; - if (rdataset->trust != dns_trust_pending_answer || - !PENDINGOK(client->query.dboptions)) { - dns_rdataset_disassociate(rdataset); - if (sigrdataset != NULL && - dns_rdataset_isassociated(sigrdataset)) - dns_rdataset_disassociate(sigrdataset); - if (sigrdataset == &tmprdataset) - sigrdataset = NULL; - dns_db_detachnode(db, &node); - dboptions &= ~DNS_DBFIND_PENDINGOK; - goto refind; - } - validation_done: - if (sigrdataset == &tmprdataset) { - if (dns_rdataset_isassociated(sigrdataset)) - dns_rdataset_disassociate(sigrdataset); - sigrdataset = NULL; - } + client->query.dboptions, client->now, + &node, fname, rdataset, sigrdataset); resume: CTRACE("query_find: resume"); Modified: stable/8/contrib/bind9/doc/arm/Bv9ARM.pdf ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/8/contrib/bind9/doc/arm/man.dnssec-signzone.html ============================================================================== --- stable/8/contrib/bind9/doc/arm/man.dnssec-signzone.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/doc/arm/man.dnssec-signzone.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,12 +14,12 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + dnssec-signzone - + @@ -50,7 +50,7 @@

dnssec-signzone [-a] [-c class] [-d directory] [-e end-time] [-f output-file] [-g] [-h] [-k key] [-l domain] [-i interval] [-I input-format] [-j jitter] [-N soa-seria l-format] [-o origin] [-O output-format] [-p] [-r randomdev] [-s start-time] [-t] [-v level] [-z] [-3 salt] [-H iterations] [-A] {zonefile} [key...]

-

DESCRIPTION

+

DESCRIPTION

dnssec-signzone signs a zone. It generates NSEC and RRSIG records and produces a signed version of the @@ -61,7 +61,7 @@

-

OPTIONS

+

OPTIONS

-a

@@ -276,7 +276,7 @@

-

EXAMPLE

+

EXAMPLE

The following command signs the example.com zone with the DSA key generated by dnssec-keygen @@ -305,7 +305,7 @@ db.example.com.signed %

-

KNOWN BUGS

+

KNOWN BUGS

dnssec-signzone was designed so that it could sign a zone partially, using only a subset of the DNSSEC keys @@ -330,14 +330,14 @@ db.example.com.signed

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), BIND 9 Administrator Reference Manual, RFC 4033.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: stable/8/contrib/bind9/doc/arm/man.named-checkconf.html ============================================================================== --- stable/8/contrib/bind9/doc/arm/man.named-checkconf.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/doc/arm/man.named-checkconf.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -50,14 +50,14 @@

named-checkconf [-h] [-v] [-j] [-t directory] {filename} [-z]

-

DESCRIPTION

+

DESCRIPTION

named-checkconf checks the syntax, but not the semantics, of a named configuration file.

-

OPTIONS

+

OPTIONS

-h

@@ -92,21 +92,21 @@

-

RETURN VALUES

+

RETURN VALUES

named-checkconf returns an exit status of 1 if errors were detected and 0 otherwise.

-

SEE ALSO

+

SEE ALSO

named(8), named-checkzone(8), BIND 9 Administrator Reference Manual.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: stable/8/contrib/bind9/doc/arm/man.named-checkzone.html ============================================================================== --- stable/8/contrib/bind9/doc/arm/man.named-checkzone.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/doc/arm/man.named-checkzone.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -51,7 +51,7 @@

named-compilezone [-d] [-j] [-q] [-v] [-c class] [-C mode] [-f format] [-F format] [-i mode] [-k mode] [-m mode] [-n mode] [-o filename] [-s style] [-t directory] [-w directory] [-D] [-W mode] {zonename} {filename}

-

DESCRIPTION

+

DESCRIPTION

named-checkzone checks the syntax and integrity of a zone file. It performs the same checks as named does when loading a @@ -71,7 +71,7 @@

-

OPTIONS

+

OPTIONS

-d

@@ -257,14 +257,14 @@

-

RETURN VALUES

+

RETURN VALUES

named-checkzone returns an exit status of 1 if errors were detected and 0 otherwise.

-

SEE ALSO

+

SEE ALSO

named(8), named-checkconf(8), RFC 1035, @@ -272,7 +272,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: stable/8/contrib/bind9/doc/arm/man.named.html ============================================================================== --- stable/8/contrib/bind9/doc/arm/man.named.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/doc/arm/man.named.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -50,7 +50,7 @@

named [-4] [-6] [-c config-file] [-d debug-level] [-f] [-g] [-m flag] [-n #cpus] [-p port] [-s] [-S #max-socks] [-t directory] [-u user] [-v] [-V] [-x cache-file]

-

DESCRIPTION

+

DESCRIPTION

named is a Domain Name System (DNS) server, part of the BIND 9 distribution from ISC. For more @@ -65,7 +65,7 @@

-

OPTIONS

+

OPTIONS

-4

@@ -238,7 +238,7 @@

-

SIGNALS

+

SIGNALS

In routine operation, signals should not be used to control the nameserver; rndc should be used @@ -259,7 +259,7 @@

-

CONFIGURATION

+

CONFIGURATION

The named configuration file is too complex to describe in detail here. A complete description is provided @@ -268,7 +268,7 @@

-

FILES

+

FILES

/etc/named.conf

@@ -281,7 +281,7 @@

-

SEE ALSO

+

SEE ALSO

RFC 1033, RFC 1034, RFC 1035, @@ -294,7 +294,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: stable/8/contrib/bind9/doc/arm/man.nsupdate.html ============================================================================== --- stable/8/contrib/bind9/doc/arm/man.nsupdate.html Sun Feb 7 20:26:45 2010 (r203634) +++ stable/8/contrib/bind9/doc/arm/man.nsupdate.html Sun Feb 7 20:28:24 2010 (r203635) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -50,7 +50,7 @@

nsupdate [-d] [-D] [[-g] | [-o] | [-y [hmac:]keyname:secret] | [-k keyfile]] [-t timeout] [-u udptimeout] [-r udpretries] [-R randomdev] [-v] [filename]

-

DESCRIPTION

*** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sun Feb 7 21:04:26 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1D3C106566C; Sun, 7 Feb 2010 21:04:26 +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 C101E8FC08; Sun, 7 Feb 2010 21:04:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o17L4Qwt034304; Sun, 7 Feb 2010 21:04:26 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o17L4Qo9034302; Sun, 7 Feb 2010 21:04:26 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002072104.o17L4Qo9034302@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 7 Feb 2010 21:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203638 - stable/8/games/fortune/datfiles X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 21:04:26 -0000 Author: gavin Date: Sun Feb 7 21:04:26 2010 New Revision: 203638 URL: http://svn.freebsd.org/changeset/base/203638 Log: Merge r202115 from head: Our standard "xterm" termcap entry supports colour, so this tip is redundant. As it happens, "xterm-color" has just been an alias for "xterm" since src/share/termcap/termcap.src 1.131 in September 2002. PR: docs/132959 Modified: stable/8/games/fortune/datfiles/freebsd-tips Directory Properties: stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) Modified: stable/8/games/fortune/datfiles/freebsd-tips ============================================================================== --- stable/8/games/fortune/datfiles/freebsd-tips Sun Feb 7 20:48:57 2010 (r203637) +++ stable/8/games/fortune/datfiles/freebsd-tips Sun Feb 7 21:04:26 2010 (r203638) @@ -50,18 +50,6 @@ If you are in the C shell and have just be able to run it unless you first type "rehash". -- Dru % -If you are running xterm, the default TERM variable will be 'xterm'. If you -set this environment variable to 'xterm-color' instead, a lot of programs will -use colors. You can do this by - - TERM=xterm-color; export TERM - -in Bourne-derived shells, and - - setenv TERM xterm-color - -in csh-derived shells. -% If you do not want to get beeps in X11 (X Windows), you can turn them off with xset b off From owner-svn-src-stable@FreeBSD.ORG Mon Feb 8 03:11:55 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D1BD1065679; Mon, 8 Feb 2010 03:11:55 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BAB58FC1B; Mon, 8 Feb 2010 03:11:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o183BtFk015423; Mon, 8 Feb 2010 03:11:55 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o183BtL6015421; Mon, 8 Feb 2010 03:11:55 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201002080311.o183BtL6015421@svn.freebsd.org> From: David Xu Date: Mon, 8 Feb 2010 03:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203645 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 03:11:55 -0000 Author: davidxu Date: Mon Feb 8 03:11:55 2010 New Revision: 203645 URL: http://svn.freebsd.org/changeset/base/203645 Log: MFC r203414: After busied the lock, re-read state word before checking waiters flag, otherwise, the waiters bit may not be set and a wakeup is lost. Modified: stable/8/sys/kern/kern_umtx.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_umtx.c ============================================================================== --- stable/8/sys/kern/kern_umtx.c Mon Feb 8 00:57:57 2010 (r203644) +++ stable/8/sys/kern/kern_umtx.c Mon Feb 8 03:11:55 2010 (r203645) @@ -2463,6 +2463,12 @@ do_rw_rdlock(struct thread *td, struct u umtxq_busy(&uq->uq_key); umtxq_unlock(&uq->uq_key); + /* + * re-read the state, in case it changed between the try-lock above + * and the check below + */ + state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + /* set read contention bit */ while ((state & wrflags) && !(state & URWLOCK_READ_WAITERS)) { oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_READ_WAITERS); @@ -2595,6 +2601,12 @@ do_rw_wrlock(struct thread *td, struct u umtxq_busy(&uq->uq_key); umtxq_unlock(&uq->uq_key); + /* + * re-read the state, in case it changed between the try-lock above + * and the check below + */ + state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + while (((state & URWLOCK_WRITE_OWNER) || URWLOCK_READER_COUNT(state) != 0) && (state & URWLOCK_WRITE_WAITERS) == 0) { oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_WRITE_WAITERS); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 8 14:08:52 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A156B106568F; Mon, 8 Feb 2010 14:08:52 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 907828FC1E; Mon, 8 Feb 2010 14:08:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18E8qJ0064382; Mon, 8 Feb 2010 14:08:52 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18E8qfK064378; Mon, 8 Feb 2010 14:08:52 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002081408.o18E8qfK064378@svn.freebsd.org> From: Attilio Rao Date: Mon, 8 Feb 2010 14:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203662 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 14:08:52 -0000 Author: attilio Date: Mon Feb 8 14:08:52 2010 New Revision: 203662 URL: http://svn.freebsd.org/changeset/base/203662 Log: MC r202889, r202940: - Fix a race in sched_switch() of sched_4bsd. Block the td_lock when acquiring explicitly sched_lock in order to prevent races with other td_lock contenders. - Merge the ULE's internal function thread_block_switch() into the global thread_lock_block() and make the former semantic as the default for thread_lock_block(). - Split out an invariant in order to have better checks. Modified: stable/8/sys/kern/kern_mutex.c stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_mutex.c ============================================================================== --- stable/8/sys/kern/kern_mutex.c Mon Feb 8 14:04:32 2010 (r203661) +++ stable/8/sys/kern/kern_mutex.c Mon Feb 8 14:08:52 2010 (r203662) @@ -616,7 +616,6 @@ thread_lock_block(struct thread *td) { struct mtx *lock; - spinlock_enter(); THREAD_LOCK_ASSERT(td, MA_OWNED); lock = td->td_lock; td->td_lock = &blocked_lock; @@ -631,7 +630,6 @@ thread_lock_unblock(struct thread *td, s mtx_assert(new, MA_OWNED); MPASS(td->td_lock == &blocked_lock); atomic_store_rel_ptr((volatile void *)&td->td_lock, (uintptr_t)new); - spinlock_exit(); } void Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Mon Feb 8 14:04:32 2010 (r203661) +++ stable/8/sys/kern/sched_4bsd.c Mon Feb 8 14:08:52 2010 (r203662) @@ -920,9 +920,11 @@ sched_sleep(struct thread *td, int pri) void sched_switch(struct thread *td, struct thread *newtd, int flags) { + struct mtx *tmtx; struct td_sched *ts; struct proc *p; + tmtx = NULL; ts = td->td_sched; p = td->td_proc; @@ -931,17 +933,20 @@ sched_switch(struct thread *td, struct t /* * Switch to the sched lock to fix things up and pick * a new thread. + * Block the td_lock in order to avoid breaking the critical path. */ if (td->td_lock != &sched_lock) { mtx_lock_spin(&sched_lock); - thread_unlock(td); + tmtx = thread_lock_block(td); } if ((p->p_flag & P_NOLOAD) == 0) sched_load_rem(); - if (newtd) + if (newtd) { + MPASS(newtd->td_lock == &sched_lock); newtd->td_flags |= (td->td_flags & TDF_NEEDRESCHED); + } td->td_lastcpu = td->td_oncpu; td->td_flags &= ~TDF_NEEDRESCHED; @@ -984,8 +989,8 @@ sched_switch(struct thread *td, struct t sched_load_add(); } else { newtd = choosethread(); + MPASS(newtd->td_lock == &sched_lock); } - MPASS(newtd->td_lock == &sched_lock); if (td != newtd) { #ifdef HWPMC_HOOKS @@ -1004,7 +1009,7 @@ sched_switch(struct thread *td, struct t (*dtrace_vtime_switch_func)(newtd); #endif - cpu_switch(td, newtd, td->td_lock); + cpu_switch(td, newtd, tmtx != NULL ? tmtx : td->td_lock); lock_profile_obtain_lock_success(&sched_lock.lock_object, 0, 0, __FILE__, __LINE__); /* Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Mon Feb 8 14:04:32 2010 (r203661) +++ stable/8/sys/kern/sched_ule.c Mon Feb 8 14:08:52 2010 (r203662) @@ -301,7 +301,6 @@ static int sched_pickcpu(struct thread * static void sched_balance(void); static int sched_balance_pair(struct tdq *, struct tdq *); static inline struct tdq *sched_setcpu(struct thread *, int, int); -static inline struct mtx *thread_block_switch(struct thread *); static inline void thread_unblock_switch(struct thread *, struct mtx *); static struct mtx *sched_switch_migrate(struct tdq *, struct thread *, int); static int sysctl_kern_sched_topology_spec(SYSCTL_HANDLER_ARGS); @@ -1106,9 +1105,11 @@ sched_setcpu(struct thread *td, int cpu, * The hard case, migration, we need to block the thread first to * prevent order reversals with other cpus locks. */ + spinlock_enter(); thread_lock_block(td); TDQ_LOCK(tdq); thread_lock_unblock(td, TDQ_LOCKPTR(tdq)); + spinlock_exit(); return (tdq); } @@ -1715,23 +1716,6 @@ sched_unlend_user_prio(struct thread *td } /* - * Block a thread for switching. Similar to thread_block() but does not - * bump the spin count. - */ -static inline struct mtx * -thread_block_switch(struct thread *td) -{ - struct mtx *lock; - - THREAD_LOCK_ASSERT(td, MA_OWNED); - lock = td->td_lock; - td->td_lock = &blocked_lock; - mtx_unlock_spin(lock); - - return (lock); -} - -/* * Handle migration from sched_switch(). This happens only for * cpu binding. */ @@ -1749,7 +1733,7 @@ sched_switch_migrate(struct tdq *tdq, st * not holding either run-queue lock. */ spinlock_enter(); - thread_block_switch(td); /* This releases the lock on tdq. */ + thread_lock_block(td); /* This releases the lock on tdq. */ /* * Acquire both run-queue locks before placing the thread on the new @@ -1769,7 +1753,8 @@ sched_switch_migrate(struct tdq *tdq, st } /* - * Release a thread that was blocked with thread_block_switch(). + * Variadic version of thread_lock_unblock() that does not assume td_lock + * is blocked. */ static inline void thread_unblock_switch(struct thread *td, struct mtx *mtx) @@ -1825,7 +1810,7 @@ sched_switch(struct thread *td, struct t } else { /* This thread must be going to sleep. */ TDQ_LOCK(tdq); - mtx = thread_block_switch(td); + mtx = thread_lock_block(td); tdq_load_rem(tdq, td); } /* From owner-svn-src-stable@FreeBSD.ORG Mon Feb 8 15:48:18 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D91CE106566B; Mon, 8 Feb 2010 15:48:18 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C87998FC08; Mon, 8 Feb 2010 15:48:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18FmIF9086459; Mon, 8 Feb 2010 15:48:18 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18FmIMQ086457; Mon, 8 Feb 2010 15:48:18 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002081548.o18FmIMQ086457@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 8 Feb 2010 15:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203666 - stable/8/usr.bin/truss X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 15:48:19 -0000 Author: jh Date: Mon Feb 8 15:48:18 2010 New Revision: 203666 URL: http://svn.freebsd.org/changeset/base/203666 Log: MFC r200751: Add fork(2), getegid(2), geteuid(2), getgid(2), getpid(2), getpgid(2), getpgrp(2), getppid(2), getsid(2) and getuid(2) to syscall table to decode their arguments correctly. Modified: stable/8/usr.bin/truss/syscalls.c Directory Properties: stable/8/usr.bin/truss/ (props changed) Modified: stable/8/usr.bin/truss/syscalls.c ============================================================================== --- stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:42:55 2010 (r203665) +++ stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:48:18 2010 (r203666) @@ -92,6 +92,18 @@ static const char rcsid[] = struct syscall syscalls[] = { { .name = "fcntl", .ret_type = 1, .nargs = 3, .args = { { Int, 0 } , { Fcntl, 1 }, { Fcntlflag | OUT, 2 } } }, + { .name = "fork", .ret_type = 1, .nargs = 0 }, + { .name = "getegid", .ret_type = 1, .nargs = 0 }, + { .name = "geteuid", .ret_type = 1, .nargs = 0 }, + { .name = "getgid", .ret_type = 1, .nargs = 0 }, + { .name = "getpid", .ret_type = 1, .nargs = 0 }, + { .name = "getpgid", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, + { .name = "getpgrp", .ret_type = 1, .nargs = 0 }, + { .name = "getppid", .ret_type = 1, .nargs = 0 }, + { .name = "getsid", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, + { .name = "getuid", .ret_type = 1, .nargs = 0 }, { .name = "readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 } , { Readlinkres | OUT, 1 }, { Int, 2 } } }, { .name = "lseek", .ret_type = 2, .nargs = 3, From owner-svn-src-stable@FreeBSD.ORG Mon Feb 8 15:50:51 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDDA8106566B; Mon, 8 Feb 2010 15:50:51 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDBCA8FC12; Mon, 8 Feb 2010 15:50:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18Fopgi087063; Mon, 8 Feb 2010 15:50:51 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18FopI0087061; Mon, 8 Feb 2010 15:50:51 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002081550.o18FopI0087061@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 8 Feb 2010 15:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203667 - stable/8/usr.bin/truss X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 15:50:52 -0000 Author: jh Date: Mon Feb 8 15:50:51 2010 New Revision: 203667 URL: http://svn.freebsd.org/changeset/base/203667 Log: MFC r200752: Avoid sharing the file descriptor of the output file with traced processes by setting the FD_CLOEXEC flag for the output file. PR: bin/140493 Modified: stable/8/usr.bin/truss/main.c Directory Properties: stable/8/usr.bin/truss/ (props changed) Modified: stable/8/usr.bin/truss/main.c ============================================================================== --- stable/8/usr.bin/truss/main.c Mon Feb 8 15:48:18 2010 (r203666) +++ stable/8/usr.bin/truss/main.c Mon Feb 8 15:50:51 2010 (r203667) @@ -239,6 +239,12 @@ main(int ac, char **av) if ((trussinfo->outfile = fopen(fname, "w")) == NULL) errx(1, "cannot open %s", fname); } + /* + * Set FD_CLOEXEC, so that the output file is not shared with + * the traced process. + */ + if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == -1) + warn("fcntl()"); /* * If truss starts the process itself, it will ignore some signals -- From owner-svn-src-stable@FreeBSD.ORG Mon Feb 8 15:53:28 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B92B1065672; Mon, 8 Feb 2010 15:53:28 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B0788FC33; Mon, 8 Feb 2010 15:53:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18FrSf1087671; Mon, 8 Feb 2010 15:53:28 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18FrSMk087667; Mon, 8 Feb 2010 15:53:28 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002081553.o18FrSMk087667@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 8 Feb 2010 15:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203668 - stable/8/usr.bin/truss X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 15:53:28 -0000 Author: jh Date: Mon Feb 8 15:53:28 2010 New Revision: 203668 URL: http://svn.freebsd.org/changeset/base/203668 Log: MFC r200780: Remove non-working special case for pipe(2) from amd64-fbsd32.c and i386-fbsd.c. Add pipe(2) to syscall table to decode it's pointer argument properly and re-add special handling for pipe(2) return value to print_syscall_ret(). PR: bin/120870 Modified: stable/8/usr.bin/truss/amd64-fbsd32.c stable/8/usr.bin/truss/i386-fbsd.c stable/8/usr.bin/truss/syscalls.c Directory Properties: stable/8/usr.bin/truss/ (props changed) Modified: stable/8/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- stable/8/usr.bin/truss/amd64-fbsd32.c Mon Feb 8 15:50:51 2010 (r203667) +++ stable/8/usr.bin/truss/amd64-fbsd32.c Mon Feb 8 15:53:28 2010 (r203668) @@ -315,19 +315,6 @@ amd64_fbsd32_syscall_exit(struct trussin } } - /* - * The pipe syscall returns its fds in two registers and has assembly glue - * to provide the libc API, so it cannot be handled like regular syscalls. - * The nargs check is so we don't have to do yet another strcmp on every - * syscall. - */ - if (!errorp && fsc.nargs == 0 && fsc.name && strcmp(fsc.name, "pipe") == 0) { - fsc.nargs = 1; - fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*)); - asprintf(&fsc.s_args[0], "[%d,%d]", (int)retval, (int)regs.r_rdx); - retval = 0; - } - if (fsc.name != NULL && (!strcmp(fsc.name, "freebsd32_execve") || !strcmp(fsc.name, "exit"))) { trussinfo->curthread->in_syscall = 1; Modified: stable/8/usr.bin/truss/i386-fbsd.c ============================================================================== --- stable/8/usr.bin/truss/i386-fbsd.c Mon Feb 8 15:50:51 2010 (r203667) +++ stable/8/usr.bin/truss/i386-fbsd.c Mon Feb 8 15:53:28 2010 (r203668) @@ -305,19 +305,6 @@ i386_syscall_exit(struct trussinfo *trus } } - /* - * The pipe syscall returns its fds in two registers and has assembly glue - * to provide the libc API, so it cannot be handled like regular syscalls. - * The nargs check is so we don't have to do yet another strcmp on every - * syscall. - */ - if (!errorp && fsc.nargs == 0 && fsc.name && strcmp(fsc.name, "pipe") == 0) { - fsc.nargs = 1; - fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*)); - asprintf(&fsc.s_args[0], "[%d,%d]", (int)retval, regs.r_edx); - retval = 0; - } - if (fsc.name != NULL && (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit"))) { trussinfo->curthread->in_syscall = 1; Modified: stable/8/usr.bin/truss/syscalls.c ============================================================================== --- stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:50:51 2010 (r203667) +++ stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:53:28 2010 (r203668) @@ -242,6 +242,8 @@ struct syscall syscalls[] = { .args = { { Name | IN, 0 }, { Hex, 1 } } }, { .name = "pathconf", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Pathconf, 1 } } }, + { .name = "pipe", .ret_type = 1, .nargs = 1, + .args = { { Ptr, 0 } } }, { .name = "truncate", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { Int | IN, 1 }, { Quad | IN, 2 } } }, { .name = "ftruncate", .ret_type = 1, .nargs = 3, @@ -1137,6 +1139,12 @@ print_syscall_ret(struct trussinfo *trus if (errorp) { fprintf(trussinfo->outfile, " ERR#%ld '%s'\n", retval, strerror(retval)); } else { + /* + * Because pipe(2) has a special assembly glue to provide the + * libc API, we have to adjust retval. + */ + if (name != NULL && !strcmp(name, "pipe")) + retval = 0; fprintf(trussinfo->outfile, " = %ld (0x%lx)\n", retval, retval); } } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 8 15:55:01 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDB831065676; Mon, 8 Feb 2010 15:55:01 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD4B78FC1F; Mon, 8 Feb 2010 15:55:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18Ft1gj088093; Mon, 8 Feb 2010 15:55:01 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18Ft1Ia088091; Mon, 8 Feb 2010 15:55:01 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002081555.o18Ft1Ia088091@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 8 Feb 2010 15:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203669 - stable/8/usr.bin/truss X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 15:55:01 -0000 Author: jh Date: Mon Feb 8 15:55:01 2010 New Revision: 203669 URL: http://svn.freebsd.org/changeset/base/203669 Log: MFC r200781: Cast time_t values to intmax_t and use %jd with printf. Modified: stable/8/usr.bin/truss/syscalls.c Directory Properties: stable/8/usr.bin/truss/ (props changed) Modified: stable/8/usr.bin/truss/syscalls.c ============================================================================== --- stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:53:28 2010 (r203668) +++ stable/8/usr.bin/truss/syscalls.c Mon Feb 8 15:55:01 2010 (r203669) @@ -1161,15 +1161,15 @@ print_summary(struct trussinfo *trussinf ncall = nerror = 0; for (sc = syscalls; sc->name != NULL; sc++) if (sc->ncalls) { - fprintf(trussinfo->outfile, "%-20s%5d.%09ld%8d%8d\n", - sc->name, sc->time.tv_sec, sc->time.tv_nsec, - sc->ncalls, sc->nerror); + fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n", + sc->name, (intmax_t)sc->time.tv_sec, + sc->time.tv_nsec, sc->ncalls, sc->nerror); timespecadd(&total, &sc->time, &total); ncall += sc->ncalls; nerror += sc->nerror; } fprintf(trussinfo->outfile, "%20s%15s%8s%8s\n", "", "-------------", "-------", "-------"); - fprintf(trussinfo->outfile, "%-20s%5d.%09ld%8d%8d\n", - "", total.tv_sec, total.tv_nsec, ncall, nerror); + fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n", + "", (intmax_t)total.tv_sec, total.tv_nsec, ncall, nerror); } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 8 18:37:11 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47D66106566B; Mon, 8 Feb 2010 18:37:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36EB58FC18; Mon, 8 Feb 2010 18:37:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18IbAoQ023990; Mon, 8 Feb 2010 18:37:10 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18IbAY1023988; Mon, 8 Feb 2010 18:37:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002081837.o18IbAY1023988@svn.freebsd.org> From: Ed Maste Date: Mon, 8 Feb 2010 18:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203674 - stable/6/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 18:37:11 -0000 Author: emaste Date: Mon Feb 8 18:37:10 2010 New Revision: 203674 URL: http://svn.freebsd.org/changeset/base/203674 Log: MFC r162488: Use __builtin_offsetof for GCC 4.1. Submitted by: Ryan Stone Modified: stable/6/sys/sys/cdefs.h Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/sys/cdefs.h ============================================================================== --- stable/6/sys/sys/cdefs.h Mon Feb 8 18:16:59 2010 (r203673) +++ stable/6/sys/sys/cdefs.h Mon Feb 8 18:37:10 2010 (r203674) @@ -304,6 +304,9 @@ * We define this here since , , and * require it. */ +#if __GNUC_PREREQ__(4, 1) +#define __offsetof(type, field) __builtin_offsetof(type, field) +#else #ifndef __cplusplus #define __offsetof(type, field) ((size_t)(&((type *)0)->field)) #else @@ -312,6 +315,7 @@ (&reinterpret_cast \ (static_cast (0)->field)))) #endif +#endif #define __rangeof(type, start, end) \ (__offsetof(type, end) - __offsetof(type, start)) From owner-svn-src-stable@FreeBSD.ORG Tue Feb 9 01:19:10 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5F9B106566B; Tue, 9 Feb 2010 01:19:10 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C54CC8FC1B; Tue, 9 Feb 2010 01:19:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o191JADa013462; Tue, 9 Feb 2010 01:19:10 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o191JAj4013460; Tue, 9 Feb 2010 01:19:10 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201002090119.o191JAj4013460@svn.freebsd.org> From: David Xu Date: Tue, 9 Feb 2010 01:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203694 - stable/7/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 01:19:10 -0000 Author: davidxu Date: Tue Feb 9 01:19:10 2010 New Revision: 203694 URL: http://svn.freebsd.org/changeset/base/203694 Log: MFC r203414: After busied the lock, re-read state word before checking waiters flag, otherwise, the waiters bit may not be set and a wakeup is lost. Approved by: re (kib) Modified: stable/7/sys/kern/kern_umtx.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_umtx.c ============================================================================== --- stable/7/sys/kern/kern_umtx.c Tue Feb 9 00:38:40 2010 (r203693) +++ stable/7/sys/kern/kern_umtx.c Tue Feb 9 01:19:10 2010 (r203694) @@ -2463,6 +2463,12 @@ do_rw_rdlock(struct thread *td, struct u umtxq_busy(&uq->uq_key); umtxq_unlock(&uq->uq_key); + /* + * re-read the state, in case it changed between the try-lock above + * and the check below + */ + state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + /* set read contention bit */ while ((state & wrflags) && !(state & URWLOCK_READ_WAITERS)) { oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_READ_WAITERS); @@ -2595,6 +2601,12 @@ do_rw_wrlock(struct thread *td, struct u umtxq_busy(&uq->uq_key); umtxq_unlock(&uq->uq_key); + /* + * re-read the state, in case it changed between the try-lock above + * and the check below + */ + state = fuword32(__DEVOLATILE(int32_t *, &rwlock->rw_state)); + while (((state & URWLOCK_WRITE_OWNER) || URWLOCK_READER_COUNT(state) != 0) && (state & URWLOCK_WRITE_WAITERS) == 0) { oldstate = casuword32(&rwlock->rw_state, state, state | URWLOCK_WRITE_WAITERS); From owner-svn-src-stable@FreeBSD.ORG Tue Feb 9 12:20:49 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25D05106568F; Tue, 9 Feb 2010 12:20:49 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14B868FC1B; Tue, 9 Feb 2010 12:20:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19CKmci062300; Tue, 9 Feb 2010 12:20:48 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19CKmbr062298; Tue, 9 Feb 2010 12:20:48 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002091220.o19CKmbr062298@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 9 Feb 2010 12:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203700 - stable/8/sbin/dumpfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 12:20:49 -0000 Author: ru Date: Tue Feb 9 12:20:48 2010 New Revision: 203700 URL: http://svn.freebsd.org/changeset/base/203700 Log: MFC: r198231: Properly re-create "-s size" argument to newfs(8). Modified: stable/8/sbin/dumpfs/dumpfs.c Directory Properties: stable/8/sbin/dumpfs/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.c Tue Feb 9 10:47:44 2010 (r203699) +++ stable/8/sbin/dumpfs/dumpfs.c Tue Feb 9 12:20:48 2010 (r203700) @@ -413,7 +413,7 @@ marshal(const char *name) break; } /* -p..r unimplemented */ - printf("-s %jd ", (intmax_t)fs->fs_size); + printf("-s %jd ", (intmax_t)fsbtodb(fs, fs->fs_size)); printf("%s ", disk.d_name); printf("\n"); From owner-svn-src-stable@FreeBSD.ORG Tue Feb 9 13:07:32 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2966106566B; Tue, 9 Feb 2010 13:07:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A15C38FC12; Tue, 9 Feb 2010 13:07:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19D7WkA072636; Tue, 9 Feb 2010 13:07:32 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19D7WAP072635; Tue, 9 Feb 2010 13:07:32 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002091307.o19D7WAP072635@svn.freebsd.org> From: Ed Maste Date: Tue, 9 Feb 2010 13:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203701 - stable/8/lib/libc/stdlib X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 13:07:32 -0000 Author: emaste Date: Tue Feb 9 13:07:32 2010 New Revision: 203701 URL: http://svn.freebsd.org/changeset/base/203701 Log: MFC r203077: Add missing return, in a rare case where we can't allocate memory in deallocate. Submitted by: Ryan Stone (rysto32 at gmail dot com) Approved by: jasone Modified: stable/8/lib/libc/stdlib/malloc.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/stdlib/malloc.c ============================================================================== --- stable/8/lib/libc/stdlib/malloc.c Tue Feb 9 12:20:48 2010 (r203700) +++ stable/8/lib/libc/stdlib/malloc.c Tue Feb 9 13:07:32 2010 (r203701) @@ -3861,6 +3861,7 @@ arena_dalloc(arena_t *arena, arena_chunk arena_dalloc_small(arena, chunk, ptr, mapelm); malloc_spin_unlock(&arena->lock); + return; } mag_rack = rack; } From owner-svn-src-stable@FreeBSD.ORG Tue Feb 9 14:56:10 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE080106568B; Tue, 9 Feb 2010 14:56:10 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C9158FC1D; Tue, 9 Feb 2010 14:56:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19EuAek099392; Tue, 9 Feb 2010 14:56:10 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19EuA4w099388; Tue, 9 Feb 2010 14:56:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002091456.o19EuA4w099388@svn.freebsd.org> From: Attilio Rao Date: Tue, 9 Feb 2010 14:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203704 - stable/7/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 14:56:10 -0000 Author: attilio Date: Tue Feb 9 14:56:10 2010 New Revision: 203704 URL: http://svn.freebsd.org/changeset/base/203704 Log: MFC r202889, r202940: - Fix a race in sched_switch() of sched_4bsd. Block the td_lock when acquiring explicitly sched_lock in order to prevent races with other td_lock contenders. - Merge the ULE's internal function thread_block_switch() into the global thread_lock_block() and make the former semantic as the default for thread_lock_block(). - Split out an invariant in order to have better checks. Tested by: Giovanni Trematerra Approved by: re (kib) Modified: stable/7/sys/kern/kern_mutex.c stable/7/sys/kern/sched_4bsd.c stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_mutex.c ============================================================================== --- stable/7/sys/kern/kern_mutex.c Tue Feb 9 14:51:39 2010 (r203703) +++ stable/7/sys/kern/kern_mutex.c Tue Feb 9 14:56:10 2010 (r203704) @@ -557,7 +557,6 @@ thread_lock_block(struct thread *td) { struct mtx *lock; - spinlock_enter(); THREAD_LOCK_ASSERT(td, MA_OWNED); lock = td->td_lock; td->td_lock = &blocked_lock; @@ -572,7 +571,6 @@ thread_lock_unblock(struct thread *td, s mtx_assert(new, MA_OWNED); MPASS(td->td_lock == &blocked_lock); atomic_store_rel_ptr((volatile void *)&td->td_lock, (uintptr_t)new); - spinlock_exit(); } void Modified: stable/7/sys/kern/sched_4bsd.c ============================================================================== --- stable/7/sys/kern/sched_4bsd.c Tue Feb 9 14:51:39 2010 (r203703) +++ stable/7/sys/kern/sched_4bsd.c Tue Feb 9 14:56:10 2010 (r203704) @@ -824,9 +824,11 @@ sched_sleep(struct thread *td) void sched_switch(struct thread *td, struct thread *newtd, int flags) { + struct mtx *tmtx; struct td_sched *ts; struct proc *p; + tmtx = NULL; ts = td->td_sched; p = td->td_proc; @@ -835,17 +837,20 @@ sched_switch(struct thread *td, struct t /* * Switch to the sched lock to fix things up and pick * a new thread. + * Block the td_lock in order to avoid breaking the critical path. */ if (td->td_lock != &sched_lock) { mtx_lock_spin(&sched_lock); - thread_unlock(td); + tmtx = thread_lock_block(td); } if ((p->p_flag & P_NOLOAD) == 0) sched_load_rem(); - if (newtd) + if (newtd) { + MPASS(newtd->td_lock == &sched_lock); newtd->td_flags |= (td->td_flags & TDF_NEEDRESCHED); + } td->td_lastcpu = td->td_oncpu; td->td_flags &= ~TDF_NEEDRESCHED; @@ -888,8 +893,8 @@ sched_switch(struct thread *td, struct t sched_load_add(); } else { newtd = choosethread(); + MPASS(newtd->td_lock == &sched_lock); } - MPASS(newtd->td_lock == &sched_lock); if (td != newtd) { #ifdef HWPMC_HOOKS @@ -907,7 +912,7 @@ sched_switch(struct thread *td, struct t (*dtrace_vtime_switch_func)(newtd); #endif /* I feel sleepy */ - cpu_switch(td, newtd, td->td_lock); + cpu_switch(td, newtd, tmtx != NULL ? tmtx : td->td_lock); /* * Where am I? What year is it? * We are in the same thread that went to sleep above, Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Tue Feb 9 14:51:39 2010 (r203703) +++ stable/7/sys/kern/sched_ule.c Tue Feb 9 14:56:10 2010 (r203704) @@ -318,7 +318,6 @@ static void sched_balance_groups(void); static void sched_balance_group(struct tdq_group *); static void sched_balance_pair(struct tdq *, struct tdq *); static inline struct tdq *sched_setcpu(struct td_sched *, int, int); -static inline struct mtx *thread_block_switch(struct thread *); static inline void thread_unblock_switch(struct thread *, struct mtx *); static struct mtx *sched_switch_migrate(struct tdq *, struct thread *, int); #endif @@ -989,9 +988,11 @@ sched_setcpu(struct td_sched *ts, int cp * The hard case, migration, we need to block the thread first to * prevent order reversals with other cpus locks. */ + spinlock_enter(); thread_lock_block(td); TDQ_LOCK(tdq); thread_lock_unblock(td, TDQ_LOCKPTR(tdq)); + spinlock_exit(); return (tdq); } @@ -1789,23 +1790,6 @@ sched_switchin(struct tdq *tdq, struct t } /* - * Block a thread for switching. Similar to thread_block() but does not - * bump the spin count. - */ -static inline struct mtx * -thread_block_switch(struct thread *td) -{ - struct mtx *lock; - - THREAD_LOCK_ASSERT(td, MA_OWNED); - lock = td->td_lock; - td->td_lock = &blocked_lock; - mtx_unlock_spin(lock); - - return (lock); -} - -/* * Handle migration from sched_switch(). This happens only for * cpu binding. */ @@ -1822,7 +1806,7 @@ sched_switch_migrate(struct tdq *tdq, st * not holding either run-queue lock. */ spinlock_enter(); - thread_block_switch(td); /* This releases the lock on tdq. */ + thread_lock_block(td); /* This releases the lock on tdq. */ /* * Acquire both run-queue locks before placing the thread on the new @@ -1848,7 +1832,8 @@ sched_switch_migrate(struct tdq *tdq, st } /* - * Release a thread that was blocked with thread_block_switch(). + * Variadic version of thread_lock_unblock() that does not assume td_lock + * is blocked. */ static inline void thread_unblock_switch(struct thread *td, struct mtx *mtx) @@ -1907,7 +1892,7 @@ sched_switch(struct thread *td, struct t } else { /* This thread must be going to sleep. */ TDQ_LOCK(tdq); - mtx = thread_block_switch(td); + mtx = thread_lock_block(td); tdq_load_rem(tdq, ts); } /* From owner-svn-src-stable@FreeBSD.ORG Tue Feb 9 16:18:44 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9059106566B; Tue, 9 Feb 2010 16:18:44 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C85B18FC1A; Tue, 9 Feb 2010 16:18:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19GIi0n017626; Tue, 9 Feb 2010 16:18:44 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19GIi1V017624; Tue, 9 Feb 2010 16:18:44 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002091618.o19GIi1V017624@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 9 Feb 2010 16:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203706 - stable/7/sbin/dumpfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 16:18:45 -0000 Author: ru Date: Tue Feb 9 16:18:44 2010 New Revision: 203706 URL: http://svn.freebsd.org/changeset/base/203706 Log: MFC: r198231: Properly re-create "-s size" argument to newfs(8). Approved by: re (kib) Modified: stable/7/sbin/dumpfs/dumpfs.c Directory Properties: stable/7/sbin/dumpfs/ (props changed) Modified: stable/7/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/7/sbin/dumpfs/dumpfs.c Tue Feb 9 15:23:15 2010 (r203705) +++ stable/7/sbin/dumpfs/dumpfs.c Tue Feb 9 16:18:44 2010 (r203706) @@ -413,7 +413,7 @@ marshal(const char *name) break; } /* -p..r unimplemented */ - printf("-s %jd ", (intmax_t)fs->fs_size); + printf("-s %jd ", (intmax_t)fsbtodb(fs, fs->fs_size)); printf("%s ", disk.d_name); printf("\n"); From owner-svn-src-stable@FreeBSD.ORG Tue Feb 9 17:55:57 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 257B9106566B; Tue, 9 Feb 2010 17:55:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EAC3D8FC1E; Tue, 9 Feb 2010 17:55:56 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 84D6446B49; Tue, 9 Feb 2010 12:55:56 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E103F8A01F; Tue, 9 Feb 2010 12:55:55 -0500 (EST) From: John Baldwin To: Attilio Rao Date: Tue, 9 Feb 2010 12:54:09 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <201002091456.o19EuA4w099388@svn.freebsd.org> In-Reply-To: <201002091456.o19EuA4w099388@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201002091254.09935.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 09 Feb 2010 12:55:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r203704 - stable/7/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 17:55:57 -0000 On Tuesday 09 February 2010 9:56:10 am Attilio Rao wrote: > Author: attilio > Date: Tue Feb 9 14:56:10 2010 > New Revision: 203704 > URL: http://svn.freebsd.org/changeset/base/203704 > > Log: > MFC r202889, r202940: > - Fix a race in sched_switch() of sched_4bsd. > Block the td_lock when acquiring explicitly sched_lock in order to prevent > races with other td_lock contenders. > - Merge the ULE's internal function thread_block_switch() into the global > thread_lock_block() and make the former semantic as the default for > thread_lock_block(). > - Split out an invariant in order to have better checks. Does this require an MFC of a change to cpu_switch() for sparc64? -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Tue Feb 9 17:58:59 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92451106566B; Tue, 9 Feb 2010 17:58:59 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.223.172]) by mx1.freebsd.org (Postfix) with ESMTP id 2B9338FC15; Tue, 9 Feb 2010 17:58:58 +0000 (UTC) Received: by iwn2 with SMTP id 2so77113iwn.8 for ; Tue, 09 Feb 2010 09:58:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=MAUIWO7CjyuOOyoXCbc6XtcbnIiSqU15muK4QkOA+3c=; b=b/0n1PLCyvz6oS6YbJdHAozjVXUd/5aejuZRT9ElJC1ph4fwI2E0uuGIcdwSlS2naS 8Bi8cBxl/qjRKI5hniH2G6mBMN9vxmqBlWByt0VA+82vPTze9nqHXrQ8BrD2MILB2rur 1aEud9AVnlY53SmxC+a25l6mN9gTI31TbJ2Zo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=m56SUzGiaK85r9eZ70RiBmUFRlSo53MXcI98iTwjOclio/HpcR7V2KSSFUSQLml1Ax 1YFUx7YMP4WsIqjKAJmDW0yQmlQRAKzqOzfzU8jOUfChV2EG8b+sCUL0j/a4FdmbZpQV AgZLD1d8pQ8mc+3U1s3SCpOo3+Um0LVDMRv3g= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.168.136 with SMTP id u8mr748040iby.56.1265738336256; Tue, 09 Feb 2010 09:58:56 -0800 (PST) In-Reply-To: <201002091254.09935.jhb@freebsd.org> References: <201002091456.o19EuA4w099388@svn.freebsd.org> <201002091254.09935.jhb@freebsd.org> Date: Tue, 9 Feb 2010 18:58:56 +0100 X-Google-Sender-Auth: a5629e27620976ce Message-ID: <3bbf2fe11002090958i850d50bt404998c3aefc5bfb@mail.gmail.com> From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r203704 - stable/7/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 17:58:59 -0000 2010/2/9 John Baldwin : > On Tuesday 09 February 2010 9:56:10 am Attilio Rao wrote: >> Author: attilio >> Date: Tue Feb =C2=A09 14:56:10 2010 >> New Revision: 203704 >> URL: http://svn.freebsd.org/changeset/base/203704 >> >> Log: >> =C2=A0 MFC r202889, r202940: >> =C2=A0 - Fix a race in sched_switch() of sched_4bsd. >> =C2=A0 =C2=A0 Block the td_lock when acquiring explicitly sched_lock in = order to prevent >> =C2=A0 =C2=A0 races with other td_lock contenders. >> =C2=A0 - Merge the ULE's internal function thread_block_switch() into th= e global >> =C2=A0 =C2=A0 thread_lock_block() and make the former semantic as the de= fault for >> =C2=A0 =C2=A0 thread_lock_block(). >> =C2=A0 - Split out an invariant in order to have better checks. > > Does this require an MFC of a change to cpu_switch() for sparc64? It is already done by marius. (I waited for his work before to let this go in). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-stable@FreeBSD.ORG Tue Feb 9 18:43:50 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4F54106566C; Tue, 9 Feb 2010 18:43:50 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B433B8FC19; Tue, 9 Feb 2010 18:43:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19Ihof0049853; Tue, 9 Feb 2010 18:43:50 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19IhoTH049851; Tue, 9 Feb 2010 18:43:50 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201002091843.o19IhoTH049851@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 9 Feb 2010 18:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203715 - stable/8/etc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 18:43:50 -0000 Author: bms Date: Tue Feb 9 18:43:50 2010 New Revision: 203715 URL: http://svn.freebsd.org/changeset/base/203715 Log: MFC Revision: 203574 Add sane-port (Scanner Access Now Easy) as port 6566. Obtained from: http://www.iana.org/assignments/port-numbers Modified: stable/8/etc/services (contents, props changed) Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/services ============================================================================== --- stable/8/etc/services Tue Feb 9 18:43:20 2010 (r203714) +++ stable/8/etc/services Tue Feb 9 18:43:50 2010 (r203715) @@ -2338,6 +2338,8 @@ sge_execd 6445/tcp #Grid Engine Execut sge_execd 6445/udp #Grid Engine Execution Service xdsxdm 6558/tcp xdsxdm 6558/udp +sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port +sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port ircd 6667/tcp #Internet Relay Chat (unoffical) acmsoda 6969/tcp acmsoda 6969/udp From owner-svn-src-stable@FreeBSD.ORG Tue Feb 9 19:27:54 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FD6A106568D; Tue, 9 Feb 2010 19:27:54 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EE6F8FC2B; Tue, 9 Feb 2010 19:27:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19JRsqR059667; Tue, 9 Feb 2010 19:27:54 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19JRsQY059665; Tue, 9 Feb 2010 19:27:54 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201002091927.o19JRsQY059665@svn.freebsd.org> From: Qing Li Date: Tue, 9 Feb 2010 19:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203718 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 19:27:54 -0000 Author: qingli Date: Tue Feb 9 19:27:54 2010 New Revision: 203718 URL: http://svn.freebsd.org/changeset/base/203718 Log: MFC r203401 Some of the existing ppp and vpn related scripts create and set the IP addresses of the tunnel end points to the same value. In these cases the loopback route is not installed for the local end. Modified: stable/8/sys/netinet/in.c Directory Properties: stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Feb 9 19:13:45 2010 (r203717) +++ stable/8/sys/netinet/in.c Tue Feb 9 19:27:54 2010 (r203718) @@ -921,6 +921,12 @@ in_ifinit(struct ifnet *ifp, struct in_i if (ia->ia_addr.sin_addr.s_addr == INADDR_ANY) return (0); + if (ifp->if_flags & IFF_POINTOPOINT) { + if (ia->ia_dstaddr.sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr) + return (0); + } + + /* * add a loopback route to self */ From owner-svn-src-stable@FreeBSD.ORG Tue Feb 9 22:05:30 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82A151065679; Tue, 9 Feb 2010 22:05:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 578408FC15; Tue, 9 Feb 2010 22:05:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o19M5U9P094909; Tue, 9 Feb 2010 22:05:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o19M5UAm094906; Tue, 9 Feb 2010 22:05:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002092205.o19M5UAm094906@svn.freebsd.org> From: Ed Maste Date: Tue, 9 Feb 2010 22:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203726 - stable/8/sys/dev/aac X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 22:05:30 -0000 Author: emaste Date: Tue Feb 9 22:05:30 2010 New Revision: 203726 URL: http://svn.freebsd.org/changeset/base/203726 Log: MFC r198593: Rename aac_fast_intr to aac_filter to reflect its current use. Eliminate the fallback of using the filter as an interrupt handler, as it is no longer needed. Discussed with: scottl, jhb Modified: stable/8/sys/dev/aac/aac.c stable/8/sys/dev/aac/aacvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Tue Feb 9 22:01:42 2010 (r203725) +++ stable/8/sys/dev/aac/aac.c Tue Feb 9 22:05:30 2010 (r203726) @@ -909,8 +909,11 @@ aac_new_intr(void *arg) mtx_unlock(&sc->aac_io_lock); } +/* + * Interrupt filter for !NEW_COMM interface. + */ int -aac_fast_intr(void *arg) +aac_filter(void *arg) { struct aac_softc *sc; u_int16_t reason; @@ -2032,18 +2035,11 @@ aac_setup_intr(struct aac_softc *sc) } } else { if (bus_setup_intr(sc->aac_dev, sc->aac_irq, - INTR_TYPE_BIO, aac_fast_intr, NULL, + INTR_TYPE_BIO, aac_filter, NULL, sc, &sc->aac_intr)) { device_printf(sc->aac_dev, - "can't set up FAST interrupt\n"); - if (bus_setup_intr(sc->aac_dev, sc->aac_irq, - INTR_MPSAFE|INTR_TYPE_BIO, - NULL, (driver_intr_t *)aac_fast_intr, - sc, &sc->aac_intr)) { - device_printf(sc->aac_dev, - "can't set up MPSAFE interrupt\n"); - return (EINVAL); - } + "can't set up interrupt filter\n"); + return (EINVAL); } } return (0); Modified: stable/8/sys/dev/aac/aacvar.h ============================================================================== --- stable/8/sys/dev/aac/aacvar.h Tue Feb 9 22:01:42 2010 (r203725) +++ stable/8/sys/dev/aac/aacvar.h Tue Feb 9 22:05:30 2010 (r203726) @@ -441,7 +441,7 @@ extern int aac_shutdown(device_t dev); extern int aac_suspend(device_t dev); extern int aac_resume(device_t dev); extern void aac_new_intr(void *arg); -extern int aac_fast_intr(void *arg); +extern int aac_filter(void *arg); extern void aac_submit_bio(struct bio *bp); extern void aac_biodone(struct bio *bp); extern void aac_startio(struct aac_softc *sc); From owner-svn-src-stable@FreeBSD.ORG Wed Feb 10 00:34:14 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B0B81065670; Wed, 10 Feb 2010 00:34:14 +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 333F08FC16; Wed, 10 Feb 2010 00:34:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A0YEhV028381; Wed, 10 Feb 2010 00:34:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A0YEIv028376; Wed, 10 Feb 2010 00:34:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002100034.o1A0YEIv028376@svn.freebsd.org> From: Xin LI Date: Wed, 10 Feb 2010 00:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203737 - stable/8/usr.bin/netstat X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 00:34:14 -0000 Author: delphij Date: Wed Feb 10 00:34:13 2010 New Revision: 203737 URL: http://svn.freebsd.org/changeset/base/203737 Log: MFC r202060: Add a new option, -q howmany, which when used in conjuction with -w, exits netstat after _howmany_ outputs. Requested by: thomasa Reviewed by: freebsd-net (bms, old version in early 2007) Modified: stable/8/usr.bin/netstat/if.c stable/8/usr.bin/netstat/main.c stable/8/usr.bin/netstat/netstat.1 stable/8/usr.bin/netstat/netstat.h Directory Properties: stable/8/usr.bin/netstat/ (props changed) Modified: stable/8/usr.bin/netstat/if.c ============================================================================== --- stable/8/usr.bin/netstat/if.c Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/if.c Wed Feb 10 00:34:13 2010 (r203737) @@ -685,6 +685,8 @@ loop: if (!first) putchar('\n'); fflush(stdout); + if ((noutputs != 0) && (--noutputs == 0)) + exit(0); oldmask = sigblock(sigmask(SIGALRM)); while (!signalled) sigpause(0); Modified: stable/8/usr.bin/netstat/main.c ============================================================================== --- stable/8/usr.bin/netstat/main.c Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/main.c Wed Feb 10 00:34:13 2010 (r203737) @@ -332,6 +332,7 @@ int hflag; /* show counters in human re int iflag; /* show interfaces */ int Lflag; /* show size of listen queues */ int mflag; /* show memory stats */ +int noutputs = 0; /* how much outputs before we exit */ int numeric_addr; /* show addresses numerically */ int numeric_port; /* show ports numerically */ static int pflag; /* show given protocol */ @@ -358,7 +359,7 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:rSstuWw:xz")) != -1) + while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:q:rSstuWw:xz")) != -1) switch(ch) { case 'A': Aflag = 1; @@ -444,6 +445,11 @@ main(int argc, char *argv[]) } pflag = 1; break; + case 'q': + noutputs = atoi(optarg); + if (noutputs != 0) + noutputs++; + break; case 'r': rflag = 1; break; @@ -780,7 +786,7 @@ usage(void) " [-M core] [-N system]", " netstat -i | -I interface [-abdhntW] [-f address_family]\n" " [-M core] [-N system]", -" netstat -w wait [-I interface] [-d] [-M core] [-N system]", +" netstat -w wait [-I interface] [-d] [-M core] [-N system] [-q howmany]", " netstat -s [-s] [-z] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -i | -I interface -s [-f protocol_family | -p protocol]\n" Modified: stable/8/usr.bin/netstat/netstat.1 ============================================================================== --- stable/8/usr.bin/netstat/netstat.1 Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/netstat.1 Wed Feb 10 00:34:13 2010 (r203737) @@ -32,7 +32,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 9, 2009 +.Dd January 10, 2010 .Dt NETSTAT 1 .Os .Sh NAME @@ -136,6 +136,7 @@ is also present, print interface names u .Op Fl d .Op Fl M Ar core .Op Fl N Ar system +.Op Fl q Ar howmany .Ek .Xc At intervals of @@ -146,6 +147,11 @@ traffic on all configured network interf or a single .Ar interface . If +.Fl q +is also present, exit after +.Ar howmany +outputs. +If .Fl d is also present, show the number of dropped packets. .It Xo Modified: stable/8/usr.bin/netstat/netstat.h ============================================================================== --- stable/8/usr.bin/netstat/netstat.h Wed Feb 10 00:26:20 2010 (r203736) +++ stable/8/usr.bin/netstat/netstat.h Wed Feb 10 00:34:13 2010 (r203737) @@ -45,6 +45,7 @@ extern int hflag; /* show counters in hu extern int iflag; /* show interfaces */ extern int Lflag; /* show size of listen queues */ extern int mflag; /* show memory stats */ +extern int noutputs; /* how much outputs before we exit */ extern int numeric_addr; /* show addresses numerically */ extern int numeric_port; /* show ports numerically */ extern int rflag; /* show routing tables (or routing stats) */ From owner-svn-src-stable@FreeBSD.ORG Wed Feb 10 04:12:55 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD8261065670; Wed, 10 Feb 2010 04:12: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 CB7978FC16; Wed, 10 Feb 2010 04:12:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A4CtGL076841; Wed, 10 Feb 2010 04:12:55 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A4CtV9076839; Wed, 10 Feb 2010 04:12:55 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201002100412.o1A4CtV9076839@svn.freebsd.org> From: Ken Smith Date: Wed, 10 Feb 2010 04:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203742 - stable/7/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 04:12:56 -0000 Author: kensmith Date: Wed Feb 10 04:12:55 2010 New Revision: 203742 URL: http://svn.freebsd.org/changeset/base/203742 Log: Bump __FreeBSD_version to reflect that releng/7.3 has been branched. Approved by: re (implicit) Modified: stable/7/sys/sys/param.h Modified: stable/7/sys/sys/param.h ============================================================================== --- stable/7/sys/sys/param.h Wed Feb 10 04:10:36 2010 (r203741) +++ stable/7/sys/sys/param.h Wed Feb 10 04:12:55 2010 (r203742) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 702106 /* Master, propagated to newvers */ +#define __FreeBSD_version 703100 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-stable@FreeBSD.ORG Wed Feb 10 08:50:06 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E72E4106566B; Wed, 10 Feb 2010 08:50:06 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 994278FC12; Wed, 10 Feb 2010 08:50:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A8o6c8038845; Wed, 10 Feb 2010 08:50:06 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A8o6tD038842; Wed, 10 Feb 2010 08:50:06 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201002100850.o1A8o6tD038842@svn.freebsd.org> From: Marko Zec Date: Wed, 10 Feb 2010 08:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203748 - stable/8/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 08:50:07 -0000 Author: zec Date: Wed Feb 10 08:50:06 2010 New Revision: 203748 URL: http://svn.freebsd.org/changeset/base/203748 Log: MFC r203483: Instead of spamming the console on each curvnet recursion event, print out each such call graph only once, along with a stack backtrace. This should make kernels built with VNET_DEBUG reasonably usable again in busy / production environments. Introduce a new DDB command "show vnetrcrs" which dumps the whole log of distinctive curvnet recursion events. This might be useful when recursion reports get burried / lost too deep in the message buffer. In the later case stack backtraces are not available. Reviewed by: bz Modified: stable/8/sys/net/vnet.c stable/8/sys/net/vnet.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/net/vnet.c ============================================================================== --- stable/8/sys/net/vnet.c Wed Feb 10 07:15:21 2010 (r203747) +++ stable/8/sys/net/vnet.c Wed Feb 10 08:50:06 2010 (r203748) @@ -37,8 +37,10 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_kdb.h" #include +#include #include #include #include @@ -616,6 +618,65 @@ vnet_sysuninit(void) VNET_SYSINIT_RUNLOCK(); } +#ifdef VNET_DEBUG +struct vnet_recursion { + SLIST_ENTRY(vnet_recursion) vnr_le; + const char *prev_fn; + const char *where_fn; + int where_line; + struct vnet *old_vnet; + struct vnet *new_vnet; +}; + +static SLIST_HEAD(, vnet_recursion) vnet_recursions = + SLIST_HEAD_INITIALIZER(vnet_recursions); + +static void +vnet_print_recursion(struct vnet_recursion *vnr, int brief) +{ + + if (!brief) + printf("CURVNET_SET() recursion in "); + printf("%s() line %d, prev in %s()", vnr->where_fn, vnr->where_line, + vnr->prev_fn); + if (brief) + printf(", "); + else + printf("\n "); + printf("%p -> %p\n", vnr->old_vnet, vnr->new_vnet); +} + +void +vnet_log_recursion(struct vnet *old_vnet, const char *old_fn, int line) +{ + struct vnet_recursion *vnr; + + /* Skip already logged recursion events. */ + SLIST_FOREACH(vnr, &vnet_recursions, vnr_le) + if (vnr->prev_fn == old_fn && + vnr->where_fn == curthread->td_vnet_lpush && + vnr->where_line == line && + (vnr->old_vnet == vnr->new_vnet) == (curvnet == old_vnet)) + return; + + vnr = malloc(sizeof(*vnr), M_VNET, M_NOWAIT | M_ZERO); + if (vnr == NULL) + panic("%s: malloc failed", __func__); + vnr->prev_fn = old_fn; + vnr->where_fn = curthread->td_vnet_lpush; + vnr->where_line = line; + vnr->old_vnet = old_vnet; + vnr->new_vnet = curvnet; + + SLIST_INSERT_HEAD(&vnet_recursions, vnr, vnr_le); + + vnet_print_recursion(vnr, 0); +#ifdef KDB + kdb_backtrace(); +#endif +} +#endif /* VNET_DEBUG */ + #ifdef DDB DB_SHOW_COMMAND(vnets, db_show_vnets) { @@ -637,4 +698,14 @@ DB_SHOW_COMMAND(vnets, db_show_vnets) break; } } + +#ifdef VNET_DEBUG +DB_SHOW_COMMAND(vnetrcrs, db_show_vnetrcrs) +{ + struct vnet_recursion *vnr; + + SLIST_FOREACH(vnr, &vnet_recursions, vnr_le) + vnet_print_recursion(vnr, 1); +} #endif +#endif /* DDB */ Modified: stable/8/sys/net/vnet.h ============================================================================== --- stable/8/sys/net/vnet.h Wed Feb 10 07:15:21 2010 (r203747) +++ stable/8/sys/net/vnet.h Wed Feb 10 08:50:06 2010 (r203748) @@ -108,6 +108,8 @@ void vnet_destroy(struct vnet *vnet); * assertions. */ #ifdef VNET_DEBUG +void vnet_log_recursion(struct vnet *, const char *, int); + #define VNET_ASSERT(condition) \ if (!(condition)) { \ printf("VNET_ASSERT @ %s:%d %s():\n", \ @@ -125,9 +127,7 @@ void vnet_destroy(struct vnet *vnet); #define CURVNET_SET_VERBOSE(arg) \ CURVNET_SET_QUIET(arg) \ if (saved_vnet) \ - printf("CURVNET_SET(%p) in %s() on cpu %d, prev %p in %s()\n", \ - curvnet, curthread->td_vnet_lpush, curcpu, \ - saved_vnet, saved_vnet_lpush); + vnet_log_recursion(saved_vnet, saved_vnet_lpush, __LINE__); #define CURVNET_SET(arg) CURVNET_SET_VERBOSE(arg) From owner-svn-src-stable@FreeBSD.ORG Wed Feb 10 09:46:31 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDFA41065670; Wed, 10 Feb 2010 09:46:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2DF58FC15; Wed, 10 Feb 2010 09:46:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A9kVjO051261; Wed, 10 Feb 2010 09:46:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A9kVUL051259; Wed, 10 Feb 2010 09:46:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201002100946.o1A9kVUL051259@svn.freebsd.org> From: Andriy Gapon Date: Wed, 10 Feb 2010 09:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203749 - stable/8/sys/dev/acpica X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 09:46:32 -0000 Author: avg Date: Wed Feb 10 09:46:31 2010 New Revision: 203749 URL: http://svn.freebsd.org/changeset/base/203749 Log: MFC r203062: acpi_hpet: correctly get number of timers in a timer block Modified: stable/8/sys/dev/acpica/acpi_hpet.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_hpet.c Wed Feb 10 08:50:06 2010 (r203748) +++ stable/8/sys/dev/acpica/acpi_hpet.c Wed Feb 10 09:46:31 2010 (r203749) @@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include +#define HPET_VENDID_AMD 0x4353 +#define HPET_VENDID_INTEL 0x8086 + ACPI_SERIAL_DECL(hpet, "ACPI HPET support"); static devclass_t acpi_hpet_devclass; @@ -155,9 +158,10 @@ static int acpi_hpet_attach(device_t dev) { struct acpi_hpet_softc *sc; - int rid; + int rid, num_timers; uint32_t val, val2; uintmax_t freq; + uint16_t vendor; ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); @@ -194,10 +198,21 @@ acpi_hpet_attach(device_t dev) freq = (1000000000000000LL + val / 2) / val; if (bootverbose) { val = bus_read_4(sc->mem_res, HPET_CAPABILITIES); + + /* + * ATI/AMD violates IA-PC HPET (High Precision Event Timers) + * Specification and provides an off by one number + * of timers/comparators. + * Additionally, they use unregistered value in VENDOR_ID field. + */ + num_timers = 1 + ((val & HPET_CAP_NUM_TIM) >> 8); + vendor = val >> 16; + if (vendor == HPET_VENDID_AMD && num_timers > 0) + num_timers--; device_printf(dev, "vend: 0x%x rev: 0x%x num: %d hz: %jd opts:%s%s\n", - val >> 16, val & HPET_CAP_REV_ID, - (val & HPET_CAP_NUM_TIM) >> 8, freq, + vendor, val & HPET_CAP_REV_ID, + num_timers, freq, (val & HPET_CAP_LEG_RT) ? " legacy_route" : "", (val & HPET_CAP_COUNT_SIZE) ? " 64-bit" : ""); } From owner-svn-src-stable@FreeBSD.ORG Wed Feb 10 10:09:04 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0686D106568F; Wed, 10 Feb 2010 10:09:04 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 51B228FC19; Wed, 10 Feb 2010 10:09:01 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA29445; Wed, 10 Feb 2010 12:09:00 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Nf9VE-0005S6-5F; Wed, 10 Feb 2010 12:09:00 +0200 Message-ID: <4B7285BA.3050000@freebsd.org> Date: Wed, 10 Feb 2010 12:08:58 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20091128) MIME-Version: 1.0 To: Marko Zec References: <201002100850.o1A8o6tD038842@svn.freebsd.org> In-Reply-To: <201002100850.o1A8o6tD038842@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r203748 - stable/8/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 10:09:04 -0000 on 10/02/2010 10:50 Marko Zec said the following: > Author: zec > Date: Wed Feb 10 08:50:06 2010 > New Revision: 203748 > URL: http://svn.freebsd.org/changeset/base/203748 > > Log: > MFC r203483: > Instead of spamming the console on each curvnet recursion event, print > out each such call graph only once, along with a stack backtrace. This > should make kernels built with VNET_DEBUG reasonably usable again in > busy / production environments. > > Introduce a new DDB command "show vnetrcrs" which dumps the whole log > of distinctive curvnet recursion events. This might be useful when > recursion reports get burried / lost too deep in the message buffer. > In the later case stack backtraces are not available. > > Reviewed by: bz > > Modified: > stable/8/sys/net/vnet.c > stable/8/sys/net/vnet.h > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/dev/xen/xenpci/ (props changed) > stable/8/sys/netinet/ (props changed) It looks like after this commit we started to have mergeinfo on stable/8/sys/netinet. Not sure if this is correct or not. -- Andriy Gapon From owner-svn-src-stable@FreeBSD.ORG Wed Feb 10 11:04:34 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 724D91065670; Wed, 10 Feb 2010 11:04:34 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id 26FD08FC0C; Wed, 10 Feb 2010 11:04:33 +0000 (UTC) Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NfAD2-00073O-NV; Wed, 10 Feb 2010 13:54:16 +0300 Date: Wed, 10 Feb 2010 13:54:11 +0300 From: Ruslan Ermilov To: Andriy Gapon Message-ID: <20100210105411.GB85373@edoofus.dev.vega.ru> References: <201002100850.o1A8o6tD038842@svn.freebsd.org> <4B7285BA.3050000@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B7285BA.3050000@freebsd.org> Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Marko Zec , Qing Li , svn-src-stable-8@freebsd.org Subject: Re: svn commit: r203748 - stable/8/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 11:04:34 -0000 On Wed, Feb 10, 2010 at 12:08:58PM +0200, Andriy Gapon wrote: > on 10/02/2010 10:50 Marko Zec said the following: > > Author: zec > > Date: Wed Feb 10 08:50:06 2010 > > New Revision: 203748 > > URL: http://svn.freebsd.org/changeset/base/203748 > > > > Log: > > MFC r203483: > > Instead of spamming the console on each curvnet recursion event, print > > out each such call graph only once, along with a stack backtrace. This > > should make kernels built with VNET_DEBUG reasonably usable again in > > busy / production environments. > > > > Introduce a new DDB command "show vnetrcrs" which dumps the whole log > > of distinctive curvnet recursion events. This might be useful when > > recursion reports get burried / lost too deep in the message buffer. > > In the later case stack backtraces are not available. > > > > Reviewed by: bz > > > > Modified: > > stable/8/sys/net/vnet.c > > stable/8/sys/net/vnet.h > > Directory Properties: > > stable/8/sys/ (props changed) > > stable/8/sys/amd64/include/xen/ (props changed) > > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > > stable/8/sys/contrib/dev/acpica/ (props changed) > > stable/8/sys/contrib/pf/ (props changed) > > stable/8/sys/dev/xen/xenpci/ (props changed) > > stable/8/sys/netinet/ (props changed) > > It looks like after this commit we started to have mergeinfo on > stable/8/sys/netinet. Not sure if this is correct or not. Actually svn:mergeinfo was brought in previous commit by Qing Li, who merged directly to sys/netinet/ instead of sys/. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-stable@FreeBSD.ORG Wed Feb 10 12:20:09 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4165B1065676; Wed, 10 Feb 2010 12:20:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EA768FC28; Wed, 10 Feb 2010 12:20:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1ACK8Ap086694; Wed, 10 Feb 2010 12:20:08 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ACK81o086693; Wed, 10 Feb 2010 12:20:08 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002101220.o1ACK81o086693@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 10 Feb 2010 12:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203753 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 12:20:09 -0000 Author: bz Date: Wed Feb 10 12:20:08 2010 New Revision: 203753 URL: http://svn.freebsd.org/changeset/base/203753 Log: Cleanup mergeinfo after r203718. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-stable@FreeBSD.ORG Wed Feb 10 16:16:50 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80004106568B; Wed, 10 Feb 2010 16:16:50 +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 6C8EF8FC1B; Wed, 10 Feb 2010 16:16:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AGGocv039918; Wed, 10 Feb 2010 16:16:50 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AGGo4f039911; Wed, 10 Feb 2010 16:16:50 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201002101616.o1AGGo4f039911@svn.freebsd.org> From: Rick Macklem Date: Wed, 10 Feb 2010 16:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203756 - stable/8/sys/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 16:16:50 -0000 Author: rmacklem Date: Wed Feb 10 16:16:50 2010 New Revision: 203756 URL: http://svn.freebsd.org/changeset/base/203756 Log: MFC: r203072 Fix a race that can occur when nfs nfsiod threads are being created. Without this patch it was possible for a different thread that calls nfs_asyncio() to snitch a newly created nfsiod thread that was intended for another caller of nfs_asyncio(), because the nfs_iod_mtx mutex was unlocked while the new nfsiod thread was created. This patch labels the newly created nfsiod, so that it is not taken by another caller of nfs_asyncio(). This is believed to fix the problem reported on the freebsd-stable email list under the subject: FreeBSD NFS client/Linux NFS server issue. Tested by: to DOT my DOT trociny AT gmail DOT com Reviewed by: jhb Modified: stable/8/sys/nfsclient/nfs.h stable/8/sys/nfsclient/nfs_bio.c stable/8/sys/nfsclient/nfs_nfsiod.c stable/8/sys/nfsclient/nfs_subs.c stable/8/sys/nfsclient/nfs_vnops.c stable/8/sys/nfsclient/nfsnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/nfsclient/nfs.h ============================================================================== --- stable/8/sys/nfsclient/nfs.h Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfs.h Wed Feb 10 16:16:50 2010 (r203756) @@ -252,7 +252,7 @@ int nfs_writerpc(struct vnode *, struct int nfs_commit(struct vnode *vp, u_quad_t offset, int cnt, struct ucred *cred, struct thread *td); int nfs_readdirrpc(struct vnode *, struct uio *, struct ucred *); -int nfs_nfsiodnew(void); +int nfs_nfsiodnew(int); int nfs_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *); int nfs_doio(struct vnode *, struct buf *, struct ucred *, struct thread *); void nfs_doio_directwrite (struct buf *); Modified: stable/8/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/8/sys/nfsclient/nfs_bio.c Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfs_bio.c Wed Feb 10 16:16:50 2010 (r203756) @@ -1377,7 +1377,7 @@ again: * Find a free iod to process this request. */ for (iod = 0; iod < nfs_numasync; iod++) - if (nfs_iodwant[iod]) { + if (nfs_iodwant[iod] == NFSIOD_AVAILABLE) { gotiod = TRUE; break; } @@ -1386,7 +1386,7 @@ again: * Try to create one if none are free. */ if (!gotiod) { - iod = nfs_nfsiodnew(); + iod = nfs_nfsiodnew(1); if (iod != -1) gotiod = TRUE; } @@ -1398,7 +1398,7 @@ again: */ NFS_DPF(ASYNCIO, ("nfs_asyncio: waking iod %d for mount %p\n", iod, nmp)); - nfs_iodwant[iod] = NULL; + nfs_iodwant[iod] = NFSIOD_NOT_AVAILABLE; nfs_iodmount[iod] = nmp; nmp->nm_bufqiods++; wakeup(&nfs_iodwant[iod]); Modified: stable/8/sys/nfsclient/nfs_nfsiod.c ============================================================================== --- stable/8/sys/nfsclient/nfs_nfsiod.c Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfs_nfsiod.c Wed Feb 10 16:16:50 2010 (r203756) @@ -113,7 +113,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) * than the new minimum, create some more. */ for (i = nfs_iodmin - nfs_numasync; i > 0; i--) - nfs_nfsiodnew(); + nfs_nfsiodnew(0); out: mtx_unlock(&nfs_iod_mtx); return (0); @@ -147,7 +147,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) */ iod = nfs_numasync - 1; for (i = 0; i < nfs_numasync - nfs_iodmax; i++) { - if (nfs_iodwant[iod]) + if (nfs_iodwant[iod] == NFSIOD_AVAILABLE) wakeup(&nfs_iodwant[iod]); iod--; } @@ -160,7 +160,7 @@ SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, "Max number of nfsiod kthreads"); int -nfs_nfsiodnew(void) +nfs_nfsiodnew(int set_iodwant) { int error, i; int newiod; @@ -176,12 +176,17 @@ nfs_nfsiodnew(void) } if (newiod == -1) return (-1); + if (set_iodwant > 0) + nfs_iodwant[i] = NFSIOD_CREATED_FOR_NFS_ASYNCIO; mtx_unlock(&nfs_iod_mtx); error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID, 0, "nfsiod %d", newiod); mtx_lock(&nfs_iod_mtx); - if (error) + if (error) { + if (set_iodwant > 0) + nfs_iodwant[i] = NFSIOD_NOT_AVAILABLE; return (-1); + } nfs_numasync++; return (newiod); } @@ -199,7 +204,7 @@ nfsiod_setup(void *dummy) nfs_iodmin = NFS_MAXASYNCDAEMON; for (i = 0; i < nfs_iodmin; i++) { - error = nfs_nfsiodnew(); + error = nfs_nfsiodnew(0); if (error == -1) panic("nfsiod_setup: nfs_nfsiodnew failed"); } @@ -236,7 +241,8 @@ nfssvc_iod(void *instance) goto finish; if (nmp) nmp->nm_bufqiods--; - nfs_iodwant[myiod] = curthread->td_proc; + if (nfs_iodwant[myiod] == NFSIOD_NOT_AVAILABLE) + nfs_iodwant[myiod] = NFSIOD_AVAILABLE; nfs_iodmount[myiod] = NULL; /* * Always keep at least nfs_iodmin kthreads. @@ -303,7 +309,7 @@ finish: nfs_asyncdaemon[myiod] = 0; if (nmp) nmp->nm_bufqiods--; - nfs_iodwant[myiod] = NULL; + nfs_iodwant[myiod] = NFSIOD_NOT_AVAILABLE; nfs_iodmount[myiod] = NULL; /* Someone may be waiting for the last nfsiod to terminate. */ if (--nfs_numasync == 0) Modified: stable/8/sys/nfsclient/nfs_subs.c ============================================================================== --- stable/8/sys/nfsclient/nfs_subs.c Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfs_subs.c Wed Feb 10 16:16:50 2010 (r203756) @@ -347,7 +347,7 @@ nfs_init(struct vfsconf *vfsp) nfs_ticks = 1; /* Ensure async daemons disabled */ for (i = 0; i < NFS_MAXASYNCDAEMON; i++) { - nfs_iodwant[i] = NULL; + nfs_iodwant[i] = NFSIOD_NOT_AVAILABLE; nfs_iodmount[i] = NULL; } nfs_nhinit(); /* Init the nfsnode table */ @@ -375,7 +375,7 @@ nfs_uninit(struct vfsconf *vfsp) mtx_lock(&nfs_iod_mtx); nfs_iodmax = 0; for (i = 0; i < nfs_numasync; i++) - if (nfs_iodwant[i]) + if (nfs_iodwant[i] == NFSIOD_AVAILABLE) wakeup(&nfs_iodwant[i]); /* The last nfsiod to exit will wake us up when nfs_numasync hits 0 */ while (nfs_numasync) Modified: stable/8/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vnops.c Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfs_vnops.c Wed Feb 10 16:16:50 2010 (r203756) @@ -212,7 +212,7 @@ static int nfs_renameit(struct vnode *sd * Global variables */ struct mtx nfs_iod_mtx; -struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON]; +enum nfsiod_state nfs_iodwant[NFS_MAXASYNCDAEMON]; struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON]; int nfs_numasync = 0; vop_advlock_t *nfs_advlock_p = nfs_dolock; Modified: stable/8/sys/nfsclient/nfsnode.h ============================================================================== --- stable/8/sys/nfsclient/nfsnode.h Wed Feb 10 15:12:36 2010 (r203755) +++ stable/8/sys/nfsclient/nfsnode.h Wed Feb 10 16:16:50 2010 (r203756) @@ -177,10 +177,23 @@ struct nfsnode { #define NFS_TIMESPEC_COMPARE(T1, T2) (((T1)->tv_sec != (T2)->tv_sec) || ((T1)->tv_nsec != (T2)->tv_nsec)) /* + * NFS iod threads can be in one of these three states once spawned. + * NFSIOD_NOT_AVAILABLE - Cannot be assigned an I/O operation at this time. + * NFSIOD_AVAILABLE - Available to be assigned an I/O operation. + * NFSIOD_CREATED_FOR_NFS_ASYNCIO - Newly created for nfs_asyncio() and + * will be used by the thread that called nfs_asyncio(). + */ +enum nfsiod_state { + NFSIOD_NOT_AVAILABLE = 0, + NFSIOD_AVAILABLE = 1, + NFSIOD_CREATED_FOR_NFS_ASYNCIO = 2, +}; + +/* * Queue head for nfsiod's */ extern TAILQ_HEAD(nfs_bufq, buf) nfs_bufq; -extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON]; +extern enum nfsiod_state nfs_iodwant[NFS_MAXASYNCDAEMON]; extern struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON]; #if defined(_KERNEL) From owner-svn-src-stable@FreeBSD.ORG Wed Feb 10 20:35:21 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 288FA106566C; Wed, 10 Feb 2010 20:35:21 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 165C88FC13; Wed, 10 Feb 2010 20:35:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1AKZKTb001497; Wed, 10 Feb 2010 20:35:20 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1AKZK0G001495; Wed, 10 Feb 2010 20:35:20 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201002102035.o1AKZK0G001495@svn.freebsd.org> From: Kirk McKusick Date: Wed, 10 Feb 2010 20:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203765 - stable/8/sbin/fsck_ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 20:35:21 -0000 Author: mckusick Date: Wed Feb 10 20:35:20 2010 New Revision: 203765 URL: http://svn.freebsd.org/changeset/base/203765 Log: MFC of r201700 | mckusick | 2010-01-06 This corrects a bug that manifested itself as identifying the last cylinder group of a UFS1 filesystem as bad. The error was in the check and not in the cylinder group itself. So even though fsck fixed the cylinder group correctly, it was still endlessly reported as bad. This bug first appeared in 8.0 so does not apply to earlier releases. PR: 141992 Reported by: Dan Strick Modified: stable/8/sbin/fsck_ffs/fsutil.c Directory Properties: stable/8/sbin/fsck_ffs/ (props changed) Modified: stable/8/sbin/fsck_ffs/fsutil.c ============================================================================== --- stable/8/sbin/fsck_ffs/fsutil.c Wed Feb 10 20:17:46 2010 (r203764) +++ stable/8/sbin/fsck_ffs/fsutil.c Wed Feb 10 20:35:20 2010 (r203765) @@ -436,7 +436,7 @@ check_cgmagic(int cg, struct cg *cgp) ((sblock.fs_magic == FS_UFS1_MAGIC && cgp->cg_old_niblk == sblock.fs_ipg && cgp->cg_ndblk <= sblock.fs_fpg && - cgp->cg_old_ncyl == sblock.fs_old_cpg) || + cgp->cg_old_ncyl <= sblock.fs_old_cpg) || (sblock.fs_magic == FS_UFS2_MAGIC && cgp->cg_niblk == sblock.fs_ipg && cgp->cg_ndblk <= sblock.fs_fpg && From owner-svn-src-stable@FreeBSD.ORG Thu Feb 11 18:34:08 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 875601065676; Thu, 11 Feb 2010 18:34:08 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 713558FC08; Thu, 11 Feb 2010 18:34:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BIY8SC054327; Thu, 11 Feb 2010 18:34:08 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BIY71Y054300; Thu, 11 Feb 2010 18:34:07 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002111834.o1BIY71Y054300@svn.freebsd.org> From: Matt Jacob Date: Thu, 11 Feb 2010 18:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203786 - in stable/8/sys: cam/scsi compat/linux dev/aac dev/agp dev/amd dev/amr dev/arcmsr dev/ata dev/ata/chipsets dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5416... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 18:34:08 -0000 Author: mjacob Date: Thu Feb 11 18:34:06 2010 New Revision: 203786 URL: http://svn.freebsd.org/changeset/base/203786 Log: MFC a number of changes from head for ISP (203478,203463,203444,202418,201758, 201408,201325,200089,198822,197373,197372,197214,196162). Since one of those changes was a semicolon cleanup from somebody else, this touches a lot more. Deleted: stable/8/sys/dev/isp/isp_tpublic.h Modified: stable/8/sys/cam/scsi/scsi_ses.c stable/8/sys/cam/scsi/scsi_targ_bh.c stable/8/sys/compat/linux/linux_futex.c stable/8/sys/dev/aac/aac.c stable/8/sys/dev/agp/agp.c stable/8/sys/dev/amd/amd.c stable/8/sys/dev/amr/amr.c stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/ata/ata-raid.c stable/8/sys/dev/ata/chipsets/ata-ahci.c stable/8/sys/dev/ata/chipsets/ata-siliconimage.c stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c stable/8/sys/dev/bktr/bktr_i2c.c stable/8/sys/dev/cs/if_cs.c stable/8/sys/dev/cxgb/cxgb_sge.c stable/8/sys/dev/de/if_de.c stable/8/sys/dev/e1000/if_em.c stable/8/sys/dev/fatm/if_fatm.c stable/8/sys/dev/firewire/sbp.c stable/8/sys/dev/hatm/if_hatm.c stable/8/sys/dev/hptmv/entry.c stable/8/sys/dev/if_ndis/if_ndis_usb.c stable/8/sys/dev/iscsi/initiator/isc_sm.c stable/8/sys/dev/isp/isp.c stable/8/sys/dev/isp/isp_freebsd.c stable/8/sys/dev/isp/isp_freebsd.h stable/8/sys/dev/isp/isp_library.c stable/8/sys/dev/isp/isp_library.h stable/8/sys/dev/isp/isp_pci.c stable/8/sys/dev/isp/isp_sbus.c stable/8/sys/dev/isp/isp_stds.h stable/8/sys/dev/isp/ispmbox.h stable/8/sys/dev/isp/ispvar.h stable/8/sys/dev/ixgbe/ixgbe.c stable/8/sys/dev/malo/if_malo.c stable/8/sys/dev/mge/if_mge.c stable/8/sys/dev/mxge/if_mxge.c stable/8/sys/dev/patm/if_patm_intr.c stable/8/sys/dev/pdq/if_fea.c stable/8/sys/dev/safe/safe.c stable/8/sys/dev/sound/pci/maestro3.c stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/trm/trm.c stable/8/sys/dev/usb/controller/musb_otg.c stable/8/sys/dev/usb/storage/umass.c stable/8/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c stable/8/sys/isa/pnp.c stable/8/sys/kern/kern_fail.c stable/8/sys/kern/subr_firmware.c stable/8/sys/mips/adm5120/if_admsw.c stable/8/sys/mips/mips/elf_machdep.c stable/8/sys/net/flowtable.c stable/8/sys/net80211/ieee80211_node.c stable/8/sys/netinet/libalias/alias_db.c stable/8/sys/netinet/libalias/alias_mod.c stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctputil.c stable/8/sys/nfsclient/bootp_subr.c stable/8/sys/pci/ncr.c stable/8/sys/powerpc/aim/mmu_oea.c stable/8/sys/powerpc/aim/mmu_oea64.c stable/8/sys/powerpc/booke/pmap.c stable/8/sys/rpc/clnt_dg.c stable/8/sys/ufs/ffs/ffs_snapshot.c stable/8/sys/xen/xenbus/xenbus_probe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_ses.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_ses.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/cam/scsi/scsi_ses.c Thu Feb 11 18:34:06 2010 (r203786) @@ -1555,7 +1555,7 @@ ses_encode(char *b, int amt, uint8_t *ep */ static int safte_getconfig(ses_softc_t *); -static int safte_rdstat(ses_softc_t *, int);; +static int safte_rdstat(ses_softc_t *, int); static int set_objstat_sel(ses_softc_t *, ses_objstat *, int); static int wrbuf16(ses_softc_t *, uint8_t, uint8_t, uint8_t, uint8_t, int); static void wrslot_stat(ses_softc_t *, int); @@ -2257,7 +2257,7 @@ safte_rdstat(ses_softc_t *ssc, int slpfl ssc->ses_objmap[oid].encstat[0] = SES_OBJSTAT_NOTAVAIL; ssc->ses_objmap[oid].encstat[1] = 0; ssc->ses_objmap[oid].encstat[2] = sdata[r]; - ssc->ses_objmap[oid].encstat[3] = 0;; + ssc->ses_objmap[oid].encstat[3] = 0; ssc->ses_objmap[oid++].svalid = 1; r++; } Modified: stable/8/sys/cam/scsi/scsi_targ_bh.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_targ_bh.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/cam/scsi/scsi_targ_bh.c Thu Feb 11 18:34:06 2010 (r203786) @@ -429,7 +429,7 @@ targbhdtor(struct cam_periph *periph) switch (softc->init_level) { case 0: - panic("targdtor - impossible init level");; + panic("targdtor - impossible init level"); case 1: /* FALLTHROUGH */ default: Modified: stable/8/sys/compat/linux/linux_futex.c ============================================================================== --- stable/8/sys/compat/linux/linux_futex.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/compat/linux/linux_futex.c Thu Feb 11 18:34:06 2010 (r203786) @@ -493,7 +493,7 @@ linux_sys_futex(struct thread *td, struc return (error); if (f == NULL) { td->td_retval[0] = 0; - return (error);; + return (error); } td->td_retval[0] = futex_wake(f, args->val); futex_put(f, NULL); Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/aac/aac.c Thu Feb 11 18:34:06 2010 (r203786) @@ -553,7 +553,7 @@ aac_alloc(struct aac_softc *sc) 0, /* flags */ NULL, NULL, /* No locking needed */ &sc->aac_fib_dmat)) { - device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n");; + device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n"); return (ENOMEM); } Modified: stable/8/sys/dev/agp/agp.c ============================================================================== --- stable/8/sys/dev/agp/agp.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/agp/agp.c Thu Feb 11 18:34:06 2010 (r203786) @@ -763,7 +763,7 @@ agp_allocate_user(device_t dev, agp_allo static int agp_deallocate_user(device_t dev, int id) { - struct agp_memory *mem = agp_find_memory(dev, id);; + struct agp_memory *mem = agp_find_memory(dev, id); if (mem) { AGP_FREE_MEMORY(dev, mem); Modified: stable/8/sys/dev/amd/amd.c ============================================================================== --- stable/8/sys/dev/amd/amd.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/amd/amd.c Thu Feb 11 18:34:06 2010 (r203786) @@ -1657,7 +1657,7 @@ amdhandlemsgreject(struct amd_softc *amd tinfo_sync_period[pDCB->SyncPeriod - 4]; pDCB->tinfo.goal.offset = pDCB->SyncOffset; pDCB->tinfo.current.period = - tinfo_sync_period[pDCB->SyncPeriod - 4];; + tinfo_sync_period[pDCB->SyncPeriod - 4]; pDCB->tinfo.current.offset = pDCB->SyncOffset; /* Modified: stable/8/sys/dev/amr/amr.c ============================================================================== --- stable/8/sys/dev/amr/amr.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/amr/amr.c Thu Feb 11 18:34:06 2010 (r203786) @@ -221,7 +221,7 @@ amr_attach(struct amr_softc *sc) sc->amr_submit_command = amr_std_submit_command; sc->amr_get_work = amr_std_get_work; sc->amr_poll_command = amr_std_poll_command; - amr_std_attach_mailbox(sc);; + amr_std_attach_mailbox(sc); } #ifdef AMR_BOARD_INIT Modified: stable/8/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/arcmsr/arcmsr.c Thu Feb 11 18:34:06 2010 (r203786) @@ -1940,7 +1940,7 @@ static void arcmsr_handle_virtual_comman switch (pccb->csio.cdb_io.cdb_bytes[0]) { case INQUIRY: { unsigned char inqdata[36]; - char *buffer=pccb->csio.data_ptr;; + char *buffer=pccb->csio.data_ptr; if (pccb->ccb_h.target_lun) { pccb->ccb_h.status |= CAM_SEL_TIMEOUT; Modified: stable/8/sys/dev/ata/ata-raid.c ============================================================================== --- stable/8/sys/dev/ata/ata-raid.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ata/ata-raid.c Thu Feb 11 18:34:06 2010 (r203786) @@ -407,7 +407,7 @@ ata_raid_strategy(struct bio *bp) if (rdp->status & AR_S_REBUILDING) blk = ((lba / rdp->interleave) * rdp->width) * rdp->interleave + (rdp->interleave * (drv % rdp->width)) + - lba % rdp->interleave;; + lba % rdp->interleave; if (bp->bio_cmd == BIO_READ) { int src_online = Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ahci.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ata/chipsets/ata-ahci.c Thu Feb 11 18:34:06 2010 (r203786) @@ -656,9 +656,9 @@ ata_ahci_pm_write(device_t dev, int port ctp->cfis[3] = reg; ctp->cfis[7] = port | ATA_D_LBA; ctp->cfis[12] = value & 0xff; - ctp->cfis[4] = (value >> 8) & 0xff;; - ctp->cfis[5] = (value >> 16) & 0xff;; - ctp->cfis[6] = (value >> 24) & 0xff;; + ctp->cfis[4] = (value >> 8) & 0xff; + ctp->cfis[5] = (value >> 16) & 0xff; + ctp->cfis[6] = (value >> 24) & 0xff; ctp->cfis[15] = ATA_A_4BIT; if (ata_ahci_issue_cmd(dev, 0, 100)) { Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Thu Feb 11 18:34:06 2010 (r203786) @@ -716,9 +716,9 @@ ata_siiprb_pm_write(device_t dev, int po prb->fis[3] = reg; prb->fis[7] = port; prb->fis[12] = value & 0xff; - prb->fis[4] = (value >> 8) & 0xff;; - prb->fis[5] = (value >> 16) & 0xff;; - prb->fis[6] = (value >> 24) & 0xff;; + prb->fis[4] = (value >> 8) & 0xff; + prb->fis[5] = (value >> 16) & 0xff; + prb->fis[6] = (value >> 24) & 0xff; if (ata_siiprb_issue_cmd(dev)) { device_printf(dev, "error writing PM port\n"); return ATA_E_ABORT; Modified: stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Thu Feb 11 18:34:06 2010 (r203786) @@ -136,7 +136,7 @@ static void ar5211GetLowerUpperPcdacs(ui uint16_t channel, const PCDACS_EEPROM *pSrcStruct, uint16_t *pLowerPcdac, uint16_t *pUpperPcdac); -static void ar5211SetRfgain(struct ath_hal *, const GAIN_VALUES *);; +static void ar5211SetRfgain(struct ath_hal *, const GAIN_VALUES *); static void ar5211RequestRfgain(struct ath_hal *); static HAL_BOOL ar5211InvalidGainReadback(struct ath_hal *, GAIN_VALUES *); static HAL_BOOL ar5211IsGainAdjustNeeded(struct ath_hal *, const GAIN_VALUES *); Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c Thu Feb 11 18:34:06 2010 (r203786) @@ -76,7 +76,7 @@ ar5212GetPendingInterrupts(struct ath_ha isr = OS_REG_READ(ah, AR_ISR_RAC); if (isr == 0xffffffff) { *masked = 0; - return AH_FALSE;; + return AH_FALSE; } *masked = isr & HAL_INT_COMMON; Modified: stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Feb 11 18:34:06 2010 (r203786) @@ -104,7 +104,7 @@ ar5416GetPendingInterrupts(struct ath_ha isr = OS_REG_READ(ah, AR_ISR_RAC); if (isr == 0xffffffff) { *masked = 0; - return AH_FALSE;; + return AH_FALSE; } *masked = isr & HAL_INT_COMMON; Modified: stable/8/sys/dev/bktr/bktr_i2c.c ============================================================================== --- stable/8/sys/dev/bktr/bktr_i2c.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/bktr/bktr_i2c.c Thu Feb 11 18:34:06 2010 (r203786) @@ -331,7 +331,7 @@ bti2c_smb_readb(device_t dev, u_char sla /* clear status bits */ OUTL(sc,BKTR_INT_STAT, (BT848_INT_RACK | BT848_INT_I2CDONE)); - OUTL(sc,BKTR_I2C_DATA_CTL, ((slave & 0xff) << 24) | (u_char)cmd);; + OUTL(sc,BKTR_I2C_DATA_CTL, ((slave & 0xff) << 24) | (u_char)cmd); BTI2C_DEBUG(printf("r%lx/", (u_long)(((slave & 0xff) << 24) | (u_char)cmd))); Modified: stable/8/sys/dev/cs/if_cs.c ============================================================================== --- stable/8/sys/dev/cs/if_cs.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/cs/if_cs.c Thu Feb 11 18:34:06 2010 (r203786) @@ -475,7 +475,7 @@ int cs_attach(device_t dev) { int error, media=0; - struct cs_softc *sc = device_get_softc(dev);; + struct cs_softc *sc = device_get_softc(dev); struct ifnet *ifp; sc->dev = dev; Modified: stable/8/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_sge.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/cxgb/cxgb_sge.c Thu Feb 11 18:34:06 2010 (r203786) @@ -152,7 +152,7 @@ struct rx_desc { uint32_t len_gen; uint32_t gen2; uint32_t addr_hi; -} __packed;; +} __packed; struct rsp_desc { /* response queue descriptor */ struct rss_header rss_hdr; Modified: stable/8/sys/dev/de/if_de.c ============================================================================== --- stable/8/sys/dev/de/if_de.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/de/if_de.c Thu Feb 11 18:34:06 2010 (r203786) @@ -2289,7 +2289,7 @@ tulip_identify_asante_nic(tulip_softc_t mi->mi_gpr_length = 0; mi->mi_gpr_offset = 0; mi->mi_reset_length = 0; - mi->mi_reset_offset = 0;; + mi->mi_reset_offset = 0; mi->mi_phyaddr = TULIP_MII_NOPHY; for (idx = 20; idx > 0 && mi->mi_phyaddr == TULIP_MII_NOPHY; idx--) { Modified: stable/8/sys/dev/e1000/if_em.c ============================================================================== --- stable/8/sys/dev/e1000/if_em.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/e1000/if_em.c Thu Feb 11 18:34:06 2010 (r203786) @@ -4446,7 +4446,7 @@ em_free_receive_structures(struct adapte static int em_rxeof(struct adapter *adapter, int count) { - struct ifnet *ifp = adapter->ifp;; + struct ifnet *ifp = adapter->ifp; struct mbuf *mp; u8 status, accept_frame = 0, eop = 0; u16 len, desc_len, prev_len_adj; Modified: stable/8/sys/dev/fatm/if_fatm.c ============================================================================== --- stable/8/sys/dev/fatm/if_fatm.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/fatm/if_fatm.c Thu Feb 11 18:34:06 2010 (r203786) @@ -860,7 +860,7 @@ fatm_getprom(struct fatm_softc *sc) NEXT_QUEUE_ENTRY(sc->cmdqueue.head, FATM_CMD_QLEN); q->error = 0; - q->cb = NULL;; + q->cb = NULL; H_SETSTAT(q->q.statp, FATM_STAT_PENDING); H_SYNCSTAT_PREWRITE(sc, q->q.statp); Modified: stable/8/sys/dev/firewire/sbp.c ============================================================================== --- stable/8/sys/dev/firewire/sbp.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/firewire/sbp.c Thu Feb 11 18:34:06 2010 (r203786) @@ -1573,7 +1573,7 @@ END_DEBUG bcopy(&sbp_cmd_status->s_keydep[0], &sense->sense_key_spec[0], 3); - ocb->ccb->csio.scsi_status = sbp_cmd_status->status;; + ocb->ccb->csio.scsi_status = sbp_cmd_status->status; ocb->ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; /* @@ -2148,7 +2148,7 @@ sbp_free_target(struct sbp_target *targe } STAILQ_INIT(&target->xferlist); free(target->luns, M_SBP); - target->num_lun = 0;; + target->num_lun = 0; target->luns = NULL; target->fwdev = NULL; } @@ -2318,7 +2318,7 @@ sbp_timeout(void *arg) sbp_cam_detach_target(target); if (target->luns != NULL) free(target->luns, M_SBP); - target->num_lun = 0;; + target->num_lun = 0; target->luns = NULL; target->fwdev = NULL; #endif Modified: stable/8/sys/dev/hatm/if_hatm.c ============================================================================== --- stable/8/sys/dev/hatm/if_hatm.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/hatm/if_hatm.c Thu Feb 11 18:34:06 2010 (r203786) @@ -836,7 +836,7 @@ hatm_init_rx_buffer_pool(struct hatm_sof uint32_t lbuf_addr; /* address of current buffer */ u_int i; - row_size = sc->bytes_per_row;; + row_size = sc->bytes_per_row; row_addr = start * row_size; lbuf_size = sc->cells_per_lbuf * 48; lbufs_per_row = sc->cells_per_row / sc->cells_per_lbuf; @@ -889,7 +889,7 @@ hatm_init_tx_buffer_pool(struct hatm_sof uint32_t lbuf_addr; /* address of current buffer */ u_int i; - row_size = sc->bytes_per_row;; + row_size = sc->bytes_per_row; row_addr = start * row_size; lbuf_size = sc->cells_per_lbuf * 48; lbufs_per_row = sc->cells_per_row / sc->cells_per_lbuf; Modified: stable/8/sys/dev/hptmv/entry.c ============================================================================== --- stable/8/sys/dev/hptmv/entry.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/hptmv/entry.c Thu Feb 11 18:34:06 2010 (r203786) @@ -1341,7 +1341,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter) #endif &pAdapter->io_dma_parent /* tag */)) { - return ENXIO;; + return ENXIO; } Modified: stable/8/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis_usb.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/if_ndis/if_ndis_usb.c Thu Feb 11 18:34:06 2010 (r203786) @@ -204,7 +204,7 @@ ndisusb_detach(device_t self) { int i; struct ndis_softc *sc = device_get_softc(self); - struct ndisusb_ep *ne;; + struct ndisusb_ep *ne; sc->ndisusb_status |= NDISUSB_STATUS_DETACH; Modified: stable/8/sys/dev/iscsi/initiator/isc_sm.c ============================================================================== --- stable/8/sys/dev/iscsi/initiator/isc_sm.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/iscsi/initiator/isc_sm.c Thu Feb 11 18:34:06 2010 (r203786) @@ -399,7 +399,7 @@ ism_recv(isc_session_t *sp, pduq_t *pq) if(sp->flags & ISC_STALLED) { sdebug(4, "window opened: max=0x%x exp=0x%x opcode=0x%x cmd=0x%x cws=%d.", sn->maxCmd, sn->expCmd, bhs->opcode, sn->cmd, sp->cws); - sp->flags &= ~ISC_STALLED;; + sp->flags &= ~ISC_STALLED; } } } Modified: stable/8/sys/dev/isp/isp.c ============================================================================== --- stable/8/sys/dev/isp/isp.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/isp/isp.c Thu Feb 11 18:34:06 2010 (r203786) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); /* * General defines */ - #define MBOX_DELAY_COUNT 1000000 / 100 #define ISP_MARK_PORTDB(a, b, c) \ isp_prt(isp, ISP_LOGSANCFG, \ @@ -695,7 +694,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d mbs.logval = MBLOGALL; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, "NOP ommand failed (%x)", mbs.param[0]); + isp_prt(isp, ISP_LOGERR, "NOP command failed (%x)", mbs.param[0]); ISP_RESET0(isp); return; } @@ -1547,24 +1546,18 @@ isp_fibre_init(ispsoftc_t *isp) } icbp->icb_maxfrmlen = DEFAULT_FRAMESIZE(isp); - if (icbp->icb_maxfrmlen < ICB_MIN_FRMLEN || - icbp->icb_maxfrmlen > ICB_MAX_FRMLEN) { - isp_prt(isp, ISP_LOGERR, - "bad frame length (%d) from NVRAM- using %d", - DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN); + if (icbp->icb_maxfrmlen < ICB_MIN_FRMLEN || icbp->icb_maxfrmlen > ICB_MAX_FRMLEN) { + isp_prt(isp, ISP_LOGERR, "bad frame length (%d) from NVRAM- using %d", DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN); icbp->icb_maxfrmlen = ICB_DFLT_FRMLEN; } icbp->icb_maxalloc = fcp->isp_maxalloc; if (icbp->icb_maxalloc < 1) { - isp_prt(isp, ISP_LOGERR, - "bad maximum allocation (%d)- using 16", fcp->isp_maxalloc); + isp_prt(isp, ISP_LOGERR, "bad maximum allocation (%d)- using 16", fcp->isp_maxalloc); icbp->icb_maxalloc = 16; } icbp->icb_execthrottle = DEFAULT_EXEC_THROTTLE(isp); if (icbp->icb_execthrottle < 1) { - isp_prt(isp, ISP_LOGERR, - "bad execution throttle of %d- using %d", - DEFAULT_EXEC_THROTTLE(isp), ICB_DFLT_THROTTLE); + isp_prt(isp, ISP_LOGERR, "bad execution throttle of %d- using %d", DEFAULT_EXEC_THROTTLE(isp), ICB_DFLT_THROTTLE); icbp->icb_execthrottle = ICB_DFLT_THROTTLE; } icbp->icb_retry_delay = fcp->isp_retry_delay; @@ -1658,18 +1651,18 @@ isp_fibre_init(ispsoftc_t *isp) /* * For 22XX > 2.1.26 && 23XX, set some options. - * XXX: Probably okay for newer 2100 f/w too. */ if (ISP_FW_NEWER_THAN(isp, 2, 26, 0)) { - /* - * Turn on LIP F8 async event (1) - * Turn on generate AE 8013 on all LIP Resets (2) - * Disable LIP F7 switching (8) - */ MBSINIT(&mbs, MBOX_SET_FIRMWARE_OPTIONS, MBLOGALL, 0); - mbs.param[1] = 0xb; + mbs.param[1] = IFCOPT1_DISF7SWTCH|IFCOPT1_LIPASYNC|IFCOPT1_LIPF8; mbs.param[2] = 0; mbs.param[3] = 0; + if (ISP_FW_NEWER_THAN(isp, 3, 16, 0)) { + mbs.param[1] |= IFCOPT1_EQFQASYNC|IFCOPT1_CTIO_RETRY; + if (fcp->role & ISP_ROLE_TARGET) { + mbs.param[3] = IFCOPT3_NOPRLI; + } + } isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { return; @@ -2093,8 +2086,7 @@ isp_mark_portdb(ispsoftc_t *isp, int cha * or via FABRIC LOGIN/FABRIC LOGOUT for other cards. */ static int -isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, - int flags, int gs) +isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, int flags, int gs) { mbreg_t mbs; uint8_t q[QENTRY_LEN]; @@ -2771,21 +2763,15 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) /* * Make sure we're okay for doing this right now. */ - if (fcp->isp_loopstate != LOOP_PDB_RCVD && - fcp->isp_loopstate != LOOP_FSCAN_DONE && - fcp->isp_loopstate != LOOP_LSCAN_DONE) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", - fcp->isp_loopstate); + if (fcp->isp_loopstate != LOOP_PDB_RCVD && fcp->isp_loopstate != LOOP_FSCAN_DONE && fcp->isp_loopstate != LOOP_LSCAN_DONE) { + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", fcp->isp_loopstate); return (-1); } - if (fcp->isp_topo == TOPO_FL_PORT || - fcp->isp_topo == TOPO_NL_PORT || - fcp->isp_topo == TOPO_N_PORT) { + if (fcp->isp_topo == TOPO_FL_PORT || fcp->isp_topo == TOPO_NL_PORT || fcp->isp_topo == TOPO_N_PORT) { if (fcp->isp_loopstate < LOOP_LSCAN_DONE) { if (isp_scan_loop(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, - "isp_pdb_sync: isp_scan_loop failed"); + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_loop failed"); return (-1); } } @@ -2794,15 +2780,13 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) if (fcp->isp_topo == TOPO_F_PORT || fcp->isp_topo == TOPO_FL_PORT) { if (fcp->isp_loopstate < LOOP_FSCAN_DONE) { if (isp_scan_fabric(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, - "isp_pdb_sync: isp_scan_fabric failed"); + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_fabric failed"); return (-1); } } } - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Synchronizing PDBs", chan); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Synchronizing PDBs", chan); fcp->isp_loopstate = LOOP_SYNCING_PDB; @@ -2831,11 +2815,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) lp->state = FC_PORTDB_STATE_NIL; isp_async(isp, ISPASYNC_DEV_GONE, chan, lp); if (lp->autologin == 0) { - (void) isp_plogx(isp, chan, lp->handle, - lp->portid, - PLOGX_FLG_CMD_LOGO | - PLOGX_FLG_IMPLICIT | - PLOGX_FLG_FREE_NPHDL, 0); + (void) isp_plogx(isp, chan, lp->handle, lp->portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 0); } else { lp->autologin = 0; } @@ -3081,8 +3061,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) for (i = 0; i < MAX_FC_TARG; i++) { lp = &fcp->portdb[i]; - if (lp->state == FC_PORTDB_STATE_NIL || - lp->target_mode) { + if (lp->state == FC_PORTDB_STATE_NIL || lp->target_mode) { continue; } if (lp->node_wwn != tmp.node_wwn) { @@ -3600,8 +3579,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) { lp = &fcp->portdb[dbidx]; - if (lp->state != FC_PORTDB_STATE_PROBATIONAL || - lp->target_mode) { + if (lp->state != FC_PORTDB_STATE_PROBATIONAL || lp->target_mode) { continue; } if (lp->portid == portid) { @@ -3838,8 +3816,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha if (fcp->portdb[dbidx].target_mode) { continue; } - if (fcp->portdb[dbidx].node_wwn == wwnn && - fcp->portdb[dbidx].port_wwn == wwpn) { + if (fcp->portdb[dbidx].node_wwn == wwnn && fcp->portdb[dbidx].port_wwn == wwpn) { break; } } @@ -4425,7 +4402,7 @@ isp_start(XS_T *xs) *tptr = 0x1999; } - if (isp_save_xs(isp, xs, &handle)) { + if (isp_allocate_xs(isp, xs, &handle)) { isp_prt(isp, ISP_LOGDEBUG0, "out of xflist pointers"); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); @@ -5171,8 +5148,8 @@ again: } } - if ((sp->req_handle != ISP_SPCL_HANDLE) && (sp->req_handle > isp->isp_maxcmds || sp->req_handle < 1)) { - isp_prt(isp, ISP_LOGERR, "bad request handle %d (type 0x%x)", sp->req_handle, etype); + if (!ISP_VALID_HANDLE(isp, sp->req_handle)) { + isp_prt(isp, ISP_LOGERR, "bad request handle 0x%x (iocb type 0x%x)", sp->req_handle, etype); ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ ISP_WRITE(isp, isp->isp_respoutrp, optr); continue; @@ -5186,14 +5163,13 @@ again: */ if (etype != RQSTYPE_RESPONSE) { isp_prt(isp, ISP_LOGERR, "cannot find handle 0x%x (type 0x%x)", sp->req_handle, etype); - } else if (ts != RQCS_ABORTED && ts != RQCS_RESET_OCCURRED && sp->req_handle != ISP_SPCL_HANDLE) { + } else if (ts != RQCS_ABORTED && ts != RQCS_RESET_OCCURRED) { isp_prt(isp, ISP_LOGERR, "cannot find handle 0x%x (status 0x%x)", sp->req_handle, ts); } ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ ISP_WRITE(isp, isp->isp_respoutrp, optr); continue; } - isp_destroy_handle(isp, sp->req_handle); if (req_status_flags & RQSTF_BUS_RESET) { XS_SETERR(xs, HBA_BUSRESET); ISP_SET_SENDMARKER(isp, XS_CHANNEL(xs), 1); @@ -5329,6 +5305,7 @@ again: if (XS_XFRLEN(xs)) { ISP_DMAFREE(isp, xs, sp->req_handle); } + isp_destroy_handle(isp, sp->req_handle); if (((isp->isp_dblev & (ISP_LOGDEBUG1|ISP_LOGDEBUG2|ISP_LOGDEBUG3))) || ((isp->isp_dblev & ISP_LOGDEBUG0) && ((!XS_NOERR(xs)) || @@ -5689,16 +5666,19 @@ isp_parse_async(ispsoftc_t *isp, uint16_ * commands that complete (with no apparent error) after * we receive a LIP. This has been observed mostly on * Local Loop topologies. To be safe, let's just mark - * all active commands as dead. + * all active initiator commands as dead. */ if (topo == TOPO_NL_PORT || topo == TOPO_FL_PORT) { int i, j; for (i = j = 0; i < isp->isp_maxcmds; i++) { XS_T *xs; - xs = isp->isp_xflist[i]; - if (xs == NULL) { + isp_hdl_t *hdp; + + hdp = &isp->isp_xflist[i]; + if (ISP_H2HT(hdp->handle) != ISP_HANDLE_INITIATOR) { continue; } + xs = hdp->cmd; if (XS_CHANNEL(xs) != chan) { continue; } @@ -6666,8 +6646,8 @@ isp_mbox_continue(ispsoftc_t *isp) ptr = isp->isp_mbxworkp; switch (isp->isp_lastmbxcmd) { case MBOX_WRITE_RAM_WORD: - mbs.param[1] = isp->isp_mbxwrk1++;; - mbs.param[2] = *ptr++;; + mbs.param[1] = isp->isp_mbxwrk1++; + mbs.param[2] = *ptr++; break; case MBOX_READ_RAM_WORD: *ptr++ = isp->isp_mboxtmp[2]; @@ -6677,7 +6657,7 @@ isp_mbox_continue(ispsoftc_t *isp) offset = isp->isp_mbxwrk1; offset |= isp->isp_mbxwrk8 << 16; - mbs.param[2] = *ptr++;; + mbs.param[2] = *ptr++; mbs.param[1] = offset; mbs.param[8] = offset >> 16; isp->isp_mbxwrk1 = ++offset; @@ -8293,6 +8273,8 @@ isp_parse_nvram_2100(ispsoftc_t *isp, ui if ((wwn >> 60) == 0) { wwn |= (((uint64_t) 2)<< 60); } + } else { + wwn = fcp->isp_wwpn_nvram & ~((uint64_t) 0xfff << 48); } } else { wwn &= ~((uint64_t) 0xfff << 48); @@ -8358,11 +8340,6 @@ isp_parse_nvram_2400(ispsoftc_t *isp, ui ISP2400_NVRAM_FIRMWARE_OPTIONS3(nvram_data)); wwn = ISP2400_NVRAM_PORT_NAME(nvram_data); - if (wwn) { - if ((wwn >> 60) != 2 && (wwn >> 60) != 5) { - wwn = 0; - } - } fcp->isp_wwpn_nvram = wwn; wwn = ISP2400_NVRAM_NODE_NAME(nvram_data); @@ -8371,6 +8348,10 @@ isp_parse_nvram_2400(ispsoftc_t *isp, ui wwn = 0; } } + if (wwn == 0 && (fcp->isp_wwpn_nvram >> 60) == 2) { + wwn = fcp->isp_wwpn_nvram; + wwn &= ~((uint64_t) 0xfff << 48); + } fcp->isp_wwnn_nvram = wwn; if (ISP2400_NVRAM_EXCHANGE_COUNT(nvram_data)) { Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/isp/isp_freebsd.c Thu Feb 11 18:34:06 2010 (r203786) @@ -133,33 +133,37 @@ isp_attach_chan(ispsoftc_t *isp, struct } #endif } else { + fcparam *fcp = FCPARAM(isp, chan); struct isp_fc *fc = ISP_FC_PC(isp, chan); + ISP_LOCK(isp); fc->sim = sim; fc->path = path; fc->isp = isp; + fc->ready = 1; callout_init_mtx(&fc->ldt, &isp->isp_osinfo.lock, 0); callout_init_mtx(&fc->gdt, &isp->isp_osinfo.lock, 0); - - if (THREAD_CREATE(isp_kthread, fc, &fc->kproc, 0, 0, "%s: fc_thrd%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { - xpt_free_path(fc->path); - ISP_LOCK(isp); - xpt_bus_deregister(cam_sim_path(fc->sim)); - ISP_UNLOCK(isp); - cam_sim_free(fc->sim, FALSE); - } /* * We start by being "loop down" if we have an initiator role */ - ISP_LOCK(isp); - if ((FCPARAM(isp, chan)->role & ISP_ROLE_INITIATOR) && fc->ldt_running == 0) { + if (fcp->role & ISP_ROLE_INITIATOR) { isp_freeze_loopdown(isp, chan, "isp_attach"); - fc->ldt_running = 1; callout_reset(&fc->ldt, isp_quickboot_time * hz, isp_ldt, fc); isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Starting Initial Loop Down Timer @ %lu", (unsigned long) time_uptime); } ISP_UNLOCK(isp); + if (THREAD_CREATE(isp_kthread, fc, &fc->kproc, 0, 0, "%s: fc_thrd%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { + xpt_free_path(fc->path); + ISP_LOCK(isp); + if (callout_active(&fc->ldt)) { + callout_stop(&fc->ldt); + } + xpt_bus_deregister(cam_sim_path(fc->sim)); + ISP_UNLOCK(isp); + cam_sim_free(fc->sim, FALSE); + return (ENOMEM); + } #ifdef ISP_INTERNAL_TARGET ISP_SET_PC(isp, chan, proc_active, 1); if (THREAD_CREATE(isp_target_thread_fc, fc, &fc->target_proc, 0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { @@ -343,6 +347,17 @@ ispioctl(struct cdev *dev, u_long c, cad break; } if (IS_FC(isp)) { + /* + * We don't really support dual role at present on FC cards. + * + * We should, but a bunch of things are currently broken, + * so don't allow it. + */ + if (nr == ISP_ROLE_BOTH) { + isp_prt(isp, ISP_LOGERR, "cannot support dual role at present"); + retval = EINVAL; + break; + } *(int *)addr = FCPARAM(isp, chan)->role; #ifdef ISP_INTERNAL_TARGET ISP_LOCK(isp); @@ -1638,7 +1653,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u cto->ct_timeout = 10; } - if (isp_save_xs_tgt(isp, ccb, &handle)) { + if (isp_allocate_xs_tgt(isp, ccb, &handle)) { xpt_print(ccb->ccb_h.path, "No XFLIST pointers for %s\n", __func__); ccb->ccb_h.status = CAM_REQUEUE_REQ; goto out; @@ -2943,8 +2958,8 @@ isp_target_mark_aborted_early(ispsoftc_t #ifdef ISP_INTERNAL_TARGET // #define ISP_FORCE_TIMEOUT 1 -#define ISP_TEST_WWNS 1 -#define ISP_TEST_SEPARATE_STATUS 1 +// #define ISP_TEST_WWNS 1 +// #define ISP_TEST_SEPARATE_STATUS 1 #define ccb_data_offset ppriv_field0 #define ccb_atio ppriv_ptr1 @@ -3819,21 +3834,41 @@ isp_watchdog(void *arg) isp = XS_ISP(xs); handle = isp_find_handle(isp, xs); - if (handle) { + if (handle != ISP_HANDLE_FREE) { + /* + * Try and make sure the command is really dead before + * we release the handle (and DMA resources) for reuse. + * + * If we are successful in aborting the command then + * we're done here because we'll get the command returned + * back separately. + */ + if (isp_control(isp, ISPCTL_ABORT_CMD, xs) == 0) { + return; + } + + /* + * Note that after calling the above, the command may in + * fact have been completed. + */ + xs = isp_find_xs(isp, handle); + /* - * Make sure the command is *really* dead before we - * release the handle (and DMA resources) for reuse. + * If the command no longer exists, then we won't + * be able to find the xs again with this handle. */ - (void) isp_control(isp, ISPCTL_ABORT_CMD, xs); + if (xs == NULL) { + return; + } /* - * After this point, the comamnd is really dead. + * After this point, the command is really dead. */ if (XS_XFRLEN(xs)) { ISP_DMAFREE(isp, xs, handle); } isp_destroy_handle(isp, handle); - xpt_print(xs->ccb_h.path, "watchdog timeout for handle 0x%x\n", handle); + isp_prt(isp, ISP_LOGERR, "%s: timeout for handle 0x%x", __func__, handle); XS_SETERR(xs, CAM_CMD_TIMEOUT); isp_done(xs); } @@ -3924,12 +3959,12 @@ isp_gdt(void *arg) isp_prt(isp, ISP_LOGCONFIG, prom3, chan, lp->portid, tgt, "Gone Device Timeout"); isp_make_gone(isp, chan, tgt); } - if (more_to_do) { - fc->gdt_running = 1; - callout_reset(&fc->gdt, hz, isp_gdt, fc); - } else { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d stopping Gone Device Timer", chan); - fc->gdt_running = 0; + if (fc->ready) { + if (more_to_do) { + callout_reset(&fc->gdt, hz, isp_gdt, fc); + } else { + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d stopping Gone Device Timer", chan); + } } } @@ -4006,6 +4041,7 @@ isp_kthread(void *arg) ispsoftc_t *isp = fc->isp; int chan = fc - isp->isp_osinfo.pc.fc; int slp = 0; + mtx_lock(&isp->isp_osinfo.lock); for (;;) { @@ -4238,6 +4274,7 @@ isp_action(struct cam_sim *sim, union cc isp_disable_lun(isp, ccb); } break; + case XPT_IMMED_NOTIFY: case XPT_IMMEDIATE_NOTIFY: /* Add Immediate Notify Resource */ case XPT_ACCEPT_TARGET_IO: /* Add Accept Target IO Resource */ { @@ -4287,11 +4324,19 @@ isp_action(struct cam_sim *sim, union cc SLIST_INSERT_HEAD(&tptr->inots, &ccb->ccb_h, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "Put FREE INOT, (seq id 0x%x) count now %d\n", ((struct ccb_immediate_notify *)ccb)->seq_id, tptr->inot_count); + } else if (ccb->ccb_h.func_code == XPT_IMMED_NOTIFY) { + tptr->inot_count++; + SLIST_INSERT_HEAD(&tptr->inots, &ccb->ccb_h, sim_links.sle); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "Put FREE INOT, (seq id 0x%x) count now %d\n", + ((struct ccb_immediate_notify *)ccb)->seq_id, tptr->inot_count); } rls_lun_statep(isp, tptr); ccb->ccb_h.status = CAM_REQ_INPROG; break; } + case XPT_NOTIFY_ACK: + ccb->ccb_h.status = CAM_REQ_CMP_ERR; + break; case XPT_NOTIFY_ACKNOWLEDGE: /* notify ack */ { tstate_t *tptr; @@ -4601,10 +4646,21 @@ isp_prt(isp, ISP_LOGALL, "Setting Channe } break; case KNOB_ROLE_BOTH: +#if 0 if (fcp->role != ISP_ROLE_BOTH) { rchange = 1; newrole = ISP_ROLE_BOTH; } +#else + /* + * We don't really support dual role at present on FC cards. + * + * We should, but a bunch of things are currently broken, + * so don't allow it. + */ + isp_prt(isp, ISP_LOGERR, "cannot support dual role at present"); + ccb->ccb_h.status = CAM_REQ_INVALID; +#endif break; } if (rchange) { @@ -4771,6 +4827,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm char *msg = NULL; target_id_t tgt; fcportdb_t *lp; + struct isp_fc *fc; struct cam_path *tmppath; va_list ap; @@ -4855,7 +4912,6 @@ isp_async(ispsoftc_t *isp, ispasync_t cm /* FALLTHROUGH */ case ISPASYNC_LOOP_DOWN: { - struct isp_fc *fc; if (msg == NULL) { msg = "LOOP Down"; } @@ -4863,20 +4919,21 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); va_end(ap); - FCPARAM(isp, bus)->link_active = 1; + FCPARAM(isp, bus)->link_active = 0; fc = ISP_FC_PC(isp, bus); - /* - * We don't do any simq freezing if we are only in target mode - */ - if (fc->role & ISP_ROLE_INITIATOR) { - if (fc->path) { - isp_freeze_loopdown(isp, bus, msg); - } - if (fc->ldt_running == 0) { - fc->ldt_running = 1; - callout_reset(&fc->ldt, fc->loop_down_limit * hz, isp_ldt, fc); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "starting Loop Down Timer @ %lu", (unsigned long) time_uptime); + if (cmd == ISPASYNC_LOOP_DOWN && fc->ready) { + /* + * We don't do any simq freezing if we are only in target mode + */ + if (fc->role & ISP_ROLE_INITIATOR) { + if (fc->path) { + isp_freeze_loopdown(isp, bus, msg); + } + if (!callout_active(&fc->ldt)) { + callout_reset(&fc->ldt, fc->loop_down_limit * hz, isp_ldt, fc); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "starting Loop Down Timer @ %lu", (unsigned long) time_uptime); + } } } isp_prt(isp, ISP_LOGINFO, "Chan %d: %s", bus, msg); @@ -4886,6 +4943,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm va_start(ap, cmd); bus = va_arg(ap, int); va_end(ap); + fc = ISP_FC_PC(isp, bus); /* * Now we just note that Loop has come up. We don't * actually do anything because we're waiting for a @@ -4893,8 +4951,8 @@ isp_async(ispsoftc_t *isp, ispasync_t cm * thread to look at the state of the loop again. */ FCPARAM(isp, bus)->link_active = 1; - ISP_FC_PC(isp, bus)->loop_dead = 0; - ISP_FC_PC(isp, bus)->loop_down_time = 0; + fc->loop_dead = 0; + fc->loop_down_time = 0; isp_prt(isp, ISP_LOGINFO, "Chan %d Loop UP", bus); break; case ISPASYNC_DEV_ARRIVED: @@ -4902,8 +4960,9 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); lp = va_arg(ap, fcportdb_t *); va_end(ap); + fc = ISP_FC_PC(isp, bus); lp->reserved = 0; - if ((ISP_FC_PC(isp, bus)->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) { + if ((fc->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) { int dbidx = lp - FCPARAM(isp, bus)->portdb; int i; @@ -4936,6 +4995,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); lp = va_arg(ap, fcportdb_t *); va_end(ap); + fc = ISP_FC_PC(isp, bus); lp->reserved = 0; if (isp_change_is_bad) { lp->state = FC_PORTDB_STATE_NIL; @@ -4982,6 +5042,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); lp = va_arg(ap, fcportdb_t *); va_end(ap); + fc = ISP_FC_PC(isp, bus); /* * If this has a virtual target and we haven't marked it * that we're going to have isp_gdt tell the OS it's gone, @@ -4994,10 +5055,9 @@ isp_async(ispsoftc_t *isp, ispasync_t cm lp->reserved = 1; lp->new_reserved = ISP_FC_PC(isp, bus)->gone_device_time; lp->state = FC_PORTDB_STATE_ZOMBIE; - if (ISP_FC_PC(isp, bus)->gdt_running == 0) { + if (fc->ready && !callout_active(&fc->gdt)) { isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d starting Gone Device Timer", bus); - ISP_FC_PC(isp, bus)->gdt_running = 1; - callout_reset(&ISP_FC_PC(isp, bus)->gdt, hz, isp_gdt, ISP_FC_PC(isp, bus)); + callout_reset(&fc->gdt, hz, isp_gdt, fc); } tgt = lp->dev_map_idx - 1; isp_prt(isp, ISP_LOGCONFIG, prom2, bus, lp->portid, lp->handle, roles[lp->roles], "gone zombie at", tgt, (uint32_t) (lp->port_wwn >> 32), (uint32_t) lp->port_wwn); @@ -5022,6 +5082,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm nlstate = reason = 0; } va_end(ap); + fc = ISP_FC_PC(isp, bus); if (evt == ISPASYNC_CHANGE_PDB) { msg = "Chan %d Port Database Changed"; @@ -5034,16 +5095,15 @@ isp_async(ispsoftc_t *isp, ispasync_t cm /* * If the loop down timer is running, cancel it. */ - if (ISP_FC_PC(isp, bus)->ldt_running) { + if (fc->ready && callout_active(&fc->ldt)) { isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Stopping Loop Down Timer @ %lu", (unsigned long) time_uptime); - ISP_FC_PC(isp, bus)->ldt_running = 0; - callout_stop(&ISP_FC_PC(isp, bus)->ldt); + callout_stop(&fc->ldt); } isp_prt(isp, ISP_LOGINFO, msg, bus); - if (ISP_FC_PC(isp, bus)->role & ISP_ROLE_INITIATOR) { + if (fc->role & ISP_ROLE_INITIATOR) { isp_freeze_loopdown(isp, bus, msg); } - wakeup(ISP_FC_PC(isp, bus)); + wakeup(fc); break; } #ifdef ISP_TARGET_MODE Modified: stable/8/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.h Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/isp/isp_freebsd.h Thu Feb 11 18:34:06 2010 (r203786) @@ -177,9 +177,9 @@ struct isp_fc { hysteresis : 8, role : 2, gdt_running : 1, - ldt_running : 1, loop_dead : 1, - fcbsy : 1; + fcbsy : 1, + ready : 1; struct callout ldt; /* loop down timer */ struct callout gdt; /* gone device timer */ #ifdef ISP_TARGET_MODE Modified: stable/8/sys/dev/isp/isp_library.c ============================================================================== --- stable/8/sys/dev/isp/isp_library.c Thu Feb 11 18:24:00 2010 (r203785) +++ stable/8/sys/dev/isp/isp_library.c Thu Feb 11 18:34:06 2010 (r203786) @@ -246,65 +246,70 @@ copy_and_sync: } int -isp_save_xs(ispsoftc_t *isp, XS_T *xs, uint32_t *handlep) +isp_allocate_xs(ispsoftc_t *isp, XS_T *xs, uint32_t *handlep) { - uint16_t i, j; + isp_hdl_t *hdp; - for (j = isp->isp_lasthdls, i = 0; i < isp->isp_maxcmds; i++) { - if (isp->isp_xflist[j] == NULL) { - break; - } - if (++j == isp->isp_maxcmds) { - j = 0; - } - } - if (i == isp->isp_maxcmds) { + hdp = isp->isp_xffree; + if (hdp == NULL) { return (-1); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Feb 11 21:25:49 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF73E106566C; Thu, 11 Feb 2010 21:25:48 +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 CD8B58FC0C; Thu, 11 Feb 2010 21:25:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1BLPm0o092473; Thu, 11 Feb 2010 21:25:48 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1BLPmeF092467; Thu, 11 Feb 2010 21:25:48 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201002112125.o1BLPmeF092467@svn.freebsd.org> From: Rick Macklem Date: Thu, 11 Feb 2010 21:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203789 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 21:25:49 -0000 Author: rmacklem Date: Thu Feb 11 21:25:48 2010 New Revision: 203789 URL: http://svn.freebsd.org/changeset/base/203789 Log: MFC: r203119 Patch the experimental NFS client in a manner analogous to r203072 for the regular NFS client. Also, delete two fields of struct nfsmount that are not used by the FreeBSD port of the client. Modified: stable/8/sys/fs/nfsclient/nfs.h stable/8/sys/fs/nfsclient/nfs_clbio.c stable/8/sys/fs/nfsclient/nfs_clnfsiod.c stable/8/sys/fs/nfsclient/nfs_clsubs.c stable/8/sys/fs/nfsclient/nfsmount.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfs.h Thu Feb 11 21:10:56 2010 (r203788) +++ stable/8/sys/fs/nfsclient/nfs.h Thu Feb 11 21:25:48 2010 (r203789) @@ -56,6 +56,19 @@ (VFSTONFS((v)->v_mount)->nm_flag & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) /* + * NFS iod threads can be in one of these three states once spawned. + * NFSIOD_NOT_AVAILABLE - Cannot be assigned an I/O operation at this time. + * NFSIOD_AVAILABLE - Available to be assigned an I/O operation. + * NFSIOD_CREATED_FOR_NFS_ASYNCIO - Newly created for nfs_asyncio() and + * will be used by the thread that called nfs_asyncio(). + */ +enum nfsiod_state { + NFSIOD_NOT_AVAILABLE = 0, + NFSIOD_AVAILABLE = 1, + NFSIOD_CREATED_FOR_NFS_ASYNCIO = 2, +}; + +/* * Function prototypes. */ int ncl_meta_setsize(struct vnode *, struct ucred *, struct thread *, @@ -87,7 +100,7 @@ int ncl_fsinfo(struct nfsmount *, struct int ncl_init(struct vfsconf *); int ncl_uninit(struct vfsconf *); int ncl_mountroot(struct mount *); -int ncl_nfsiodnew(void); +int ncl_nfsiodnew(int); #endif /* _KERNEL */ Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clbio.c Thu Feb 11 21:10:56 2010 (r203788) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Thu Feb 11 21:25:48 2010 (r203789) @@ -63,7 +63,7 @@ extern int newnfs_directio_allow_mmap; extern struct nfsstats newnfsstats; extern struct mtx ncl_iod_mutex; extern int ncl_numasync; -extern struct proc *ncl_iodwant[NFS_MAXRAHEAD]; +extern enum nfsiod_state ncl_iodwant[NFS_MAXRAHEAD]; extern struct nfsmount *ncl_iodmount[NFS_MAXRAHEAD]; extern int newnfs_directio_enable; @@ -1396,7 +1396,7 @@ again: * Find a free iod to process this request. */ for (iod = 0; iod < ncl_numasync; iod++) - if (ncl_iodwant[iod]) { + if (ncl_iodwant[iod] == NFSIOD_AVAILABLE) { gotiod = TRUE; break; } @@ -1405,7 +1405,7 @@ again: * Try to create one if none are free. */ if (!gotiod) { - iod = ncl_nfsiodnew(); + iod = ncl_nfsiodnew(1); if (iod != -1) gotiod = TRUE; } @@ -1417,7 +1417,7 @@ again: */ NFS_DPF(ASYNCIO, ("ncl_asyncio: waking iod %d for mount %p\n", iod, nmp)); - ncl_iodwant[iod] = NULL; + ncl_iodwant[iod] = NFSIOD_NOT_AVAILABLE; ncl_iodmount[iod] = nmp; nmp->nm_bufqiods++; wakeup(&ncl_iodwant[iod]); Modified: stable/8/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clnfsiod.c Thu Feb 11 21:10:56 2010 (r203788) +++ stable/8/sys/fs/nfsclient/nfs_clnfsiod.c Thu Feb 11 21:25:48 2010 (r203789) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); extern struct mtx ncl_iod_mutex; int ncl_numasync; -struct proc *ncl_iodwant[NFS_MAXRAHEAD]; +enum nfsiod_state ncl_iodwant[NFS_MAXRAHEAD]; struct nfsmount *ncl_iodmount[NFS_MAXRAHEAD]; static void nfssvc_iod(void *); @@ -114,7 +114,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) * than the new minimum, create some more. */ for (i = nfs_iodmin - ncl_numasync; i > 0; i--) - ncl_nfsiodnew(); + ncl_nfsiodnew(0); out: mtx_unlock(&ncl_iod_mutex); return (0); @@ -147,7 +147,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) */ iod = ncl_numasync - 1; for (i = 0; i < ncl_numasync - ncl_iodmax; i++) { - if (ncl_iodwant[iod]) + if (ncl_iodwant[iod] == NFSIOD_AVAILABLE) wakeup(&ncl_iodwant[iod]); iod--; } @@ -159,7 +159,7 @@ SYSCTL_PROC(_vfs_newnfs, OID_AUTO, iodma sizeof (ncl_iodmax), sysctl_iodmax, "IU", ""); int -ncl_nfsiodnew(void) +ncl_nfsiodnew(int set_iodwant) { int error, i; int newiod; @@ -175,12 +175,17 @@ ncl_nfsiodnew(void) } if (newiod == -1) return (-1); + if (set_iodwant > 0) + ncl_iodwant[i] = NFSIOD_CREATED_FOR_NFS_ASYNCIO; mtx_unlock(&ncl_iod_mutex); error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID, 0, "nfsiod %d", newiod); mtx_lock(&ncl_iod_mutex); - if (error) + if (error) { + if (set_iodwant > 0) + ncl_iodwant[i] = NFSIOD_NOT_AVAILABLE; return (-1); + } ncl_numasync++; return (newiod); } @@ -199,7 +204,7 @@ nfsiod_setup(void *dummy) nfs_iodmin = NFS_MAXRAHEAD; for (i = 0; i < nfs_iodmin; i++) { - error = ncl_nfsiodnew(); + error = ncl_nfsiodnew(0); if (error == -1) panic("newnfsiod_setup: ncl_nfsiodnew failed"); } @@ -235,7 +240,8 @@ nfssvc_iod(void *instance) goto finish; if (nmp) nmp->nm_bufqiods--; - ncl_iodwant[myiod] = curthread->td_proc; + if (ncl_iodwant[myiod] == NFSIOD_NOT_AVAILABLE) + ncl_iodwant[myiod] = NFSIOD_AVAILABLE; ncl_iodmount[myiod] = NULL; /* * Always keep at least nfs_iodmin kthreads. @@ -295,7 +301,7 @@ finish: nfs_asyncdaemon[myiod] = 0; if (nmp) nmp->nm_bufqiods--; - ncl_iodwant[myiod] = NULL; + ncl_iodwant[myiod] = NFSIOD_NOT_AVAILABLE; ncl_iodmount[myiod] = NULL; /* Someone may be waiting for the last nfsiod to terminate. */ if (--ncl_numasync == 0) Modified: stable/8/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clsubs.c Thu Feb 11 21:10:56 2010 (r203788) +++ stable/8/sys/fs/nfsclient/nfs_clsubs.c Thu Feb 11 21:25:48 2010 (r203789) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #include extern struct mtx ncl_iod_mutex; -extern struct proc *ncl_iodwant[NFS_MAXRAHEAD]; +extern enum nfsiod_state ncl_iodwant[NFS_MAXRAHEAD]; extern struct nfsmount *ncl_iodmount[NFS_MAXRAHEAD]; extern int ncl_numasync; extern unsigned int ncl_iodmax; @@ -100,7 +100,7 @@ ncl_uninit(struct vfsconf *vfsp) mtx_lock(&ncl_iod_mutex); ncl_iodmax = 0; for (i = 0; i < ncl_numasync; i++) - if (ncl_iodwant[i]) + if (ncl_iodwant[i] == NFSIOD_AVAILABLE) wakeup(&ncl_iodwant[i]); /* The last nfsiod to exit will wake us up when ncl_numasync hits 0 */ while (ncl_numasync) @@ -396,7 +396,7 @@ ncl_init(struct vfsconf *vfsp) /* Ensure async daemons disabled */ for (i = 0; i < NFS_MAXRAHEAD; i++) { - ncl_iodwant[i] = NULL; + ncl_iodwant[i] = NFSIOD_NOT_AVAILABLE; ncl_iodmount[i] = NULL; } ncl_nhinit(); /* Init the nfsnode table */ Modified: stable/8/sys/fs/nfsclient/nfsmount.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfsmount.h Thu Feb 11 21:10:56 2010 (r203788) +++ stable/8/sys/fs/nfsclient/nfsmount.h Thu Feb 11 21:25:48 2010 (r203789) @@ -71,8 +71,6 @@ struct nfsmount { int nm_tprintf_delay; /* interval for messages */ /* Newnfs additions */ - int nm_iothreadcnt; - struct proc *nm_iodwant[NFS_MAXRAHEAD]; struct nfsclclient *nm_clp; uid_t nm_uid; /* Uid for SetClientID etc. */ u_int64_t nm_clval; /* identifies which clientid */ From owner-svn-src-stable@FreeBSD.ORG Fri Feb 12 00:47:23 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E3AE106566C; Fri, 12 Feb 2010 00:47:23 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D0948FC14; Fri, 12 Feb 2010 00:47:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1C0lN09040677; Fri, 12 Feb 2010 00:47:23 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1C0lN0W040674; Fri, 12 Feb 2010 00:47:23 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002120047.o1C0lN0W040674@svn.freebsd.org> From: Matt Jacob Date: Fri, 12 Feb 2010 00:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203794 - stable/8/sys/dev/isp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 00:47:23 -0000 Author: mjacob Date: Fri Feb 12 00:47:23 2010 New Revision: 203794 URL: http://svn.freebsd.org/changeset/base/203794 Log: Pick up some changes the the MFC missed. Modified: stable/8/sys/dev/isp/isp.c stable/8/sys/dev/isp/isp_library.c Modified: stable/8/sys/dev/isp/isp.c ============================================================================== --- stable/8/sys/dev/isp/isp.c Fri Feb 12 00:45:29 2010 (r203793) +++ stable/8/sys/dev/isp/isp.c Fri Feb 12 00:47:23 2010 (r203794) @@ -2763,15 +2763,21 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) /* * Make sure we're okay for doing this right now. */ - if (fcp->isp_loopstate != LOOP_PDB_RCVD && fcp->isp_loopstate != LOOP_FSCAN_DONE && fcp->isp_loopstate != LOOP_LSCAN_DONE) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", fcp->isp_loopstate); + if (fcp->isp_loopstate != LOOP_PDB_RCVD && + fcp->isp_loopstate != LOOP_FSCAN_DONE && + fcp->isp_loopstate != LOOP_LSCAN_DONE) { + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", + fcp->isp_loopstate); return (-1); } - if (fcp->isp_topo == TOPO_FL_PORT || fcp->isp_topo == TOPO_NL_PORT || fcp->isp_topo == TOPO_N_PORT) { + if (fcp->isp_topo == TOPO_FL_PORT || + fcp->isp_topo == TOPO_NL_PORT || + fcp->isp_topo == TOPO_N_PORT) { if (fcp->isp_loopstate < LOOP_LSCAN_DONE) { if (isp_scan_loop(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_loop failed"); + isp_prt(isp, ISP_LOGWARN, + "isp_pdb_sync: isp_scan_loop failed"); return (-1); } } @@ -2780,13 +2786,15 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) if (fcp->isp_topo == TOPO_F_PORT || fcp->isp_topo == TOPO_FL_PORT) { if (fcp->isp_loopstate < LOOP_FSCAN_DONE) { if (isp_scan_fabric(isp, chan) != 0) { - isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: isp_scan_fabric failed"); + isp_prt(isp, ISP_LOGWARN, + "isp_pdb_sync: isp_scan_fabric failed"); return (-1); } } } - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Synchronizing PDBs", chan); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, + "Chan %d Synchronizing PDBs", chan); fcp->isp_loopstate = LOOP_SYNCING_PDB; @@ -2815,7 +2823,11 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) lp->state = FC_PORTDB_STATE_NIL; isp_async(isp, ISPASYNC_DEV_GONE, chan, lp); if (lp->autologin == 0) { - (void) isp_plogx(isp, chan, lp->handle, lp->portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 0); + (void) isp_plogx(isp, chan, lp->handle, + lp->portid, + PLOGX_FLG_CMD_LOGO | + PLOGX_FLG_IMPLICIT | + PLOGX_FLG_FREE_NPHDL, 0); } else { lp->autologin = 0; } @@ -3061,7 +3073,8 @@ isp_scan_loop(ispsoftc_t *isp, int chan) for (i = 0; i < MAX_FC_TARG; i++) { lp = &fcp->portdb[i]; - if (lp->state == FC_PORTDB_STATE_NIL || lp->target_mode) { + if (lp->state == FC_PORTDB_STATE_NIL || + lp->target_mode) { continue; } if (lp->node_wwn != tmp.node_wwn) { @@ -3579,7 +3592,8 @@ isp_scan_fabric(ispsoftc_t *isp, int cha for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) { lp = &fcp->portdb[dbidx]; - if (lp->state != FC_PORTDB_STATE_PROBATIONAL || lp->target_mode) { + if (lp->state != FC_PORTDB_STATE_PROBATIONAL || + lp->target_mode) { continue; } if (lp->portid == portid) { @@ -3816,7 +3830,8 @@ isp_scan_fabric(ispsoftc_t *isp, int cha if (fcp->portdb[dbidx].target_mode) { continue; } - if (fcp->portdb[dbidx].node_wwn == wwnn && fcp->portdb[dbidx].port_wwn == wwpn) { + if (fcp->portdb[dbidx].node_wwn == wwnn && + fcp->portdb[dbidx].port_wwn == wwpn) { break; } } Modified: stable/8/sys/dev/isp/isp_library.c ============================================================================== --- stable/8/sys/dev/isp/isp_library.c Fri Feb 12 00:45:29 2010 (r203793) +++ stable/8/sys/dev/isp/isp_library.c Fri Feb 12 00:47:23 2010 (r203794) @@ -650,7 +650,7 @@ isp_clear_commands(ispsoftc_t *isp) #ifdef ISP_TARGET_MODE for (tmp = 0; isp->isp_tgtlist && tmp < isp->isp_maxcmds; tmp++) { uint8_t local[QENTRY_LEN]; - hdp = &isp->isp_tgt_xflist[tmp]; + hdp = &isp->isp_tgtlist[tmp]; if (hdp->handle == ISP_HANDLE_FREE) { continue; } @@ -2275,7 +2275,7 @@ isp_find_tgt_handle(ispsoftc_t *isp, voi void isp_destroy_tgt_handle(ispsoftc_t *isp, uint32_t handle) { - if (!ISP_VALID_TGT_HANDLE(handle)) { + if (!ISP_VALID_TGT_HANDLE(isp, handle)) { isp_prt(isp, ISP_LOGERR, "%s: bad handle 0x%x", __func__, handle); } else { isp->isp_tgtlist[(handle & ISP_HANDLE_CMD_MASK)].handle = ISP_HANDLE_FREE; From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 00:29:02 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DCE41065693; Sat, 13 Feb 2010 00:29:02 +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 2C75B8FC15; Sat, 13 Feb 2010 00:29:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D0T2C0073968; Sat, 13 Feb 2010 00:29:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D0T2g5073966; Sat, 13 Feb 2010 00:29:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002130029.o1D0T2g5073966@svn.freebsd.org> From: Xin LI Date: Sat, 13 Feb 2010 00:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203806 - stable/8/sbin/newfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 00:29:02 -0000 Author: delphij Date: Sat Feb 13 00:29:01 2010 New Revision: 203806 URL: http://svn.freebsd.org/changeset/base/203806 Log: MFC r203534: Correct two typos. Reported by: Brandon Falk Modified: stable/8/sbin/newfs/newfs.c Directory Properties: stable/8/sbin/newfs/ (props changed) Modified: stable/8/sbin/newfs/newfs.c ============================================================================== --- stable/8/sbin/newfs/newfs.c Fri Feb 12 20:27:35 2010 (r203805) +++ stable/8/sbin/newfs/newfs.c Sat Feb 13 00:29:01 2010 (r203806) @@ -499,13 +499,13 @@ usage() getprogname(), " [device-type]"); fprintf(stderr, "where fsoptions are:\n"); - fprintf(stderr, "\t-E Erase previuos disk content\n"); + fprintf(stderr, "\t-E Erase previous disk content\n"); fprintf(stderr, "\t-J Enable journaling via gjournal\n"); fprintf(stderr, "\t-L volume label to add to superblock\n"); fprintf(stderr, "\t-N do not create file system, just print out parameters\n"); fprintf(stderr, "\t-O file system format: 1 => UFS1, 2 => UFS2\n"); - fprintf(stderr, "\t-R regression test, supress random factors\n"); + fprintf(stderr, "\t-R regression test, suppress random factors\n"); fprintf(stderr, "\t-S sector size\n"); fprintf(stderr, "\t-T disktype\n"); fprintf(stderr, "\t-U enable soft updates\n"); From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 00:30:51 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB717106566B; Sat, 13 Feb 2010 00:30:50 +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 D96788FC13; Sat, 13 Feb 2010 00:30:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D0Uo2d074413; Sat, 13 Feb 2010 00:30:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D0UopM074410; Sat, 13 Feb 2010 00:30:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002130030.o1D0UopM074410@svn.freebsd.org> From: Xin LI Date: Sat, 13 Feb 2010 00:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203807 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 00:30:51 -0000 Author: delphij Date: Sat Feb 13 00:30:50 2010 New Revision: 203807 URL: http://svn.freebsd.org/changeset/base/203807 Log: MFC r203053: Add a manual page for nvram(4). Added: stable/8/share/man/man4/nvram.4 - copied unchanged from r203053, head/share/man/man4/nvram.4 Modified: stable/8/share/man/man4/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Sat Feb 13 00:29:01 2010 (r203806) +++ stable/8/share/man/man4/Makefile Sat Feb 13 00:30:50 2010 (r203807) @@ -290,6 +290,7 @@ MAN= aac.4 \ nsp.4 \ null.4 \ ${_nve.4} \ + ${_nvram.4} \ ${_nxge.4} \ ohci.4 \ orm.4 \ @@ -638,6 +639,7 @@ _ndis.4= ndis.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 _nve.4= nve.4 +_nvram.4= nvram.4 _nxge.4= nxge.4 _rr232x.4= rr232x.4 _speaker.4= speaker.4 Copied: stable/8/share/man/man4/nvram.4 (from r203053, head/share/man/man4/nvram.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/nvram.4 Sat Feb 13 00:30:50 2010 (r203807, copy of r203053, head/share/man/man4/nvram.4) @@ -0,0 +1,93 @@ +.\" +.\"Copyright (c) 2010 iXsystems, Inc. +.\"All rights reserved. +.\" written by: Xin LI +.\" +.\"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$ +.\" +.Dd January 27, 2010 +.Dt NVRAM 4 i386 +.Os +.Sh NAME +.Nm nvram +.Nd "non-volatile RAM" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device nvram" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +nvram_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides access to BIOS configuration NVRAM on i386 and amd64 +systems. +.Pp +PC motherboard uses a small non-volatile memory to store BIOS settings +which is usually part of its clock chip and sometimes referred as +.Dq CMOS SRAM . +This driver exposes bytes 14 through 128 of the NVRAM, or a total of +114 bytes, at offset zero of the device file +.Pa /dev/nvram . +.Pp +This driver is useful for cloning machines that shares the same hardware +configuration and need same BIOS setting tweaks. +.Sh IMPLEMENTATION NOTES +The BIOS NVRAM's bytes 16 through 31 are checksummed at byte 32. +This driver +.Em does not +take care for these checksums. +.Sh EXAMPLES +Backup existing BIOS NVRAM to +.Pa nvram.bin : +.Pp +.Dl dd if=/dev/nvram of=nvram.bin +.Pp +Restore BIOS NVRAM from +.Pa nvram.bin : +.Pp +.Dl dd if=nvram.bin of=/dev/nvram +.Sh SEE ALSO +.Xr dd 1 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 6.4 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver was written by +.An Peter Wemm . +This manual page was written by +.An Xin LI . From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 00:39:03 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1DD8106566C; Sat, 13 Feb 2010 00:39:03 +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 877BF8FC0C; Sat, 13 Feb 2010 00:39:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D0d3CP076435; Sat, 13 Feb 2010 00:39:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D0d3Em076434; Sat, 13 Feb 2010 00:39:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002130039.o1D0d3Em076434@svn.freebsd.org> From: Xin LI Date: Sat, 13 Feb 2010 00:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203808 - stable/8/etc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 00:39:03 -0000 Author: delphij Date: Sat Feb 13 00:39:03 2010 New Revision: 203808 URL: http://svn.freebsd.org/changeset/base/203808 Log: Migrate mergeinfo which was done on wrong target back to etc/ (203163). Modified: Directory Properties: stable/8/etc/ (props changed) stable/8/etc/services (props changed) From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 00:39:48 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D567106568B; Sat, 13 Feb 2010 00:39:48 +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 62C818FC21; Sat, 13 Feb 2010 00:39:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1D0dlp7076645; Sat, 13 Feb 2010 00:39:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1D0dlqp076644; Sat, 13 Feb 2010 00:39:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002130039.o1D0dlqp076644@svn.freebsd.org> From: Xin LI Date: Sat, 13 Feb 2010 00:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203809 - stable/8/etc/rc.d X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 00:39:48 -0000 Author: delphij Date: Sat Feb 13 00:39:46 2010 New Revision: 203809 URL: http://svn.freebsd.org/changeset/base/203809 Log: MFC r202130: Set svn:executable to *. Modified: Directory Properties: stable/8/etc/ (props changed) stable/8/etc/rc.d/static_arp (props changed) From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 10:26:00 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C6B7106568D; Sat, 13 Feb 2010 10:26:00 +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 6853B8FC13; Sat, 13 Feb 2010 10:26:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DAQ0Bu045467; Sat, 13 Feb 2010 10:26:00 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DAQ0qw045465; Sat, 13 Feb 2010 10:26:00 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002131026.o1DAQ0qw045465@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 13 Feb 2010 10:26:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203817 - stable/8/lib/libc/gen X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 10:26:00 -0000 Author: gavin Date: Sat Feb 13 10:26:00 2010 New Revision: 203817 URL: http://svn.freebsd.org/changeset/base/203817 Log: Merge r203393,r203395 from head: The multiplicand a = 0x5deece66d = 25214903917, not 0xfdeece66d. This bug in the man page has gone unnoticed for over 15 years! PR: docs/143461 Submitted by: Jeremy Huddleston jeremyhu apple.com Modified: stable/8/lib/libc/gen/rand48.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/gen/rand48.3 ============================================================================== --- stable/8/lib/libc/gen/rand48.3 Sat Feb 13 10:22:07 2010 (r203816) +++ stable/8/lib/libc/gen/rand48.3 Sat Feb 13 10:26:00 2010 (r203817) @@ -12,7 +12,7 @@ .\" @(#)rand48.3 V1.0 MB 8 Oct 1993 .\" $FreeBSD$ .\" -.Dd October 8, 1993 +.Dd February 2, 2010 .Dt RAND48 3 .Os .Sh NAME @@ -57,7 +57,7 @@ The particular formula employed is r(n+1) = (a * r(n) + c) mod m where the default values are -for the multiplicand a = 0xfdeece66d = 25214903917 and +for the multiplicand a = 0x5deece66d = 25214903917 and the addend c = 0xb = 11. The modulo is always fixed at m = 2 ** 48. r(n) is called the seed of the random number generator. From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 10:42:29 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC9941065670; Sat, 13 Feb 2010 10:42:29 +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 D8C428FC12; Sat, 13 Feb 2010 10:42:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DAgTu4060952; Sat, 13 Feb 2010 10:42:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DAgTos060950; Sat, 13 Feb 2010 10:42:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002131042.o1DAgTos060950@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Feb 2010 10:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203819 - stable/7/sys/vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 10:42:30 -0000 Author: kib Date: Sat Feb 13 10:42:29 2010 New Revision: 203819 URL: http://svn.freebsd.org/changeset/base/203819 Log: MFC r195635: Properly set MAP_ENTRY_WIRE_SKIPPED when aborting the loop. PR: kern/143717 (for RELENG_7) Approved by: re (bz) Modified: stable/7/sys/vm/vm_map.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/vm/vm_map.c ============================================================================== --- stable/7/sys/vm/vm_map.c Sat Feb 13 10:34:50 2010 (r203818) +++ stable/7/sys/vm/vm_map.c Sat Feb 13 10:42:29 2010 (r203819) @@ -2060,12 +2060,12 @@ vm_map_wire(vm_map_t map, vm_offset_t st if (entry->wired_count == 0) { if ((entry->protection & (VM_PROT_READ|VM_PROT_EXECUTE)) == 0) { + entry->eflags |= MAP_ENTRY_WIRE_SKIPPED; if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { end = entry->end; rv = KERN_INVALID_ADDRESS; goto done; } - entry->eflags |= MAP_ENTRY_WIRE_SKIPPED; goto next_entry; } entry->wired_count++; From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 16:25:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66C9B1065672; Sat, 13 Feb 2010 16:25:33 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58EE18FC0A; Sat, 13 Feb 2010 16:25:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DGPXSZ077859; Sat, 13 Feb 2010 16:25:33 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DGPX0P077855; Sat, 13 Feb 2010 16:25:33 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201002131625.o1DGPX0P077855@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 13 Feb 2010 16:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203836 - stable/8/usr.sbin/rtsold X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 16:25:33 -0000 Author: ume Date: Sat Feb 13 16:25:33 2010 New Revision: 203836 URL: http://svn.freebsd.org/changeset/base/203836 Log: MFC r203378: Make -a option actually work. Modified: stable/8/usr.sbin/rtsold/rtsold.c Directory Properties: stable/8/usr.sbin/rtsold/ (props changed) Modified: stable/8/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/8/usr.sbin/rtsold/rtsold.c Sat Feb 13 16:22:08 2010 (r203835) +++ stable/8/usr.sbin/rtsold/rtsold.c Sat Feb 13 16:25:33 2010 (r203836) @@ -841,7 +841,6 @@ autoifprobe(void) if (!argv[n]) err(1, "malloc"); n++; - argv[n] = NULL; } if (n) { From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 16:28:25 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E625E1065696; Sat, 13 Feb 2010 16:28:25 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEE9D8FC14; Sat, 13 Feb 2010 16:28:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DGSPmd080649; Sat, 13 Feb 2010 16:28:25 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DGSPwO080646; Sat, 13 Feb 2010 16:28:25 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201002131628.o1DGSPwO080646@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 13 Feb 2010 16:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203837 - stable/8/usr.sbin/rtsold X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 16:28:26 -0000 Author: ume Date: Sat Feb 13 16:28:25 2010 New Revision: 203837 URL: http://svn.freebsd.org/changeset/base/203837 Log: MFC r203387: Exclude the interfaces which IPv6 and/or accepting RA is disabled from the auto probed interface list. Modified: stable/8/usr.sbin/rtsold/rtsold.c Directory Properties: stable/8/usr.sbin/rtsold/ (props changed) Modified: stable/8/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/8/usr.sbin/rtsold/rtsold.c Sat Feb 13 16:25:33 2010 (r203836) +++ stable/8/usr.sbin/rtsold/rtsold.c Sat Feb 13 16:28:25 2010 (r203837) @@ -32,15 +32,20 @@ */ #include +#include #include #include #include #include #include +#include #include #include +#include + +#include #include #include @@ -789,8 +794,9 @@ autoifprobe(void) static char **argv = NULL; static int n = 0; char **a; - int i, found; + int s, i, found; struct ifaddrs *ifap, *ifa, *target; + struct in6_ndireq nd; /* initialize */ while (n--) @@ -804,6 +810,11 @@ autoifprobe(void) if (getifaddrs(&ifap) != 0) return NULL; + if (!Fflag && (s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + err(1, "socket"); + /* NOTREACHED */ + } + target = NULL; /* find an ethernet */ for (ifa = ifap; ifa; ifa = ifa->ifa_next) { @@ -829,6 +840,23 @@ autoifprobe(void) if (found) continue; + /* + * Skip the interfaces which IPv6 and/or accepting RA + * is disabled. + */ + if (!Fflag) { + memset(&nd, 0, sizeof(nd)); + strlcpy(nd.ifname, ifa->ifa_name, sizeof(nd.ifname)); + if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd) < 0) { + err(1, "ioctl(SIOCGIFINFO_IN6)"); + /* NOTREACHED */ + } + if ((nd.ndi.flags & ND6_IFF_IFDISABLED)) + continue; + if (!(nd.ndi.flags & ND6_IFF_ACCEPT_RTADV)) + continue; + } + /* if we find multiple candidates, just warn. */ if (n != 0 && dflag > 1) warnx("multiple interfaces found"); @@ -855,6 +883,8 @@ autoifprobe(void) warnx("probing %s", argv[i]); } } + if (!Fflag) + close(s); freeifaddrs(ifap); return argv; } From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 17:35:29 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF08C1065706; Sat, 13 Feb 2010 17:35:29 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFB5C8FC14; Sat, 13 Feb 2010 17:35:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DHZTF4044968; Sat, 13 Feb 2010 17:35:29 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DHZTgM044965; Sat, 13 Feb 2010 17:35:29 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201002131735.o1DHZTgM044965@svn.freebsd.org> From: Antoine Brodin Date: Sat, 13 Feb 2010 17:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203840 - stable/8/kerberos5/usr.bin/kdestroy X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 17:35:30 -0000 Author: antoine Date: Sat Feb 13 17:35:29 2010 New Revision: 203840 URL: http://svn.freebsd.org/changeset/base/203840 Log: Merge r201918 to stable/8: Fix a typo. Modified: stable/8/kerberos5/usr.bin/kdestroy/Makefile Directory Properties: stable/8/kerberos5/usr.bin/kdestroy/ (props changed) Modified: stable/8/kerberos5/usr.bin/kdestroy/Makefile ============================================================================== --- stable/8/kerberos5/usr.bin/kdestroy/Makefile Sat Feb 13 17:05:57 2010 (r203839) +++ stable/8/kerberos5/usr.bin/kdestroy/Makefile Sat Feb 13 17:35:29 2010 (r203840) @@ -2,7 +2,7 @@ PROG= kdestroy CFLAGS+=-I${KRB5DIR}/lib/roken -DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHX509) ${LIBROKEN} ${LIBVERS} \ +DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHX509} ${LIBROKEN} ${LIBVERS} \ ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT} ${LIBCOM_ERR} LDADD= -lkafs5 -lkrb5 -lhx509 -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -lcom_err From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 17:41:23 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DB0A1065679; Sat, 13 Feb 2010 17:41:23 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E6B78FC16; Sat, 13 Feb 2010 17:41:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DHfNxT050705; Sat, 13 Feb 2010 17:41:23 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DHfNVO050703; Sat, 13 Feb 2010 17:41:23 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201002131741.o1DHfNVO050703@svn.freebsd.org> From: Antoine Brodin Date: Sat, 13 Feb 2010 17:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203841 - stable/8/kerberos5/usr.bin/kpasswd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 17:41:23 -0000 Author: antoine Date: Sat Feb 13 17:41:22 2010 New Revision: 203841 URL: http://svn.freebsd.org/changeset/base/203841 Log: Merge r201919 to stable/8: Fix a typo. Modified: stable/8/kerberos5/usr.bin/kpasswd/Makefile Directory Properties: stable/8/kerberos5/usr.bin/kpasswd/ (props changed) Modified: stable/8/kerberos5/usr.bin/kpasswd/Makefile ============================================================================== --- stable/8/kerberos5/usr.bin/kpasswd/Makefile Sat Feb 13 17:35:29 2010 (r203840) +++ stable/8/kerberos5/usr.bin/kpasswd/Makefile Sat Feb 13 17:41:22 2010 (r203841) @@ -2,7 +2,7 @@ PROG= kpasswd CFLAGS+=-I${KRB5DIR}/lib/roken -DPADD= ${LIBKRB5} ${LIBHX509 ${LIBROKEN} ${LIBVERS} \ +DPADD= ${LIBKRB5} ${LIBHX509} ${LIBROKEN} ${LIBVERS} \ ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT} ${LIBCOM_ERR} LDADD= -lkrb5 -lhx509 -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -lcom_err From owner-svn-src-stable@FreeBSD.ORG Sat Feb 13 17:48:52 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD3D3106566B; Sat, 13 Feb 2010 17:48:52 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADF348FC0C; Sat, 13 Feb 2010 17:48:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1DHmqsH058000; Sat, 13 Feb 2010 17:48:52 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1DHmqbS057998; Sat, 13 Feb 2010 17:48:52 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201002131748.o1DHmqbS057998@svn.freebsd.org> From: Antoine Brodin Date: Sat, 13 Feb 2010 17:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203842 - stable/8/share/mk X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 17:48:52 -0000 Author: antoine Date: Sat Feb 13 17:48:52 2010 New Revision: 203842 URL: http://svn.freebsd.org/changeset/base/203842 Log: Merge r201920 to stable/8: libusb20 was renamed libusb several months ago. Modified: stable/8/share/mk/bsd.libnames.mk Directory Properties: stable/8/share/mk/ (props changed) Modified: stable/8/share/mk/bsd.libnames.mk ============================================================================== --- stable/8/share/mk/bsd.libnames.mk Sat Feb 13 17:41:22 2010 (r203841) +++ stable/8/share/mk/bsd.libnames.mk Sat Feb 13 17:48:52 2010 (r203842) @@ -150,7 +150,7 @@ LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a -LIBUSB20?= ${DESTDIR}${LIBDIR}/libusb20.a +LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a