svn commit: r241043 - head/sys/netinet
Author: glebius Date: Sat Sep 29 05:52:19 2012 New Revision: 241043 URL: http://svn.freebsd.org/changeset/base/241043 Log: carp_send_ad() should never return without rescheduling next run. Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c == --- head/sys/netinet/ip_carp.c Sat Sep 29 03:41:21 2012(r241042) +++ head/sys/netinet/ip_carp.c Sat Sep 29 05:52:19 2012(r241043) @@ -771,10 +771,7 @@ carp_send_ad_locked(struct carp_softc *s MGETHDR(m, M_NOWAIT, MT_HEADER); if (m == NULL) { CARPSTATS_INC(carps_onomem); - /* XXX maybe less ? */ - callout_reset(&sc->sc_ad_tmo, tvtohz(&tv), - carp_send_ad, sc); - return; + goto resched; } len = sizeof(*ip) + sizeof(ch); m->m_pkthdr.len = len; @@ -807,7 +804,7 @@ carp_send_ad_locked(struct carp_softc *s ch_ptr = (struct carp_header *)(&ip[1]); bcopy(&ch, ch_ptr, sizeof(ch)); if (carp_prepare_ad(m, sc, ch_ptr)) - return; + goto resched; m->m_data += sizeof(*ip); ch_ptr->carp_cksum = carp_cksum(m, len - sizeof(*ip)); @@ -842,10 +839,7 @@ carp_send_ad_locked(struct carp_softc *s MGETHDR(m, M_NOWAIT, MT_HEADER); if (m == NULL) { CARPSTATS_INC(carps_onomem); - /* XXX maybe less ? */ - callout_reset(&sc->sc_ad_tmo, tvtohz(&tv), - carp_send_ad, sc); - return; + goto resched; } len = sizeof(*ip6) + sizeof(ch); m->m_pkthdr.len = len; @@ -877,13 +871,13 @@ carp_send_ad_locked(struct carp_softc *s if (in6_setscope(&ip6->ip6_dst, sc->sc_carpdev, NULL) != 0) { m_freem(m); CARP_DEBUG("%s: in6_setscope failed\n", __func__); - return; + goto resched; } ch_ptr = (struct carp_header *)(&ip6[1]); bcopy(&ch, ch_ptr, sizeof(ch)); if (carp_prepare_ad(m, sc, ch_ptr)) - return; + goto resched; m->m_data += sizeof(*ip6); ch_ptr->carp_cksum = carp_cksum(m, len - sizeof(*ip6)); @@ -913,6 +907,7 @@ carp_send_ad_locked(struct carp_softc *s } #endif /* INET6 */ +resched: callout_reset(&sc->sc_ad_tmo, tvtohz(&tv), carp_send_ad, sc); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241042 - head/usr.sbin/bsdconfig/share
Author: dteske Date: Sat Sep 29 03:41:21 2012 New Revision: 241042 URL: http://svn.freebsd.org/changeset/base/241042 Log: Allow deferred word-splitting via f_sysrc_get() by allowing $IFS in the "clean-room" environment used to query rc.conf(5) parameters. This brings bsdconfig(8)'s sysrc.subr in-line with both the sysrc(8) manual [provided by sysutils/sysrc] and sysrc(8)'s own sysrc.subr (now identical to bsdconfig(8)'s sysrc.subr as of this patch). Finally, this will allow a clean import of sysutils/sysrc (sans sysrc.subr, already provided here). Reviewed by: jilles Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/share/sysrc.subr Modified: head/usr.sbin/bsdconfig/share/sysrc.subr == --- head/usr.sbin/bsdconfig/share/sysrc.subrSat Sep 29 01:15:45 2012 (r241041) +++ head/usr.sbin/bsdconfig/share/sysrc.subrSat Sep 29 03:41:21 2012 (r241042) @@ -143,7 +143,7 @@ f_sysrc_get() # Clear the environment of all variables, preventing the # expansion of normals such as `PS1', `TERM', etc. # - f_clean_env --except RC_CONFS RC_DEFAULTS + f_clean_env --except IFS RC_CONFS RC_DEFAULTS . "$RC_DEFAULTS" > /dev/null 2>&1 @@ -451,8 +451,7 @@ f_sysrc_set() if [ "${RC_CONFS+set}" ]; then file="${RC_CONFS%%[$IFS]*}" else - file=$( f_sysrc_get rc_conf_files ) - file="${file%%[$IFS]*}" + file=$( f_sysrc_get 'rc_conf_files%%[$IFS]*' ) fi fi ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241039 - head/sys/netpfil/pf
Author: glebius Date: Fri Sep 28 20:43:03 2012 New Revision: 241039 URL: http://svn.freebsd.org/changeset/base/241039 Log: Simplify and somewhat redesign interaction between pf_purge_thread() and pf_purge_expired_states(). Now pf purging daemon stores the current hash table index on stack in pf_purge_thread(), and supplies it to next iteration of pf_purge_expired_states(). The latter returns new index back. The important change is that whenever pf_purge_expired_states() wraps around the array it returns immediately. This makes our knowledge about status of states expiry run more consistent. Prior to this change it could happen that n-th run stopped on i-th entry, and returned (1) as full run complete, then next (n+1) full run stopped on j-th entry, where j < i, and that broke the mark-and-sweep algorythm that saves references rules. A referenced rule was freed, and this later lead to a crash. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c == --- head/sys/netpfil/pf/pf.cFri Sep 28 20:29:06 2012(r241038) +++ head/sys/netpfil/pf/pf.cFri Sep 28 20:43:03 2012(r241039) @@ -282,7 +282,7 @@ static int pf_src_connlimit(struct pf_ static void pf_overload_task(void *c, int pending); static int pf_insert_src_node(struct pf_src_node **, struct pf_rule *, struct pf_addr *, sa_family_t); -static int pf_purge_expired_states(int); +static u_intpf_purge_expired_states(u_int, int); static void pf_purge_unlinked_rules(void); static int pf_mtag_init(void *, int, int); static void pf_mtag_free(struct m_tag *); @@ -1307,7 +1307,7 @@ pf_intr(void *v) void pf_purge_thread(void *v) { - int fullrun; + u_int idx = 0; CURVNET_SET((struct vnet *)v); @@ -1329,7 +1329,7 @@ pf_purge_thread(void *v) /* * Now purge everything. */ - pf_purge_expired_states(V_pf_hashmask + 1); + pf_purge_expired_states(0, V_pf_hashmask); pf_purge_expired_fragments(); pf_purge_expired_src_nodes(); @@ -1352,11 +1352,11 @@ pf_purge_thread(void *v) PF_RULES_RUNLOCK(); /* Process 1/interval fraction of the state table every run. */ - fullrun = pf_purge_expired_states(V_pf_hashmask / + idx = pf_purge_expired_states(idx, V_pf_hashmask / (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); /* Purge other expired types every PFTM_INTERVAL seconds. */ - if (fullrun) { + if (idx == 0) { /* * Order is important: * - states and src nodes reference rules @@ -1533,14 +1533,11 @@ pf_free_state(struct pf_state *cur) /* * Called only from pf_purge_thread(), thus serialized. */ -static int -pf_purge_expired_states(int maxcheck) +static u_int +pf_purge_expired_states(u_int i, int maxcheck) { - static u_int i = 0; - struct pf_idhash *ih; struct pf_state *s; - int rv = 0; V_pf_status.states = uma_zone_get_cur(V_pf_state_z); @@ -1549,12 +1546,6 @@ pf_purge_expired_states(int maxcheck) */ while (maxcheck > 0) { - /* Wrap to start of hash when we hit the end. */ - if (i > V_pf_hashmask) { - i = 0; - rv = 1; - } - ih = &V_pf_idhash[i]; relock: PF_HASHROW_LOCK(ih); @@ -1574,13 +1565,19 @@ relock: s->rt_kif->pfik_flags |= PFI_IFLAG_REFS; } PF_HASHROW_UNLOCK(ih); - i++; + + /* Return when we hit end of hash. */ + if (++i > V_pf_hashmask) { + V_pf_status.states = uma_zone_get_cur(V_pf_state_z); + return (0); + } + maxcheck--; } V_pf_status.states = uma_zone_get_cur(V_pf_state_z); - return (rv); + return (i); } static void ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241037 - in head: share/man/man9 sys/dev/bxe sys/dev/e1000 sys/dev/ixgbe sys/dev/mxge sys/dev/oce sys/dev/vxge sys/net sys/ofed/drivers/net/mlx4 sys/sys
Author: glebius Date: Fri Sep 28 18:28:27 2012 New Revision: 241037 URL: http://svn.freebsd.org/changeset/base/241037 Log: The drbr(9) API appeared to be so unclear, that most drivers in tree used it incorrectly, which lead to inaccurate overrated if_obytes accounting. The drbr(9) used to update ifnet stats on drbr_enqueue(), which is not accurate since enqueuing doesn't imply successful processing by driver. Dequeuing neither mean that. Most drivers also called drbr_stats_update() which did accounting again, leading to doubled if_obytes statistics. And in case of severe transmitting, when a packet could be several times enqueued and dequeued it could have been accounted several times. o Thus, make drbr(9) API thinner. Now drbr(9) merely chooses between ALTQ queueing or buf_ring(9) queueing. - It doesn't touch the buf_ring stats any more. - It doesn't touch ifnet stats anymore. - drbr_stats_update() no longer exists. o buf_ring(9) handles its stats itself: - It handles br_drops itself. - br_prod_bytes stats are dropped. Rationale: no one ever reads them but update of a common counter on every packet negatively affects performance due to excessive cache invalidation. - buf_ring_enqueue_bytes() reduced to buf_ring_enqueue(), since we no longer account bytes. o Drivers handle their stats theirselves: if_obytes, if_omcasts. o mlx4(4), igb(4), em(4), vxge(4), oce(4) and ixv(4) no longer use drbr_stats_update(), and update ifnet stats theirselves. o bxe(4) was the most correct driver, it didn't call drbr_stats_update(), thus it was the only driver accurate under moderate load. Now it also maintains stats itself. o ixgbe(4) had already taken stats from hardware, so just - drop software stats updating. - take multicast packet count from hardware as well. o mxge(4) just no longer needs NO_SLOW_STATS define. o cxgb(4), cxgbe(4) need no change, since they obtain stats from hardware. Reviewed by: jfv, gnn Modified: head/share/man/man9/buf_ring.9 head/share/man/man9/drbr.9 head/sys/dev/bxe/if_bxe.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixv.c head/sys/dev/mxge/if_mxge.c head/sys/dev/oce/oce_if.c head/sys/dev/vxge/vxge.c head/sys/net/if_var.h head/sys/ofed/drivers/net/mlx4/en_tx.c head/sys/sys/buf_ring.h Modified: head/share/man/man9/buf_ring.9 == --- head/share/man/man9/buf_ring.9 Fri Sep 28 17:36:00 2012 (r241036) +++ head/share/man/man9/buf_ring.9 Fri Sep 28 18:28:27 2012 (r241037) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2012 +.Dd September 27, 2012 .Dt BUF_RING 9 .Os .Sh NAME @@ -33,7 +33,6 @@ .Nm buf_ring_alloc , .Nm buf_ring_free , .Nm buf_ring_enqueue , -.Nm buf_ring_enqueue_bytes , .Nm buf_ring_dequeue_mc , .Nm buf_ring_dequeue_sc , .Nm buf_ring_count , @@ -50,8 +49,6 @@ .Fn buf_ring_free "struct buf_ring *br" "struct malloc_type *type" .Ft int .Fn buf_ring_enqueue "struct buf_ring *br" "void *buf" -.Ft int -.Fn buf_ring_enqueue_bytes "struct buf_ring *br" "void *buf" "int bytes" .Ft void * .Fn buf_ring_dequeue_mc "struct buf_ring *br" .Ft void * @@ -91,12 +88,6 @@ The function is used to enqueue a buffer to a buf_ring. .Pp The -.Fn buf_ring_enqueue_bytes -function is used to enqueue a buffer to a buf_ring and increment the -number of bytes enqueued by -.Fa bytes . -.Pp -The .Fn buf_ring_dequeue_mc function is a multi-consumer safe way of dequeueing elements from a buf_ring. .Pp @@ -134,9 +125,7 @@ otherwise. .Sh RETURN VALUES The .Fn buf_ring_enqueue -and -.Fn buf_ring_enqueue_bytes -functions return +function return .Er ENOBUFS if there are no available slots in the buf_ring. .Sh HISTORY Modified: head/share/man/man9/drbr.9 == --- head/share/man/man9/drbr.9 Fri Sep 28 17:36:00 2012(r241036) +++ head/share/man/man9/drbr.9 Fri Sep 28 18:28:27 2012(r241037) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2012 +.Dd September 27, 2012 .Dt DRBR 9 .Os .Sh NAME @@ -37,7 +37,6 @@ .Nm drbr_flush , .Nm drbr_empty , .Nm drbr_inuse , -.Nm drbr_stats_update , .Nd network driver interface to buf_ring .Sh SYNOPSIS .In sys/param.h @@ -57,8 +56,6 @@ .Fn drbr_empty "struct ifnet *ifp" "struct buf_ring *br" .Ft int .Fn drbr_inuse "struct ifnet *ifp" "struct buf_ring *br" -.Ft void -.Fn drbr_stats_update "struct ifnet *ifp" "int len" "int mflags" .Sh DESCRIPTION The .Nm @@ -123,9 +120,6 @@ there will not be more mbufs when is actually called. Provided the tx queue lock is held there will not be less. .Pp -The -.Fn drbr_stats_update -function updates the number of bytes and the number of multicast packets sent. .Sh RETURN VALUES Th
svn commit: r241035 - head/sbin/fsck_ffs
Author: mdf Date: Fri Sep 28 17:34:34 2012 New Revision: 241035 URL: http://svn.freebsd.org/changeset/base/241035 Log: Fix some nearby type and style errors. Pointed out by: bde Modified: head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/pass1.c head/sbin/fsck_ffs/suj.c Modified: head/sbin/fsck_ffs/main.c == --- head/sbin/fsck_ffs/main.c Fri Sep 28 16:23:01 2012(r241034) +++ head/sbin/fsck_ffs/main.c Fri Sep 28 17:34:34 2012(r241035) @@ -210,12 +210,11 @@ checkfilesys(char *filesys) struct statfs *mntp; struct stat snapdir; struct group *grp; - ufs2_daddr_t blks; struct iovec *iov; char errmsg[255]; int iovlen; int cylno; - ino_t files; + intmax_t blks, files; size_t size; iov = NULL; @@ -382,9 +381,9 @@ checkfilesys(char *filesys) clean: pwarn("clean, %ld free ", (long)(sblock.fs_cstotal.cs_nffree + sblock.fs_frag * sblock.fs_cstotal.cs_nbfree)); - printf("(%lld frags, %lld blocks, %.1f%% fragmentation)\n", - (long long)sblock.fs_cstotal.cs_nffree, - (long long)sblock.fs_cstotal.cs_nbfree, + printf("(%jd frags, %jd blocks, %.1f%% fragmentation)\n", + (intmax_t)sblock.fs_cstotal.cs_nffree, + (intmax_t)sblock.fs_cstotal.cs_nbfree, sblock.fs_cstotal.cs_nffree * 100.0 / sblock.fs_dsize); return (0); } @@ -481,8 +480,8 @@ checkfilesys(char *filesys) blks = maxfsblock - (n_ffree + sblock.fs_frag * n_bfree) - blks; if (bkgrdflag && (files > 0 || blks > 0)) { countdirs = sblock.fs_cstotal.cs_ndir - countdirs; - pwarn("Reclaimed: %ld directories, %ld files, %lld fragments\n", - countdirs, (long)files - countdirs, (long long)blks); + pwarn("Reclaimed: %ld directories, %jd files, %jd fragments\n", + countdirs, files - countdirs, blks); } pwarn("%ld files, %jd used, %ju free ", (long)n_files, (intmax_t)n_blks, @@ -492,13 +491,13 @@ checkfilesys(char *filesys) n_ffree * 100.0 / sblock.fs_dsize); if (debug) { if (files < 0) - printf("%jd inodes missing\n", (intmax_t)-files); + printf("%jd inodes missing\n", -files); if (blks < 0) - printf("%lld blocks missing\n", -(long long)blks); + printf("%jd blocks missing\n", -blks); if (duplist != NULL) { printf("The following duplicate blocks remain:"); for (dp = duplist; dp; dp = dp->next) - printf(" %lld,", (long long)dp->dup); + printf(" %jd,", (intmax_t)dp->dup); printf("\n"); } } Modified: head/sbin/fsck_ffs/pass1.c == --- head/sbin/fsck_ffs/pass1.c Fri Sep 28 16:23:01 2012(r241034) +++ head/sbin/fsck_ffs/pass1.c Fri Sep 28 17:34:34 2012(r241035) @@ -99,11 +99,10 @@ pass1(void) if (!rebuildcg && sblock.fs_magic == FS_UFS2_MAGIC) { inosused = cgrp.cg_initediblk; if (inosused > sblock.fs_ipg) { - pfatal("%s (%ju > %d) %s %d\nReset to %d\n", - "Too many initialized inodes", + pfatal( +"Too many initialized inodes (%ju > %d) in cylinder group %d\nReset to %d\n", (uintmax_t)inosused, - sblock.fs_ipg, "in cylinder group", c, - sblock.fs_ipg); + sblock.fs_ipg, c, sblock.fs_ipg); inosused = sblock.fs_ipg; } } else { Modified: head/sbin/fsck_ffs/suj.c == --- head/sbin/fsck_ffs/suj.cFri Sep 28 16:23:01 2012(r241034) +++ head/sbin/fsck_ffs/suj.cFri Sep 28 17:34:34 2012(r241035) @@ -1401,9 +1401,8 @@ ino_adjust(struct suj_ino *sino) ip = ino_read(ino); mode = DIP(ip, di_mode) & IFMT; if (nlink > LINK_MAX) - err_suj("ino %ju %s, new link %d, old link %d\n", - (uintmax_t)ino, "nlink manipulation error", nlink, - DIP(ip, di_nlink)); + err_suj("ino %ju nlink manipulation error, new %d, old %d\n", + (uintmax_t)ino, nlink, DIP(ip, di_nlink)); if (debug) printf("Adjusting ino %ju, nlink %d, old link
svn commit: r241034 - head/sys/dev/usb/net
Author: hselasky Date: Fri Sep 28 16:23:01 2012 New Revision: 241034 URL: http://svn.freebsd.org/changeset/base/241034 Log: Make sure we don't leak a mbuf in a fail case. Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c == --- head/sys/dev/usb/net/if_smsc.c Fri Sep 28 15:33:13 2012 (r241033) +++ head/sys/dev/usb/net/if_smsc.c Fri Sep 28 16:23:01 2012 (r241034) @@ -1043,8 +1043,11 @@ smsc_bulk_read_callback(struct usb_xfer /* Finally enqueue the mbuf on the receive queue */ /* Remove 4 trailing bytes */ - if (pktlen >= (4 + ETHER_HDR_LEN)) - uether_rxmbuf(ue, m, pktlen - 4); + if (pktlen < (4 + ETHER_HDR_LEN)) { + m_freem(m); + goto tr_setup; + } + uether_rxmbuf(ue, m, pktlen - 4); } /* Update the offset to move to the next potential packet */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241033 - head/sys/dev/usb/net
Author: hselasky Date: Fri Sep 28 15:33:13 2012 New Revision: 241033 URL: http://svn.freebsd.org/changeset/base/241033 Log: Remove some trailing bytes which are not part of the ethernet packet. Discussed with: bgray @ Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c == --- head/sys/dev/usb/net/if_smsc.c Fri Sep 28 15:24:14 2012 (r241032) +++ head/sys/dev/usb/net/if_smsc.c Fri Sep 28 15:33:13 2012 (r241033) @@ -1042,7 +1042,9 @@ smsc_bulk_read_callback(struct usb_xfer } /* Finally enqueue the mbuf on the receive queue */ - uether_rxmbuf(ue, m, pktlen); + /* Remove 4 trailing bytes */ + if (pktlen >= (4 + ETHER_HDR_LEN)) + uether_rxmbuf(ue, m, pktlen - 4); } /* Update the offset to move to the next potential packet */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241032 - head/sys/dev/usb/controller
Author: hselasky Date: Fri Sep 28 15:24:14 2012 New Revision: 241032 URL: http://svn.freebsd.org/changeset/base/241032 Log: Correct NYET handling. Remove superfluous transfer complete interrupt mask. Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c == --- head/sys/dev/usb/controller/dwc_otg.c Fri Sep 28 13:50:37 2012 (r241031) +++ head/sys/dev/usb/controller/dwc_otg.c Fri Sep 28 15:24:14 2012 (r241032) @@ -222,7 +222,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * /* enable interrupts */ DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), HCINT_STALL | HCINT_BBLERR | - HCINT_XACTERR | HCINT_XFERCOMPL | + HCINT_XACTERR | HCINT_NAK | HCINT_ACK | HCINT_NYET | HCINT_CHHLTD | HCINT_FRMOVRUN | HCINT_DATATGLERR); @@ -524,6 +524,10 @@ dwc_otg_host_channel_wait(struct dwc_otg if (x == 0) return (0); /* wait */ + /* assume NAK-ing is next */ + if (sc->sc_chan_state[x].hcint & HCINT_NYET) + return (0); /* wait */ + /* find new disabled channel */ for (x = 1; x != sc->sc_host_ch_max; x++) { @@ -701,15 +705,6 @@ dwc_otg_host_setup_tx(struct dwc_otg_td } } - /* treat NYET like NAK, if SPLIT transactions are used */ - if (hcint & HCINT_NYET) { - if (td->hcsplt != 0) { - DPRINTF("CH=%d NYET+SPLIT\n", td->channel); - hcint &= ~HCINT_NYET; - hcint |= HCINT_NAK; - } - } - /* channel must be disabled before we can complete the transfer */ if (hcint & (HCINT_ERRORS | HCINT_RETRY | @@ -755,13 +750,18 @@ dwc_otg_host_setup_tx(struct dwc_otg_td } break; case DWC_CHAN_ST_WAIT_C_ANE: + if (hcint & HCINT_NYET) { + if (!dwc_otg_host_channel_wait(td)) + break; + goto send_cpkt; + } if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { if (!dwc_otg_host_channel_wait(td)) break; td->did_nak = 1; - goto send_cpkt; + goto send_pkt; } - if (hcint & (HCINT_ACK | HCINT_NYET)) { + if (hcint & HCINT_ACK) { if (!dwc_otg_host_channel_wait(td)) break; td->offset += td->tx_bytes; @@ -1043,15 +1043,6 @@ dwc_otg_host_data_rx(struct dwc_otg_td * } } - /* treat NYET like NAK, if SPLIT transactions are used */ - if (hcint & HCINT_NYET) { - if (td->hcsplt != 0) { - DPRINTF("CH=%d NYET+SPLIT\n", td->channel); - hcint &= ~HCINT_NYET; - hcint |= HCINT_NAK; - } - } - /* channel must be disabled before we can complete the transfer */ if (hcint & (HCINT_ERRORS | HCINT_RETRY | @@ -1136,12 +1127,15 @@ check_state: break; td->did_nak = 1; - if (td->hcsplt != 0) goto receive_spkt; else goto receive_pkt; } + if (hcint & HCINT_NYET) { + if (td->hcsplt != 0) + goto receive_pkt; + } if (!(hcint & HCINT_SOFTWARE_ONLY)) break; if (hcint & (HCINT_ACK | HCINT_NYET)) { @@ -1171,7 +1165,6 @@ check_state: break; td->did_nak = 1; - goto receive_spkt; } if (hcint & (HCINT_ACK | HCINT_NYET)) { @@ -1401,15 +1394,6 @@ dwc_otg_host_data_tx(struct dwc_otg_td * } } - /* treat NYET like NAK, if SPLIT transactions are used */ - if (hcint & HCINT_NYET) { - if (td->hcsplt != 0) { - DPRINTF("CH=%d NYET+SPLIT\n", td->channel); - hcint &= ~HCINT_NYET; - hcint |= HCINT_NAK; - } - } - /* channel must be disabled before we can complete the transfer */ if (hcint & (HCINT_ERRORS | HCINT_RETRY | @@ -1467,13 +1451,18 @@ dwc_otg_host_data_tx(struct dwc_otg_td * } break; case DWC_CHAN_ST_WAIT_C_ANE: + if (hcint & HCINT_NYET) { +
svn commit: r241031 - head/lib/libc/stdlib
Author: des Date: Fri Sep 28 13:50:37 2012 New Revision: 241031 URL: http://svn.freebsd.org/changeset/base/241031 Log: Slight stylification. Modified: head/lib/libc/stdlib/random.c Modified: head/lib/libc/stdlib/random.c == --- head/lib/libc/stdlib/random.c Fri Sep 28 13:43:42 2012 (r241030) +++ head/lib/libc/stdlib/random.c Fri Sep 28 13:50:37 2012 (r241031) @@ -216,10 +216,8 @@ static int rand_deg = DEG_3; static int rand_sep = SEP_3; static uint32_t *end_ptr = &randtbl[DEG_3 + 1]; -static inline uint32_t good_rand(int32_t); - -static inline uint32_t good_rand (x) - int32_t x; +static inline uint32_t +good_rand(int32_t x) { #ifdef USE_WEAK_SEEDING /* @@ -264,8 +262,7 @@ static inline uint32_t good_rand (x) * for default usage relies on values produced by this routine. */ void -srandom(x) - unsigned long x; +srandom(unsigned long x) { int i, lim; @@ -295,7 +292,7 @@ srandom(x) * a fixed seed. */ void -srandomdev() +srandomdev(void) { int fd, done; size_t len; @@ -352,10 +349,7 @@ srandomdev() * complain about mis-alignment, but you should disregard these messages. */ char * -initstate(seed, arg_state, n) - unsigned long seed; /* seed for R.N.G. */ - char *arg_state;/* pointer to state array */ - long n; /* # bytes of state info */ +initstate(unsigned long seed, char *arg_state, long n) { char *ostate = (char *)(&state[-1]); uint32_t *int_arg_state = (uint32_t *)arg_state; @@ -367,7 +361,7 @@ initstate(seed, arg_state, n) if (n < BREAK_0) { (void)fprintf(stderr, "random: not enough state (%ld bytes); ignored.\n", n); - return(0); + return (0); } if (n < BREAK_1) { rand_type = TYPE_0; @@ -397,7 +391,7 @@ initstate(seed, arg_state, n) int_arg_state[0] = rand_type; else int_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type; - return(ostate); + return (ostate); } /* @@ -420,8 +414,7 @@ initstate(seed, arg_state, n) * complain about mis-alignment, but you should disregard these messages. */ char * -setstate(arg_state) - char *arg_state;/* pointer to state array */ +setstate(char *arg_state) { uint32_t *new_state = (uint32_t *)arg_state; uint32_t type = new_state[0] % MAX_TYPES; @@ -452,7 +445,7 @@ setstate(arg_state) fptr = &state[(rear + rand_sep) % rand_deg]; } end_ptr = &state[rand_deg]; /* set end_ptr too */ - return(ostate); + return (ostate); } /* @@ -473,7 +466,7 @@ setstate(arg_state) * Returns a 31-bit random number. */ long -random() +random(void) { uint32_t i; uint32_t *f, *r; @@ -498,5 +491,5 @@ random() fptr = f; rptr = r; } - return((long)i); + return ((long)i); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241029 - head/lib/libpam/modules/pam_radius
Author: des Date: Fri Sep 28 12:29:25 2012 New Revision: 241029 URL: http://svn.freebsd.org/changeset/base/241029 Log: Remove unnecessary #include. Modified: head/lib/libpam/modules/pam_radius/pam_radius.c Modified: head/lib/libpam/modules/pam_radius/pam_radius.c == --- head/lib/libpam/modules/pam_radius/pam_radius.c Fri Sep 28 12:13:34 2012(r241028) +++ head/lib/libpam/modules/pam_radius/pam_radius.c Fri Sep 28 12:29:25 2012(r241029) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241028 - head/sys/cam
Author: mav Date: Fri Sep 28 12:13:34 2012 New Revision: 241028 URL: http://svn.freebsd.org/changeset/base/241028 Log: Change queue overflow checks from DIAGNOSTIC+panic() to KASSERT() to make them enabled on HEAD by default. It is probably better to do single compare then hunt for unexpected memory corruption. Modified: head/sys/cam/cam_queue.c Modified: head/sys/cam/cam_queue.c == --- head/sys/cam/cam_queue.cFri Sep 28 11:59:32 2012(r241027) +++ head/sys/cam/cam_queue.cFri Sep 28 12:13:34 2012(r241028) @@ -121,11 +121,9 @@ camq_resize(struct camq *queue, int new_ { cam_pinfo **new_array; -#ifdef DIAGNOSTIC - if (new_size < queue->entries) - panic("camq_resize: New queue size can't accomodate " - "queued entries."); -#endif + KASSERT(new_size >= queue->entries, ("camq_resize: " + "New queue size can't accomodate queued entries (%d < %d).", + new_size, queue->entries)); new_array = (cam_pinfo **)malloc(new_size * sizeof(cam_pinfo *), M_CAMQ, M_NOWAIT); if (new_array == NULL) { @@ -156,10 +154,10 @@ camq_resize(struct camq *queue, int new_ void camq_insert(struct camq *queue, cam_pinfo *new_entry) { -#ifdef DIAGNOSTIC - if (queue->entries >= queue->array_size) - panic("camq_insert: Attempt to insert into a full queue"); -#endif + + KASSERT(queue->entries < queue->array_size, + ("camq_insert: Attempt to insert into a full queue (%d >= %d)", + queue->entries, queue->array_size)); queue->entries++; queue->queue_array[queue->entries] = new_entry; new_entry->index = queue->entries; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241027 - in head/sys: amd64/include/pc dev/ipmi i386/include/pc x86/bios
Author: jhb Date: Fri Sep 28 11:59:32 2012 New Revision: 241027 URL: http://svn.freebsd.org/changeset/base/241027 Log: - Re-shuffle the headers to move all kernel-specific bits under #ifdef _KERNEL but leave definitions for various structures defined by standards ($PIR table, SMAP entries, etc.) available to userland. - Consolidate duplicate SMBIOS table structure definitions in ipmi(4) and smbios(4) in and make them available to userland. MFC after:2 weeks Modified: head/sys/amd64/include/pc/bios.h head/sys/dev/ipmi/ipmi_smbios.c head/sys/i386/include/pc/bios.h head/sys/x86/bios/smbios.c Modified: head/sys/amd64/include/pc/bios.h == --- head/sys/amd64/include/pc/bios.hFri Sep 28 11:40:59 2012 (r241026) +++ head/sys/amd64/include/pc/bios.hFri Sep 28 11:59:32 2012 (r241027) @@ -30,16 +30,9 @@ #ifndef _MACHINE_PC_BIOS_H_ #define _MACHINE_PC_BIOS_H_ -extern u_int32_t bios_sigsearch(u_int32_t start, u_char *sig, int siglen, -int paralen, int sigofs); - -#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE) -#define BIOS_VADDRTOPADDR(x) ((x) - KERNBASE) - /* * Int 15:E820 'SMAP' structure */ - #define SMAP_SIG 0x534D4150 /* 'SMAP' */ #defineSMAP_TYPE_MEMORY1 @@ -58,22 +51,61 @@ struct bios_smap { u_int32_t type; } __packed; +/* + * System Management BIOS + */ +#defineSMBIOS_START0xf +#defineSMBIOS_STEP 0x10 +#defineSMBIOS_OFF 0 +#defineSMBIOS_LEN 4 +#defineSMBIOS_SIG "_SM_" + +struct smbios_eps { + uint8_t anchor_string[4]; /* '_SM_' */ + uint8_t checksum; + uint8_t length; + uint8_t major_version; + uint8_t minor_version; + uint16_tmaximum_structure_size; + uint8_t entry_point_revision; + uint8_t formatted_area[5]; + uint8_t intermediate_anchor_string[5]; /* '_DMI_' */ + uint8_t intermediate_checksum; + uint16_tstructure_table_length; + uint32_tstructure_table_address; + uint16_tnumber_structures; + uint8_t BCD_revision; +}; + +struct smbios_structure_header { + uint8_t type; + uint8_t length; + uint16_thandle; +}; + +#ifdef _KERNEL +#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE) +#define BIOS_VADDRTOPADDR(x) ((x) - KERNBASE) + struct bios_oem_signature { char * anchor; /* search anchor string in BIOS memory */ size_t offset; /* offset from anchor (may be negative) */ size_t totlen; /* total length of BIOS string to copy */ } __packed; + struct bios_oem_range { u_int from; /* shouldn't be below 0xe */ u_int to; /* shouldn't be above 0xf */ } __packed; + struct bios_oem { struct bios_oem_range range; struct bios_oem_signature signature[]; } __packed; -extern int -bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen); - +intbios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen); +uint32_t bios_sigsearch(uint32_t start, u_char *sig, int siglen, int paralen, + int sigofs); +#endif #endif /* _MACHINE_PC_BIOS_H_ */ Modified: head/sys/dev/ipmi/ipmi_smbios.c == --- head/sys/dev/ipmi/ipmi_smbios.c Fri Sep 28 11:40:59 2012 (r241026) +++ head/sys/dev/ipmi/ipmi_smbios.c Fri Sep 28 11:59:32 2012 (r241027) @@ -52,29 +52,6 @@ __FBSDID("$FreeBSD$"); #definepmap_unmapbios pmap_unmapdev #endif -struct smbios_table { - uint8_t anchor_string[4]; - uint8_t checksum; - uint8_t length; - uint8_t major_version; - uint8_t minor_version; - uint16_tmaximum_structure_size; - uint8_t entry_point_revision; - uint8_t formatted_area[5]; - uint8_t DMI_anchor_string[5]; - uint8_t intermediate_checksum; - uint16_tstructure_table_length; - uint32_tstructure_table_address; - uint16_tnumber_structures; - uint8_t BCD_revision; -}; - -struct structure_header { - uint8_t type; - uint8_t length; - uint16_thandle; -}; - struct ipmi_entry { uint8_t type; uint8_t length; @@ -102,13 +79,7 @@ struct ipmi_entry { #defineSPACING_32 0x1 #defineSPACING_16 0x2 -#defineSMBIOS_START0xf -#defineSMBIOS_STEP 0x10 -#defineSMBIOS_OFF 0 -
svn commit: r241026 - head/usr.sbin/portsnap/portsnap
Author: issyl0 (doc committer) Date: Fri Sep 28 11:40:59 2012 New Revision: 241026 URL: http://svn.freebsd.org/changeset/base/241026 Log: Change "only only" to "only" in portsnap(8). Spotted by: Ruslan Mahmatkhanov Approved by: gabor (mentor, implicit) Modified: head/usr.sbin/portsnap/portsnap/portsnap.8 Modified: head/usr.sbin/portsnap/portsnap/portsnap.8 == --- head/usr.sbin/portsnap/portsnap/portsnap.8 Fri Sep 28 11:25:02 2012 (r241025) +++ head/usr.sbin/portsnap/portsnap/portsnap.8 Fri Sep 28 11:40:59 2012 (r241026) @@ -187,7 +187,7 @@ Note that running or .Nm .Cm fetch -does not apply the changes that were received: they only only download +does not apply the changes that were received: they only download them. To apply the changes, you must follow these commands with .Nm ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r241024 - head/usr.sbin/portsnap/portsnap
Isabell Long wrote on 28.09.2012 15:11: Author: issyl0 (doc committer) Date: Fri Sep 28 11:11:42 2012 New Revision: 241024 URL: http://svn.freebsd.org/changeset/base/241024 Log: Add a note to portsnap(8) about the behaviour of the example cron command. [ ...] +.Pp +Note that running +.Nm +.Cm cron +or +.Nm +.Cm fetch +does not apply the changes that were received: they only only download double 'only' +them. +To apply the changes, you must follow these commands with +.Nm +.Cm update . +The +.Nm +.Cm update +command is normally run by hand at a time when you are sure that +no one is manually working in the ports tree. .It Running .Nm -- Regards, Ruslan Tinderboxing kills... the drives. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241025 - in head/sys: compat/linux fs/coda fs/nfsserver kern nfsserver vm
Author: kib Date: Fri Sep 28 11:25:02 2012 New Revision: 241025 URL: http://svn.freebsd.org/changeset/base/241025 Log: Fix the mis-handling of the VV_TEXT on the nullfs vnodes. If you have a binary on a filesystem which is also mounted over by nullfs, you could execute the binary from the lower filesystem, or from the nullfs mount. When executed from lower filesystem, the lower vnode gets VV_TEXT flag set, and the file cannot be modified while the binary is active. But, if executed as the nullfs alias, only the nullfs vnode gets VV_TEXT set, and you still can open the lower vnode for write. Add a set of VOPs for the VV_TEXT query, set and clear operations, which are correctly bypassed to lower vnode. Tested by:pho (previous version) MFC after:2 weeks Modified: head/sys/compat/linux/linux_misc.c head/sys/fs/coda/coda_subr.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/kern/imgact_elf.c head/sys/kern/kern_exec.c head/sys/kern/vfs_default.c head/sys/kern/vfs_vnops.c head/sys/kern/vnode_if.src head/sys/nfsserver/nfs_serv.c head/sys/vm/vm_object.c head/sys/vm/vnode_pager.c Modified: head/sys/compat/linux/linux_misc.c == --- head/sys/compat/linux/linux_misc.c Fri Sep 28 11:11:42 2012 (r241024) +++ head/sys/compat/linux/linux_misc.c Fri Sep 28 11:25:02 2012 (r241025) @@ -386,7 +386,7 @@ linux_uselib(struct thread *td, struct l * XXX: Note that if any of the VM operations fail below we don't * clear this flag. */ - vp->v_vflag |= VV_TEXT; + VOP_SET_TEXT(vp); /* * Lock no longer needed Modified: head/sys/fs/coda/coda_subr.c == --- head/sys/fs/coda/coda_subr.cFri Sep 28 11:11:42 2012 (r241024) +++ head/sys/fs/coda/coda_subr.cFri Sep 28 11:25:02 2012 (r241025) @@ -486,7 +486,7 @@ handleDownCall(struct coda_mntinfo *mnt, cache_purge(CTOV(cp)); cp->c_flags &= ~(C_VATTR | C_ACCCACHE); ASSERT_VOP_LOCKED(CTOV(cp), "coda HandleDownCall"); - if (CTOV(cp)->v_vflag & VV_TEXT) + if (VOP_IS_TEXT(CTOV(cp))) error = coda_vmflush(cp); CODADEBUG(CODA_ZAPFILE, myprintf(("zapfile: fid = %s, refcnt = %d, error = " @@ -532,7 +532,7 @@ handleDownCall(struct coda_mntinfo *mnt, cp->c_flags &= ~(C_VATTR | C_ACCCACHE); ASSERT_VOP_LOCKED(CTOV(cp), "coda HandleDownCall"); if (!(IS_DIR(out->coda_purgefid.Fid)) - && (CTOV(cp)->v_vflag & VV_TEXT)) + && VOP_IS_TEXT(CTOV(cp))) error = coda_vmflush(cp); CODADEBUG(CODA_PURGEFID, myprintf(("purgefid: fid " "= %s, refcnt = %d, error = %d\n", Modified: head/sys/fs/nfsserver/nfs_nfsdport.c == --- head/sys/fs/nfsserver/nfs_nfsdport.cFri Sep 28 11:11:42 2012 (r241024) +++ head/sys/fs/nfsserver/nfs_nfsdport.cFri Sep 28 11:25:02 2012 (r241025) @@ -252,7 +252,7 @@ nfsvno_accchk(struct vnode *vp, accmode_ * the inode, try to free it up once. If * we fail, we can't allow writing. */ - if ((vp->v_vflag & VV_TEXT) != 0 && error == 0) + if (VOP_IS_TEXT(vp) && error == 0) error = ETXTBSY; } if (error != 0) { Modified: head/sys/kern/imgact_elf.c == --- head/sys/kern/imgact_elf.c Fri Sep 28 11:11:42 2012(r241024) +++ head/sys/kern/imgact_elf.c Fri Sep 28 11:25:02 2012(r241025) @@ -647,7 +647,7 @@ __elfN(load_file)(struct proc *p, const * Also make certain that the interpreter stays the same, so set * its VV_TEXT flag, too. */ - nd->ni_vp->v_vflag |= VV_TEXT; + VOP_SET_TEXT(nd->ni_vp); imgp->object = nd->ni_vp->v_object; Modified: head/sys/kern/kern_exec.c == --- head/sys/kern/kern_exec.c Fri Sep 28 11:11:42 2012(r241024) +++ head/sys/kern/kern_exec.c Fri Sep 28 11:25:02 2012(r241025) @@ -473,9 +473,8 @@ interpret: * Remember if this was set before and unset it in case this is not * actually an executable image. */ - textset = imgp->vp->v_vflag & VV_TEXT; - ASSERT_VOP_ELOCKED(imgp->vp, "vv_text"); - imgp->vp->v_vflag |= VV_TEXT; + textset = VOP_IS_TEXT(imgp->vp); + VOP_SET_TEXT(i
svn commit: r241024 - head/usr.sbin/portsnap/portsnap
Author: issyl0 (doc committer) Date: Fri Sep 28 11:11:42 2012 New Revision: 241024 URL: http://svn.freebsd.org/changeset/base/241024 Log: Add a note to portsnap(8) about the behaviour of the example cron command. PR: docs/171759 Submitted by: Paul Hoffman (phoffman at proper dot com) Approved by: cperciva, gabor (mentor) MFC after:3 days Modified: head/usr.sbin/portsnap/portsnap/portsnap.8 Modified: head/usr.sbin/portsnap/portsnap/portsnap.8 == --- head/usr.sbin/portsnap/portsnap/portsnap.8 Fri Sep 28 10:49:41 2012 (r241023) +++ head/usr.sbin/portsnap/portsnap/portsnap.8 Fri Sep 28 11:11:42 2012 (r241024) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2012 +.Dd September 28, 2012 .Dt PORTSNAP 8 .Os FreeBSD .Sh NAME @@ -180,6 +180,23 @@ can quickly be extracted into If your clock is set to UTC, please pick a random time other than 3AM, to avoid overly imposing an uneven load on the server(s) hosting the snapshots. +.Pp +Note that running +.Nm +.Cm cron +or +.Nm +.Cm fetch +does not apply the changes that were received: they only only download +them. +To apply the changes, you must follow these commands with +.Nm +.Cm update . +The +.Nm +.Cm update +command is normally run by hand at a time when you are sure that +no one is manually working in the ports tree. .It Running .Nm ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241023 - head/sys/boot/common
Author: ae Date: Fri Sep 28 10:49:41 2012 New Revision: 241023 URL: http://svn.freebsd.org/changeset/base/241023 Log: Make the loader a bit smarter, when it tries to open disk and the slice number is not exactly specified. When the disk has MBR, also try to read BSD label after ptable_getpart() call. When the disk has GPT, also set d_partition to 255. Mostly, this is how it worked before. Modified: head/sys/boot/common/disk.c Modified: head/sys/boot/common/disk.c == --- head/sys/boot/common/disk.c Fri Sep 28 08:22:51 2012(r241022) +++ head/sys/boot/common/disk.c Fri Sep 28 10:49:41 2012(r241023) @@ -179,12 +179,21 @@ disk_open(struct disk_devdesc *dev, off_ rc = ptable_getpart(od->table, &part, dev->d_partition); if (rc == 0) dev->d_offset = part.start; - } else if (dev->d_slice > 0) { + } else if (dev->d_slice >= 0) { /* Try to get information about partition */ - rc = ptable_getpart(od->table, &part, dev->d_slice); + if (dev->d_slice == 0) + rc = ptable_getbestpart(od->table, &part); + else + rc = ptable_getpart(od->table, &part, dev->d_slice); if (rc != 0) /* Partition doesn't exist */ goto out; dev->d_offset = part.start; + if (dev->d_slice == 0) { + /* Save the slice number of best partition to dev */ + dev->d_slice = part.index; + if (ptable_gettype(od->table) == PTABLE_GPT) + dev->d_partition = 255; + } if (dev->d_partition == 255) goto out; /* Nothing more to do */ /* @@ -217,13 +226,6 @@ disk_open(struct disk_devdesc *dev, off_ if (rc != 0) goto out; dev->d_offset += part.start; - } else if (dev->d_slice == 0) { - rc = ptable_getbestpart(od->table, &part); - if (rc != 0) - goto out; - /* Save the slice number of best partition to dev */ - dev->d_slice = part.index; - dev->d_offset = part.start; } out: if (table != NULL) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241022 - head/sys/geom
Author: pjd Date: Fri Sep 28 08:22:51 2012 New Revision: 241022 URL: http://svn.freebsd.org/changeset/base/241022 Log: Remove the topology lock from disk_gone(), it might be called with regular mutexes held and the topology lock is an sx lock. The topology lock was there to protect traversing through the list of providers of disk's geom, but it seems that disk's geom has always exactly one provider. Change the code to call g_wither_provider() for this one provider, which is safe to do without holding the topology lock and assert that there is indeed only one provider. Discussed with: ken MFC after:1 week Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c == --- head/sys/geom/geom_disk.c Fri Sep 28 07:51:30 2012(r241021) +++ head/sys/geom/geom_disk.c Fri Sep 28 08:22:51 2012(r241022) @@ -635,13 +635,15 @@ disk_gone(struct disk *dp) struct g_geom *gp; struct g_provider *pp; - g_topology_lock(); gp = dp->d_geom; if (gp != NULL) { - LIST_FOREACH(pp, &gp->provider, provider) + pp = LIST_FIRST(&gp->provider); + if (pp != NULL) { + KASSERT(LIST_NEXT(pp, provider) == NULL, + ("geom %p has more than one provider", gp)); g_wither_provider(pp, ENXIO); + } } - g_topology_unlock(); } void ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r241021 - in head: cddl/contrib/opensolaris/lib/libdtrace/common cddl/contrib/opensolaris/lib/libzfs/common contrib/telnet/telnetd usr.bin/csup usr.sbin/pkg_install/lib usr.sbin/pw
Author: kevlo Date: Fri Sep 28 07:51:30 2012 New Revision: 241021 URL: http://svn.freebsd.org/changeset/base/241021 Log: Make sure that each va_start has one and only one matching va_end, especially in error cases. Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c head/contrib/telnet/telnetd/state.c head/usr.bin/csup/proto.c head/usr.sbin/pkg_install/lib/exec.c head/usr.sbin/pw/pwupd.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c == --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.cFri Sep 28 05:30:59 2012(r241020) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.cFri Sep 28 07:51:30 2012(r241021) @@ -678,6 +678,7 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c dtp->dt_buffered_offs += needed; assert(dtp->dt_buffered_buf[dtp->dt_buffered_offs] == '\0'); + va_end(ap); return (0); } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c == --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Sep 28 05:30:59 2012(r241020) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Sep 28 07:51:30 2012(r241021) @@ -368,6 +368,7 @@ zfs_standard_error_fmt(libzfs_handle_t * case ENOSPC: case EDQUOT: zfs_verror(hdl, EZFS_NOSPC, fmt, ap); + va_end(ap); return (-1); case EEXIST: @@ -467,6 +468,7 @@ zpool_standard_error_fmt(libzfs_handle_t case ENOSPC: case EDQUOT: zfs_verror(hdl, EZFS_NOSPC, fmt, ap); + va_end(ap); return (-1); case EAGAIN: Modified: head/contrib/telnet/telnetd/state.c == --- head/contrib/telnet/telnetd/state.c Fri Sep 28 05:30:59 2012 (r241020) +++ head/contrib/telnet/telnetd/state.c Fri Sep 28 07:51:30 2012 (r241021) @@ -1600,8 +1600,10 @@ output_data(const char *format, ...) char *buf; va_start(args, format); - if ((len = vasprintf(&buf, format, args)) == -1) + if ((len = vasprintf(&buf, format, args)) == -1) { + va_end(args); return -1; + } output_datalen(buf, len); va_end(args); free(buf); Modified: head/usr.bin/csup/proto.c == --- head/usr.bin/csup/proto.c Fri Sep 28 05:30:59 2012(r241020) +++ head/usr.bin/csup/proto.c Fri Sep 28 07:51:30 2012(r241021) @@ -789,18 +789,24 @@ proto_printf(struct stream *wr, const ch case '%': n = stream_write(wr, "%", 1); - if (n == -1) + if (n == -1) { + va_end(ap); return (-1); + } break; } - if (rv == -1) + if (rv == -1) { + va_end(ap); return (-1); + } fmt = cp + 1; } if (*fmt != '\0') { rv = stream_printf(wr, "%s", fmt); - if (rv == -1) + if (rv == -1) { + va_end(ap); return (-1); + } } done: va_end(ap); Modified: head/usr.sbin/pkg_install/lib/exec.c == --- head/usr.sbin/pkg_install/lib/exec.cFri Sep 28 05:30:59 2012 (r241020) +++ head/usr.sbin/pkg_install/lib/exec.cFri Sep 28 07:51:30 2012 (r241021) @@ -93,6 +93,7 @@ vpipe(const char *fmt, ...) fp = popen(cmd, "r"); if (fp == NULL) { warnx("popen() failed"); + va_end(args); return NULL; } get_string(rp, MAXPATHLEN, fp); Modified: head/usr.sbin/pw/pwupd.c == --- head/usr.sbin/pw/pwupd.cFri Sep 28 05:30:59 2012(r241020) +++ head/usr.sbin/pw/pwupd.cFri Sep 28 07:51:30 2012(r241021) @@ -102,6 +102,7 @@ pwdb(char *arg,...) if (WEXITSTATUS(i)) i = EIO; } + va_end(ap); return i; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"