svn commit: r356758 - in head/usr.sbin/bsdinstall: . scripts
Author: woodsb02 (ports committer) Date: Wed Jan 15 07:47:52 2020 New Revision: 356758 URL: https://svnweb.freebsd.org/changeset/base/356758 Log: bsdinstall: Change "default" (first) Partitioning method to ZFS Reported by: Ruben Schade (during his talk at linux.conf.au) Approved by: philip Differential Revision:https://reviews.freebsd.org/D23173 Modified: head/usr.sbin/bsdinstall/bsdinstall.8 head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/bsdinstall.8 == --- head/usr.sbin/bsdinstall/bsdinstall.8 Wed Jan 15 06:18:32 2020 (r356757) +++ head/usr.sbin/bsdinstall/bsdinstall.8 Wed Jan 15 07:47:52 2020 (r356758) @@ -119,7 +119,7 @@ Provides the installer's interactive guided disk parti installations. Defaults to UFS. .It Cm zfsboot -Provides an alternative ZFS-only automatic interactive disk partitioner. +Provides a ZFS-only automatic interactive disk partitioner. Creates a single .Ic zpool with separate datasets for Modified: head/usr.sbin/bsdinstall/scripts/auto == --- head/usr.sbin/bsdinstall/scripts/auto Wed Jan 15 06:18:32 2020 (r356757) +++ head/usr.sbin/bsdinstall/scripts/auto Wed Jan 15 07:47:52 2020 (r356758) @@ -289,7 +289,7 @@ Shell \"Open a shell and partition by hand\"" CURARCH=$( uname -m ) case $CURARCH in amd64|arm64|i386) # Booting ZFS Supported - PMODES="$PMODES \"Auto (ZFS)\" \"Guided Root-on-ZFS\"" + PMODES="\"Auto (ZFS)\" \"Guided Root-on-ZFS\" $PMODES" ;; *) # Booting ZFS Unspported ;; @@ -303,6 +303,10 @@ PARTMODE=`echo $PMODES | xargs dialog --backtitle "Fre exec 3>&- case "$PARTMODE" in +"Auto (ZFS)") # ZFS + bsdinstall zfsboot || error "ZFS setup failed" + bsdinstall mount || error "Failed to mount filesystem" + ;; "Auto (UFS)") # Guided bsdinstall autopart || error "Partitioning error" bsdinstall mount || error "Failed to mount filesystem" @@ -319,10 +323,6 @@ case "$PARTMODE" in else bsdinstall partedit || error "Partitioning error" fi - bsdinstall mount || error "Failed to mount filesystem" - ;; -"Auto (ZFS)") # ZFS - bsdinstall zfsboot || error "ZFS setup failed" bsdinstall mount || error "Failed to mount filesystem" ;; *) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r356755 - in head/sys: net netinet netinet6 netpfil/ipfw/nat64 sys
Aren’t the current and suggested the same there or do I need more coffee this morning? On Wed, 15 Jan 2020 at 06:10, Gleb Smirnoff wrote: > Hi, > > On Wed, Jan 15, 2020 at 06:05:20AM +, Gleb Smirnoff wrote: > T> Log: > T> Introduce NET_EPOCH_CALL() macro and use it everywhere where we free > T> data based on the network epoch. The macro reverses the argument > T> order of epoch_call(9) - first function, then its argument. NFC > > I really want to reverse the argument order of epoch_call() as well. > The current order is really backwards: > > void > epoch_call(epoch_t epoch, epoch_context_t ctx, > void (*callback)(epoch_context_t)); > > Suggested declaration is: > > void > epoch_call(epoch_t epoch, epoch_context_t ctx, > void (*callback)(epoch_context_t)); > > This will be a very easy change, since today function is > used just in few places. > > Before branching stable/12 we intentionally put this > note in epoch.9 manual page: > > NOTES > The epoch kernel programming interface is under development and is > subject to change. > > Any objections? > > -- > Gleb Smirnoff > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356757 - head/sys/net
Author: glebius Date: Wed Jan 15 06:18:32 2020 New Revision: 356757 URL: https://svnweb.freebsd.org/changeset/base/356757 Log: gif_transmit() must always be called in the network epoch. Modified: head/sys/net/if_gif.c head/sys/net/if_gif.h Modified: head/sys/net/if_gif.c == --- head/sys/net/if_gif.c Wed Jan 15 06:12:39 2020(r356756) +++ head/sys/net/if_gif.c Wed Jan 15 06:18:32 2020(r356757) @@ -272,7 +272,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) uint8_t proto, ecn; int error; - GIF_RLOCK(); + NET_EPOCH_ASSERT(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) { @@ -370,7 +370,6 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) err: if (error) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - GIF_RUNLOCK(); return (error); } Modified: head/sys/net/if_gif.h == --- head/sys/net/if_gif.h Wed Jan 15 06:12:39 2020(r356756) +++ head/sys/net/if_gif.h Wed Jan 15 06:18:32 2020(r356757) @@ -97,8 +97,6 @@ struct etherip_header { /* mbuf adjust factor to force 32-bit alignment of IP header */ #defineETHERIP_ALIGN 2 -#defineGIF_RLOCK() struct epoch_tracker gif_et; epoch_enter_preempt(net_epoch_preempt, _et) -#defineGIF_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, _et) #defineGIF_WAIT() epoch_wait_preempt(net_epoch_preempt) /* Prototypes */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356756 - head/sys/netinet
Author: glebius Date: Wed Jan 15 06:12:39 2020 New Revision: 356756 URL: https://svnweb.freebsd.org/changeset/base/356756 Log: A miss from r356754. Modified: head/sys/netinet/tcp_ratelimit.c Modified: head/sys/netinet/tcp_ratelimit.c == --- head/sys/netinet/tcp_ratelimit.cWed Jan 15 06:05:20 2020 (r356755) +++ head/sys/netinet/tcp_ratelimit.cWed Jan 15 06:12:39 2020 (r356756) @@ -913,7 +913,7 @@ use_real_interface: */ if (rs->rs_disable && error) *error = ENODEV; - epoch_exit_preempt(net_epoch_preempt, ); + NET_EPOCH_EXIT(et); return (NULL); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r356755 - in head/sys: net netinet netinet6 netpfil/ipfw/nat64 sys
Hi, On Wed, Jan 15, 2020 at 06:05:20AM +, Gleb Smirnoff wrote: T> Log: T> Introduce NET_EPOCH_CALL() macro and use it everywhere where we free T> data based on the network epoch. The macro reverses the argument T> order of epoch_call(9) - first function, then its argument. NFC I really want to reverse the argument order of epoch_call() as well. The current order is really backwards: void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback)(epoch_context_t)); Suggested declaration is: void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback)(epoch_context_t)); This will be a very easy change, since today function is used just in few places. Before branching stable/12 we intentionally put this note in epoch.9 manual page: NOTES The epoch kernel programming interface is under development and is subject to change. Any objections? -- Gleb Smirnoff ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356755 - in head/sys: net netinet netinet6 netpfil/ipfw/nat64 sys
Author: glebius Date: Wed Jan 15 06:05:20 2020 New Revision: 356755 URL: https://svnweb.freebsd.org/changeset/base/356755 Log: Introduce NET_EPOCH_CALL() macro and use it everywhere where we free data based on the network epoch. The macro reverses the argument order of epoch_call(9) - first function, then its argument. NFC Modified: head/sys/net/bpf.c head/sys/net/if.c head/sys/net/if_gre.c head/sys/net/if_lagg.c head/sys/net/if_vlan.c head/sys/netinet/in.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_gre.c head/sys/netinet/tcp_ratelimit.c head/sys/netinet6/in6.c head/sys/netinet6/ip6_gre.c head/sys/netpfil/ipfw/nat64/nat64lsn.c head/sys/sys/epoch.h Modified: head/sys/net/bpf.c == --- head/sys/net/bpf.c Wed Jan 15 05:48:36 2020(r356754) +++ head/sys/net/bpf.c Wed Jan 15 06:05:20 2020(r356755) @@ -274,10 +274,10 @@ static struct filterops bpfread_filtops = { * * 2. An userland application uses ioctl() call to bpf_d descriptor. * All such call are serialized with global lock. BPF filters can be - * changed, but pointer to old filter will be freed using epoch_call(). + * changed, but pointer to old filter will be freed using NET_EPOCH_CALL(). * Thus it should be safe for bpf_tap/bpf_mtap* code to do access to * filter pointers, even if change will happen during bpf_tap execution. - * Destroying of bpf_d descriptor also is doing using epoch_call(). + * Destroying of bpf_d descriptor also is doing using NET_EPOCH_CALL(). * * 3. An userland application can write packets into bpf_d descriptor. * There we need to be sure, that ifnet won't disappear during bpfwrite(). @@ -288,7 +288,7 @@ static struct filterops bpfread_filtops = { * * 5. The kernel invokes bpfdetach() on interface destroying. All lists * are modified with global lock held and actual free() is done using - * epoch_call(). + * NET_EPOCH_CALL(). */ static void @@ -314,7 +314,7 @@ bpfif_rele(struct bpf_if *bp) if (!refcount_release(>bif_refcnt)) return; - epoch_call(net_epoch_preempt, >epoch_ctx, bpfif_free); + NET_EPOCH_CALL(bpfif_free, >epoch_ctx); } static void @@ -330,7 +330,7 @@ bpfd_rele(struct bpf_d *d) if (!refcount_release(>bd_refcnt)) return; - epoch_call(net_epoch_preempt, >epoch_ctx, bpfd_free); + NET_EPOCH_CALL(bpfd_free, >epoch_ctx); } static struct bpf_program_buffer* @@ -2036,8 +2036,7 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_lo BPFD_UNLOCK(d); if (fcode != NULL) - epoch_call(net_epoch_preempt, >epoch_ctx, - bpf_program_buffer_free); + NET_EPOCH_CALL(bpf_program_buffer_free, >epoch_ctx); if (track_event) EVENTHANDLER_INVOKE(bpf_track, Modified: head/sys/net/if.c == --- head/sys/net/if.c Wed Jan 15 05:48:36 2020(r356754) +++ head/sys/net/if.c Wed Jan 15 06:05:20 2020(r356755) @@ -654,7 +654,7 @@ if_free(struct ifnet *ifp) IFNET_WUNLOCK(); if (refcount_release(>if_refcount)) - epoch_call(net_epoch_preempt, >if_epoch_ctx, if_destroy); + NET_EPOCH_CALL(if_destroy, >if_epoch_ctx); CURVNET_RESTORE(); } @@ -677,7 +677,7 @@ if_rele(struct ifnet *ifp) if (!refcount_release(>if_refcount)) return; - epoch_call(net_epoch_preempt, >if_epoch_ctx, if_destroy); + NET_EPOCH_CALL(if_destroy, >if_epoch_ctx); } void @@ -1826,7 +1826,7 @@ ifa_free(struct ifaddr *ifa) { if (refcount_release(>ifa_refcnt)) - epoch_call(net_epoch_preempt, >ifa_epoch_ctx, ifa_destroy); + NET_EPOCH_CALL(ifa_destroy, >ifa_epoch_ctx); } @@ -3410,7 +3410,7 @@ if_freemulti(struct ifmultiaddr *ifma) KASSERT(ifma->ifma_refcount == 0, ("if_freemulti_epoch: refcount %d", ifma->ifma_refcount)); - epoch_call(net_epoch_preempt, >ifma_epoch_ctx, if_destroymulti); + NET_EPOCH_CALL(if_destroymulti, >ifma_epoch_ctx); } Modified: head/sys/net/if_gre.c == --- head/sys/net/if_gre.c Wed Jan 15 05:48:36 2020(r356754) +++ head/sys/net/if_gre.c Wed Jan 15 06:05:20 2020(r356755) @@ -392,7 +392,7 @@ gre_delete_tunnel(struct gre_softc *sc) if ((gs = sc->gre_so) != NULL && CK_LIST_EMPTY(>list)) { CK_LIST_REMOVE(gs, chain); soclose(gs->so); - epoch_call(net_epoch_preempt, >epoch_ctx, gre_sofree); + NET_EPOCH_CALL(gre_sofree, >epoch_ctx); sc->gre_so = NULL; } GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: head/sys/net/if_lagg.c
svn commit: r356754 - head/sys/netinet
Author: glebius Date: Wed Jan 15 05:48:36 2020 New Revision: 356754 URL: https://svnweb.freebsd.org/changeset/base/356754 Log: Use official macro to enter/exit the network epoch. NFC Modified: head/sys/netinet/tcp_ratelimit.c Modified: head/sys/netinet/tcp_ratelimit.c == --- head/sys/netinet/tcp_ratelimit.cWed Jan 15 05:45:27 2020 (r356753) +++ head/sys/netinet/tcp_ratelimit.cWed Jan 15 05:48:36 2020 (r356754) @@ -880,7 +880,7 @@ rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, ui struct epoch_tracker et; int err; - epoch_enter_preempt(net_epoch_preempt, ); + NET_EPOCH_ENTER(et); use_real_interface: CK_LIST_FOREACH(rs, _rs, next) { /* @@ -920,7 +920,7 @@ use_real_interface: if ((rs == NULL) || (rs->rs_disable != 0)) { if (rs->rs_disable && error) *error = ENOSPC; - epoch_exit_preempt(net_epoch_preempt, ); + NET_EPOCH_EXIT(et); return (NULL); } if (rs->rs_flags & RS_IS_DEFF) { @@ -931,7 +931,7 @@ use_real_interface: if (tifp == NULL) { if (rs->rs_disable && error) *error = ENOTSUP; - epoch_exit_preempt(net_epoch_preempt, ); + NET_EPOCH_EXIT(et); return (NULL); } goto use_real_interface; @@ -940,7 +940,7 @@ use_real_interface: ((rs->rs_flows_using + 1) > rs->rs_flow_limit)) { if (error) *error = ENOSPC; - epoch_exit_preempt(net_epoch_preempt, ); + NET_EPOCH_EXIT(et); return (NULL); } rte = tcp_find_suitable_rate(rs, bytes_per_sec, flags); @@ -964,7 +964,7 @@ use_real_interface: */ atomic_add_64(>rs_flows_using, 1); } - epoch_exit_preempt(net_epoch_preempt, ); + NET_EPOCH_EXIT(et); return (rte); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356753 - in head/sys: net netinet netinet6
Author: glebius Date: Wed Jan 15 05:45:27 2020 New Revision: 356753 URL: https://svnweb.freebsd.org/changeset/base/356753 Log: Mechanically substitute assertion of in_epoch(net_epoch_preempt) to NET_EPOCH_ASSERT(). NFC Modified: head/sys/net/if.c head/sys/net/if_ipsec.c head/sys/net/if_lagg.c head/sys/net/if_me.c head/sys/net/route.c head/sys/netinet/in_gif.c head/sys/netinet/ip_gre.c head/sys/netinet6/in6_gif.c head/sys/netinet6/ip6_gre.c Modified: head/sys/net/if.c == --- head/sys/net/if.c Wed Jan 15 03:41:15 2020(r356752) +++ head/sys/net/if.c Wed Jan 15 05:45:27 2020(r356753) @@ -1964,7 +1964,7 @@ ifa_ifwithbroadaddr(const struct sockaddr *addr, int f struct ifnet *ifp; struct ifaddr *ifa; - MPASS(in_epoch(net_epoch_preempt)); + NET_EPOCH_ASSERT(); CK_STAILQ_FOREACH(ifp, _ifnet, if_link) { if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) continue; @@ -1994,7 +1994,7 @@ ifa_ifwithdstaddr(const struct sockaddr *addr, int fib struct ifnet *ifp; struct ifaddr *ifa; - MPASS(in_epoch(net_epoch_preempt)); + NET_EPOCH_ASSERT(); CK_STAILQ_FOREACH(ifp, _ifnet, if_link) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0) continue; @@ -2027,7 +2027,7 @@ ifa_ifwithnet(const struct sockaddr *addr, int ignore_ u_int af = addr->sa_family; const char *addr_data = addr->sa_data, *cplim; - MPASS(in_epoch(net_epoch_preempt)); + NET_EPOCH_ASSERT(); /* * AF_LINK addresses can be looked up directly by their index number, * so do that if we can. @@ -2121,7 +2121,7 @@ ifaof_ifpforaddr(const struct sockaddr *addr, struct i if (af >= AF_MAX) return (NULL); - MPASS(in_epoch(net_epoch_preempt)); + NET_EPOCH_ASSERT(); CK_STAILQ_FOREACH(ifa, >if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != af) continue; Modified: head/sys/net/if_ipsec.c == --- head/sys/net/if_ipsec.c Wed Jan 15 03:41:15 2020(r356752) +++ head/sys/net/if_ipsec.c Wed Jan 15 05:45:27 2020(r356753) @@ -796,7 +796,7 @@ ipsec_srcaddr(void *arg __unused, const struct sockadd if (V_ipsec_idhtbl == NULL) return; - MPASS(in_epoch(net_epoch_preempt)); + NET_EPOCH_ASSERT(); CK_LIST_FOREACH(sc, ipsec_srchash(sa), srchash) { if (sc->family == 0) continue; Modified: head/sys/net/if_lagg.c == --- head/sys/net/if_lagg.c Wed Jan 15 03:41:15 2020(r356752) +++ head/sys/net/if_lagg.c Wed Jan 15 05:45:27 2020(r356753) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #defineLAGG_RLOCK()struct epoch_tracker lagg_et; epoch_enter_preempt(net_epoch_preempt, _et) #defineLAGG_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, _et) -#defineLAGG_RLOCK_ASSERT() MPASS(in_epoch(net_epoch_preempt)) +#defineLAGG_RLOCK_ASSERT() NET_EPOCH_ASSERT() #defineLAGG_UNLOCK_ASSERT()MPASS(!in_epoch(net_epoch_preempt)) #defineLAGG_SX_INIT(_sc) sx_init(&(_sc)->sc_sx, "if_lagg sx") Modified: head/sys/net/if_me.c == --- head/sys/net/if_me.cWed Jan 15 03:41:15 2020(r356752) +++ head/sys/net/if_me.cWed Jan 15 05:45:27 2020(r356753) @@ -326,7 +326,7 @@ me_lookup(const struct mbuf *m, int off, int proto, vo if (V_me_hashtbl == NULL) return (0); - MPASS(in_epoch(net_epoch_preempt)); + NET_EPOCH_ASSERT(); ip = mtod(m, const struct ip *); CK_LIST_FOREACH(sc, _HASH(ip->ip_dst.s_addr, ip->ip_src.s_addr), chain) { @@ -370,7 +370,7 @@ me_srcaddr(void *arg __unused, const struct sockaddr * if (V_me_hashtbl == NULL) return; - MPASS(in_epoch(net_epoch_preempt)); + NET_EPOCH_ASSERT(); sin = (const struct sockaddr_in *)sa; CK_LIST_FOREACH(sc, _SRCHASH(sin->sin_addr.s_addr), srchash) { if (sc->me_src.s_addr != sin->sin_addr.s_addr) Modified: head/sys/net/route.c == --- head/sys/net/route.cWed Jan 15 03:41:15 2020(r356752) +++ head/sys/net/route.cWed Jan 15 05:45:27 2020(r356753) @@ -740,7 +740,7 @@ ifa_ifwithroute(int flags, const struct sockaddr *dst, struct ifaddr *ifa; int not_found = 0; - MPASS(in_epoch(net_epoch_preempt)); + NET_EPOCH_ASSERT(); if ((flags & RTF_GATEWAY)
svn commit: r356752 - head/sys/netinet
Author: glebius Date: Wed Jan 15 03:41:15 2020 New Revision: 356752 URL: https://svnweb.freebsd.org/changeset/base/356752 Log: Stop header pollution and don't include if_var.h via in_pcb.h. Modified: head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.h == --- head/sys/netinet/in_pcb.h Wed Jan 15 03:40:32 2020(r356751) +++ head/sys/netinet/in_pcb.h Wed Jan 15 03:41:15 2020(r356752) @@ -51,8 +51,6 @@ #include #include #include -#include -#include #include #endif #include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356751 - head/sys/netinet
Author: glebius Date: Wed Jan 15 03:40:32 2020 New Revision: 356751 URL: https://svnweb.freebsd.org/changeset/base/356751 Log: Since this code dereferences struct ifnet, it must include if_var.h explicitly, not via header pollution. While here move TCPSTATES declaration right above the include that is going to make use of it. Modified: head/sys/netinet/tcp_ratelimit.c Modified: head/sys/netinet/tcp_ratelimit.c == --- head/sys/netinet/tcp_ratelimit.cWed Jan 15 03:39:11 2020 (r356750) +++ head/sys/netinet/tcp_ratelimit.cWed Jan 15 03:40:32 2020 (r356751) @@ -49,9 +49,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define TCPSTATES /* for logging */ +#include +#include #include #include +#define TCPSTATES /* for logging */ #include #ifdef INET6 #include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356750 - head/sys/kern
Author: glebius Date: Wed Jan 15 03:39:11 2020 New Revision: 356750 URL: https://svnweb.freebsd.org/changeset/base/356750 Log: Since this code uses if_ref()/if_rele() it must include if_var.h explicitly, not via header pollution. Modified: head/sys/kern/uipc_ktls.c Modified: head/sys/kern/uipc_ktls.c == --- head/sys/kern/uipc_ktls.c Wed Jan 15 03:35:57 2020(r356749) +++ head/sys/kern/uipc_ktls.c Wed Jan 15 03:39:11 2020(r356750) @@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include +#include #ifdef RSS #include #include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356749 - head/sys/netgraph
Author: glebius Date: Wed Jan 15 03:35:57 2020 New Revision: 356749 URL: https://svnweb.freebsd.org/changeset/base/356749 Log: Netgraph queue processing thread must process all its items in the network epoch. Reported by: Michael Zhilin Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c == --- head/sys/netgraph/ng_base.c Wed Jan 15 03:34:21 2020(r356748) +++ head/sys/netgraph/ng_base.c Wed Jan 15 03:35:57 2020(r356749) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -3398,6 +3399,7 @@ static void ngthread(void *arg) { for (;;) { + struct epoch_tracker et; node_p node; /* Get node from the worklist. */ @@ -3418,6 +3420,7 @@ ngthread(void *arg) * that lets us be sure that the node still exists. * Let the reference go at the last minute. */ + NET_EPOCH_ENTER(et); for (;;) { item_p item; int rw; @@ -3435,6 +3438,7 @@ ngthread(void *arg) NG_NODE_UNREF(node); } } + NET_EPOCH_EXIT(et); NG_NODE_UNREF(node); CURVNET_RESTORE(); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356748 - in head/sys: kern net sys
Author: glebius Date: Wed Jan 15 03:34:21 2020 New Revision: 356748 URL: https://svnweb.freebsd.org/changeset/base/356748 Log: - Move global network epoch definition to epoch.h, as more different subsystems tend to need to know about it, and including if_var.h is huge header pollution for them. Polluting possible non-network users with single symbol seems much lesser evil. - Remove non-preemptible network epoch. Not used yet, and unlikely to get used in close future. Modified: head/sys/kern/uipc_domain.c head/sys/net/if.c head/sys/net/if_var.h head/sys/sys/epoch.h Modified: head/sys/kern/uipc_domain.c == --- head/sys/kern/uipc_domain.c Wed Jan 15 03:30:33 2020(r356747) +++ head/sys/kern/uipc_domain.c Wed Jan 15 03:34:21 2020(r356748) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -47,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* XXXGL: net_epoch should move out there */ -#include /* XXXGL: net_epoch should move out there */ /* * System initialization Modified: head/sys/net/if.c == --- head/sys/net/if.c Wed Jan 15 03:30:33 2020(r356747) +++ head/sys/net/if.c Wed Jan 15 03:34:21 2020(r356748) @@ -108,7 +108,6 @@ _Static_assert(sizeof(((struct ifreq *)0)->ifr_name) = offsetof(struct ifreq, ifr_ifru), "gap between ifr_name and ifr_ifru"); __read_mostly epoch_t net_epoch_preempt; -__read_mostly epoch_t net_epoch; #ifdef COMPAT_FREEBSD32 #include #include @@ -932,7 +931,6 @@ if_epochalloc(void *dummy __unused) { net_epoch_preempt = epoch_alloc("Net preemptible", EPOCH_PREEMPT); - net_epoch = epoch_alloc("Net", 0); } SYSINIT(ifepochalloc, SI_SUB_EPOCH, SI_ORDER_ANY, if_epochalloc, NULL); Modified: head/sys/net/if_var.h == --- head/sys/net/if_var.h Wed Jan 15 03:30:33 2020(r356747) +++ head/sys/net/if_var.h Wed Jan 15 03:34:21 2020(r356748) @@ -107,8 +107,6 @@ VNET_DECLARE(struct hhook_head *, ipsec_hhh_in[HHOOK_I VNET_DECLARE(struct hhook_head *, ipsec_hhh_out[HHOOK_IPSEC_COUNT]); #defineV_ipsec_hhh_in VNET(ipsec_hhh_in) #defineV_ipsec_hhh_out VNET(ipsec_hhh_out) -extern epoch_t net_epoch_preempt; -extern epoch_t net_epoch; #endif /* _KERNEL */ typedef enum { @@ -445,10 +443,6 @@ struct ifnet { #defineIF_ADDR_WUNLOCK(if) mtx_unlock(&(if)->if_addr_lock) #defineIF_ADDR_LOCK_ASSERT(if) MPASS(in_epoch(net_epoch_preempt) || mtx_owned(&(if)->if_addr_lock)) #defineIF_ADDR_WLOCK_ASSERT(if) mtx_assert(&(if)->if_addr_lock, MA_OWNED) -#defineNET_EPOCH_ENTER(et) epoch_enter_preempt(net_epoch_preempt, &(et)) -#defineNET_EPOCH_EXIT(et) epoch_exit_preempt(net_epoch_preempt, &(et)) -#defineNET_EPOCH_WAIT()epoch_wait_preempt(net_epoch_preempt) -#defineNET_EPOCH_ASSERT() MPASS(in_epoch(net_epoch_preempt)) #ifdef _KERNEL /* interface link layer address change event */ Modified: head/sys/sys/epoch.h == --- head/sys/sys/epoch.hWed Jan 15 03:30:33 2020(r356747) +++ head/sys/sys/epoch.hWed Jan 15 03:34:21 2020(r356748) @@ -93,5 +93,15 @@ void epoch_trace_list(struct thread *); void epoch_enter(epoch_t epoch); void epoch_exit(epoch_t epoch); +/* + * Globally recognized epochs in the FreeBSD kernel. + */ +/* Network preemptible epoch, declared in sys/net/if.c. */ +extern epoch_t net_epoch_preempt; +#defineNET_EPOCH_ENTER(et) epoch_enter_preempt(net_epoch_preempt, &(et)) +#defineNET_EPOCH_EXIT(et) epoch_exit_preempt(net_epoch_preempt, &(et)) +#defineNET_EPOCH_WAIT()epoch_wait_preempt(net_epoch_preempt) +#defineNET_EPOCH_ASSERT() MPASS(in_epoch(net_epoch_preempt)) + #endif /* _KERNEL */ #endif /* _SYS_EPOCH_H_ */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356747 - head/sys/netinet
Author: glebius Date: Wed Jan 15 03:30:33 2020 New Revision: 356747 URL: https://svnweb.freebsd.org/changeset/base/356747 Log: The non-preemptible network epoch identified by net_epoch isn't used. This code definitely meant net_epoch_preempt. Modified: head/sys/netinet/tcp_ratelimit.c Modified: head/sys/netinet/tcp_ratelimit.c == --- head/sys/netinet/tcp_ratelimit.cWed Jan 15 02:31:03 2020 (r356746) +++ head/sys/netinet/tcp_ratelimit.cWed Jan 15 03:30:33 2020 (r356747) @@ -284,7 +284,7 @@ rs_defer_destroy(struct tcp_rate_set *rs) /* Set flag to only defer once. */ rs->rs_flags |= RS_FUNERAL_SCHD; - epoch_call(net_epoch, >rs_epoch_ctx, rs_destroy); + epoch_call(net_epoch_preempt, >rs_epoch_ctx, rs_destroy); } #ifdef INET ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356746 - stable/12/sys/amd64/vmm/amd
Author: anish Date: Wed Jan 15 02:31:03 2020 New Revision: 356746 URL: https://svnweb.freebsd.org/changeset/base/356746 Log: MFC r355258: Bhyve AMD IOMMU log the last timeout command. Differential Revision:https://reviews.freebsd.org/D22566 Modified: stable/12/sys/amd64/vmm/amd/amdvi_hw.c Modified: stable/12/sys/amd64/vmm/amd/amdvi_hw.c == --- stable/12/sys/amd64/vmm/amd/amdvi_hw.c Wed Jan 15 01:34:05 2020 (r356745) +++ stable/12/sys/amd64/vmm/amd/amdvi_hw.c Wed Jan 15 02:31:03 2020 (r356746) @@ -66,7 +66,7 @@ SYSCTL_NODE(_hw_vmm, OID_AUTO, amdvi, CTLFLAG_RW, NULL /* Print RID or device ID in PCI string format. */ #define RID2PCI_STR(d) PCI_RID2BUS(d), PCI_RID2SLOT(d), PCI_RID2FUNC(d) -static void amdvi_dump_cmds(struct amdvi_softc *softc); +static void amdvi_dump_cmds(struct amdvi_softc *softc, int count); static void amdvi_print_dev_cap(struct amdvi_softc *softc); MALLOC_DEFINE(M_AMDVI, "amdvi", "amdvi"); @@ -321,9 +321,7 @@ amdvi_cmd_cmp(struct amdvi_softc *softc, const uint64_ pa = vtophys(>cmp_data); cmd->opcode = AMDVI_CMP_WAIT_OPCODE; - cmd->word0 = (pa & 0xFFF8) | - (AMDVI_CMP_WAIT_STORE); - //(AMDVI_CMP_WAIT_FLUSH | AMDVI_CMP_WAIT_STORE); + cmd->word0 = (pa & 0xFFF8) | AMDVI_CMP_WAIT_STORE; cmd->word1 = (pa >> 32) & 0xF; cmd->addr = data; @@ -492,26 +490,26 @@ amdvi_wait(struct amdvi_softc *softc) device_printf(softc->dev, "Error: completion failed" " tail:0x%x, head:0x%x.\n", ctrl->cmd_tail, ctrl->cmd_head); - amdvi_dump_cmds(softc); + /* Dump the last command. */ + amdvi_dump_cmds(softc, 1); } static void -amdvi_dump_cmds(struct amdvi_softc *softc) +amdvi_dump_cmds(struct amdvi_softc *softc, int count) { struct amdvi_ctrl *ctrl; struct amdvi_cmd *cmd; int off, i; ctrl = softc->ctrl; - device_printf(softc->dev, "Dump all the commands:\n"); + device_printf(softc->dev, "Dump last %d command(s):\n", count); /* * If h/w is stuck in completion, it is the previous command, * start dumping from previous command onward. */ off = MOD_DEC(ctrl->cmd_head, sizeof(struct amdvi_cmd), softc->cmd_max); - for (i = 0; off != ctrl->cmd_tail && - i < softc->cmd_max; i++) { + for (i = 0; off != ctrl->cmd_tail && i < count; i++) { cmd = (struct amdvi_cmd *)((uint8_t *)softc->cmd + off); printf(" [CMD%d, off:0x%x] opcode= 0x%x 0x%x" " 0x%x 0x%lx\n", i, off, cmd->opcode, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356745 - head/sys/kern
Author: mjg Date: Wed Jan 15 01:34:05 2020 New Revision: 356745 URL: https://svnweb.freebsd.org/changeset/base/356745 Log: vfs: in vop_stdadd_writecount only vlazy vnodes on mounts using msync The only reason to vlazy there is to (overzealously) ensure all vnodes which need to be visited by msync scan can be found there. In particluar this is of no use zfs and tmpfs. While here depessimize the check. Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c == --- head/sys/kern/vfs_default.c Wed Jan 15 01:32:11 2020(r356744) +++ head/sys/kern/vfs_default.c Wed Jan 15 01:34:05 2020(r356745) @@ -1220,6 +1220,7 @@ static int vop_stdadd_writecount(struct vop_add_writecount_args *ap) { struct vnode *vp; + struct mount *mp; int error; vp = ap->a_vp; @@ -1229,9 +1230,12 @@ vop_stdadd_writecount(struct vop_add_writecount_args * } else { VNASSERT(vp->v_writecount + ap->a_inc >= 0, vp, ("neg writecount increment %d", ap->a_inc)); + if (vp->v_writecount == 0) { + mp = vp->v_mount; + if (mp != NULL && (mp->mnt_kern_flag & MNTK_NOMSYNC) == 0) + vlazy(vp); + } vp->v_writecount += ap->a_inc; - if (vp->v_writecount > 0 && vp->v_mount != NULL) - vlazy(vp); error = 0; } VI_UNLOCK(vp); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356744 - head/sys/fs/tmpfs
Author: mjg Date: Wed Jan 15 01:32:11 2020 New Revision: 356744 URL: https://svnweb.freebsd.org/changeset/base/356744 Log: tmpfs: add missing CLTFLAG_MPSAFE annotation Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c == --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Jan 15 01:31:57 2020 (r356743) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Jan 15 01:32:11 2020 (r356744) @@ -160,8 +160,9 @@ sysctl_mem_reserved(SYSCTL_HANDLER_ARGS) return (0); } -SYSCTL_PROC(_vfs_tmpfs, OID_AUTO, memory_reserved, CTLTYPE_LONG|CTLFLAG_RW, -_pages_reserved, 0, sysctl_mem_reserved, "L", +SYSCTL_PROC(_vfs_tmpfs, OID_AUTO, memory_reserved, +CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, _pages_reserved, 0, +sysctl_mem_reserved, "L", "Amount of available memory and swap below which tmpfs growth stops"); static __inline int tmpfs_dirtree_cmp(struct tmpfs_dirent *a, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356743 - head/sys/fs/nfsserver
Author: mjg Date: Wed Jan 15 01:31:57 2020 New Revision: 356743 URL: https://svnweb.freebsd.org/changeset/base/356743 Log: nfs: add missing CLTFLAG_MPSAFE annotations Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c == --- head/sys/fs/nfsserver/nfs_nfsdcache.c Wed Jan 15 01:31:28 2020 (r356742) +++ head/sys/fs/nfsserver/nfs_nfsdcache.c Wed Jan 15 01:31:57 2020 (r356743) @@ -187,9 +187,9 @@ sysctl_tcphighwater(SYSCTL_HANDLER_ARGS) nfsrc_tcphighwater = newhighwater; return (0); } -SYSCTL_PROC(_vfs_nfsd, OID_AUTO, tcphighwater, CTLTYPE_UINT | CTLFLAG_RW, 0, -sizeof(nfsrc_tcphighwater), sysctl_tcphighwater, "IU", -"High water mark for TCP cache entries"); +SYSCTL_PROC(_vfs_nfsd, OID_AUTO, tcphighwater, +CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(nfsrc_tcphighwater), +sysctl_tcphighwater, "IU", "High water mark for TCP cache entries"); static u_int nfsrc_udphighwater = NFSRVCACHE_UDPHIGHWATER; SYSCTL_UINT(_vfs_nfsd, OID_AUTO, udphighwater, CTLFLAG_RW, Modified: head/sys/fs/nfsserver/nfs_nfsdport.c == --- head/sys/fs/nfsserver/nfs_nfsdport.cWed Jan 15 01:31:28 2020 (r356742) +++ head/sys/fs/nfsserver/nfs_nfsdport.cWed Jan 15 01:31:57 2020 (r356743) @@ -188,9 +188,9 @@ sysctl_dsdirsize(SYSCTL_HANDLER_ARGS) nfsrv_dsdirsize = newdsdirsize; return (0); } -SYSCTL_PROC(_vfs_nfsd, OID_AUTO, dsdirsize, CTLTYPE_UINT | CTLFLAG_RW, 0, -sizeof(nfsrv_dsdirsize), sysctl_dsdirsize, "IU", -"Number of dsN subdirs on the DS servers"); +SYSCTL_PROC(_vfs_nfsd, OID_AUTO, dsdirsize, +CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(nfsrv_dsdirsize), +sysctl_dsdirsize, "IU", "Number of dsN subdirs on the DS servers"); #defineMAX_REORDERED_RPC 16 #defineNUM_HEURISTIC 1031 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356742 - head/sys/fs/fuse
Author: mjg Date: Wed Jan 15 01:31:28 2020 New Revision: 356742 URL: https://svnweb.freebsd.org/changeset/base/356742 Log: fusefs: add missing CLTFLAG_MPSAFE annotation Modified: head/sys/fs/fuse/fuse_node.c Modified: head/sys/fs/fuse/fuse_node.c == --- head/sys/fs/fuse/fuse_node.cWed Jan 15 01:30:32 2020 (r356741) +++ head/sys/fs/fuse/fuse_node.cWed Jan 15 01:31:28 2020 (r356742) @@ -124,7 +124,8 @@ int fuse_data_cache_mode = FUSE_CACHE_WT; * The sysctl is retained primarily for use by jails supporting older FUSE * protocols. It may be removed entirely once FreeBSD 11.3 and 12.0 are EOL. */ -SYSCTL_PROC(_vfs_fusefs, OID_AUTO, data_cache_mode, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_vfs_fusefs, OID_AUTO, data_cache_mode, +CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, _data_cache_mode, 0, sysctl_fuse_cache_mode, "I", "Zero: disable caching of FUSE file data; One: write-through caching " "(default); Two: write-back caching (generally unsafe)"); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356741 - in head/libexec/rtld-elf: . rtld-libc
Author: mjg Date: Wed Jan 15 01:30:32 2020 New Revision: 356741 URL: https://svnweb.freebsd.org/changeset/base/356741 Log: rtld: remove hand rolled memset and bzero They were introduced to take care of ifunc, but right now no architecture provides ifunc'ed variants. Since rtld uses memset extensively this results in a pessmization. Should someone want to use ifunc here they should provide a mandatory symbol (e.g., rtld_memset). See the review for profiling data. Reviewed by: kib Differential Revision:https://reviews.freebsd.org/D23176 Modified: head/libexec/rtld-elf/rtld-libc/Makefile.inc head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld-libc/Makefile.inc == --- head/libexec/rtld-elf/rtld-libc/Makefile.incWed Jan 15 00:45:05 2020(r356740) +++ head/libexec/rtld-elf/rtld-libc/Makefile.incWed Jan 15 01:30:32 2020(r356741) @@ -40,9 +40,9 @@ CFLAGS.errlst.c+=-I${LIBC_SRCTOP}/include # Use the string and memory .o files from libc instead of rebuilding them (they # might be using optimized assembly and duplicating that logic here is awkward). -_libc_string_objects= bcmp bcopy memchr memcmp memcpy memmove stpncpy strcat \ -strchr strcmp stpcpy strcpy strcspn strdup strlcat strlcpy strlen strncmp \ -strncpy strrchr strsep strspn strstr strtok +_libc_string_objects= bcmp bcopy bzero memset memchr memcmp memcpy memmove \ +stpncpy strcat strchr strcmp stpcpy strcpy strcspn strdup strlcat strlcpy \ +strlen strncmp strncpy strrchr strsep strspn strstr strtok # Also use all the syscall .o files from libc_nossp_pic: _libc_other_objects= sigsetjmp lstat stat fstat fstatat fstatfs syscall \ cerror geteuid getegid munmap mprotect sysarch __sysctl issetugid __getcwd \ Modified: head/libexec/rtld-elf/rtld.c == --- head/libexec/rtld-elf/rtld.cWed Jan 15 00:45:05 2020 (r356740) +++ head/libexec/rtld-elf/rtld.cWed Jan 15 01:30:32 2020 (r356741) @@ -5729,28 +5729,6 @@ rtld_strerror(int errnum) return (sys_errlist[errnum]); } -/* - * No ifunc relocations. - */ -void * -memset(void *dest, int c, size_t len) -{ - size_t i; - - for (i = 0; i < len; i++) - ((char *)dest)[i] = c; - return (dest); -} - -void -bzero(void *dest, size_t len) -{ - size_t i; - - for (i = 0; i < len; i++) - ((char *)dest)[i] = 0; -} - /* malloc */ void * malloc(size_t nbytes) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356740 - in head/usr.sbin/bsdinstall: . partedit scripts
Author: bcran Date: Wed Jan 15 00:45:05 2020 New Revision: 356740 URL: https://svnweb.freebsd.org/changeset/base/356740 Log: bsdinstall: Use TMPDIR if set Submitted by: Ryan Moeller Reviewed by: bcran, Nick Wolff Differential Revision:https://reviews.freebsd.org/D22979/ Modified: head/usr.sbin/bsdinstall/bsdinstall head/usr.sbin/bsdinstall/bsdinstall.8 head/usr.sbin/bsdinstall/partedit/gpart_ops.c head/usr.sbin/bsdinstall/partedit/partedit.c head/usr.sbin/bsdinstall/partedit/partedit.h head/usr.sbin/bsdinstall/scripts/bootconfig head/usr.sbin/bsdinstall/scripts/mount head/usr.sbin/bsdinstall/scripts/script head/usr.sbin/bsdinstall/scripts/umount head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/bsdinstall == --- head/usr.sbin/bsdinstall/bsdinstall Tue Jan 14 22:27:46 2020 (r356739) +++ head/usr.sbin/bsdinstall/bsdinstall Wed Jan 15 00:45:05 2020 (r356740) @@ -40,13 +40,15 @@ BSDCFG_SHARE="/usr/share/bsdconfig" GLOBALS -: ${BSDINSTALL_TMPETC="/tmp/bsdinstall_etc"}; export BSDINSTALL_TMPETC -: ${BSDINSTALL_TMPBOOT="/tmp/bsdinstall_boot"}; export BSDINSTALL_TMPBOOT +: ${TMPDIR:="/tmp"}; export TMPDIR + +: ${BSDINSTALL_TMPETC="${TMPDIR}/bsdinstall_etc"}; export BSDINSTALL_TMPETC +: ${BSDINSTALL_TMPBOOT="${TMPDIR}/bsdinstall_boot"}; export BSDINSTALL_TMPBOOT : ${PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"}; export PATH_FSTAB : ${BSDINSTALL_DISTDIR="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR : ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT -export debugFile="${debugFile-${BSDINSTALL_LOG-/tmp/bsdinstall_log}}" +export debugFile="${debugFile-${BSDINSTALL_LOG-${TMPDIR}/bsdinstall_log}}" MAIN Modified: head/usr.sbin/bsdinstall/bsdinstall.8 == --- head/usr.sbin/bsdinstall/bsdinstall.8 Tue Jan 14 22:27:46 2020 (r356739) +++ head/usr.sbin/bsdinstall/bsdinstall.8 Wed Jan 15 00:45:05 2020 (r356740) @@ -259,6 +259,10 @@ for most installation scenarios. Others are set by various interactive user prompts, and can be usefully overridden when making scripted or customized installers. .Bl -tag -width ".Ev BSDINSTALL_DISTSITE" +.It Ev TMPDIR +The directory to use for temporary files. +Default: +.Dq Pa /tmp .It Ev DISTRIBUTIONS The set of distributions to install, e.g., "base.txz kernel.txz ports.txz". Default: unset @@ -291,7 +295,7 @@ Default: .It Ev BSDINSTALL_LOG Path to a log file for the installation. Default: -.Dq Pa /tmp/bsdinstall_log +.Dq Pa $TMPDIR/bsdinstall_log .It Ev BSDINSTALL_TMPETC Directory where files destined for the new system's .Pa /etc @@ -300,7 +304,7 @@ will be stored until the target is executed. If this directory does not already exist, it will be created. Default: -.Dq Pa /tmp/bsdinstall_etc +.Dq Pa $TMPDIR/bsdinstall_etc .It Ev BSDINSTALL_TMPBOOT Directory where files destined for the new system's .Pa /boot @@ -309,7 +313,7 @@ will be stored until the target is executed. If this directory does not already exist, it will be created. Default: -.Dq Pa /tmp/bsdinstall_boot +.Dq Pa $TMPDIR/bsdinstall_boot .It Ev ZFSBOOT_POOL_NAME Name for the pool containing the base system. Default: Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c == --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Tue Jan 14 22:27:46 2020(r356739) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Wed Jan 15 00:45:05 2020(r356740) @@ -711,10 +711,11 @@ set_default_part_metadata(const char *name, const char if (strcmp(type, bootpart_type(scheme, _bootmount)) == 0) { if (default_bootmount == NULL) { - int fd = open("/tmp/bsdinstall-esps", O_CREAT | O_WRONLY | O_APPEND, - 0600); + int fd = openat(tmpdfd, "bsdinstall-esps", + O_CREAT | O_WRONLY | O_APPEND, 0600); if (fd > 0) { write(fd, md->name, strlen(md->name)); + write(fd, "\n", 1); close(fd); } Modified: head/usr.sbin/bsdinstall/partedit/partedit.c == --- head/usr.sbin/bsdinstall/partedit/partedit.cTue Jan 14 22:27:46 2020(r356739) +++ head/usr.sbin/bsdinstall/partedit/partedit.cWed Jan 15 00:45:05 2020(r356740) @@ -32,17 +32,20 @@ #include #include +#include #include #include #include #include #include #include +#include #include
svn commit: r356739 - head/sys/ufs/ffs
Author: mckusick Date: Tue Jan 14 22:27:46 2020 New Revision: 356739 URL: https://svnweb.freebsd.org/changeset/base/356739 Log: When sync'ing a mount point, the mount point's vnodes were scanned twice. Once to update the changed inodes, and a second time to update changed quota information. This change merges these two scans into a single scan which does both inode and quota updates. MFC after: 7 days Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c == --- head/sys/ufs/ffs/ffs_vfsops.c Tue Jan 14 18:06:09 2020 (r356738) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Jan 14 22:27:46 2020 (r356739) @@ -1480,8 +1480,12 @@ ffs_sync_lazy(mp) allerror = 0; td = curthread; - if ((mp->mnt_flag & MNT_NOATIME) != 0) - goto qupdate; + if ((mp->mnt_flag & MNT_NOATIME) != 0) { +#ifdef QUOTA + qsync(mp); +#endif + goto sbupdate; + } MNT_VNODE_FOREACH_LAZY(vp, mp, mvp, ffs_sync_lazy_filter, NULL) { if (vp->v_type == VNON) { VI_UNLOCK(vp); @@ -1503,18 +1507,16 @@ ffs_sync_lazy(mp) if ((error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, td)) != 0) continue; +#ifdef QUOTA + qsyncvp(vp); +#endif if (sync_doupdate(ip)) error = ffs_update(vp, 0); if (error != 0) allerror = error; vput(vp); } - -qupdate: -#ifdef QUOTA - qsync(mp); -#endif - +sbupdate: if (VFSTOUFS(mp)->um_fs->fs_fmod != 0 && (error = ffs_sbupdate(VFSTOUFS(mp), MNT_LAZY, 0)) != 0) allerror = error; @@ -1607,6 +1609,9 @@ loop: } continue; } +#ifdef QUOTA + qsyncvp(vp); +#endif if ((error = ffs_syncvnode(vp, waitfor, 0)) != 0) allerror = error; vput(vp); @@ -1621,9 +1626,6 @@ loop: if (allerror == 0 && count) goto loop; } -#ifdef QUOTA - qsync(mp); -#endif devvp = ump->um_devvp; bo = >v_bufobj; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356738 - head/share/man/man5
Author: emaste Date: Tue Jan 14 18:06:09 2020 New Revision: 356738 URL: https://svnweb.freebsd.org/changeset/base/356738 Log: src.conf.5: regen after r356736, limiting ld.bfd to powerpc Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Tue Jan 14 18:00:04 2020 (r356737) +++ head/share/man/man5/src.conf.5 Tue Jan 14 18:06:09 2020 (r356738) @@ -182,7 +182,7 @@ processing at process startup rather than on demand. Set to not build or install GNU .Xr as 1 , .Xr objdump 1 , -and for some CPU architectures +and, on powerpc, .Xr ld.bfd 1 as part of the normal system build. @@ -194,7 +194,7 @@ arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. Set to build and install GNU .Xr as 1 , .Xr objdump 1 , -and for some CPU architectures +and, on powerpc, .Xr ld.bfd 1 as part of the normal system build. @@ -202,7 +202,7 @@ of the normal system build. This is a default setting on amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP -Set to not build binutils (as, ld, and objdump) +Set to not build binutils (as, objdump, and on powerpc ld) as part of the bootstrap process. .Bf -symbolic The option does not work for build targets unless some alternative @@ -212,7 +212,7 @@ toolchain is provided. This is a default setting on arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_BINUTILS_BOOTSTRAP -Set build binutils (as, ld, and objdump) +Set build binutils (as, objdump, and on powerpc ld) as part of the bootstrap process. .Pp This is a default setting on ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356737 - head/sys/mips/mips
Author: jhb Date: Tue Jan 14 18:00:04 2020 New Revision: 356737 URL: https://svnweb.freebsd.org/changeset/base/356737 Log: Preserve the inherited value of the status register in cpu_set_upcall(). Instead of re-deriving the value of SR using logic similar to exec_set_regs(), just inherit the value from the existing thread similar to fork(). Reviewed by: brooks Obtained from:CheriBSD Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D23059 Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c == --- head/sys/mips/mips/vm_machdep.c Tue Jan 14 17:56:54 2020 (r356736) +++ head/sys/mips/mips/vm_machdep.c Tue Jan 14 18:00:04 2020 (r356737) @@ -414,7 +414,7 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * stack_t *stack) { struct trapframe *tf; - register_t sp; + register_t sp, sr; sp = (((intptr_t)stack->ss_sp + stack->ss_size) & ~(STACK_ALIGN - 1)) - CALLFRAME_SIZ; @@ -424,8 +424,10 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * * function. */ tf = td->td_frame; + sr = tf->sr; bzero(tf, sizeof(struct trapframe)); tf->sp = sp; + tf->sr = sr; tf->pc = (register_t)(intptr_t)entry; /* * MIPS ABI requires T9 to be the same as PC @@ -434,18 +436,6 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * tf->t9 = (register_t)(intptr_t)entry; tf->a0 = (register_t)(intptr_t)arg; - /* -* Keep interrupt mask -*/ - td->td_frame->sr = MIPS_SR_KSU_USER | MIPS_SR_EXL | MIPS_SR_INT_IE | - (mips_rd_status() & MIPS_SR_INT_MASK); -#if defined(__mips_n32) - td->td_frame->sr |= MIPS_SR_PX; -#elif defined(__mips_n64) - td->td_frame->sr |= MIPS_SR_PX | MIPS_SR_UX | MIPS_SR_KX; -#endif -/* tf->sr |= (ALL_INT_MASK & idle_mask) | SR_INT_ENAB; */ - /**XXX the above may now be wrong -- mips2 implements this as panic */ /* * FREEBSD_DEVELOPERS_FIXME: * Setup any other CPU-Specific registers (Not MIPS Standard) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356736 - in head: gnu/usr.bin/binutils tools/build/options
Author: emaste Date: Tue Jan 14 17:56:54 2020 New Revision: 356736 URL: https://svnweb.freebsd.org/changeset/base/356736 Log: limit ld.bfd to powerpc All archs except powerpc either use lld or require external toolchain. powerpc still needs binutils ld to link 32-bit binaries. Reviewed by: jhibbits Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D23107 Modified: head/gnu/usr.bin/binutils/Makefile head/tools/build/options/WITHOUT_BINUTILS head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP head/tools/build/options/WITH_BINUTILS head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Modified: head/gnu/usr.bin/binutils/Makefile == --- head/gnu/usr.bin/binutils/Makefile Tue Jan 14 17:50:13 2020 (r356735) +++ head/gnu/usr.bin/binutils/Makefile Tue Jan 14 17:56:54 2020 (r356736) @@ -11,11 +11,9 @@ SUBDIR.${MK_BINUTILS}+= libbinutils SUBDIR.${MK_BINUTILS}+=as SUBDIR.${MK_BINUTILS}+=objdump -# When we use ld.lld as /usr/bin/ld, do not install the non-ifunc-capable -# GNU binutils 2.17.50 ld. -# Except if we are on powerpc, that needs the ld from binutils to link -# 32-bit binaries. -.if ${MK_LLD_IS_LD} == "no" || ${TARGET} == "powerpc" +# All archs except powerpc either use lld or require external toolchain. +# powerpc still needs binutils ld to link 32-bit binaries. +.if ${TARGET} == "powerpc" SUBDIR.${MK_BINUTILS}+=ld .endif Modified: head/tools/build/options/WITHOUT_BINUTILS == --- head/tools/build/options/WITHOUT_BINUTILS Tue Jan 14 17:50:13 2020 (r356735) +++ head/tools/build/options/WITHOUT_BINUTILS Tue Jan 14 17:56:54 2020 (r356736) @@ -2,7 +2,7 @@ Set to not build or install GNU .Xr as 1 , .Xr objdump 1 , -and for some CPU architectures +and, on powerpc, .Xr ld.bfd 1 as part of the normal system build. Modified: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP == --- head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Tue Jan 14 17:50:13 2020(r356735) +++ head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Tue Jan 14 17:56:54 2020(r356736) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to not build binutils (as, ld, and objdump) +Set to not build binutils (as, objdump, and on powerpc ld) as part of the bootstrap process. .Bf -symbolic The option does not work for build targets unless some alternative Modified: head/tools/build/options/WITH_BINUTILS == --- head/tools/build/options/WITH_BINUTILS Tue Jan 14 17:50:13 2020 (r356735) +++ head/tools/build/options/WITH_BINUTILS Tue Jan 14 17:56:54 2020 (r356736) @@ -2,7 +2,7 @@ Set to build and install GNU .Xr as 1 , .Xr objdump 1 , -and for some CPU architectures +and, on powerpc, .Xr ld.bfd 1 as part of the normal system build. Modified: head/tools/build/options/WITH_BINUTILS_BOOTSTRAP == --- head/tools/build/options/WITH_BINUTILS_BOOTSTRAPTue Jan 14 17:50:13 2020(r356735) +++ head/tools/build/options/WITH_BINUTILS_BOOTSTRAPTue Jan 14 17:56:54 2020(r356736) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Set build binutils (as, ld, and objdump) +Set build binutils (as, objdump, and on powerpc ld) as part of the bootstrap process. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356735 - in head: lib/csu/tests/dso lib/libc++ lib/libcxxrt lib/libgcc_eh lib/libpmc share/mk
Author: kevans Date: Tue Jan 14 17:50:13 2020 New Revision: 356735 URL: https://svnweb.freebsd.org/changeset/base/356735 Log: Revert r353140: Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around arichardson has an actual fix for the same issue that this was working around; given that we don't build with llvm today, go ahead and revert the workaround in advance. Modified: head/lib/csu/tests/dso/Makefile head/lib/libc++/Makefile head/lib/libcxxrt/Makefile head/lib/libgcc_eh/Makefile.inc head/lib/libpmc/Makefile head/share/mk/bsd.lib.mk Modified: head/lib/csu/tests/dso/Makefile == --- head/lib/csu/tests/dso/Makefile Tue Jan 14 17:38:34 2020 (r356734) +++ head/lib/csu/tests/dso/Makefile Tue Jan 14 17:50:13 2020 (r356735) @@ -5,8 +5,6 @@ SHLIB= h_csu SHLIB_NAME=libh_csu.so SHLIB_MAJOR= 1 -ALLOW_MIPS_SHARED_TEXTREL= - WITHOUT_STATIC= WITHOUT_PROFILE= WITHOUT_PIC= Modified: head/lib/libc++/Makefile == --- head/lib/libc++/MakefileTue Jan 14 17:38:34 2020(r356734) +++ head/lib/libc++/MakefileTue Jan 14 17:50:13 2020(r356735) @@ -11,8 +11,6 @@ CXXINCLUDEDIR=${INCLUDEDIR}/c++/v${SHLIB_MAJOR} STATIC_CXXFLAGS+= -mlong-calls .endif -ALLOW_MIPS_SHARED_TEXTREL= - .PATH: ${SRCDIR} LIB= c++ Modified: head/lib/libcxxrt/Makefile == --- head/lib/libcxxrt/Makefile Tue Jan 14 17:38:34 2020(r356734) +++ head/lib/libcxxrt/Makefile Tue Jan 14 17:50:13 2020(r356735) @@ -5,7 +5,6 @@ SRCDIR= ${SRCTOP}/contrib/libcxxrt SHLIB_MAJOR= 1 SHLIBDIR?= /lib -ALLOW_MIPS_SHARED_TEXTREL= .PATH: ${SRCDIR} Modified: head/lib/libgcc_eh/Makefile.inc == --- head/lib/libgcc_eh/Makefile.inc Tue Jan 14 17:38:34 2020 (r356734) +++ head/lib/libgcc_eh/Makefile.inc Tue Jan 14 17:50:13 2020 (r356735) @@ -6,8 +6,6 @@ UNWINDSRCDIR= ${SRCTOP}/contrib/llvm-project/libunwind STATIC_CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN -ALLOW_MIPS_SHARED_TEXTREL= - .PATH: ${COMPILERRTDIR}/lib/builtins .PATH: ${UNWINDSRCDIR} SRCS_EXC+= gcc_personality_v0.c Modified: head/lib/libpmc/Makefile == --- head/lib/libpmc/MakefileTue Jan 14 17:38:34 2020(r356734) +++ head/lib/libpmc/MakefileTue Jan 14 17:50:13 2020(r356735) @@ -5,8 +5,6 @@ LIB=pmc SRCS= libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json.cc INCS= pmc.h pmclog.h pmcformat.h -ALLOW_MIPS_SHARED_TEXTREL= - .if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ ${MACHINE_ARCH} == "i386" Modified: head/share/mk/bsd.lib.mk == --- head/share/mk/bsd.lib.mkTue Jan 14 17:38:34 2020(r356734) +++ head/share/mk/bsd.lib.mkTue Jan 14 17:50:13 2020(r356735) @@ -291,10 +291,6 @@ CLEANFILES+= ${SOBJS} .if defined(SHLIB_NAME) _LIBS+=${SHLIB_NAME} -.if ${CFLAGS:M-fexceptions} || defined(SHLIB_CXX) || defined(LIB_CXX) -ALLOW_MIPS_SHARED_TEXTREL= -.endif - SOLINKOPTS+= -shared -Wl,-x .if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no" SOLINKOPTS+= -Wl,--no-fatal-warnings @@ -302,15 +298,6 @@ SOLINKOPTS+= -Wl,--no-fatal-warnings SOLINKOPTS+= -Wl,--fatal-warnings .endif SOLINKOPTS+= -Wl,--warn-shared-textrel - -.if defined(ALLOW_MIPS_SHARED_TEXTREL) && ${MACHINE_CPUARCH:Mmips} -# Check if we should be defining ALLOW_SHARED_TEXTREL... basically, C++ -# or -fexceptions in CFLAGS on MIPS. This works around clang/lld attempting -# to generate text relocations in read-only .eh_frame. A future version of -# clang/lld should instead transform them into relative references at link -# time, and then we can stop doing this. -SOLINKOPTS+= -Wl,-z,notext -.endif .if target(beforelinking) beforelinking: ${SOBJS} ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356734 - head/share/man/man5
Author: emaste Date: Tue Jan 14 17:38:34 2020 New Revision: 356734 URL: https://svnweb.freebsd.org/changeset/base/356734 Log: src.conf.5: regen after option description updates Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Tue Jan 14 17:35:34 2020 (r356733) +++ head/share/man/man5/src.conf.5 Tue Jan 14 17:38:34 2020 (r356734) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 13, 2020 +.Dd January 14, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -101,9 +101,12 @@ Set to not build .Xr acpidump 8 and related programs. .It Va WITH_AMD -Set to build -.Xr amd 8 , -and related programs. +Set to build the legacy +.Xr amd 8 +automount daemon and related programs. +Note that +.Xr autofs 5 +is the preferred automount technique. .It Va WITHOUT_APM Set to not build .Xr apm 8 , @@ -410,16 +413,19 @@ Clang C/C++ compiler. This is a default setting on amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_CLANG_IS_CC -Set to install the GCC compiler as +Do not install links to the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ and .Pa /usr/bin/cpp . +If +.Va WITH_GCC +is set then links to the GCC C/C++ compiler will be installed instead. .Pp This is a default setting on mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and sparc64/sparc64. .It Va WITH_CLANG_IS_CC -Set to install the Clang C/C++ compiler as +Install links to the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ and ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356733 - head/tools/build/options
Author: emaste Date: Tue Jan 14 17:35:34 2020 New Revision: 356733 URL: https://svnweb.freebsd.org/changeset/base/356733 Log: Update WITH_/WITHOUT_CLANG_IS_CC descriptions Describe /usr/bin/cc etc. as links to the compiler, and don't conflate WITHOUT_CLANG_IS_CC with installing GCC. Leave a reference to WITH_GCC and WITHOUT_CLANG_IS_CC installing links to GCC, although this will be removed in ~1.5 months when GCC 4.2.1 is removed from the tree. Sponsored by: The FreeBSD Foundation Modified: head/tools/build/options/WITHOUT_CLANG_IS_CC head/tools/build/options/WITH_CLANG_IS_CC Modified: head/tools/build/options/WITHOUT_CLANG_IS_CC == --- head/tools/build/options/WITHOUT_CLANG_IS_CCTue Jan 14 16:59:21 2020(r356732) +++ head/tools/build/options/WITHOUT_CLANG_IS_CCTue Jan 14 17:35:34 2020(r356733) @@ -1,6 +1,9 @@ .\" $FreeBSD$ -Set to install the GCC compiler as +Do not install links to the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ and .Pa /usr/bin/cpp . +If +.Va WITH_GCC +is set then links to the GCC C/C++ compiler will be installed instead. Modified: head/tools/build/options/WITH_CLANG_IS_CC == --- head/tools/build/options/WITH_CLANG_IS_CC Tue Jan 14 16:59:21 2020 (r356732) +++ head/tools/build/options/WITH_CLANG_IS_CC Tue Jan 14 17:35:34 2020 (r356733) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to install the Clang C/C++ compiler as +Install links to the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ and ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r356725 - head/usr.bin/diff
On Tue, Jan 14, 2020 at 08:44:29AM -0700, Ian Lepore wrote: > On Tue, 2020-01-14 at 08:22 +, Baptiste Daroussin wrote: > > Author: bapt > > Date: Tue Jan 14 08:22:28 2020 > > New Revision: 356725 > > URL: https://svnweb.freebsd.org/changeset/base/356725 > > > > Log: > > When system calls indicate an error they return -1, not some > > arbitrary > > value < 0. errno is only updated in this case. > > > > What's the point of these changes, other than almost certainly leading > to worse code generation? > > In most instruction sets, you can test for a value < 0 without using > any instructions, you only need to examine the condition flags after > loading the value. To compare equal to -1 typically requires at least > 1 extra instruction, and on risc architectures typically at least two > extra (load -1 to a register then compare). > our diff has forked from the OpenBSD one. The goal of those patches is to keep in sync code that is still close to the original OpenBSD one as much as possible. Best regards, Bapt signature.asc Description: PGP signature
svn commit: r356732 - head/tools/build/options
Author: emaste Date: Tue Jan 14 16:59:21 2020 New Revision: 356732 URL: https://svnweb.freebsd.org/changeset/base/356732 Log: Update WITH_AMD description reflecting upcoming removal In-tree amd(8) is deprecated; update WITH_AMD's description to make this more clear. Sponsored by: The FreeBSD Foundation Modified: head/tools/build/options/WITH_AMD Modified: head/tools/build/options/WITH_AMD == --- head/tools/build/options/WITH_AMD Tue Jan 14 15:35:03 2020 (r356731) +++ head/tools/build/options/WITH_AMD Tue Jan 14 16:59:21 2020 (r356732) @@ -1,4 +1,7 @@ .\" $FreeBSD$ -Set to build -.Xr amd 8 , -and related programs. +Set to build the legacy +.Xr amd 8 +automount daemon and related programs. +Note that +.Xr autofs 5 +is the preferred automount technique. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r356725 - head/usr.bin/diff
On Tue, 2020-01-14 at 08:22 +, Baptiste Daroussin wrote: > Author: bapt > Date: Tue Jan 14 08:22:28 2020 > New Revision: 356725 > URL: https://svnweb.freebsd.org/changeset/base/356725 > > Log: > When system calls indicate an error they return -1, not some > arbitrary > value < 0. errno is only updated in this case. > What's the point of these changes, other than almost certainly leading to worse code generation? In most instruction sets, you can test for a value < 0 without using any instructions, you only need to examine the condition flags after loading the value. To compare equal to -1 typically requires at least 1 extra instruction, and on risc architectures typically at least two extra (load -1 to a register then compare). -- Ian > Obtained from: OpenBSD > MFC after: 3 days > > Modified: > head/usr.bin/diff/diff.c > head/usr.bin/diff/diffreg.c > > Modified: head/usr.bin/diff/diff.c > = > = > --- head/usr.bin/diff/diff.c Tue Jan 14 08:18:04 2020(r356724) > +++ head/usr.bin/diff/diff.c Tue Jan 14 08:22:28 2020(r356725) > @@ -1,4 +1,4 @@ > -/* $OpenBSD: diff.c,v 1.65 2015/12/29 19:04:46 gsoares Exp $ */ > +/* $OpenBSD: diff.c,v 1.67 2019/06/28 13:35:00 deraadt Exp $ */ > > /* > * Copyright (c) 2003 Todd C. Miller > @@ -316,12 +316,12 @@ main(int argc, char **argv) > } else { > if (S_ISDIR(stb1.st_mode)) { > argv[0] = splice(argv[0], argv[1]); > - if (stat(argv[0], ) < 0) > + if (stat(argv[0], ) == -1) > err(2, "%s", argv[0]); > } > if (S_ISDIR(stb2.st_mode)) { > argv[1] = splice(argv[1], argv[0]); > - if (stat(argv[1], ) < 0) > + if (stat(argv[1], ) == -1) > err(2, "%s", argv[1]); > } > print_status(diffreg(argv[0], argv[1], dflags, 1), > argv[0], > > Modified: head/usr.bin/diff/diffreg.c > = > = > --- head/usr.bin/diff/diffreg.c Tue Jan 14 08:18:04 2020(r356 > 724) > +++ head/usr.bin/diff/diffreg.c Tue Jan 14 08:22:28 2020(r356 > 725) > @@ -1,4 +1,4 @@ > -/* $OpenBSD: diffreg.c,v 1.92 2019/06/28 05:35:34 deraadt Exp $ > */ > +/* $OpenBSD: diffreg.c,v 1.93 2019/06/28 13:35:00 deraadt Exp $ > */ > > /*- > * SPDX-License-Identifier: BSD-4-Clause > @@ -277,7 +277,7 @@ diffreg(char *file1, char *file2, int flags, int > capsi > else { > if (!S_ISREG(stb1.st_mode)) { > if ((f1 = opentemp(file1)) == NULL || > - fstat(fileno(f1), ) < 0) { > + fstat(fileno(f1), ) == -1) { > warn("%s", file1); > status |= 2; > goto closem; > @@ -298,7 +298,7 @@ diffreg(char *file1, char *file2, int flags, int > capsi > else { > if (!S_ISREG(stb2.st_mode)) { > if ((f2 = opentemp(file2)) == NULL || > - fstat(fileno(f2), ) < 0) { > + fstat(fileno(f2), ) == -1) { > warn("%s", file2); > status |= 2; > goto closem; > @@ -446,7 +446,7 @@ opentemp(const char *f) > > if (strcmp(f, "-") == 0) > ifd = STDIN_FILENO; > - else if ((ifd = open(f, O_RDONLY, 0644)) < 0) > + else if ((ifd = open(f, O_RDONLY, 0644)) == -1) > return (NULL); > > (void)strlcpy(tempfile, _PATH_TMP "/diff.", > sizeof(tempfile)); > @@ -942,7 +942,7 @@ preadline(int fd, size_t rlen, off_t off) > ssize_t nr; > > line = xmalloc(rlen + 1); > - if ((nr = pread(fd, line, rlen, off)) < 0) > + if ((nr = pread(fd, line, rlen, off)) == -1) > err(2, "preadline"); > if (nr > 0 && line[nr-1] == '\n') > nr--; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r356695 - head/usr.bin/diff
On Tue, Jan 14, 2020 at 08:05:21AM -0600, Kyle Evans wrote: > On Tue, Jan 14, 2020 at 6:12 AM Li-Wen Hsu wrote: > > > > On Tue, Jan 14, 2020 at 2:29 AM Mark Johnston wrote: > > > > > > Author: markj > > > Date: Mon Jan 13 18:29:47 2020 > > > New Revision: 356695 > > > URL: https://svnweb.freebsd.org/changeset/base/356695 > > > > > > Log: > > > Optimize diff -q. > > > > > > Once we know whether the files differ, we don't need to do any further > > > work. > > > > > > PR: 242828 > > > Submitted by: fehmi noyan isi (original version) > > > Reviewed by: bapt, kevans > > > MFC after:1 week > > > Differential Revision:https://reviews.freebsd.org/D23152 > > > > > > Modified: > > > head/usr.bin/diff/diffreg.c > > > > > > Modified: head/usr.bin/diff/diffreg.c > > > == > > > --- head/usr.bin/diff/diffreg.c Mon Jan 13 18:26:27 2020(r356694) > > > +++ head/usr.bin/diff/diffreg.c Mon Jan 13 18:29:47 2020(r356695) > > > @@ -349,6 +349,11 @@ diffreg(char *file1, char *file2, int flags, int > > > capsi > > > goto closem; > > > } > > > > > > + if (diff_format == D_BRIEF) { > > > + rval = D_DIFFER; > > > + status |= 1; > > > + goto closem; > > > + } > > > if ((flags & D_FORCEASCII) == 0 && > > > (!asciifile(f1) || !asciifile(f2))) { > > > rval = D_BINARY; > > > > Hi Mark, > > > > This one seems breaks test case usr.sbin.etcupdate.fbsdid_test.main: > > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/13920/testReport/junit/usr.sbin.etcupdate/fbsdid_test/main/ > > > > Revert this can get the case pass. Can you check if the code or the > > test needs to be fixed? > > > > Whoops... that was a bit of an oversight. We can only short-circuit if > ignore_pats == NULL, otherwise we need to regress back to doing > line-by-line comparison. That should still see a benefit for the > majority of cases, though, I would think. Thanks, I tested and committed that change. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356731 - head/usr.bin/diff
Author: markj Date: Tue Jan 14 15:35:03 2020 New Revision: 356731 URL: https://svnweb.freebsd.org/changeset/base/356731 Log: Do not skip line-by-line comparison if -q and -I are specified. This fixes a regression from r356695. Submitted by: kevans Reported by: Jenkins via lwhsu MFC after:6 days Modified: head/usr.bin/diff/diffreg.c Modified: head/usr.bin/diff/diffreg.c == --- head/usr.bin/diff/diffreg.c Tue Jan 14 13:20:16 2020(r356730) +++ head/usr.bin/diff/diffreg.c Tue Jan 14 15:35:03 2020(r356731) @@ -349,7 +349,7 @@ diffreg(char *file1, char *file2, int flags, int capsi goto closem; } - if (diff_format == D_BRIEF) { + if (diff_format == D_BRIEF && ignore_pats == NULL) { rval = D_DIFFER; status |= 1; goto closem; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r356695 - head/usr.bin/diff
On Tue, Jan 14, 2020 at 6:12 AM Li-Wen Hsu wrote: > > On Tue, Jan 14, 2020 at 2:29 AM Mark Johnston wrote: > > > > Author: markj > > Date: Mon Jan 13 18:29:47 2020 > > New Revision: 356695 > > URL: https://svnweb.freebsd.org/changeset/base/356695 > > > > Log: > > Optimize diff -q. > > > > Once we know whether the files differ, we don't need to do any further > > work. > > > > PR: 242828 > > Submitted by: fehmi noyan isi (original version) > > Reviewed by: bapt, kevans > > MFC after:1 week > > Differential Revision:https://reviews.freebsd.org/D23152 > > > > Modified: > > head/usr.bin/diff/diffreg.c > > > > Modified: head/usr.bin/diff/diffreg.c > > == > > --- head/usr.bin/diff/diffreg.c Mon Jan 13 18:26:27 2020(r356694) > > +++ head/usr.bin/diff/diffreg.c Mon Jan 13 18:29:47 2020(r356695) > > @@ -349,6 +349,11 @@ diffreg(char *file1, char *file2, int flags, int capsi > > goto closem; > > } > > > > + if (diff_format == D_BRIEF) { > > + rval = D_DIFFER; > > + status |= 1; > > + goto closem; > > + } > > if ((flags & D_FORCEASCII) == 0 && > > (!asciifile(f1) || !asciifile(f2))) { > > rval = D_BINARY; > > Hi Mark, > > This one seems breaks test case usr.sbin.etcupdate.fbsdid_test.main: > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/13920/testReport/junit/usr.sbin.etcupdate/fbsdid_test/main/ > > Revert this can get the case pass. Can you check if the code or the > test needs to be fixed? > Whoops... that was a bit of an oversight. We can only short-circuit if ignore_pats == NULL, otherwise we need to regress back to doing line-by-line comparison. That should still see a benefit for the majority of cases, though, I would think. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356730 - head/sys/dev/hyperv/storvsc
Author: avg Date: Tue Jan 14 13:20:16 2020 New Revision: 356730 URL: https://svnweb.freebsd.org/changeset/base/356730 Log: storvsc: port a Linux patch, properly set residual data length on errors This change is based on Linux commit 40630f462824ee. csio.resid should account for transfer_len only for success and SRB_STATUS_DATA_OVERRUN condition. I am not sure how exactly this change works, but I have a report from a user that they see lots of checksum errors when running a pool scrub concurrently with iozone -l 1 -s 100G. After applying this patch the problem cannot be reproduced. Reviewed by: nobody Sponsored by: CyberSecure Differential Revision: https://reviews.freebsd.org/D22312 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/storvsc/hv_vstorage.h Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Jan 14 11:33:07 2020(r356729) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Jan 14 13:20:16 2020(r356730) @@ -2278,7 +2278,11 @@ storvsc_io_done(struct hv_storvsc_request *reqp) } ccb->csio.scsi_status = (vm_srb->scsi_status & 0xFF); - ccb->csio.resid = ccb->csio.dxfer_len - vm_srb->transfer_len; + if (srb_status == SRB_STATUS_SUCCESS || + srb_status == SRB_STATUS_DATA_OVERRUN) + ccb->csio.resid = ccb->csio.dxfer_len - vm_srb->transfer_len; + else + ccb->csio.resid = ccb->csio.dxfer_len; if (reqp->sense_info_len != 0) { csio->sense_resid = csio->sense_len - reqp->sense_info_len; Modified: head/sys/dev/hyperv/storvsc/hv_vstorage.h == --- head/sys/dev/hyperv/storvsc/hv_vstorage.h Tue Jan 14 11:33:07 2020 (r356729) +++ head/sys/dev/hyperv/storvsc/hv_vstorage.h Tue Jan 14 13:20:16 2020 (r356730) @@ -245,7 +245,8 @@ struct vstor_packet { #define SRB_STATUS_SUCCESS 0x01 #define SRB_STATUS_ABORTED 0x02 #define SRB_STATUS_ERROR 0x04 -#define SRB_STATUS_INVALID_LUN 0x20 +#define SRB_STATUS_DATA_OVERRUN0x12 +#define SRB_STATUS_INVALID_LUN 0x20 /** * SRB Status Masks (can be combined with above status codes) */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r356695 - head/usr.bin/diff
On Tue, Jan 14, 2020 at 2:29 AM Mark Johnston wrote: > > Author: markj > Date: Mon Jan 13 18:29:47 2020 > New Revision: 356695 > URL: https://svnweb.freebsd.org/changeset/base/356695 > > Log: > Optimize diff -q. > > Once we know whether the files differ, we don't need to do any further > work. > > PR: 242828 > Submitted by: fehmi noyan isi (original version) > Reviewed by: bapt, kevans > MFC after:1 week > Differential Revision:https://reviews.freebsd.org/D23152 > > Modified: > head/usr.bin/diff/diffreg.c > > Modified: head/usr.bin/diff/diffreg.c > == > --- head/usr.bin/diff/diffreg.c Mon Jan 13 18:26:27 2020(r356694) > +++ head/usr.bin/diff/diffreg.c Mon Jan 13 18:29:47 2020(r356695) > @@ -349,6 +349,11 @@ diffreg(char *file1, char *file2, int flags, int capsi > goto closem; > } > > + if (diff_format == D_BRIEF) { > + rval = D_DIFFER; > + status |= 1; > + goto closem; > + } > if ((flags & D_FORCEASCII) == 0 && > (!asciifile(f1) || !asciifile(f2))) { > rval = D_BINARY; Hi Mark, This one seems breaks test case usr.sbin.etcupdate.fbsdid_test.main: https://ci.freebsd.org/job/FreeBSD-head-amd64-test/13920/testReport/junit/usr.sbin.etcupdate/fbsdid_test/main/ Revert this can get the case pass. Can you check if the code or the test needs to be fixed? Thanks, Li-Wen ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356729 - head/sys/compat/linux
Author: trasz Date: Tue Jan 14 11:33:07 2020 New Revision: 356729 URL: https://svnweb.freebsd.org/changeset/base/356729 Log: Make linux(4) use kern_setsockopt(9) instead of going through sys_setsockopt. Just a cleanup; no functional changes. Reviewed by: kib MFC after:2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D22812 Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c == --- head/sys/compat/linux/linux_socket.cTue Jan 14 11:30:30 2020 (r356728) +++ head/sys/compat/linux/linux_socket.cTue Jan 14 11:33:07 2020 (r356729) @@ -1396,22 +1396,14 @@ linux_shutdown(struct thread *td, struct linux_shutdow int linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) { - struct setsockopt_args /* { - int s; - int level; - int name; - const void *val; - int valsize; - } */ bsd_args; l_timeval linux_tv; struct sockaddr *sa; struct timeval tv; socklen_t len; - int error, name; + int error, level, name; - bsd_args.s = args->s; - bsd_args.level = linux_to_bsd_sockopt_level(args->level); - switch (bsd_args.level) { + level = linux_to_bsd_sockopt_level(args->level); + switch (level) { case SOL_SOCKET: name = linux_to_bsd_so_sockopt(args->optname); switch (name) { @@ -1424,7 +1416,7 @@ linux_setsockopt(struct thread *td, struct linux_setso return (error); tv.tv_sec = linux_tv.tv_sec; tv.tv_usec = linux_tv.tv_usec; - return (kern_setsockopt(td, args->s, bsd_args.level, + return (kern_setsockopt(td, args->s, level, name, , UIO_SYSSPACE, sizeof(tv))); /* NOTREACHED */ default: @@ -1449,20 +1441,17 @@ linux_setsockopt(struct thread *td, struct linux_setso if (name == IPV6_NEXTHOP) { - len = args->optlen; error = linux_to_bsd_sockaddr(PTRIN(args->optval), , ); if (error != 0) return (error); - error = kern_setsockopt(td, args->s, bsd_args.level, + error = kern_setsockopt(td, args->s, level, name, sa, UIO_SYSSPACE, len); free(sa, M_SONAME); } else { - bsd_args.name = name; - bsd_args.val = PTRIN(args->optval); - bsd_args.valsize = args->optlen; - error = sys_setsockopt(td, _args); + error = kern_setsockopt(td, args->s, level, + name, PTRIN(args->optval), UIO_USERSPACE, args->optlen); } return (error); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356728 - head/sys/compat/linux
Author: trasz Date: Tue Jan 14 11:30:30 2020 New Revision: 356728 URL: https://svnweb.freebsd.org/changeset/base/356728 Log: Make linux(4) use kern_getsockopt(9) instead of going through sys_getsockopt(). It's a cleanup; no functional changes. Reviewed by: kib (earlier version) MFC after:2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D22813 Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c == --- head/sys/compat/linux/linux_socket.cTue Jan 14 11:24:06 2020 (r356727) +++ head/sys/compat/linux/linux_socket.cTue Jan 14 11:30:30 2020 (r356728) @@ -1471,13 +1471,6 @@ linux_setsockopt(struct thread *td, struct linux_setso int linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) { - struct getsockopt_args /* { - int s; - int level; - int name; - caddr_t val; - int *avalsize; - } */ bsd_args; l_timeval linux_tv; struct timeval tv; socklen_t tv_len, xulen, len; @@ -1485,11 +1478,10 @@ linux_getsockopt(struct thread *td, struct linux_getso struct sockaddr *sa; struct xucred xu; struct l_ucred lxu; - int error, name, newval; + int error, level, name, newval; - bsd_args.s = args->s; - bsd_args.level = linux_to_bsd_sockopt_level(args->level); - switch (bsd_args.level) { + level = linux_to_bsd_sockopt_level(args->level); + switch (level) { case SOL_SOCKET: name = linux_to_bsd_so_sockopt(args->optname); switch (name) { @@ -1497,7 +1489,7 @@ linux_getsockopt(struct thread *td, struct linux_getso /* FALLTHROUGH */ case SO_SNDTIMEO: tv_len = sizeof(tv); - error = kern_getsockopt(td, args->s, bsd_args.level, + error = kern_getsockopt(td, args->s, level, name, , UIO_SYSSPACE, _len); if (error != 0) return (error); @@ -1513,9 +1505,9 @@ linux_getsockopt(struct thread *td, struct linux_getso * LOCAL_PEERCRED is not served at the SOL_SOCKET level, * but by the Unix socket's level 0. */ - bsd_args.level = 0; + level = 0; xulen = sizeof(xu); - error = kern_getsockopt(td, args->s, bsd_args.level, + error = kern_getsockopt(td, args->s, level, name, , UIO_SYSSPACE, ); if (error != 0) return (error); @@ -1526,7 +1518,7 @@ linux_getsockopt(struct thread *td, struct linux_getso /* NOTREACHED */ case SO_ERROR: len = sizeof(newval); - error = kern_getsockopt(td, args->s, bsd_args.level, + error = kern_getsockopt(td, args->s, level, name, , UIO_SYSSPACE, ); if (error != 0) return (error); @@ -1553,16 +1545,13 @@ linux_getsockopt(struct thread *td, struct linux_getso if (name == -1) return (EINVAL); - bsd_args.name = name; - bsd_args.avalsize = PTRIN(args->optlen); - if (name == IPV6_NEXTHOP) { error = copyin(PTRIN(args->optlen), , sizeof(len)); if (error != 0) return (error); sa = malloc(len, M_SONAME, M_WAITOK); - error = kern_getsockopt(td, args->s, bsd_args.level, + error = kern_getsockopt(td, args->s, level, name, sa, UIO_SYSSPACE, ); if (error != 0) goto out; @@ -1577,8 +1566,16 @@ linux_getsockopt(struct thread *td, struct linux_getso out: free(sa, M_SONAME); } else { - bsd_args.val = PTRIN(args->optval); - error = sys_getsockopt(td, _args); + if (args->optval) { + error = copyin(PTRIN(args->optlen), , sizeof(len)); + if (error != 0) + return (error); + } + error = kern_getsockopt(td, args->s, level, + name, PTRIN(args->optval), UIO_USERSPACE, ); + if (error == 0) + error = copyout(, PTRIN(args->optlen), + sizeof(len)); } return (error); ___ svn-src-all@freebsd.org mailing list
svn commit: r356727 - head/sys/compat/linux
Author: trasz Date: Tue Jan 14 11:24:06 2020 New Revision: 356727 URL: https://svnweb.freebsd.org/changeset/base/356727 Log: Make linux getcpu(2) report the domain. Submitted by: markj Reviewed by: markj MFC after:2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D23144 Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c == --- head/sys/compat/linux/linux_misc.c Tue Jan 14 10:13:44 2020 (r356726) +++ head/sys/compat/linux/linux_misc.c Tue Jan 14 11:24:06 2020 (r356727) @@ -2354,7 +2354,7 @@ linux_getcpu(struct thread *td, struct linux_getcpu_ar cpu = td->td_oncpu; /* Make sure it doesn't change during copyout(9) */ error = 0; - node = 0; /* XXX: Fake NUMA node 0 for now */ + node = cpuid_to_pcpu[cpu]->pc_domain; if (args->cpu != NULL) error = copyout(, args->cpu, sizeof(l_int)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356725 - head/usr.bin/diff
Author: bapt Date: Tue Jan 14 08:22:28 2020 New Revision: 356725 URL: https://svnweb.freebsd.org/changeset/base/356725 Log: When system calls indicate an error they return -1, not some arbitrary value < 0. errno is only updated in this case. Obtained from:OpenBSD MFC after:3 days Modified: head/usr.bin/diff/diff.c head/usr.bin/diff/diffreg.c Modified: head/usr.bin/diff/diff.c == --- head/usr.bin/diff/diff.cTue Jan 14 08:18:04 2020(r356724) +++ head/usr.bin/diff/diff.cTue Jan 14 08:22:28 2020(r356725) @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.65 2015/12/29 19:04:46 gsoares Exp $ */ +/* $OpenBSD: diff.c,v 1.67 2019/06/28 13:35:00 deraadt Exp $ */ /* * Copyright (c) 2003 Todd C. Miller @@ -316,12 +316,12 @@ main(int argc, char **argv) } else { if (S_ISDIR(stb1.st_mode)) { argv[0] = splice(argv[0], argv[1]); - if (stat(argv[0], ) < 0) + if (stat(argv[0], ) == -1) err(2, "%s", argv[0]); } if (S_ISDIR(stb2.st_mode)) { argv[1] = splice(argv[1], argv[0]); - if (stat(argv[1], ) < 0) + if (stat(argv[1], ) == -1) err(2, "%s", argv[1]); } print_status(diffreg(argv[0], argv[1], dflags, 1), argv[0], Modified: head/usr.bin/diff/diffreg.c == --- head/usr.bin/diff/diffreg.c Tue Jan 14 08:18:04 2020(r356724) +++ head/usr.bin/diff/diffreg.c Tue Jan 14 08:22:28 2020(r356725) @@ -1,4 +1,4 @@ -/* $OpenBSD: diffreg.c,v 1.92 2019/06/28 05:35:34 deraadt Exp $*/ +/* $OpenBSD: diffreg.c,v 1.93 2019/06/28 13:35:00 deraadt Exp $*/ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -277,7 +277,7 @@ diffreg(char *file1, char *file2, int flags, int capsi else { if (!S_ISREG(stb1.st_mode)) { if ((f1 = opentemp(file1)) == NULL || - fstat(fileno(f1), ) < 0) { + fstat(fileno(f1), ) == -1) { warn("%s", file1); status |= 2; goto closem; @@ -298,7 +298,7 @@ diffreg(char *file1, char *file2, int flags, int capsi else { if (!S_ISREG(stb2.st_mode)) { if ((f2 = opentemp(file2)) == NULL || - fstat(fileno(f2), ) < 0) { + fstat(fileno(f2), ) == -1) { warn("%s", file2); status |= 2; goto closem; @@ -446,7 +446,7 @@ opentemp(const char *f) if (strcmp(f, "-") == 0) ifd = STDIN_FILENO; - else if ((ifd = open(f, O_RDONLY, 0644)) < 0) + else if ((ifd = open(f, O_RDONLY, 0644)) == -1) return (NULL); (void)strlcpy(tempfile, _PATH_TMP "/diff.", sizeof(tempfile)); @@ -942,7 +942,7 @@ preadline(int fd, size_t rlen, off_t off) ssize_t nr; line = xmalloc(rlen + 1); - if ((nr = pread(fd, line, rlen, off)) < 0) + if ((nr = pread(fd, line, rlen, off)) == -1) err(2, "preadline"); if (nr > 0 && line[nr-1] == '\n') nr--; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356724 - head/usr.bin/diff
Author: bapt Date: Tue Jan 14 08:18:04 2020 New Revision: 356724 URL: https://svnweb.freebsd.org/changeset/base/356724 Log: asprintf returns -1, not an arbitrary value < 0. Also upon error the (very sloppy specification) leaves an undefined value in *ret, so it is wrong to inspect it, the error condition is enough. Obtained from:OpenBSD MFC after:3 days Modified: head/usr.bin/diff/xmalloc.c Modified: head/usr.bin/diff/xmalloc.c == --- head/usr.bin/diff/xmalloc.c Tue Jan 14 08:16:15 2020(r356723) +++ head/usr.bin/diff/xmalloc.c Tue Jan 14 08:18:04 2020(r356724) @@ -1,4 +1,4 @@ -/* $OpenBSD: xmalloc.c,v 1.9 2015/11/17 18:25:02 tobias Exp $ */ +/* $OpenBSD: xmalloc.c,v 1.10 2019/06/28 05:44:09 deraadt Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -81,7 +81,7 @@ xasprintf(char **ret, const char *fmt, ...) i = vasprintf(ret, fmt, ap); va_end(ap); - if (i < 0 || *ret == NULL) + if (i == -1) err(2, "xasprintf"); return i; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r356723 - head/usr.bin/diff
Author: bapt Date: Tue Jan 14 08:16:15 2020 New Revision: 356723 URL: https://svnweb.freebsd.org/changeset/base/356723 Log: mkstemp returns -1 Obtained from:OpenBSD MFC after:3 days Modified: head/usr.bin/diff/diffreg.c Modified: head/usr.bin/diff/diffreg.c == --- head/usr.bin/diff/diffreg.c Tue Jan 14 06:28:07 2020(r356722) +++ head/usr.bin/diff/diffreg.c Tue Jan 14 08:16:15 2020(r356723) @@ -1,4 +1,4 @@ -/* $OpenBSD: diffreg.c,v 1.91 2016/03/01 20:57:35 natano Exp $ */ +/* $OpenBSD: diffreg.c,v 1.92 2019/06/28 05:35:34 deraadt Exp $*/ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -451,7 +451,7 @@ opentemp(const char *f) (void)strlcpy(tempfile, _PATH_TMP "/diff.", sizeof(tempfile)); - if ((ofd = mkstemp(tempfile)) < 0) { + if ((ofd = mkstemp(tempfile)) == -1) { close(ifd); return (NULL); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"