Re: svn commit: r366962 - in head: include usr.bin/calendar
On Fri, Oct 23, 2020 at 09:22:23AM +, Stefan Eßer wrote: > Author: se > Date: Fri Oct 23 09:22:23 2020 > New Revision: 366962 > URL: https://svnweb.freebsd.org/changeset/base/366962 > > Log: > Add search of LOCALBASE/share/calendar for calendars supplied by a port. > > Calendar files in LOCALBASE override similarily named ones in the base > system. This could easily be changed if the base system calendars should > have precedence, but it could lead to a violation of POLA since then the > port's files were ignored unless those in base have been deleted. > > There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses > of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease > a consistent modification of this prefix. You are hardcoding assumption that LOCALBASE = /usr/local. Please make it overridable with LOCALBASE environment variable. > Reviewed by:imp, pfg > Differential Revision: https://reviews.freebsd.org/D26882 > > Modified: > head/include/paths.h > head/usr.bin/calendar/io.c > head/usr.bin/calendar/pathnames.h > > Modified: head/include/paths.h > == > --- head/include/paths.h Fri Oct 23 08:44:53 2020(r366961) > +++ head/include/paths.h Fri Oct 23 09:22:23 2020(r366962) > @@ -37,8 +37,11 @@ > > #include > > +#define _PATH_LOCALBASE "/usr/local" > + > /* Default search path. */ > -#define _PATH_DEFPATH > "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" > +#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:" \ > + _PATH_LOCALBASE "/sbin:" _PATH_LOCALBASE "/bin" -- Alex ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf
On 2020-10-24 02:13, Warner Losh wrote: I was going to suggest and try this change, but life has been complicated... Has it been committed? No, not yet. --HPS ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366993 - head/sys/net
Author: hselasky Date: Sat Oct 24 10:23:21 2020 New Revision: 366993 URL: https://svnweb.freebsd.org/changeset/base/366993 Log: Run code through "clang-format -style=file" with some additional fixes. No functional change. Suggested by: kib@ and emaste@ Differential Revision:https://reviews.freebsd.org/D26254 MFC after:1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/net/if_infiniband.c Modified: head/sys/net/if_infiniband.c == --- head/sys/net/if_infiniband.cSat Oct 24 05:52:29 2020 (r366992) +++ head/sys/net/if_infiniband.cSat Oct 24 10:23:21 2020 (r366993) @@ -30,44 +30,42 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include +#include #include +#include +#include +#include #include #include -#include -#include +#include -#include -#include -#include +#include #include #include -#include -#include -#include +#include +#include #include -#include #include #include - -#include +#include +#include +#include +#include #include +#include #include - #include #include #include /* if_lagg(4) support */ -struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); +struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); #ifdef INET static inline void -infiniband_ipv4_multicast_map(uint32_t addr, -const uint8_t *broadcast, uint8_t *buf) +infiniband_ipv4_multicast_map( +uint32_t addr, const uint8_t *broadcast, uint8_t *buf) { uint8_t scope; @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, #ifdef INET6 static inline void -infiniband_ipv6_multicast_map(const struct in6_addr *addr, -const uint8_t *broadcast, uint8_t *buf) +infiniband_ipv6_multicast_map( +const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) { uint8_t scope; @@ -128,7 +126,7 @@ infiniband_bpf_mtap(struct ifnet *ifp, struct mbuf *mb { struct infiniband_header *ibh; struct ether_header eh; - + if (mb->m_len < sizeof(*ibh)) return; @@ -198,7 +196,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, c if (error) { if (error == EWOULDBLOCK) error = 0; - m = NULL; /* mbuf is consumed by resolver */ + m = NULL; /* mbuf is consumed by resolver */ goto bad; } } @@ -265,7 +263,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, c if (error) { if (error == EWOULDBLOCK) error = 0; - m = NULL; /* mbuf is consumed by resolver */ + m = NULL; /* mbuf is consumed by resolver */ goto bad; } } @@ -410,8 +408,8 @@ done: } static int -infiniband_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa, -struct sockaddr *sa) +infiniband_resolvemulti( +struct ifnet *ifp, struct sockaddr **llsa, struct sockaddr *sa) { struct sockaddr_dl *sdl; #ifdef INET @@ -442,8 +440,8 @@ infiniband_resolvemulti(struct ifnet *ifp, struct sock sdl = link_init_sdl(ifp, *llsa, IFT_INFINIBAND); sdl->sdl_alen = INFINIBAND_ADDR_LEN; e_addr = LLADDR(sdl); - infiniband_ipv4_multicast_map(sin->sin_addr.s_addr, ifp->if_broadcastaddr, - e_addr); + infiniband_ipv4_multicast_map( + sin->sin_addr.s_addr, ifp->if_broadcastaddr, e_addr); *llsa = (struct sockaddr *)sdl; return (0); #endif @@ -462,7 +460,8 @@ infiniband_resolvemulti(struct ifnet *ifp, struct sock sdl = link_init_sdl(ifp, *llsa, IFT_INFINIBAND); sdl->sdl_alen = INFINIBAND_ADDR_LEN; e_addr = LLADDR(sdl); - infiniband_ipv6_multicast_map(&sin6->sin6_addr, ifp->if_broadcastaddr, e_addr); + infiniband_ipv6_multicast_map( + &sin6->sin6_addr, ifp->if_broadcastaddr, e_addr); *llsa = (struct sockaddr *)sdl; return (0); #endif @@ -487,7 +486,7 @@ infiniband_ifattach(struct ifnet *ifp, const uint8_t * ifp->if_resolvemulti = infiniband_resolvemulti; if (ifp->if_baudrate == 0) - ifp->if_baudrate = IF_Gbps(10); /* default value */ + ifp->if_baudrate = IF_Gbps(10); /* default value */ if (llb != NULL) ifp->if_broadcastaddr = llb; ___ svn-src-head@freebsd.org mailing list
Re: svn commit: r366993 - head/sys/net
On Sat, Oct 24, 2020 at 10:23:22AM +, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Oct 24 10:23:21 2020 > New Revision: 366993 > URL: https://svnweb.freebsd.org/changeset/base/366993 > > Log: > Run code through "clang-format -style=file" with some additional fixes. > No functional change. > > Suggested by: kib@ and emaste@ > Differential Revision: https://reviews.freebsd.org/D26254 > MFC after: 1 week > Sponsored by: Mellanox Technologies // NVIDIA Networking > > Modified: > head/sys/net/if_infiniband.c > > Modified: head/sys/net/if_infiniband.c > == > --- head/sys/net/if_infiniband.c Sat Oct 24 05:52:29 2020 > (r366992) > +++ head/sys/net/if_infiniband.c Sat Oct 24 10:23:21 2020 > (r366993) > @@ -30,44 +30,42 @@ > __FBSDID("$FreeBSD$"); > > #include > -#include > -#include > -#include sys/systm.h should come right after sys/param.h. These two headers are exceptions to the normal alphabetical rule. > +#include > #include > +#include > +#include > +#include > #include > #include > -#include > -#include > +#include > > -#include > -#include > -#include > +#include > #include > #include > -#include > -#include > -#include > +#include > +#include > #include > -#include > #include > #include > - > -#include > +#include > +#include > +#include > +#include > #include > +#include > #include > - > #include > #include > > #include > > /* if_lagg(4) support */ > -struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); > +struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); > > #ifdef INET > static inline void > -infiniband_ipv4_multicast_map(uint32_t addr, > -const uint8_t *broadcast, uint8_t *buf) > +infiniband_ipv4_multicast_map( > +uint32_t addr, const uint8_t *broadcast, uint8_t *buf) And this is arguably regression, we fill line up to columns 72-80 before splitting to the continuation line. > { > uint8_t scope; > > @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, > > #ifdef INET6 > static inline void > -infiniband_ipv6_multicast_map(const struct in6_addr *addr, > -const uint8_t *broadcast, uint8_t *buf) > +infiniband_ipv6_multicast_map( > +const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) > { > uint8_t scope; > > @@ -128,7 +126,7 @@ infiniband_bpf_mtap(struct ifnet *ifp, struct mbuf *mb > { > struct infiniband_header *ibh; > struct ether_header eh; > - > + > if (mb->m_len < sizeof(*ibh)) > return; > > @@ -198,7 +196,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, c > if (error) { > if (error == EWOULDBLOCK) > error = 0; > - m = NULL; /* mbuf is consumed by resolver > */ > + m = NULL; /* mbuf is consumed by resolver */ This is a regression as well, in-line comment is typically preceeded by tab. > goto bad; > } > } > @@ -265,7 +263,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, c > if (error) { > if (error == EWOULDBLOCK) > error = 0; > - m = NULL; /* mbuf is consumed by resolver > */ > + m = NULL; /* mbuf is consumed by resolver */ > goto bad; > } > } > @@ -410,8 +408,8 @@ done: > } > > static int > -infiniband_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa, > -struct sockaddr *sa) > +infiniband_resolvemulti( > +struct ifnet *ifp, struct sockaddr **llsa, struct sockaddr *sa) > { > struct sockaddr_dl *sdl; > #ifdef INET > @@ -442,8 +440,8 @@ infiniband_resolvemulti(struct ifnet *ifp, struct sock > sdl = link_init_sdl(ifp, *llsa, IFT_INFINIBAND); > sdl->sdl_alen = INFINIBAND_ADDR_LEN; > e_addr = LLADDR(sdl); > - infiniband_ipv4_multicast_map(sin->sin_addr.s_addr, > ifp->if_broadcastaddr, > - e_addr); > + infiniband_ipv4_multicast_map( > + sin->sin_addr.s_addr, ifp->if_broadcastaddr, e_addr); > *llsa = (struct sockaddr *)sdl; > return (0); > #endif > @@ -462,7 +460,8 @@ infiniband_resolvemulti(struct ifnet *ifp, struct sock > sdl = link_init_sdl(ifp, *llsa, IFT_INFINIBAND); > sdl->sdl_alen = INFINIBAND_ADDR_LEN; > e_addr = LLADDR(sdl); > - infiniband_ipv6_multicast_map(&sin6->sin6_addr, > ifp->if_broadcastaddr, e_addr); > + infiniband_ipv6_multicast_map( > +
svn commit: r366994 - head/sys/net
Author: hselasky Date: Sat Oct 24 10:52:09 2020 New Revision: 366994 URL: https://svnweb.freebsd.org/changeset/base/366994 Log: Fix order of header files: sys/systm.h should come right after sys/param.h Suggested by: kib@ Differential Revision:https://reviews.freebsd.org/D26254 MFC after:1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/net/if_infiniband.c Modified: head/sys/net/if_infiniband.c == --- head/sys/net/if_infiniband.cSat Oct 24 10:23:21 2020 (r366993) +++ head/sys/net/if_infiniband.cSat Oct 24 10:52:09 2020 (r366994) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -37,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366993 - head/sys/net
On 2020-10-24 12:46, Konstantin Belousov wrote: sys/systm.h should come right after sys/param.h OK, fixed. --HPS ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366993 - head/sys/net
On Sat, Oct 24, 2020 at 10:23:22AM +, Hans Petter Selasky wrote: > New Revision: 366993 > URL: https://svnweb.freebsd.org/changeset/base/366993 > > Log: > Run code through "clang-format -style=file" with some additional fixes. > No functional change. > > ... > @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, > > #ifdef INET6 > static inline void > -infiniband_ipv6_multicast_map(const struct in6_addr *addr, > -const uint8_t *broadcast, uint8_t *buf) > +infiniband_ipv6_multicast_map( > +const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) > { This is not how we format these in FreeBSD, please revert. It was correct before and no "fix" is need here. ./danfe ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366995 - head/sys/net
Author: hselasky Date: Sat Oct 24 13:07:50 2020 New Revision: 366995 URL: https://svnweb.freebsd.org/changeset/base/366995 Log: More style fixes (partial revert of r366994). Suggested by: danfe@ Differential Revision:https://reviews.freebsd.org/D26254 MFC after:1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/net/if_infiniband.c Modified: head/sys/net/if_infiniband.c == --- head/sys/net/if_infiniband.cSat Oct 24 10:52:09 2020 (r366994) +++ head/sys/net/if_infiniband.cSat Oct 24 13:07:50 2020 (r366995) @@ -64,8 +64,8 @@ struct mbuf *(*lagg_input_infiniband_p)(struct ifnet * #ifdef INET static inline void -infiniband_ipv4_multicast_map( -uint32_t addr, const uint8_t *broadcast, uint8_t *buf) +infiniband_ipv4_multicast_map(uint32_t addr, +const uint8_t *broadcast, uint8_t *buf) { uint8_t scope; @@ -97,8 +97,8 @@ infiniband_ipv4_multicast_map( #ifdef INET6 static inline void -infiniband_ipv6_multicast_map( -const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) +infiniband_ipv6_multicast_map(const struct in6_addr *addr, +const uint8_t *broadcast, uint8_t *buf) { uint8_t scope; @@ -408,8 +408,8 @@ done: } static int -infiniband_resolvemulti( -struct ifnet *ifp, struct sockaddr **llsa, struct sockaddr *sa) +infiniband_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa, +struct sockaddr *sa) { struct sockaddr_dl *sdl; #ifdef INET ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366993 - head/sys/net
On 2020-10-24 14:52, Alexey Dokuchaev wrote: On Sat, Oct 24, 2020 at 10:23:22AM +, Hans Petter Selasky wrote: New Revision: 366993 URL: https://svnweb.freebsd.org/changeset/base/366993 Log: Run code through "clang-format -style=file" with some additional fixes. No functional change. ... @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, #ifdef INET6 static inline void -infiniband_ipv6_multicast_map(const struct in6_addr *addr, -const uint8_t *broadcast, uint8_t *buf) +infiniband_ipv6_multicast_map( +const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) { This is not how we format these in FreeBSD, please revert. It was correct before and no "fix" is need here. Done. --HPS ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366996 - head/sys/compat/linuxkpi/common/include/linux
Author: hselasky Date: Sat Oct 24 13:16:10 2020 New Revision: 366996 URL: https://svnweb.freebsd.org/changeset/base/366996 Log: Implement xa_init() in the LinuxKPI as a wrapper for xa_init_flags(). MFC after:1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/compat/linuxkpi/common/include/linux/xarray.h Modified: head/sys/compat/linuxkpi/common/include/linux/xarray.h == --- head/sys/compat/linuxkpi/common/include/linux/xarray.h Sat Oct 24 13:07:50 2020(r366995) +++ head/sys/compat/linuxkpi/common/include/linux/xarray.h Sat Oct 24 13:16:10 2020(r366996) @@ -91,4 +91,10 @@ xa_err(void *ptr) return (PTR_ERR_OR_ZERO(ptr)); } +static inline void +xa_init(struct xarray *xa) +{ + xa_init_flags(xa, 0); +} + #endif /* _LINUX_XARRAY_H_ */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366997 - head/sys/kern
Author: mjg Date: Sat Oct 24 13:30:37 2020 New Revision: 366997 URL: https://svnweb.freebsd.org/changeset/base/366997 Log: vfs: fix a race where reclaim vholds freed vnodes Reported by: pho Tested by:pho (previous version) Fixes:r366974 ("vfs: stop taking the interlock in vnode reclaim") Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cSat Oct 24 13:16:10 2020(r366996) +++ head/sys/kern/vfs_subr.cSat Oct 24 13:30:37 2020(r366997) @@ -109,6 +109,7 @@ static void syncer_shutdown(void *arg, int howto); static int vtryrecycle(struct vnode *vp); static voidv_init_counters(struct vnode *); static voidvgonel(struct vnode *); +static boolvhold_recycle(struct vnode *); static voidvfs_knllock(void *arg); static voidvfs_knlunlock(void *arg); static voidvfs_knl_assert_locked(void *arg); @@ -1126,7 +1127,8 @@ restart: goto next_iter; } - vhold(vp); + if (!vhold_recycle(vp)) + goto next_iter; TAILQ_REMOVE(&vnode_list, mvp, v_vnodelist); TAILQ_INSERT_AFTER(&vnode_list, vp, mvp, v_vnodelist); mtx_unlock(&vnode_list_mtx); @@ -1231,7 +1233,8 @@ restart: if (__predict_false(vp->v_type == VBAD || vp->v_type == VNON)) { continue; } - vhold(vp); + if (!vhold_recycle(vp)) + continue; count--; mtx_unlock(&vnode_list_mtx); vtryrecycle(vp); @@ -3248,13 +3251,11 @@ vholdnz(struct vnode *vp) * However, while this is more performant, it hinders debugging by eliminating * the previously mentioned invariant. */ -bool -vhold_smr(struct vnode *vp) +static bool __always_inline +_vhold_cond(struct vnode *vp) { int count; - VFS_SMR_ASSERT_ENTERED(); - count = atomic_load_int(&vp->v_holdcnt); for (;;) { if (count & VHOLD_NO_SMR) { @@ -3270,6 +3271,28 @@ vhold_smr(struct vnode *vp) return (true); } } +} + +bool +vhold_smr(struct vnode *vp) +{ + + VFS_SMR_ASSERT_ENTERED(); + return (_vhold_cond(vp)); +} + +/* + * Special case for vnode recycling. + * + * Vnodes are present on the global list until UMA takes them out. + * Attempts to recycle only need the relevant lock and have no use for SMR. + */ +static bool +vhold_recycle(struct vnode *vp) +{ + + mtx_assert(&vnode_list_mtx, MA_OWNED); + return (_vhold_cond(vp)); } static void __noinline ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366998 - head/sys/kern
Author: mjg Date: Sat Oct 24 13:31:25 2020 New Revision: 366998 URL: https://svnweb.freebsd.org/changeset/base/366998 Log: cache: add the missing NC_NOMAKEENTRY and NC_KEEPPOSENTRY to lockless lookup They are de facto ignored. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Sat Oct 24 13:30:37 2020(r366997) +++ head/sys/kern/vfs_cache.c Sat Oct 24 13:31:25 2020(r366998) @@ -3700,8 +3700,9 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int erro #define cache_fpl_handled(x, e)cache_fpl_handled_impl((x), (e), __LINE__) #define CACHE_FPL_SUPPORTED_CN_FLAGS \ - (LOCKLEAF | LOCKPARENT | WANTPARENT | NOCACHE | FOLLOW | LOCKSHARED | SAVENAME | \ -SAVESTART | WILLBEDIR | ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK) + (NC_NOMAKEENTRY | NC_KEEPPOSENTRY | LOCKLEAF | LOCKPARENT | WANTPARENT | \ +FOLLOW | LOCKSHARED | SAVENAME | SAVESTART | WILLBEDIR | ISOPEN | \ +NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK) #define CACHE_FPL_INTERNAL_CN_FLAGS \ (ISDOTDOT | MAKEENTRY | ISLASTCN) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366999 - head/sys/kern
Author: mjg Date: Sat Oct 24 13:31:40 2020 New Revision: 366999 URL: https://svnweb.freebsd.org/changeset/base/366999 Log: cache: assorted typo fixes Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Sat Oct 24 13:31:25 2020(r366998) +++ head/sys/kern/vfs_cache.c Sat Oct 24 13:31:40 2020(r366999) @@ -188,7 +188,7 @@ TAILQ_HEAD(cache_freebatch, namecache); * Regardless of the above, use of dedicated zones instead of malloc may be * inducing additional waste. This may be hard to address as said zones are * tied to VFS SMR. Even if retaining them, the current split should be - * reevaluated. + * re-evaluated. */ #ifdef __LP64__ #defineCACHE_PATH_CUTOFF 45 @@ -597,7 +597,7 @@ cache_alloc(int len, bool ts) * Avoid blowout in namecache entries. * * Bugs: -* 1. filesystems may end up tryng to add an already existing entry +* 1. filesystems may end up trying to add an already existing entry * (for example this can happen after a cache miss during concurrent * lookup), in which case we will call cache_neg_evict despite not * adding anything. @@ -3285,12 +3285,12 @@ vn_fullpath_any(struct vnode *vp, struct vnode *rdir, /* * Resolve an arbitrary vnode to a pathname (taking care of hardlinks). * - * Since the namecache does not track handlings, the caller is expected to first + * Since the namecache does not track hardlinks, the caller is expected to first * look up the target vnode with SAVENAME | WANTPARENT flags passed to namei. * * Then we have 2 cases: * - if the found vnode is a directory, the path can be constructed just by - * fullowing names up the chain + * following names up the chain * - otherwise we populate the buffer with the saved name and start resolving * from the parent */ @@ -3327,7 +3327,7 @@ vn_fullpath_hardlink(struct nameidata *ndp, char **ret * populate part of the buffer and descend to vn_fullpath_dir with * vp == vp_crossmp. Prevent the problem by checking for VBAD. * -* This should be atomic_load(&vp->v_type) but it is ilegal to take +* This should be atomic_load(&vp->v_type) but it is illegal to take * an address of a bit field, even if said field is sized to char. * Work around the problem by reading the value into a full-sized enum * and then re-reading it with atomic_load which will still prevent ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366993 - head/sys/net
24.10.2020, 14:08, "Hans Petter Selasky" : > On 2020-10-24 14:52, Alexey Dokuchaev wrote: >> On Sat, Oct 24, 2020 at 10:23:22AM +, Hans Petter Selasky wrote: >>> New Revision: 366993 >>> URL: https://svnweb.freebsd.org/changeset/base/366993 >>> >>> Log: >>> Run code through "clang-format -style=file" with some additional fixes. >>> No functional change. >>> >>> ... >>> @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, >>> >>> #ifdef INET6 >>> static inline void >>> -infiniband_ipv6_multicast_map(const struct in6_addr *addr, >>> - const uint8_t *broadcast, uint8_t *buf) >>> +infiniband_ipv6_multicast_map( >>> + const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) >>> { >> >> This is not how we format these in FreeBSD, please revert. It was correct >> before and no "fix" is need here. Given we already have nice .clang-format, that does most of the job, maybe it's worth considering looking into tweaking it further to fix this part? It would be nice if we could finally offload all formatting issues to the tool and focus on the actual code :-) > Done. > > --HPS ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366995 - head/sys/net
On Sat, Oct 24, 2020 at 01:07:50PM +, Hans Petter Selasky wrote: > New Revision: 366995 > URL: https://svnweb.freebsd.org/changeset/base/366995 > > Log: > More style fixes (partial revert of r366994). Thank you Hans Petter, I appreciate it. ./danfe ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367000 - head/sys/compat/linux
Author: trasz Date: Sat Oct 24 14:23:44 2020 New Revision: 367000 URL: https://svnweb.freebsd.org/changeset/base/367000 Log: Further improve prctl(2) debug. MFC after:2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D26916 Modified: head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_misc.h Modified: head/sys/compat/linux/linux_misc.c == --- head/sys/compat/linux/linux_misc.c Sat Oct 24 13:31:40 2020 (r366999) +++ head/sys/compat/linux/linux_misc.c Sat Oct 24 14:23:44 2020 (r367000) @@ -1949,6 +1949,10 @@ linux_prctl(struct thread *td, struct linux_prctl_args (void *)(register_t)args->arg2, sizeof(pdeath_signal))); break; + case LINUX_PR_SET_DUMPABLE: + linux_msg(td, "unsupported prctl PR_SET_DUMPABLE"); + error = EINVAL; + break; case LINUX_PR_GET_KEEPCAPS: /* * Indicate that we always clear the effective and @@ -2006,6 +2010,14 @@ linux_prctl(struct thread *td, struct linux_prctl_args /* * Same as returned by Linux without CONFIG_SECCOMP enabled. */ + error = EINVAL; + break; + case LINUX_PR_SET_NO_NEW_PRIVS: + linux_msg(td, "unsupported prctl PR_SET_NO_NEW_PRIVS"); + error = EINVAL; + break; + case LINUX_PR_SET_PTRACER: + linux_msg(td, "unsupported prctl PR_SET_PTRACER"); error = EINVAL; break; default: Modified: head/sys/compat/linux/linux_misc.h == --- head/sys/compat/linux/linux_misc.h Sat Oct 24 13:31:40 2020 (r366999) +++ head/sys/compat/linux/linux_misc.h Sat Oct 24 14:23:44 2020 (r367000) @@ -50,12 +50,15 @@ * Second arg is a ptr to return the * signal. */ +#defineLINUX_PR_SET_DUMPABLE 4 #defineLINUX_PR_GET_KEEPCAPS 7 /* Get drop capabilities on setuid */ #defineLINUX_PR_SET_KEEPCAPS 8 /* Set drop capabilities on setuid */ #defineLINUX_PR_SET_NAME 15 /* Set process name. */ #defineLINUX_PR_GET_NAME 16 /* Get process name. */ #defineLINUX_PR_GET_SECCOMP21 #defineLINUX_PR_SET_SECCOMP22 +#defineLINUX_PR_SET_NO_NEW_PRIVS 38 +#defineLINUX_PR_SET_PTRACER1499557217 #defineLINUX_MAX_COMM_LEN 16 /* Maximum length of the process name. */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367001 - head/sys/compat/linux
Author: trasz Date: Sat Oct 24 14:25:38 2020 New Revision: 367001 URL: https://svnweb.freebsd.org/changeset/base/367001 Log: Tweak linux(4) socket(2) debug messages. MFC after:2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D26900 Modified: head/sys/compat/linux/linux.h head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux.h == --- head/sys/compat/linux/linux.h Sat Oct 24 14:23:44 2020 (r367000) +++ head/sys/compat/linux/linux.h Sat Oct 24 14:25:38 2020 (r367001) @@ -58,6 +58,10 @@ struct l_sockaddr { #defineLINUX_AF_IPX4 #defineLINUX_AF_APPLETALK 5 #defineLINUX_AF_INET6 10 +#defineLINUX_AF_NETLINK16 + +#defineLINUX_NETLINK_ROUTE 0 +#defineLINUX_NETLINK_UEVENT15 /* * net device flags Modified: head/sys/compat/linux/linux_socket.c == --- head/sys/compat/linux/linux_socket.cSat Oct 24 14:23:44 2020 (r367000) +++ head/sys/compat/linux/linux_socket.cSat Oct 24 14:25:38 2020 (r367001) @@ -514,6 +514,20 @@ linux_socket(struct thread *td, struct linux_socket_ar return (retval_socket); domain = linux_to_bsd_domain(args->domain); if (domain == -1) { + if (args->domain == LINUX_AF_NETLINK && + args->protocol == LINUX_NETLINK_ROUTE) { + linux_msg(curthread, + "unsupported socket(AF_NETLINK, %d, NETLINK_ROUTE)", type); + return (EAFNOSUPPORT); + } + + if (args->domain == LINUX_AF_NETLINK && + args->protocol == LINUX_NETLINK_UEVENT) { + linux_msg(curthread, + "unsupported socket(AF_NETLINK, %d, NETLINK_UEVENT)", type); + return (EAFNOSUPPORT); + } + linux_msg(curthread, "unsupported socket domain %d, type %d, protocol %d", args->domain, args->type & LINUX_SOCK_TYPE_MASK, args->protocol); return (EAFNOSUPPORT); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366962 - in head: include usr.bin/calendar
Am 24.10.20 um 09:48 schrieb Alex Kozlov: On Fri, Oct 23, 2020 at 09:22:23AM +, Stefan Eßer wrote: Author: se Date: Fri Oct 23 09:22:23 2020 New Revision: 366962 URL: https://svnweb.freebsd.org/changeset/base/366962 Log: Add search of LOCALBASE/share/calendar for calendars supplied by a port. Calendar files in LOCALBASE override similarily named ones in the base system. This could easily be changed if the base system calendars should have precedence, but it could lead to a violation of POLA since then the port's files were ignored unless those in base have been deleted. There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease a consistent modification of this prefix. You are hardcoding assumption that LOCALBASE = /usr/local. Please make it overridable with LOCALBASE environment variable. This was a trivial change to get us going with calendars provided by a port (which has not been committed, yet - therefore there are no port-provided calendars, neither under /usr/local nor under any other PREFIX, as of now). I understand what you are asking for, but in such a case I'd rather think you want to rebuild FreeBSD with _PATH_LOCALBASE modified in paths.h. And I have made this a single instance that needs to be changed. Before my change there were 2 instances of /usr/local hard-coded in _PATH_DEFPATH - now you have to only change the definition of _PATH_LOCALBASE to adjust all 3 locations that use it. If you can show me precedence of a LOCALBASE environment variable being used in the way you suggest, I'd be willing to make calendar use it. But then I think a CALENDAR_HOME variable would be even more useful, since it would allow to search an additional user selected directory (and not just share/calendar within what you provide as LOCALBASE). Regards, STefan PS: If you are a source committer, you might even commit such a change yourself. But I'd think it should be reviewed, and it might be a good idea to wait until other changes (e.g. the switch-over to port-supplied calendar files) have been worked out. OpenPGP_signature Description: OpenPGP digital signature
svn commit: r367002 - in head/sys: compat/freebsd32 kern
Author: kevans Date: Sat Oct 24 14:39:17 2020 New Revision: 367002 URL: https://svnweb.freebsd.org/changeset/base/367002 Log: audit: correct reporting of *execve(2) success r326145 corrected do_execve() to return EJUSTRETURN upon success so that important registers are not clobbered. This had the side effect of tapping out 'failures' for all *execve(2) audit records, which is less than useful for auditing purposes. Audit exec returns earlier, where we can know for sure that EJUSTRETURN translates to success. Note that this unsets TDP_AUDITREC as we commit the audit record, so the usual audit in the syscall return path will do nothing. PR: 249179 Reported by: Eirik Oeverby Reviewed by: csjp, kib MFC after:1 week Sponsored by: Klara, Inc. Differential Revision:https://reviews.freebsd.org/D26922 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_exec.c head/sys/kern/subr_syscall.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c == --- head/sys/compat/freebsd32/freebsd32_misc.c Sat Oct 24 14:25:38 2020 (r367001) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sat Oct 24 14:39:17 2020 (r367002) @@ -442,6 +442,7 @@ freebsd32_execve(struct thread *td, struct freebsd32_e if (error == 0) error = kern_execve(td, &eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); return (error); } @@ -462,6 +463,7 @@ freebsd32_fexecve(struct thread *td, struct freebsd32_ error = kern_execve(td, &eargs, NULL, oldvmspace); } post_execve(td, error, oldvmspace); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); return (error); } Modified: head/sys/kern/kern_exec.c == --- head/sys/kern/kern_exec.c Sat Oct 24 14:25:38 2020(r367001) +++ head/sys/kern/kern_exec.c Sat Oct 24 14:39:17 2020(r367002) @@ -225,6 +225,7 @@ sys_execve(struct thread *td, struct execve_args *uap) if (error == 0) error = kern_execve(td, &args, NULL, oldvmspace); post_execve(td, error, oldvmspace); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); return (error); } @@ -252,6 +253,7 @@ sys_fexecve(struct thread *td, struct fexecve_args *ua error = kern_execve(td, &args, NULL, oldvmspace); } post_execve(td, error, oldvmspace); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); return (error); } @@ -280,6 +282,7 @@ sys___mac_execve(struct thread *td, struct __mac_execv if (error == 0) error = kern_execve(td, &args, uap->mac_p, oldvmspace); post_execve(td, error, oldvmspace); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); return (error); #else return (ENOSYS); Modified: head/sys/kern/subr_syscall.c == --- head/sys/kern/subr_syscall.cSat Oct 24 14:25:38 2020 (r367001) +++ head/sys/kern/subr_syscall.cSat Oct 24 14:39:17 2020 (r367002) @@ -154,7 +154,18 @@ syscallenter(struct thread *td) td->td_pflags &= ~TDP_NERRNO; else td->td_errno = error; + + /* +* Note that some syscall implementations (e.g., sys_execve) +* will commit the audit record just before their final return. +* These were done under the assumption that nothing of interest +* would happen between their return and here, where we would +* normally commit the audit record. These assumptions will +* need to be revisited should any substantial logic be added +* above. +*/ AUDIT_SYSCALL_EXIT(error, td); + #ifdef KDTRACE_HOOKS /* Give the syscall:::return DTrace probe a chance to fire. */ if (__predict_false(sa->callp->sy_return != 0)) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367003 - head/sys/kern
Author: freqlabs Date: Sat Oct 24 14:46:38 2020 New Revision: 367003 URL: https://svnweb.freebsd.org/changeset/base/367003 Log: kern_sysctl: Misc code cleanup Remove unused oidpp parameter from sysctl_sysctl_next_ls and add high level comments to describe how it works. No functional change. Reviewed by: imp MFC after:1 week Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D26854 Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c == --- head/sys/kern/kern_sysctl.c Sat Oct 24 14:39:17 2020(r367002) +++ head/sys/kern/kern_sysctl.c Sat Oct 24 14:46:38 2020(r367003) @@ -1100,9 +1100,13 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NAME, name, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_name, ""); +/* + * Walk the sysctl subtree at lsp until we find the given name, + * and return the next name in order by oid_number. + */ static int sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *name, u_int namelen, -int *next, int *len, int level, struct sysctl_oid **oidpp, bool honor_skip) +int *next, int *len, int level, bool honor_skip) { struct sysctl_oid *oidp; @@ -1110,7 +1114,6 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *len = level; SLIST_FOREACH(oidp, lsp, oid_link) { *next = oidp->oid_number; - *oidpp = oidp; if ((oidp->oid_kind & CTLFLAG_DORMANT) != 0) continue; @@ -1118,46 +1121,77 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int if (honor_skip && (oidp->oid_kind & CTLFLAG_SKIP) != 0) continue; - if (!namelen) { + if (namelen == 0) { + /* +* We have reached a node with a full name match and are +* looking for the next oid in its children. +* +* For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it +* has a handler) and move on to the children. +*/ if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) return (0); if (oidp->oid_handler) - /* We really should call the handler here...*/ return (0); lsp = SYSCTL_CHILDREN(oidp); - if (!sysctl_sysctl_next_ls(lsp, 0, 0, next+1, - len, level+1, oidpp, honor_skip)) + if (!sysctl_sysctl_next_ls(lsp, NULL, 0, next + 1, len, + level + 1, honor_skip)) return (0); + /* +* There were no useable children in this node. +* Continue searching for the next oid at this level. +*/ goto emptynode; } + /* +* No match yet. Continue seeking the given name. +* +* We are iterating in order by oid_number, so skip oids lower +* than the one we are looking for. +* +* When the current oid_number is higher than the one we seek, +* that means we have reached the next oid in the sequence and +* should return it. +* +* If the oid_number matches the name at this level then we +* have to find a node to continue searching at the next level. +*/ if (oidp->oid_number < *name) continue; - if (oidp->oid_number > *name) { + /* +* We have reached the next oid. +* +* For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it +* has a handler) and move on to the children. +*/ if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) return (0); if (oidp->oid_handler) return (0); lsp = SYSCTL_CHILDREN(oidp); - if (!sysctl_sysctl_next_ls(lsp, name+1, namelen-1, - next+1, len, level+1, oidpp, honor_skip)) + if (!sysctl_sysctl_next_ls(lsp, name + 1, namelen - 1, + next + 1, len, level + 1, honor_skip)) return (0); goto next; } if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE)
Re: svn commit: r366993 - head/sys/net
On Sat, Oct 24, 2020, 7:38 AM Alexander V. Chernikov wrote: > 24.10.2020, 14:08, "Hans Petter Selasky" : > > On 2020-10-24 14:52, Alexey Dokuchaev wrote: > >> On Sat, Oct 24, 2020 at 10:23:22AM +, Hans Petter Selasky wrote: > >>> New Revision: 366993 > >>> URL: https://svnweb.freebsd.org/changeset/base/366993 > >>> > >>> Log: > >>> Run code through "clang-format -style=file" with some additional > fixes. > >>> No functional change. > >>> > >>> ... > >>> @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, > >>> > >>>#ifdef INET6 > >>>static inline void > >>> -infiniband_ipv6_multicast_map(const struct in6_addr *addr, > >>> - const uint8_t *broadcast, uint8_t *buf) > >>> +infiniband_ipv6_multicast_map( > >>> + const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) > >>>{ > >> > >> This is not how we format these in FreeBSD, please revert. It was > correct > >> before and no "fix" is need here. > Given we already have nice .clang-format, that does most of the job, maybe > it's worth considering looking into tweaking it further to fix this part? > It would be nice if we could finally offload all formatting issues to the > tool and focus on the actual code :-) > It would be nice if it produced one of the style(9) acceptable formats without disrupting things already acceptable. That's been the big problem with the tweaks to date... some things are fixed, others break. It's getting a lot closer, though Warner > Done. > > > > --HPS > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367004 - head/sys/conf
Author: kevans Date: Sat Oct 24 15:38:04 2020 New Revision: 367004 URL: https://svnweb.freebsd.org/changeset/base/367004 Log: backlight(9): compile with COMPAT_LINUXKPI as well This would be more accurately expressed as COMPAT_LINUXKPI implying or requiring backlight, but config(8) doesn't really have a way to express that. This fixes the build with COMPAT_LINUXKPI specified in one's kernel config. Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Sat Oct 24 14:46:38 2020(r367003) +++ head/sys/conf/files Sat Oct 24 15:38:04 2020(r367004) @@ -1312,8 +1312,8 @@ dev/ath/ath_rate/sample/sample.c optional ath_rate_sam dev/ath/ath_dfs/null/dfs_null.coptional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" # -dev/backlight/backlight_if.m optional backlight -dev/backlight/backlight.c optional backlight +dev/backlight/backlight_if.m optional backlight | compat_linuxkpi +dev/backlight/backlight.c optional backlight | compat_linuxkpi dev/bce/if_bce.c optional bce dev/bfe/if_bfe.c optional bfe dev/bge/if_bge.c optional bge ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf
On Sat, Oct 24, 2020 at 4:52 AM Hans Petter Selasky wrote: > > On 2020-10-24 02:13, Warner Losh wrote: > > I was going to suggest and try this change, but life has been complicated... > > > > Has it been committed? > > > > No, not yet. > > --HPS > I went ahead and did so: r367004 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf
On Sat, Oct 24, 2020 at 9:38 AM Kyle Evans wrote: > On Sat, Oct 24, 2020 at 4:52 AM Hans Petter Selasky > wrote: > > > > On 2020-10-24 02:13, Warner Losh wrote: > > > I was going to suggest and try this change, but life has been > complicated... > > > > > > Has it been committed? > > > > > > > No, not yet. > > > > --HPS > > > > I went ahead and did so: r367004 > Excellent. I was going to do that, but you committed exactly what I was going to. Warner ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367005 - head/contrib/less
Author: delphij Date: Sat Oct 24 15:58:42 2020 New Revision: 367005 URL: https://svnweb.freebsd.org/changeset/base/367005 Log: MFV r366990: less v563. MFC after:2 weeks Relnotes: yes Modified: head/contrib/less/NEWS head/contrib/less/README head/contrib/less/brac.c head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/charset.h head/contrib/less/cmd.h head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/compose.uni head/contrib/less/cvt.c head/contrib/less/decode.c head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/fmt.uni head/contrib/less/forwback.c head/contrib/less/funcs.h head/contrib/less/help.c head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/less.nro head/contrib/less/lessecho.c head/contrib/less/lessecho.nro head/contrib/less/lesskey.c head/contrib/less/lesskey.h head/contrib/less/lesskey.nro head/contrib/less/lglob.h head/contrib/less/line.c head/contrib/less/linenum.c head/contrib/less/lsystem.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkutable head/contrib/less/optfunc.c head/contrib/less/option.c head/contrib/less/option.h head/contrib/less/opttbl.c head/contrib/less/os.c head/contrib/less/output.c head/contrib/less/pattern.c head/contrib/less/pattern.h head/contrib/less/pckeys.h head/contrib/less/position.c head/contrib/less/position.h head/contrib/less/prompt.c head/contrib/less/screen.c head/contrib/less/scrsize.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ttyin.c head/contrib/less/ubin.uni head/contrib/less/version.c head/contrib/less/wide.uni Directory Properties: head/contrib/less/ (props changed) Modified: head/contrib/less/NEWS == --- head/contrib/less/NEWS Sat Oct 24 15:38:04 2020(r367004) +++ head/contrib/less/NEWS Sat Oct 24 15:58:42 2020(r367005) @@ -11,6 +11,31 @@ == + Major changes between "less" versions 551 and 563 + +* Update Unicode tables. + +* Treat Hangul Jamo medial vowels and final consonants as zero width. + +* Display error message immediately when -o is toggled and + input is not a pipe. + +* Fix regression: make screen repaint when "squished" and + a no-movement command is given. + +* Fix erroneous EOF calculation when F command is interrupted. + +* Make WIN32C version include this fix from 551: + Don't count lines in initial screen if using -X with -F. + +* Fix display bug in WIN32C version. + +* Fix memory corruption when built with libtermcap. + +* Support libtinfow. + +== + Major changes between "less" versions 530 and 551 * Add --mouse option. Modified: head/contrib/less/README == --- head/contrib/less/READMESat Oct 24 15:38:04 2020(r367004) +++ head/contrib/less/READMESat Oct 24 15:58:42 2020(r367005) @@ -7,9 +7,9 @@ ** ** -Less, version 551 +Less, version 563 -This is the distribution of less, version 551, released 11 Jun 2019. +This is the distribution of less, version 563, released 13 Jun 2020. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -32,6 +32,14 @@ This is the distribution of "less", a paginator simila The formatted manual page is in less.man. The manual page nroff source is in less.nro. Major changes made since the last posted version are in NEWS. + +=== +PRE-INSTALLATION (when using git) + +If you are building from a clone of a git repository, +type "make -f Makefile.aut". +If you are building from a numbered release package (a tar or zip file +with a name like less-999.tar.gz or less-999.zip), you should skip this step. === INSTALLATION (Unix systems only): Modified: head/contrib/less/brac.c == --- head/contrib/less/brac.cSat Oct 24 15:38:04 2020(r367004) +++ head/contrib/less/brac.cSat Oct 24 15:58:42 2020(r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or
svn commit: r367006 - head/sbin/sysctl
Author: freqlabs Date: Sat Oct 24 16:05:37 2020 New Revision: 367006 URL: https://svnweb.freebsd.org/changeset/base/367006 Log: sysctl: Misc code cleanup * Use defined SYS_SYSCTL names * Use memcmp instead of explicit loop * Use NULL instead of 0 for pointer value * Use __FBSDID * Reformat, improve comments in parse() No functional changes. Reviewed by: imp MFC after:1 week Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D26832 Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c == --- head/sbin/sysctl/sysctl.c Sat Oct 24 15:58:42 2020(r367005) +++ head/sbin/sysctl/sysctl.c Sat Oct 24 16:05:37 2020(r367006) @@ -29,20 +29,9 @@ * SUCH DAMAGE. */ -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); -#ifndef lint -#if 0 -static char sccsid[] = "@(#)from: sysctl.c 8.1 (Berkeley) 6/6/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - #include #include #include @@ -221,7 +210,7 @@ main(int argc, char **argv) if (Nflag && nflag) usage(); if (aflag && argc == 0) - exit(sysctl_all(0, 0)); + exit(sysctl_all(NULL, 0)); if (argc == 0 && conffile == NULL) usage(); @@ -369,6 +358,13 @@ parse(const char *string, int lineno) else line[0] = '\0'; + /* +* Split the string into name and value. +* +* Either = or : may be used as the delimiter. +* Whitespace surrounding the delimiter is trimmed. +* Quotes around the value are stripped. +*/ cp = buf; if (snprintf(buf, BUFSIZ, "%s", string) >= BUFSIZ) { warnx("oid too long: '%s'%s", string, line); @@ -381,6 +377,7 @@ parse(const char *string, int lineno) warnx("Can't set variables when using -T or -W"); usage(); } + /* Trim whitespace before the value. */ while (isspace(*cp)) cp++; /* Strip a pair of " or ' if any. */ @@ -394,14 +391,17 @@ parse(const char *string, int lineno) newvalstr = cp; newsize = strlen(cp); } - /* Trim spaces */ + /* Trim whitespace after the name. */ cp = bufp + strlen(bufp) - 1; while (cp >= bufp && isspace((int)*cp)) { *cp = '\0'; cp--; } - len = name2oid(bufp, mib); + /* +* Check the name is a useable oid. +*/ + len = name2oid(bufp, mib); if (len < 0) { if (iflag) return (0); @@ -425,6 +425,10 @@ parse(const char *string, int lineno) exit(1); } + /* +* We have a useable oid to work with. If there is no value given, +* show the node and its children. Otherwise, set the new value. +*/ if (newvalstr == NULL || dflag) { if ((kind & CTLTYPE) == CTLTYPE_NODE) { if (dflag) { @@ -438,105 +442,109 @@ parse(const char *string, int lineno) if (!i && !bflag) putchar('\n'); } - } else { - if ((kind & CTLTYPE) == CTLTYPE_NODE) { - warnx("oid '%s' isn't a leaf node%s", bufp, line); - return (1); - } + return (0); + } - if (!(kind & CTLFLAG_WR)) { - if (kind & CTLFLAG_TUN) { - warnx("oid '%s' is a read only tunable%s", bufp, line); - warnx("Tunable values are set in /boot/loader.conf"); - } else - warnx("oid '%s' is read only%s", bufp, line); - return (1); - } + /* +* We have a new value to set. Check its validity and parse if numeric. +*/ + if ((kind & CTLTYPE) == CTLTYPE_NODE) { + warnx("oid '%s' isn't a leaf node%s", bufp, line); + return (1); + } - switch (kind & CTLTYPE) { - case CTLTYPE_INT: - case CTLTYPE_UINT: - case CTLTYPE_LONG: - case CTLTYPE_ULONG: - case CTLTYPE_S8: - case CTLTYPE_S16: - case CTLTYPE_S32: - case CTLTYPE_S64: - case CTLTYPE_U8: - case CTLTYPE_U16: - case CTLTYPE_U32: - case CTLTYPE_U64: - if (strlen(
svn commit: r367007 - in head/sys/netinet: . cc
Author: rscheff Date: Sat Oct 24 16:09:18 2020 New Revision: 367007 URL: https://svnweb.freebsd.org/changeset/base/367007 Log: tcp: move cwnd and ssthresh updates into cc modules This will pave the way of setting ssthresh differently in TCP CUBIC, according to RFC8312 section 4.7. No functional change, only code movement. Submitted by: chengc_netapp.com Reviewed by: rrs, tuexen, rscheff MFC after:2 weeks Sponsored by: NetApp, Inc. Differential Revision:https://reviews.freebsd.org/D26807 Modified: head/sys/netinet/cc/cc_cubic.c head/sys/netinet/cc/cc_dctcp.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/cc/cc_newreno.c head/sys/netinet/tcp_input.c Modified: head/sys/netinet/cc/cc_cubic.c == --- head/sys/netinet/cc/cc_cubic.c Sat Oct 24 16:05:37 2020 (r367006) +++ head/sys/netinet/cc/cc_cubic.c Sat Oct 24 16:09:18 2020 (r367007) @@ -264,8 +264,10 @@ static void cubic_cong_signal(struct cc_var *ccv, uint32_t type) { struct cubic *cubic_data; + u_int mss; cubic_data = ccv->cc_data; + mss = tcp_maxseg(ccv->ccvc.tcp); switch (type) { case CC_NDUPACK: @@ -292,6 +294,10 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) break; case CC_RTO: + CCV(ccv, snd_ssthresh) = max(min(CCV(ccv, snd_wnd), +CCV(ccv, snd_cwnd)) / 2 / mss, +2) * mss; + CCV(ccv, snd_cwnd) = mss; /* * Grab the current time and record it so we know when the * most recent congestion event was. Only record it when the Modified: head/sys/netinet/cc/cc_dctcp.c == --- head/sys/netinet/cc/cc_dctcp.c Sat Oct 24 16:05:37 2020 (r367006) +++ head/sys/netinet/cc/cc_dctcp.c Sat Oct 24 16:09:18 2020 (r367007) @@ -235,7 +235,7 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) { dctcp_data = ccv->cc_data; cwin = CCV(ccv, snd_cwnd); - mss = CCV(ccv, t_maxseg); + mss = tcp_maxseg(ccv->ccvc.tcp); switch (type) { case CC_NDUPACK: @@ -282,6 +282,10 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_data->ece_curr = 1; break; case CC_RTO: + CCV(ccv, snd_ssthresh) = max(min(CCV(ccv, snd_wnd), +CCV(ccv, snd_cwnd)) / 2 / mss, +2) * mss; + CCV(ccv, snd_cwnd) = mss; dctcp_update_alpha(ccv); dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; Modified: head/sys/netinet/cc/cc_htcp.c == --- head/sys/netinet/cc/cc_htcp.c Sat Oct 24 16:05:37 2020 (r367006) +++ head/sys/netinet/cc/cc_htcp.c Sat Oct 24 16:09:18 2020 (r367007) @@ -271,8 +271,10 @@ static void htcp_cong_signal(struct cc_var *ccv, uint32_t type) { struct htcp *htcp_data; + u_int mss; htcp_data = ccv->cc_data; + mss = tcp_maxseg(ccv->ccvc.tcp); switch (type) { case CC_NDUPACK: @@ -311,6 +313,10 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type) break; case CC_RTO: + CCV(ccv, snd_ssthresh) = max(min(CCV(ccv, snd_wnd), +CCV(ccv, snd_cwnd)) / 2 / mss, +2) * mss; + CCV(ccv, snd_cwnd) = mss; /* * Grab the current time and record it so we know when the * most recent congestion event was. Only record it when the Modified: head/sys/netinet/cc/cc_newreno.c == --- head/sys/netinet/cc/cc_newreno.cSat Oct 24 16:05:37 2020 (r367006) +++ head/sys/netinet/cc/cc_newreno.cSat Oct 24 16:09:18 2020 (r367007) @@ -237,7 +237,7 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) u_int mss; cwin = CCV(ccv, snd_cwnd); - mss = CCV(ccv, t_maxseg); + mss = tcp_maxseg(ccv->ccvc.tcp); nreno = ccv->cc_data; beta = (nreno == NULL) ? V_newreno_beta : nreno->beta; beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; @@ -274,6 +274,12 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) CCV(ccv, snd_cwnd) = cwin; E
svn commit: r367008 - head/sys/netinet/cc
Author: rscheff Date: Sat Oct 24 16:11:46 2020 New Revision: 367008 URL: https://svnweb.freebsd.org/changeset/base/367008 Log: TCP Cubic: improve reaction to (and rollback from) RTO 1. fix compliancy issue of CUBIC RTO handling according to RFC8312 section 4.7 2. add CUBIC CC_RTO_ERR handling Submitted by: chengc_netapp.com Reviewed by: rrs, tuexen, rscheff MFC after:2 weeks Sponsored by: NetApp, Inc. Differential Revision:https://reviews.freebsd.org/D26808 Modified: head/sys/netinet/cc/cc_cubic.c Modified: head/sys/netinet/cc/cc_cubic.c == --- head/sys/netinet/cc/cc_cubic.c Sat Oct 24 16:09:18 2020 (r367007) +++ head/sys/netinet/cc/cc_cubic.c Sat Oct 24 16:11:46 2020 (r367008) @@ -78,7 +78,7 @@ static void cubic_conn_init(struct cc_var *ccv); static int cubic_mod_init(void); static voidcubic_post_recovery(struct cc_var *ccv); static voidcubic_record_rtt(struct cc_var *ccv); -static voidcubic_ssthresh_update(struct cc_var *ccv); +static voidcubic_ssthresh_update(struct cc_var *ccv, uint32_t maxseg); static voidcubic_after_idle(struct cc_var *ccv); struct cubic { @@ -90,19 +90,28 @@ struct cubic { unsigned long max_cwnd; /* cwnd at the previous congestion event. */ unsigned long prev_max_cwnd; + /* A copy of prev_max_cwnd. Used for CC_RTO_ERR */ + unsigned long prev_max_cwnd_cp; /* various flags */ uint32_tflags; #define CUBICFLAG_CONG_EVENT 0x0001 /* congestion experienced */ #define CUBICFLAG_IN_SLOWSTART 0x0002 /* in slow start */ #define CUBICFLAG_IN_APPLIMIT 0x0004 /* application limited */ +#define CUBICFLAG_RTO_EVENT0x0008 /* RTO experienced */ /* Minimum observed rtt in ticks. */ int min_rtt_ticks; /* Mean observed rtt between congestion epochs. */ int mean_rtt_ticks; /* ACKs since last congestion event. */ int epoch_ack_count; - /* Time of last congestion event in ticks. */ + /* Timestamp (in ticks) of arriving in congestion avoidance from last +* congestion event. +*/ int t_last_cong; + /* Timestamp (in ticks) of a previous congestion event. Used for +* CC_RTO_ERR. +*/ + int t_last_cong_prev; }; static MALLOC_DEFINE(M_CUBIC, "cubic data", @@ -142,7 +151,14 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) cubic_data->flags |= CUBICFLAG_IN_SLOWSTART; newreno_cc_algo.ack_received(ccv, type); } else { - if (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | + if ((cubic_data->flags & CUBICFLAG_RTO_EVENT) && + (cubic_data->flags & CUBICFLAG_IN_SLOWSTART)) { + /* RFC8312 Section 4.7 */ + cubic_data->flags &= ~(CUBICFLAG_RTO_EVENT | + CUBICFLAG_IN_SLOWSTART); + cubic_data->max_cwnd = CCV(ccv, snd_cwnd); + cubic_data->K = 0; + } else if (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | CUBICFLAG_IN_APPLIMIT)) { cubic_data->flags &= ~(CUBICFLAG_IN_SLOWSTART | CUBICFLAG_IN_APPLIMIT); @@ -273,10 +289,10 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) case CC_NDUPACK: if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - cubic_ssthresh_update(ccv); + cubic_ssthresh_update(ccv, mss); cubic_data->flags |= CUBICFLAG_CONG_EVENT; cubic_data->t_last_cong = ticks; - cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); + cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); } ENTER_RECOVERY(CCV(ccv, t_flags)); } @@ -284,37 +300,35 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) case CC_ECN: if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - cubic_ssthresh_update(ccv); + cubic_ssthresh_update(ccv, mss); cubic_data->flags |= CUBICFLAG_CONG_EVENT; cubic_data->t_last_cong = ticks; - cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); + cubic_data->K = cubic_k(cubic_data->max_cwnd / mss)
svn commit: r367009 - in head: sbin/sysctl sys/kern
Author: freqlabs Date: Sat Oct 24 16:17:07 2020 New Revision: 367009 URL: https://svnweb.freebsd.org/changeset/base/367009 Log: sysctl+kern_sysctl: Honor SKIP for descendant nodes Ensure we also skip descendants of SKIP nodes when iterating through children of an explicitly specified node. Reported by: np Reviewed by: np MFC after:1 week Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D26833 Modified: head/sbin/sysctl/sysctl.c head/sys/kern/kern_sysctl.c Modified: head/sbin/sysctl/sysctl.c == --- head/sbin/sysctl/sysctl.c Sat Oct 24 16:11:46 2020(r367008) +++ head/sbin/sysctl/sysctl.c Sat Oct 24 16:17:07 2020(r367009) @@ -952,6 +952,7 @@ oidfmt(int *oid, int len, char *fmt, u_int *kind) static int show_var(int *oid, int nlen, bool honor_skip) { + static int skip_len = 0, skip_oid[CTL_MAXNAME]; u_char buf[BUFSIZ], *val, *oval, *p; char name[BUFSIZ], fmt[BUFSIZ]; const char *sep, *sep1, *prntype; @@ -1021,9 +1022,21 @@ show_var(int *oid, int nlen, bool honor_skip) return (0); } + /* keep track of encountered skip nodes, ignoring descendants */ + if (skip_len == 0 && (kind & CTLFLAG_SKIP) != 0) { + /* Save this oid so we can skip descendants. */ + skip_len = nlen * sizeof(int); + memcpy(skip_oid, oid, skip_len); + } + /* bail before fetching the value if we're honoring skip */ - if (honor_skip && (kind & CTLFLAG_SKIP) != 0) - return (1); + if (honor_skip) { + if (0 < skip_len && skip_len <= nlen * (int)sizeof(int) && + memcmp(skip_oid, oid, skip_len) == 0) + return (1); + /* Not a skip node or descendant of a skip node. */ + skip_len = 0; + } /* don't fetch opaques that we don't know how to print */ if (ctltype == CTLTYPE_OPAQUE) { Modified: head/sys/kern/kern_sysctl.c == --- head/sys/kern/kern_sysctl.c Sat Oct 24 16:11:46 2020(r367008) +++ head/sys/kern/kern_sysctl.c Sat Oct 24 16:17:07 2020(r367009) @@ -1126,9 +1126,13 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int * We have reached a node with a full name match and are * looking for the next oid in its children. * +* For CTL_SYSCTL_NEXTNOSKIP we are done. +* * For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it * has a handler) and move on to the children. */ + if (!honor_skip) + return (0); if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) return (0); if (oidp->oid_handler) @@ -1163,9 +1167,13 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int /* * We have reached the next oid. * +* For CTL_SYSCTL_NEXTNOSKIP we are done. +* * For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it * has a handler) and move on to the children. */ + if (!honor_skip) + return (0); if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) return (0); if (oidp->oid_handler) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367010 - head/sys/contrib/openzfs/module/os/freebsd/spl
Author: freqlabs Date: Sat Oct 24 16:25:52 2020 New Revision: 367010 URL: https://svnweb.freebsd.org/changeset/base/367010 Log: Skip RAW kstat sysctls by default hese kstats are often expensive to compute so we want to avoid them unless specifically requested. The following kstats are affected by this change: kstat.zfs.${pool}.multihost kstat.zfs.${pool}.misc.state kstat.zfs.${pool}.txgs kstat.zfs.misc.fletcher_4_bench kstat.zfs.misc.vdev_raidz_bench kstat.zfs.misc.dbufs kstat.zfs.misc.dbgmsg PR: 249258 Reported by: mjg Reviewed by: mjg, allanjude Obtained from:https://github.com/openzfs/zfs/pull/11099 Sponsored by: iXsystems, Inc. Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c == --- head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c Sat Oct 24 16:17:07 2020(r367009) +++ head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c Sat Oct 24 16:25:52 2020(r367010) @@ -475,14 +475,14 @@ kstat_install(kstat_t *ksp) if (ksp->ks_raw_ops.data) { root = SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), - OID_AUTO, ksp->ks_name, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + OID_AUTO, ksp->ks_name, CTLTYPE_STRING | CTLFLAG_RD + | CTLFLAG_MPSAFE | CTLFLAG_SKIP, ksp, 0, kstat_sysctl_raw, "A", ksp->ks_name); } else { root = SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), - OID_AUTO, ksp->ks_name, - CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + OID_AUTO, ksp->ks_name, CTLTYPE_OPAQUE | CTLFLAG_RD + | CTLFLAG_MPSAFE | CTLFLAG_SKIP, ksp, 0, kstat_sysctl_raw, "", ksp->ks_name); } break; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367011 - head/usr.bin/getent
Author: fernape (ports committer) Date: Sat Oct 24 16:40:34 2020 New Revision: 367011 URL: https://svnweb.freebsd.org/changeset/base/367011 Log: getent(1): Add EXAMPLES section Add 3 small examples to the EXAMPLES section. Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D26866 Modified: head/usr.bin/getent/getent.1 Modified: head/usr.bin/getent/getent.1 == --- head/usr.bin/getent/getent.1Sat Oct 24 16:25:52 2020 (r367010) +++ head/usr.bin/getent/getent.1Sat Oct 24 16:40:34 2020 (r367011) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2016 +.Dd October 24, 2020 .Dt GETENT 1 .Os .Sh NAME @@ -103,6 +103,24 @@ utility exits 0 on success, .Ar database , or 3 if there is no support for enumeration on .Ar database . +.Sh EXAMPLES +Show entry for user sshd from the passwd database: +.Bd -literal -offset indent +$ getent passwd sshd +sshd:*:22:22:Secure Shell Daemon:/var/empty:/usr/sbin/nologin +.Ed +.Pp +Show entry for TCP from the protocols database: +.Bd -literal -offset indent +$ getent protocols tcp +tcp 6 TCP +.Ed +.Pp +Show entry for the localhost IPv6 address ::1 from the hosts database: +.Bd -literal -offset indent +$ getent hosts ::1 +::1 localhost localhost.my.domain +.Ed .Sh SEE ALSO .Xr getutxent 3 , .Xr ethers 5 , @@ -123,7 +141,4 @@ command appeared in .Nx 3.0 , and was imported into .Fx 7.0 . -It was based on the command of the same name in -.Tn Solaris -and -.Tn Linux . +It was based on the command of the same name in Solaris and Linux. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367012 - head/bin/pwd
Author: fernape (ports committer) Date: Sat Oct 24 16:42:35 2020 New Revision: 367012 URL: https://svnweb.freebsd.org/changeset/base/367012 Log: pwd(1): Add EXAMPLES section Small EXAMPLES section. Add reference to realpath(1) due to similarity. Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D26862 Modified: head/bin/pwd/pwd.1 Modified: head/bin/pwd/pwd.1 == --- head/bin/pwd/pwd.1 Sat Oct 24 16:40:34 2020(r367011) +++ head/bin/pwd/pwd.1 Sat Oct 24 16:42:35 2020(r367012) @@ -32,7 +32,7 @@ .\" @(#)pwd.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd October 24, 2020 .Dt PWD 1 .Os .Sh NAME @@ -74,10 +74,30 @@ Logical current working directory. .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show current working directory with symbolic links resolved: +.Bd -literal -offset indent +$ /bin/pwd +/usr/home/fernape +.Ed +.Pp +Show the logical current directory. +Then use +.Xr file 1 +to inspect the +.Pa /home +directory: +.Bd -literal -offset indent +$ /bin/pwd -L +/home/fernape +$ file /home +/home: symbolic link to usr/home +.Ed .Sh SEE ALSO .Xr builtin 1 , .Xr cd 1 , .Xr csh 1 , +.Xr realpath 1 , .Xr sh 1 , .Xr getcwd 3 .Sh STANDARDS ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366993 - head/sys/net
On Sat, 24 Oct 2020, 16:27 Warner Losh, wrote: > > > On Sat, Oct 24, 2020, 7:38 AM Alexander V. Chernikov > wrote: > >> 24.10.2020, 14:08, "Hans Petter Selasky" : >> > On 2020-10-24 14:52, Alexey Dokuchaev wrote: >> >> On Sat, Oct 24, 2020 at 10:23:22AM +, Hans Petter Selasky wrote: >> >>> New Revision: 366993 >> >>> URL: https://svnweb.freebsd.org/changeset/base/366993 >> >>> >> >>> Log: >> >>> Run code through "clang-format -style=file" with some additional >> fixes. >> >>> No functional change. >> >>> >> >>> ... >> >>> @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, >> >>> >> >>>#ifdef INET6 >> >>>static inline void >> >>> -infiniband_ipv6_multicast_map(const struct in6_addr *addr, >> >>> - const uint8_t *broadcast, uint8_t *buf) >> >>> +infiniband_ipv6_multicast_map( >> >>> + const struct in6_addr *addr, const uint8_t *broadcast, uint8_t >> *buf) >> >>>{ >> >> >> >> This is not how we format these in FreeBSD, please revert. It was >> correct >> >> before and no "fix" is need here. >> Given we already have nice .clang-format, that does most of the job, >> maybe it's worth considering looking into tweaking it further to fix this >> part? >> It would be nice if we could finally offload all formatting issues to the >> tool and focus on the actual code :-) >> > > It would be nice if it produced one of the style(9) acceptable formats > without disrupting things already acceptable. That's been the big problem > with the tweaks to date... some things are fixed, others break. It's > getting a lot closer, though > I've upstreamed a few fixes, but haven't got to the line wrapping/continuation indentation stuff yet. That part of clang format is not particularly easy to modify without breaking other stuff and I'm also rather short on time right now, so probably won't get to it any time soon. Alex ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367013 - in head: . contrib/mandoc etc/mtree lib lib/flua lib/flua/libjail share/examples share/examples/flua share/man share/man/man3lua usr.bin/man
Author: freqlabs Date: Sat Oct 24 17:08:59 2020 New Revision: 367013 URL: https://svnweb.freebsd.org/changeset/base/367013 Log: flua: Add a libjail module libjail is pretty small, so it makes for a good proof of concept demonstrating how a system library can be wrapped to create a loadable Lua module for flua. * Introduce 3lua section for man pages * Add libjail module Reviewed by: kevans, manpages Relnotes: yes Differential Revision:https://reviews.freebsd.org/D26080 Added: head/lib/flua/ head/lib/flua/Makefile (contents, props changed) head/lib/flua/libjail/ head/lib/flua/libjail/Makefile (contents, props changed) head/lib/flua/libjail/jail.3lua (contents, props changed) head/lib/flua/libjail/lua_jail.c (contents, props changed) head/share/examples/flua/ head/share/examples/flua/libjail.lua (contents, props changed) head/share/man/man3lua/ head/share/man/man3lua/Makefile (contents, props changed) head/share/man/man3lua/intro.3lua (contents, props changed) Modified: head/Makefile.inc1 head/contrib/mandoc/msec.in head/etc/mtree/BSD.usr.dist head/lib/Makefile head/share/examples/Makefile head/share/man/Makefile head/usr.bin/man/man.1 head/usr.bin/man/man.sh Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Sat Oct 24 16:42:35 2020(r367012) +++ head/Makefile.inc1 Sat Oct 24 17:08:59 2020(r367013) @@ -2829,6 +2829,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ lib/libelf lib/libexpat \ lib/libfigpar \ ${_lib_libgssapi} \ + lib/libjail \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ lib/libzstd \ ${_lib_casper} \ Modified: head/contrib/mandoc/msec.in == --- head/contrib/mandoc/msec.in Sat Oct 24 16:42:35 2020(r367012) +++ head/contrib/mandoc/msec.in Sat Oct 24 17:08:59 2020(r367013) @@ -25,6 +25,7 @@ LINE("1", "FreeBSD General Commands Manual") LINE("2", "FreeBSD System Calls Manual") LINE("3", "FreeBSD Library Functions Manual") +LINE("3lua", "Lua Library Functions Manual") LINE("3p", "Perl Library Functions Manual") LINE("4", "FreeBSD Kernel Interfaces Manual") LINE("5", "FreeBSD File Formats Manual") Modified: head/etc/mtree/BSD.usr.dist == --- head/etc/mtree/BSD.usr.dist Sat Oct 24 16:42:35 2020(r367012) +++ head/etc/mtree/BSD.usr.dist Sat Oct 24 17:08:59 2020(r367013) @@ -281,6 +281,8 @@ .. find_interface .. +flua +.. hast .. hostapd @@ -856,6 +858,8 @@ man2 .. man3 +.. +man3lua .. man4 aarch64 Modified: head/lib/Makefile == --- head/lib/Makefile Sat Oct 24 16:42:35 2020(r367012) +++ head/lib/Makefile Sat Oct 24 17:08:59 2020(r367013) @@ -142,6 +142,11 @@ SUBDIR_DEPEND_liblzma= ${_libthr} SUBDIR_DEPEND_libpcap= ofed .endif +.if !defined(COMPAT_32BIT) +SUBDIR+= flua +SUBDIR_DEPEND_flua=libjail +.endif + # NB: keep these sorted by MK_* knobs SUBDIR.${MK_ATM}+= libngatm Added: head/lib/flua/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/flua/Makefile Sat Oct 24 17:08:59 2020(r367013) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR=libjail + +.include Added: head/lib/flua/libjail/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/flua/libjail/Makefile Sat Oct 24 17:08:59 2020 (r367013) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +SHLIB_NAME=jail.so +SHLIBDIR= ${LIBDIR}/flua + +SRCS+= lua_jail.c + +CFLAGS+= \ + -I${SRCTOP}/contrib/lua/src \ + -I${SRCTOP}/lib/liblua \ + +LIBADD+= jail + +MAN= jail.3lua + +.include Added: head/lib/flua/libjail/jail.3lua == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/flua/libjail/jail.3lua Sat Oct 24 17:08:59 2020 (r367013) @@ -0,0 +1,210 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020, Ryan Moeller +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided t
Re: svn commit: r366997 - head/sys/kern
On Sat, Oct 24, 2020 at 01:30:37PM +, Mateusz Guzik wrote: > Author: mjg > Date: Sat Oct 24 13:30:37 2020 > New Revision: 366997 > URL: https://svnweb.freebsd.org/changeset/base/366997 > > Log: > vfs: fix a race where reclaim vholds freed vnodes A description of the race in the commit message would be respectful to other readers of the code, so that we do not need to reverse-eng the change to understand what and why was fixed. > > Reported by:pho > Tested by: pho (previous version) > Fixes: r366974 ("vfs: stop taking the interlock in vnode reclaim") > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > == > --- head/sys/kern/vfs_subr.c Sat Oct 24 13:16:10 2020(r366996) > +++ head/sys/kern/vfs_subr.c Sat Oct 24 13:30:37 2020(r366997) > @@ -109,6 +109,7 @@ static void syncer_shutdown(void *arg, int howto); > static int vtryrecycle(struct vnode *vp); > static void v_init_counters(struct vnode *); > static void vgonel(struct vnode *); > +static bool vhold_recycle(struct vnode *); > static void vfs_knllock(void *arg); > static void vfs_knlunlock(void *arg); > static void vfs_knl_assert_locked(void *arg); > @@ -1126,7 +1127,8 @@ restart: > goto next_iter; > } > > - vhold(vp); > + if (!vhold_recycle(vp)) > + goto next_iter; > TAILQ_REMOVE(&vnode_list, mvp, v_vnodelist); > TAILQ_INSERT_AFTER(&vnode_list, vp, mvp, v_vnodelist); > mtx_unlock(&vnode_list_mtx); > @@ -1231,7 +1233,8 @@ restart: > if (__predict_false(vp->v_type == VBAD || vp->v_type == VNON)) { > continue; > } > - vhold(vp); > + if (!vhold_recycle(vp)) > + continue; > count--; > mtx_unlock(&vnode_list_mtx); > vtryrecycle(vp); > @@ -3248,13 +3251,11 @@ vholdnz(struct vnode *vp) > * However, while this is more performant, it hinders debugging by > eliminating > * the previously mentioned invariant. > */ > -bool > -vhold_smr(struct vnode *vp) > +static bool __always_inline > +_vhold_cond(struct vnode *vp) > { > int count; > > - VFS_SMR_ASSERT_ENTERED(); > - > count = atomic_load_int(&vp->v_holdcnt); > for (;;) { > if (count & VHOLD_NO_SMR) { > @@ -3270,6 +3271,28 @@ vhold_smr(struct vnode *vp) > return (true); > } > } > +} > + > +bool > +vhold_smr(struct vnode *vp) > +{ > + > + VFS_SMR_ASSERT_ENTERED(); > + return (_vhold_cond(vp)); > +} > + > +/* > + * Special case for vnode recycling. > + * > + * Vnodes are present on the global list until UMA takes them out. > + * Attempts to recycle only need the relevant lock and have no use for SMR. > + */ > +static bool > +vhold_recycle(struct vnode *vp) > +{ > + > + mtx_assert(&vnode_list_mtx, MA_OWNED); > + return (_vhold_cond(vp)); > } > > static void __noinline ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366997 - head/sys/kern
In message <20201024172452.gd2...@kib.kiev.ua>, Konstantin Belousov writes: > On Sat, Oct 24, 2020 at 01:30:37PM +, Mateusz Guzik wrote: > > Author: mjg > > Date: Sat Oct 24 13:30:37 2020 > > New Revision: 366997 > > URL: https://svnweb.freebsd.org/changeset/base/366997 > > > > Log: > > vfs: fix a race where reclaim vholds freed vnodes > A description of the race in the commit message would be respectful to > other readers of the code, so that we do not need to reverse-eng the > change to understand what and why was fixed. +1 -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367016 - in head/sys: dev/iommu kern
Author: br Date: Sat Oct 24 20:09:27 2020 New Revision: 367016 URL: https://svnweb.freebsd.org/changeset/base/367016 Log: o Add iommu de-initialization method for MSI interface. o Add iommu_unmap_msi() to release the msi GAS entry. o Provide default implementations for iommu init/deinit methods. Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision:https://reviews.freebsd.org/D26906 Modified: head/sys/dev/iommu/iommu_gas.c head/sys/dev/iommu/iommu_msi.h head/sys/kern/msi_if.m head/sys/kern/subr_intr.c Modified: head/sys/dev/iommu/iommu_gas.c == --- head/sys/dev/iommu/iommu_gas.c Sat Oct 24 17:47:43 2020 (r367015) +++ head/sys/dev/iommu/iommu_gas.c Sat Oct 24 20:09:27 2020 (r367016) @@ -727,6 +727,31 @@ iommu_map(struct iommu_domain *domain, return (error); } +void +iommu_unmap_msi(struct iommu_ctx *ctx) +{ + struct iommu_map_entry *entry; + struct iommu_domain *domain; + + domain = ctx->domain; + entry = domain->msi_entry; + if (entry == NULL) + return; + + domain->ops->unmap(domain, entry->start, entry->end - + entry->start, IOMMU_PGF_WAITOK); + + IOMMU_DOMAIN_LOCK(domain); + iommu_gas_free_space(domain, entry); + IOMMU_DOMAIN_UNLOCK(domain); + + iommu_gas_free_entry(domain, entry); + + domain->msi_entry = NULL; + domain->msi_base = 0; + domain->msi_phys = 0; +} + int iommu_map_msi(struct iommu_ctx *ctx, iommu_gaddr_t size, int offset, u_int eflags, u_int flags, vm_page_t *ma) Modified: head/sys/dev/iommu/iommu_msi.h == --- head/sys/dev/iommu/iommu_msi.h Sat Oct 24 17:47:43 2020 (r367015) +++ head/sys/dev/iommu/iommu_msi.h Sat Oct 24 20:09:27 2020 (r367016) @@ -42,5 +42,6 @@ struct iommu_ctx; void iommu_translate_msi(struct iommu_domain *domain, uint64_t *addr); int iommu_map_msi(struct iommu_ctx *ctx, iommu_gaddr_t size, int offset, u_int eflags, u_int flags, vm_page_t *ma); +void iommu_unmap_msi(struct iommu_ctx *ctx); #endif /* !_DEV_IOMMU_IOMMU_MSI_H_ */ Modified: head/sys/kern/msi_if.m == --- head/sys/kern/msi_if.m Sat Oct 24 17:47:43 2020(r367015) +++ head/sys/kern/msi_if.m Sat Oct 24 20:09:27 2020(r367016) @@ -38,6 +38,22 @@ HEADER { struct intr_irqsrc; }; +# +# Default implementations of some methods. +# +CODE { + static int + iommu_init(device_t dev, device_t child, struct iommu_domain **domain) + { + *domain = NULL; + return (0); + } + static void + iommu_deinit(device_t dev, device_t child) + { + } +}; + METHOD int alloc_msi { device_tdev; device_tchild; @@ -79,4 +95,9 @@ METHOD int iommu_init { device_tdev; device_tchild; struct iommu_domain **domain; -}; +} DEFAULT iommu_init; + +METHOD void iommu_deinit { + device_tdev; + device_tchild; +} DEFAULT iommu_deinit; Modified: head/sys/kern/subr_intr.c == --- head/sys/kern/subr_intr.c Sat Oct 24 17:47:43 2020(r367015) +++ head/sys/kern/subr_intr.c Sat Oct 24 20:09:27 2020(r367016) @@ -1297,9 +1297,7 @@ int intr_alloc_msi(device_t pci, device_t child, intptr_t xref, int count, int maxcount, int *irqs) { -#ifdef IOMMU struct iommu_domain *domain; -#endif struct intr_irqsrc **isrc; struct intr_pic *pic; device_t pdev; @@ -1314,7 +1312,6 @@ intr_alloc_msi(device_t pci, device_t child, intptr_t ("%s: Found a non-MSI controller: %s", __func__, device_get_name(pic->pic_dev))); -#ifdef IOMMU /* * If this is the first time we have used this context ask the * interrupt controller to map memory the msi source will need. @@ -1322,7 +1319,6 @@ intr_alloc_msi(device_t pci, device_t child, intptr_t err = MSI_IOMMU_INIT(pic->pic_dev, child, &domain); if (err != 0) return (err); -#endif isrc = malloc(sizeof(*isrc) * count, M_INTRNG, M_WAITOK); err = MSI_ALLOC_MSI(pic->pic_dev, child, count, maxcount, &pdev, isrc); @@ -1332,9 +1328,7 @@ intr_alloc_msi(device_t pci, device_t child, intptr_t } for (i = 0; i < count; i++) { -#ifdef IOMMU isrc[i]->isrc_iommu = domain; -#endif msi = (struct intr_map_data_msi *)intr_alloc_map_data( INTR_MAP_DATA_MSI, sizeof(*msi), M_WAITOK | M_ZERO); msi-> isrc = isrc[i]; @@ -1375,6 +1369,8 @@ intr_release_msi(device_t pci, device_t child, intptr_
svn commit: r367020 - in head/sys/riscv: include riscv
Author: mhorne Date: Sat Oct 24 20:57:13 2020 New Revision: 367020 URL: https://svnweb.freebsd.org/changeset/base/367020 Log: riscv: improve exception code naming The existing names were inherited from arm64, but we should prefer RISC-V terminology. Change the prefix to SCAUSE, and further change the names to better match the RISC-V spec and be more consistent with one another. Also, remove two codes that are not defined for S-mode (machine and hypervisor ecall). While here, apply style(9) to some condition checks. Reviewed by: kp Discussed with: jrtc27 Differential Revision:https://reviews.freebsd.org/D26918 Modified: head/sys/riscv/include/db_machdep.h head/sys/riscv/include/riscvreg.h head/sys/riscv/riscv/db_trace.c head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/include/db_machdep.h == --- head/sys/riscv/include/db_machdep.h Sat Oct 24 20:52:05 2020 (r367019) +++ head/sys/riscv/include/db_machdep.h Sat Oct 24 20:57:13 2020 (r367020) @@ -41,7 +41,7 @@ #include #include -#defineT_BREAKPOINT(EXCP_BREAKPOINT) +#defineT_BREAKPOINT(SCAUSE_BREAKPOINT) #defineT_WATCHPOINT(0) typedef vm_offset_tdb_addr_t; Modified: head/sys/riscv/include/riscvreg.h == --- head/sys/riscv/include/riscvreg.h Sat Oct 24 20:52:05 2020 (r367019) +++ head/sys/riscv/include/riscvreg.h Sat Oct 24 20:57:13 2020 (r367020) @@ -37,23 +37,21 @@ #ifndef _MACHINE_RISCVREG_H_ #define_MACHINE_RISCVREG_H_ -#defineEXCP_MASK (~EXCP_INTR) -#defineEXCP_MISALIGNED_FETCH 0 -#defineEXCP_FAULT_FETCH1 -#defineEXCP_ILLEGAL_INSTRUCTION2 -#defineEXCP_BREAKPOINT 3 -#defineEXCP_MISALIGNED_LOAD4 -#defineEXCP_FAULT_LOAD 5 -#defineEXCP_MISALIGNED_STORE 6 -#defineEXCP_FAULT_STORE7 -#defineEXCP_USER_ECALL 8 -#defineEXCP_SUPERVISOR_ECALL 9 -#defineEXCP_HYPERVISOR_ECALL 10 -#defineEXCP_MACHINE_ECALL 11 -#defineEXCP_INST_PAGE_FAULT12 -#defineEXCP_LOAD_PAGE_FAULT13 -#defineEXCP_STORE_PAGE_FAULT 15 -#defineEXCP_INTR (1ul << 63) +#defineSCAUSE_INTR (1ul << 63) +#defineSCAUSE_CODE (~SCAUSE_INTR) +#defineSCAUSE_INST_MISALIGNED 0 +#defineSCAUSE_INST_ACCESS_FAULT1 +#defineSCAUSE_ILLEGAL_INSTRUCTION 2 +#defineSCAUSE_BREAKPOINT 3 +#defineSCAUSE_LOAD_MISALIGNED 4 +#defineSCAUSE_LOAD_ACCESS_FAULT5 +#defineSCAUSE_STORE_MISALIGNED 6 +#defineSCAUSE_STORE_ACCESS_FAULT 7 +#defineSCAUSE_ECALL_USER 8 +#defineSCAUSE_ECALL_SUPERVISOR 9 +#defineSCAUSE_INST_PAGE_FAULT 12 +#defineSCAUSE_LOAD_PAGE_FAULT 13 +#defineSCAUSE_STORE_PAGE_FAULT 15 #defineSSTATUS_UIE (1 << 0) #defineSSTATUS_SIE (1 << 1) Modified: head/sys/riscv/riscv/db_trace.c == --- head/sys/riscv/riscv/db_trace.c Sat Oct 24 20:52:05 2020 (r367019) +++ head/sys/riscv/riscv/db_trace.c Sat Oct 24 20:57:13 2020 (r367020) @@ -101,12 +101,12 @@ db_stack_trace_cmd(struct unwind_state *frame) tf = (struct trapframe *)(uintptr_t)frame->sp; - if (tf->tf_scause & EXCP_INTR) + if ((tf->tf_scause & SCAUSE_INTR) != 0) db_printf("--- interrupt %ld\n", - tf->tf_scause & EXCP_MASK); + tf->tf_scause & SCAUSE_CODE); else db_printf("--- exception %ld, tval = %#lx\n", - tf->tf_scause & EXCP_MASK, + tf->tf_scause & SCAUSE_CODE, tf->tf_stval); frame->sp = tf->tf_sp; frame->fp = tf->tf_s[0]; Modified: head/sys/riscv/riscv/intr_machdep.c == --- head/sys/riscv/riscv/intr_machdep.c Sat Oct 24 20:52:05 2020 (r367019) +++ head/sys/riscv/riscv/intr_machdep.c Sat Oct 24 20:57:13 2020 (r367020) @@ -158,10 +158,10 @@ riscv_cpu_intr(struct trapframe *frame) struct int
svn commit: r367021 - in head/sbin: ping ping6
Author: rscheff Date: Sat Oct 24 21:01:18 2020 New Revision: 367021 URL: https://svnweb.freebsd.org/changeset/base/367021 Log: Make use of IP_VLAN_PCP setsockopt in ping and ping6. In order to validate the proper marking and use of a different ethernet priority class, add the new session-specific PCP feature to the ping/ping6 utilities. Reviewed by: mav, bcr Sponsored by: NetApp, Inc. Differential Revision:https://reviews.freebsd.org/D26627 Modified: head/sbin/ping/ping.8 head/sbin/ping/ping.c head/sbin/ping6/ping6.8 head/sbin/ping6/ping6.c Modified: head/sbin/ping/ping.8 == --- head/sbin/ping/ping.8 Sat Oct 24 20:57:13 2020(r367020) +++ head/sbin/ping/ping.8 Sat Oct 24 21:01:18 2020(r367021) @@ -28,7 +28,7 @@ .\" @(#)ping.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd August 22, 2019 +.Dd October 2, 2020 .Dt PING 8 .Os .Sh NAME @@ -39,6 +39,7 @@ packets to network hosts .Sh SYNOPSIS .Nm .Op Fl AaDdfHnoQqRrv +.Op Fl C Ar pcp .Op Fl c Ar count .Op Fl G Ar sweepmaxsize .Op Fl g Ar sweepminsize @@ -57,6 +58,7 @@ packets to network hosts .Ar host .Nm .Op Fl AaDdfHLnoQqRrv +.Op Fl C Ar pcp .Op Fl c Ar count .Op Fl I Ar iface .Op Fl i Ar wait @@ -112,6 +114,9 @@ Include a bell character in the output when any packet is received. This option is ignored if other format options are present. +.It Fl C Ar pcp +Add an 802.1p Ethernet Priority Code Point when sending a packet. +0..7 uses that specific PCP, -1 uses the interface default PCP (or none). .It Fl c Ar count Stop after sending (and receiving) Modified: head/sbin/ping/ping.c == --- head/sbin/ping/ping.c Sat Oct 24 20:57:13 2020(r367020) +++ head/sbin/ping/ping.c Sat Oct 24 21:01:18 2020(r367021) @@ -155,6 +155,7 @@ static int options; #defineF_TIME 0x10 #defineF_SWEEP 0x20 #defineF_WAITTIME 0x40 +#defineF_IP_VLAN_PCP 0x80 /* * MAX_DUP_CHK is the number of bits in received table, i.e. the maximum @@ -247,7 +248,7 @@ main(int argc, char *const *argv) u_long alarmtimeout; long ltmp; int almost_done, ch, df, hold, i, icmp_len, mib[4], preload; - int ssend_errno, srecv_errno, tos, ttl; + int ssend_errno, srecv_errno, tos, ttl, pcp; char ctrl[CMSG_SPACE(sizeof(struct timespec))]; char hnamebuf[MAXHOSTNAMELEN], snamebuf[MAXHOSTNAMELEN]; #ifdef IP_OPTIONS @@ -295,11 +296,11 @@ main(int argc, char *const *argv) err(EX_OSERR, "srecv socket"); } - alarmtimeout = df = preload = tos = 0; + alarmtimeout = df = preload = tos = pcp = 0; outpack = outpackhdr + sizeof(struct ip); while ((ch = getopt(argc, argv, - "Aac:DdfG:g:Hh:I:i:Ll:M:m:nop:QqRrS:s:T:t:vW:z:" + "AaC:c:DdfG:g:Hh:I:i:Ll:M:m:nop:QqRrS:s:T:t:vW:z:" #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC "P:" @@ -314,6 +315,13 @@ main(int argc, char *const *argv) case 'a': options |= F_AUDIBLE; break; + case 'C': + options |= F_IP_VLAN_PCP; + ltmp = strtol(optarg, &ep, 0); + if (*ep || ep == optarg || ltmp > 7 || ltmp < -1) + errx(EX_USAGE, "invalid PCP: `%s'", optarg); + pcp = ltmp; + break; case 'c': ltmp = strtol(optarg, &ep, 0); if (*ep || ep == optarg || ltmp <= 0) @@ -665,6 +673,10 @@ main(int argc, char *const *argv) if (options & F_SO_DONTROUTE) (void)setsockopt(ssend, SOL_SOCKET, SO_DONTROUTE, (char *)&hold, sizeof(hold)); + if (options & F_IP_VLAN_PCP) { + (void)setsockopt(ssend, IPPROTO_IP, IP_VLAN_PCP, (char *)&pcp, + sizeof(pcp)); + } #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC if (options & F_POLICY) { @@ -1762,11 +1774,11 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: ping [-AaDdfHnoQqRrv] [-c count] [-G sweepmaxsize] [-g sweepminsize]", +"usage: ping [-AaDdfHnoQqRrv] [-C pcp] [-c count] [-G sweepmaxsize] [-g sweepminsize]", "[-h sweepincrsize] [-i wait] [-l preload] [-M mask | time] [-m ttl]", " " SECOPT " [-p pattern] [-S src_addr] [-s packetsize] [-t timeout]", "[-W waittime] [-z tos] host", -" ping [-AaDdfHLnoQqRrv] [-c count] [-I iface] [-i wait] [-l preload]", +" ping [-AaDdfHLnoQqRrv] [-C pcp] [-c count] [-I iface] [-i wait] [-l preload]", "[-M mask | time] [-m ttl]" SECOPT " [-p pattern] [-S src_addr]", "[-s
svn commit: r367023 - in head: sys/dev/iscsi usr.bin/iscsictl usr.sbin/iscsid
Author: rscheff Date: Sat Oct 24 21:07:13 2020 New Revision: 367023 URL: https://svnweb.freebsd.org/changeset/base/367023 Log: Add network QoS support for PCP to iscsi initiator. Make the Ethernet PCP codepoint configurable for L2 local traffic, to allow lower latency for iSCSI block IO. This addresses the initiator side only. Reviewed by: mav, trasz, bcr Sponsored by: NetApp, Inc. Differential Revision:https://reviews.freebsd.org/D26739 Modified: head/sys/dev/iscsi/iscsi_ioctl.h head/usr.bin/iscsictl/iscsi.conf.5 head/usr.bin/iscsictl/iscsictl.c head/usr.bin/iscsictl/iscsictl.h head/usr.bin/iscsictl/parse.y head/usr.bin/iscsictl/token.l head/usr.sbin/iscsid/iscsid.c Modified: head/sys/dev/iscsi/iscsi_ioctl.h == --- head/sys/dev/iscsi/iscsi_ioctl.hSat Oct 24 21:07:10 2020 (r367022) +++ head/sys/dev/iscsi/iscsi_ioctl.hSat Oct 24 21:07:13 2020 (r367023) @@ -71,7 +71,8 @@ struct iscsi_session_conf { charisc_offload[ISCSI_OFFLOAD_LEN]; int isc_enable; int isc_dscp; - int isc_spare[3]; + int isc_pcp; + int isc_spare[2]; }; /* Modified: head/usr.bin/iscsictl/iscsi.conf.5 == --- head/usr.bin/iscsictl/iscsi.conf.5 Sat Oct 24 21:07:10 2020 (r367022) +++ head/usr.bin/iscsictl/iscsi.conf.5 Sat Oct 24 21:07:13 2020 (r367023) @@ -155,6 +155,13 @@ and codepoints. Default is no specified dscp codepoint, which means the default of the outgoing interface is used. +.It Cm pcp +The 802.1Q Priority CodePoint used for sending packets. +The PCP can be set to a value in the range between +.Qq Ar 0 +to +.Qq Ar 7 . +When omitted, the default for the outgoing interface is used. .El .Sh FILES .Bl -tag -width indent Modified: head/usr.bin/iscsictl/iscsictl.c == --- head/usr.bin/iscsictl/iscsictl.cSat Oct 24 21:07:10 2020 (r367022) +++ head/usr.bin/iscsictl/iscsictl.cSat Oct 24 21:07:13 2020 (r367023) @@ -88,6 +88,7 @@ target_new(struct conf *conf) xo_err(1, "calloc"); targ->t_conf = conf; targ->t_dscp = -1; + targ->t_pcp = -1; TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); return (targ); @@ -360,6 +361,7 @@ conf_from_target(struct iscsi_session_conf *conf, else conf->isc_data_digest = ISCSI_DIGEST_NONE; conf->isc_dscp = targ->t_dscp; + conf->isc_pcp = targ->t_pcp; } static int @@ -540,6 +542,9 @@ kernel_list(int iscsi_fd, const struct target *targ __ if (conf->isc_dscp != -1) xo_emit("{L:/%-26s}{V:dscp/0x%02x}\n", "Target DSCP:", conf->isc_dscp); + if (conf->isc_pcp != -1) + xo_emit("{L:/%-26s}{V:pcp/0x%02x}\n", + "Target PCP:", conf->isc_pcp); xo_close_container("target"); xo_open_container("auth"); Modified: head/usr.bin/iscsictl/iscsictl.h == --- head/usr.bin/iscsictl/iscsictl.hSat Oct 24 21:07:10 2020 (r367022) +++ head/usr.bin/iscsictl/iscsictl.hSat Oct 24 21:07:13 2020 (r367023) @@ -79,6 +79,7 @@ struct target { int t_enable; int t_protocol; int t_dscp; + int t_pcp; char*t_offload; char*t_user; char*t_secret; Modified: head/usr.bin/iscsictl/parse.y == --- head/usr.bin/iscsictl/parse.y Sat Oct 24 21:07:10 2020 (r367022) +++ head/usr.bin/iscsictl/parse.y Sat Oct 24 21:07:13 2020 (r367023) @@ -133,6 +133,8 @@ target_entry: ignored | dscp + | + pcp ; target_name: TARGET_NAME EQUALS STR @@ -306,6 +308,8 @@ dscp: DSCP EQUALS STR { uint64_t tmp; + if (target->t_dscp != -1) + xo_errx(1, "duplicated dscp at line %d", lineno); if (strcmp($3, "0x") == 0) { tmp = strtol($3 + 2, NULL, 16); } else if (expand_number($3, &tmp) != 0) { @@ -342,6 +346,27 @@ dscp: DSCP EQUALS STR | DSCP EQUALS AF41 { target->t_dscp = IPTOS_DSCP_AF41 >> 2 ; } | DSCP EQUALS AF42 { target->t_dscp = IPTOS_DSCP_AF42 >> 2 ; } | DSCP EQUALS AF43 { target->t_dscp =
svn commit: r367022 - in head/sys: geom kern sys
Author: mav Date: Sat Oct 24 21:07:10 2020 New Revision: 367022 URL: https://svnweb.freebsd.org/changeset/base/367022 Log: Fix asymmetry in devstat(9) calls by GEOM. Before this GEOM passed bio pointer to transaction start, but not end. It was irrelevant until devstat(9) got DTrace hooks, that appeared to provide bio pointer on I/O completion, but not on submission. MFC after:2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/geom/geom_io.c head/sys/kern/subr_devstat.c head/sys/sys/devicestat.h Modified: head/sys/geom/geom_io.c == --- head/sys/geom/geom_io.c Sat Oct 24 21:01:18 2020(r367021) +++ head/sys/geom/geom_io.c Sat Oct 24 21:07:10 2020(r367022) @@ -552,9 +552,9 @@ g_io_request(struct bio *bp, struct g_consumer *cp) else getbinuptime(&bp->bio_t0); if (g_collectstats & G_STATS_CONSUMERS) - devstat_start_transaction(cp->stat, &bp->bio_t0); + devstat_start_transaction_bio_t0(cp->stat, bp); if (g_collectstats & G_STATS_PROVIDERS) - devstat_start_transaction(pp->stat, &bp->bio_t0); + devstat_start_transaction_bio_t0(pp->stat, bp); #ifdef INVARIANTS atomic_add_int(&cp->nstart, 1); #endif Modified: head/sys/kern/subr_devstat.c == --- head/sys/kern/subr_devstat.cSat Oct 24 21:01:18 2020 (r367021) +++ head/sys/kern/subr_devstat.cSat Oct 24 21:07:10 2020 (r367022) @@ -256,6 +256,17 @@ devstat_start_transaction_bio(struct devstat *ds, stru return; binuptime(&bp->bio_t0); + devstat_start_transaction_bio_t0(ds, bp); +} + +void +devstat_start_transaction_bio_t0(struct devstat *ds, struct bio *bp) +{ + + /* sanity check */ + if (ds == NULL) + return; + devstat_start_transaction(ds, &bp->bio_t0); DTRACE_DEVSTAT_BIO_START(); } Modified: head/sys/sys/devicestat.h == --- head/sys/sys/devicestat.h Sat Oct 24 21:01:18 2020(r367021) +++ head/sys/sys/devicestat.h Sat Oct 24 21:07:10 2020(r367022) @@ -196,6 +196,7 @@ struct devstat *devstat_new_entry(const void *dev_name void devstat_remove_entry(struct devstat *ds); void devstat_start_transaction(struct devstat *ds, const struct bintime *now); void devstat_start_transaction_bio(struct devstat *ds, struct bio *bp); +void devstat_start_transaction_bio_t0(struct devstat *ds, struct bio *bp); void devstat_end_transaction(struct devstat *ds, u_int32_t bytes, devstat_tag_type tag_type, devstat_trans_flags flags, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367024 - head/usr.sbin/ctld
Author: rscheff Date: Sat Oct 24 21:10:53 2020 New Revision: 367024 URL: https://svnweb.freebsd.org/changeset/base/367024 Log: Add network QoS support for PCP to iscsi target. Mak the Ethernet PCP codepoint configurable for L2 local traffic, to allow lower latency for iSCSI block IO. This addresses the target side only. Reviewed by: mav, trasz, bcr Sponsored by: NetApp, Inc. Differential Revision:https://reviews.freebsd.org/D26740 Modified: head/usr.sbin/ctld/ctl.conf.5 head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/parse.y head/usr.sbin/ctld/token.l head/usr.sbin/ctld/uclparse.c Modified: head/usr.sbin/ctld/ctl.conf.5 == --- head/usr.sbin/ctld/ctl.conf.5 Sat Oct 24 21:07:13 2020 (r367023) +++ head/usr.sbin/ctld/ctl.conf.5 Sat Oct 24 21:10:53 2020 (r367024) @@ -258,6 +258,13 @@ well-defined and .Qq Ar AFxx codepoints. +.It Ic pcp Ar value +The 802.1Q Priority CodePoint used for sending packets. +The PCP can be set to a value in the range between +.Qq Ar 0 +to +.Qq Ar 7 . +When omitted, the default for the outgoing interface is used. .El .Ss target Context .Bl -tag -width indent Modified: head/usr.sbin/ctld/ctld.c == --- head/usr.sbin/ctld/ctld.c Sat Oct 24 21:07:13 2020(r367023) +++ head/usr.sbin/ctld/ctld.c Sat Oct 24 21:10:53 2020(r367024) @@ -626,6 +626,7 @@ portal_group_new(struct conf *conf, const char *name) pg->pg_conf = conf; pg->pg_tag = 0; /* Assigned later in conf_apply(). */ pg->pg_dscp = -1; + pg->pg_pcp = -1; TAILQ_INSERT_TAIL(&conf->conf_portal_groups, pg, pg_next); return (pg); @@ -2210,6 +2211,32 @@ conf_apply(struct conf *oldconf, struct conf *newconf) IPPROTO_IPV6, IPV6_TCLASS, &tos, sizeof(tos)) == -1) log_warn("setsockopt(IPV6_TCLASS) " + "failed for %s", + newp->p_listen); + } + } + if (newpg->pg_pcp != -1) { + struct sockaddr sa; + int len = sizeof(sa); + getsockname(newp->p_socket, &sa, &len); + /* +* Only allow the 6-bit DSCP +* field to be modified +*/ + int pcp = newpg->pg_pcp; + if (sa.sa_family == AF_INET) { + if (setsockopt(newp->p_socket, + IPPROTO_IP, IP_VLAN_PCP, + &pcp, sizeof(pcp)) == -1) + log_warn("setsockopt(IP_VLAN_PCP) " + "failed for %s", + newp->p_listen); + } else + if (sa.sa_family == AF_INET6) { + if (setsockopt(newp->p_socket, + IPPROTO_IPV6, IPV6_VLAN_PCP, + &pcp, sizeof(pcp)) == -1) + log_warn("setsockopt(IPV6_VLAN_PCP) " "failed for %s", newp->p_listen); } Modified: head/usr.sbin/ctld/ctld.h == --- head/usr.sbin/ctld/ctld.h Sat Oct 24 21:07:13 2020(r367023) +++ head/usr.sbin/ctld/ctld.h Sat Oct 24 21:10:53 2020(r367024) @@ -128,6 +128,7 @@ struct portal_group { char*pg_offload; char*pg_redirection; int pg_dscp; + int pg_pcp; uint16_tpg_tag; }; Modified: head/usr.sbin/ctld/parse.y == --- head/usr.sbin/ctld/parse.y Sat Oct 24 21:07:13 2020(r367023) +++ head/usr.sbin/ctld/parse.y Sat Oct 24 21:10:53 2020(r367024) @@ -65,8 +65,8 @@ extern void yyrestart(FILE *); %token DISCOVERY_AUTH_GROUP DISCOVERY_FILTER DSCP FOREIGN %token INITIATOR_NAME INITIATOR_PORTAL ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT %token LISTEN LISTEN_ISER LUN MAXPROC OFFLOAD OPENING_BRACKET OPTION -%token PA
svn commit: r367025 - head/usr.bin/sockstat
Author: freqlabs Date: Sat Oct 24 22:36:20 2020 New Revision: 367025 URL: https://svnweb.freebsd.org/changeset/base/367025 Log: sockstat: Fix error message when jail_attach fails jail_errmsg is for libjail, jail_attach() is a system call. Modified: head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.c == --- head/usr.bin/sockstat/sockstat.cSat Oct 24 21:10:53 2020 (r367024) +++ head/usr.bin/sockstat/sockstat.cSat Oct 24 22:36:20 2020 (r367025) @@ -1372,7 +1372,7 @@ main(int argc, char *argv[]) errx(2, "%s", jail_errmsg); case JAIL_SYS_NEW: if (jail_attach(opt_j) < 0) - errx(3, "%s", jail_errmsg); + err(3, "jail_attach()"); /* Set back to -1 for normal output in vnet jail. */ opt_j = -1; break; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367026 - head/usr.sbin/mountd
Author: rmacklem Date: Sat Oct 24 22:48:28 2020 New Revision: 367026 URL: https://svnweb.freebsd.org/changeset/base/367026 Log: Add "-R" option to tell mountd to not register with rpcbind. rpcbind is now considered a security risk for some sites. Since an NFSv4 only NFS server does not need rpcbind, it makes sense to have an option that implements this. This patch adds a "-R" option that disables the Mount protocol (not used by NFSv4) and does not register with rpcbind. Changes are required to /etc/rc.d/mountd and /etc/rc.d/nfsd. Those will be in a separate commit. Reviewed by: freqlabs, asomers MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D26746 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c == --- head/usr.sbin/mountd/mountd.c Sat Oct 24 22:36:20 2020 (r367025) +++ head/usr.sbin/mountd/mountd.c Sat Oct 24 22:48:28 2020 (r367026) @@ -427,8 +427,10 @@ main(int argc, char **argv) uint64_t curtime, nexttime; struct timeval tv; struct timespec tp; - sigset_t sighup_mask; + sigset_t sig_mask, sighup_mask; + int enable_rpcbind; + enable_rpcbind = 1; /* Check that another mountd isn't already running. */ pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &otherpid); if (pfh == NULL) { @@ -443,7 +445,7 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, "2deh:lnp:rS")) != -1) + while ((c = getopt(argc, argv, "2deh:lnp:RrS")) != -1) switch (c) { case '2': force_v2 = 1; @@ -454,6 +456,10 @@ main(int argc, char **argv) case 'n': resvport_only = 0; break; + case 'R': + /* Do not support Mount protocol */ + enable_rpcbind = 0; + break; case 'r': dir_only = 0; break; @@ -498,6 +504,21 @@ main(int argc, char **argv) default: usage(); } + if (enable_rpcbind == 0) { + if (svcport_str != NULL) { + warnx("-p option not compatible with -R, ignored"); + free(svcport_str); + svcport_str = NULL; + } + if (nhosts > 0) { + warnx("-h option not compatible with -R, ignored"); + for (k = 0; k < nhosts; k++) + free(hosts[k]); + free(hosts); + hosts = NULL; + nhosts = 0; + } + } if (modfind("nfsd") < 0) { /* Not present in kernel, try loading it */ @@ -531,58 +552,61 @@ main(int argc, char **argv) pidfile_write(pfh); - rpcb_unset(MOUNTPROG, MOUNTVERS, NULL); - rpcb_unset(MOUNTPROG, MOUNTVERS3, NULL); - rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec); + if (enable_rpcbind != 0) { + rpcb_unset(MOUNTPROG, MOUNTVERS, NULL); + rpcb_unset(MOUNTPROG, MOUNTVERS3, NULL); + rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec); - if (!resvport_only) { - if (sysctlbyname("vfs.nfsd.nfs_privport", NULL, NULL, - &resvport_only, sizeof(resvport_only)) != 0 && - errno != ENOENT) { - syslog(LOG_ERR, "sysctl: %m"); - exit(1); + if (!resvport_only) { + if (sysctlbyname("vfs.nfsd.nfs_privport", NULL, NULL, + &resvport_only, sizeof(resvport_only)) != 0 && + errno != ENOENT) { + syslog(LOG_ERR, "sysctl: %m"); + exit(1); + } } - } - /* -* If no hosts were specified, add a wildcard entry to bind to -* INADDR_ANY. Otherwise make sure 127.0.0.1 and ::1 are added to the -* list. -*/ - if (nhosts == 0) { - hosts = malloc(sizeof(char *)); - if (hosts == NULL) - out_of_mem(); - hosts[0] = "*"; - nhosts = 1; - } else { - hosts_bak = hosts; - if (have_v6) { - hosts_bak = realloc(hosts, (nhosts + 2) * - sizeof(char *)); - if (hosts_bak == NULL) { - for (k = 0; k < nhosts; k++) - free(hosts[k]); - free(hosts); - out_of_
svn commit: r367027 - head/usr.sbin/mountd
Author: rmacklem Date: Sat Oct 24 22:52:29 2020 New Revision: 367027 URL: https://svnweb.freebsd.org/changeset/base/367027 Log: Update man page for -R option added by r376026. This is a content change. Reviewed by: bcr MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D26746 Modified: head/usr.sbin/mountd/mountd.8 Modified: head/usr.sbin/mountd/mountd.8 == --- head/usr.sbin/mountd/mountd.8 Sat Oct 24 22:48:28 2020 (r367026) +++ head/usr.sbin/mountd/mountd.8 Sat Oct 24 22:52:29 2020 (r367027) @@ -28,7 +28,7 @@ .\" @(#)mountd.8 8.4 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd August 1, 2019 +.Dd October 11, 2020 .Dt MOUNTD 8 .Os .Sh NAME @@ -38,7 +38,7 @@ mount requests .Sh SYNOPSIS .Nm -.Op Fl 2delnrS +.Op Fl 2delnRrS .Op Fl h Ar bindip .Op Fl p Ar port .Op Ar exportsfile ... @@ -112,6 +112,17 @@ If .Nm cannot bind to this port, an appropriate error will be recorded in the system log, and the daemon will then exit. +.It Fl R +Do not support the Mount protocol and do not register with +.Xr rpcbind 8 . +This can be done for NFSv4 only servers, since the Mount protocol is not +used by NFSv4. +Useful for NFSv4 only servers that do not wish to run +.Xr rpcbind 8 . +.Xr showmount 8 +will not work, however since NFSv4 mounts are not shown by +.Xr showmount 8 , +this should not be an issue for an NFSv4 only server. .It Fl r Allow mount RPCs requests for regular files to be served. Although this seems to violate the mount protocol specification, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367028 - in head: include sys/sys
Author: imp Date: Sat Oct 24 23:21:06 2020 New Revision: 367028 URL: https://svnweb.freebsd.org/changeset/base/367028 Log: Remove obsolete check for GCC < 3 and support for Intel Compiler We no longer support old versions of GCC. Remove this check by assuming it's false. That will make the entire expression false. Also remove support for Intel compiler, it's badly bitrotted. Technically, this removes support for C89 and K&R from compilers that don't define _Bool in those compilation environments as well. I'm unaware of any working compiler today for which that would be relevant (pcc has it and tcc sadly isn't working for other reasons), though if one pops up in ports, I'll work to resolve the issue. Modified: head/include/stdbool.h head/include/stdlib.h head/sys/sys/types.h Modified: head/include/stdbool.h == --- head/include/stdbool.h Sat Oct 24 22:52:29 2020(r367027) +++ head/include/stdbool.h Sat Oct 24 23:21:06 2020(r367028) @@ -37,9 +37,6 @@ #definetrue1 #definebool_Bool -#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) -typedefint _Bool; -#endif #endif /* !__cplusplus */ #endif /* __bool_true_false_are_defined */ Modified: head/include/stdlib.h == --- head/include/stdlib.h Sat Oct 24 22:52:29 2020(r367027) +++ head/include/stdlib.h Sat Oct 24 23:21:06 2020(r367028) @@ -253,7 +253,7 @@ extern void (*malloc_message)(void *, const char *); * On platforms where alloca() is not in libc, programs which use it * will fail to link when compiled with non-GNU compilers. */ -#if __GNUC__ >= 2 || defined(__INTEL_COMPILER) +#if __GNUC__ >= 2 #undef alloca /* some GNU bits try to get cute and define this on their own */ #define alloca(sz) __builtin_alloca(sz) #endif Modified: head/sys/sys/types.h == --- head/sys/sys/types.hSat Oct 24 22:52:29 2020(r367027) +++ head/sys/sys/types.hSat Oct 24 23:21:06 2020(r367028) @@ -300,9 +300,6 @@ typedef struct vm_page *vm_page_t; #define__bool_true_false_are_defined 1 #definefalse 0 #definetrue1 -#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) -typedefint _Bool; -#endif typedef_Bool bool; #endif /* !__bool_true_false_are_defined && !__cplusplus */ #endif /* KERNEL || _STANDALONE */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367030 - head/lib/msun/src
Author: imp Date: Sat Oct 24 23:21:22 2020 New Revision: 367030 URL: https://svnweb.freebsd.org/changeset/base/367030 Log: Remove intel compiler support from math.h The intel compiler support has badly decayed over the years. Stop pretending that we support it. Note, I've stopped short of requiring gcc builtin support with this commit since other compilers may be used to build non-base software and we need to support those so more investigation is needed before simplifying further. Modified: head/lib/msun/src/math.h Modified: head/lib/msun/src/math.h == --- head/lib/msun/src/math.hSat Oct 24 23:21:18 2020(r367029) +++ head/lib/msun/src/math.hSat Oct 24 23:21:22 2020(r367030) @@ -34,11 +34,11 @@ extern const union __nan_un { float __uf; } __nan; -#if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) +#if __GNUC_PREREQ__(3, 3) #define__MATH_BUILTIN_CONSTANTS #endif -#if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER) +#if __GNUC_PREREQ__(3, 0) #define__MATH_BUILTIN_RELOPS #endif ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367031 - in head/sys/i386: i386 include
Author: imp Date: Sat Oct 24 23:21:27 2020 New Revision: 367031 URL: https://svnweb.freebsd.org/changeset/base/367031 Log: Remove support for intel compiler from i386 in_cksum We no longer support building the kernel with the old intel compiler. Remove support for it from in_cksum. Should there be interest in reviving it, this is as likely to get in the way as to help anyway. Modified: head/sys/i386/i386/in_cksum.c head/sys/i386/include/in_cksum.h Modified: head/sys/i386/i386/in_cksum.c == --- head/sys/i386/i386/in_cksum.c Sat Oct 24 23:21:22 2020 (r367030) +++ head/sys/i386/i386/in_cksum.c Sat Oct 24 23:21:27 2020 (r367031) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); * icc needs to be special cased here, as the asm code below results * in broken code if compiled with icc. */ -#if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER) +#if !defined(__GNUCLIKE_ASM) /* non gcc parts stolen from sys/alpha/alpha/in_cksum.c */ #define REDUCE32 \ {\ @@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$"); #endif #define REDUCE {sum = (sum & 0x) + (sum >> 16); ADDCARRY(sum);} -#if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER) +#if !defined(__GNUCLIKE_ASM) static const u_int32_t in_masks[] = { /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ 0x, 0x00FF, 0x, 0x00FF, /* offset 0 */ Modified: head/sys/i386/include/in_cksum.h == --- head/sys/i386/include/in_cksum.hSat Oct 24 23:21:22 2020 (r367030) +++ head/sys/i386/include/in_cksum.hSat Oct 24 23:21:27 2020 (r367031) @@ -55,7 +55,7 @@ * in the normal case (where there are no options and the header length is * therefore always exactly five 32-bit words. */ -#if defined(__GNUCLIKE_ASM) && !defined(__INTEL_COMPILER) +#if defined(__GNUCLIKE_ASM) #if defined(IPVERSION) && (IPVERSION == 4) static __inline u_int in_cksum_hdr(const struct ip *ip) @@ -137,7 +137,7 @@ in_pseudo(u_int sum, u_int b, u_int c) #endif #ifdef _KERNEL -#if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER) +#if !defined(__GNUCLIKE_ASM) #if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); #endif ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367029 - head/sys/dev/bxe
Author: imp Date: Sat Oct 24 23:21:18 2020 New Revision: 367029 URL: https://svnweb.freebsd.org/changeset/base/367029 Log: Remove support for ancient compilers We don't support building the kernel from such old compilers, nor with the Intel Compiler specifically. Remove support for this old construct that was copied from stdbool.h and not relevant here. Modified: head/sys/dev/bxe/ecore_sp.h Modified: head/sys/dev/bxe/ecore_sp.h == --- head/sys/dev/bxe/ecore_sp.h Sat Oct 24 23:21:06 2020(r367028) +++ head/sys/dev/bxe/ecore_sp.h Sat Oct 24 23:21:18 2020(r367029) @@ -75,9 +75,6 @@ typedef volatile int ecore_atomic_t; #ifndef __bool_true_false_are_defined #ifndef __cplusplus #define bool _Bool -#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) -typedef _Bool bool; -#endif #endif /* !__cplusplus */ #endif /* !__bool_true_false_are_defined$ */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367032 - head/sys/sys
Author: imp Date: Sat Oct 24 23:21:31 2020 New Revision: 367032 URL: https://svnweb.freebsd.org/changeset/base/367032 Log: cdefs.h: remove intel_compiler support The age of the intel compiler support is so old as to be uninteresting. No recent recports of intel compiler support have been received. Remove all the special case workarounds for the Intel compiler. Should there be interest in supporting the compiler, contact me and I'll work with people to make it happen, though I suspect these instances are more likely to be in the way than to be helpful. Reviewed by: cem, emaste, vangyzen, dim Differential Revision: https://reviews.freebsd.org/D26817 Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h == --- head/sys/sys/cdefs.hSat Oct 24 23:21:27 2020(r367031) +++ head/sys/sys/cdefs.hSat Oct 24 23:21:31 2020(r367032) @@ -75,9 +75,9 @@ * having a compiler-agnostic source tree. */ -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#if defined(__GNUC__) -#if __GNUC__ >= 3 || defined(__INTEL_COMPILER) +#if __GNUC__ >= 3 #define__GNUCLIKE_ASM 3 #define__GNUCLIKE_MATH_BUILTIN_CONSTANTS #else @@ -87,15 +87,9 @@ #define__GNUCLIKE___OFFSETOF 1 #define__GNUCLIKE___SECTION 1 -#ifndef __INTEL_COMPILER #define__GNUCLIKE_CTOR_SECTION_HANDLING 1 -#endif #define__GNUCLIKE_BUILTIN_CONSTANT_P 1 -#if defined(__INTEL_COMPILER) && defined(__cplusplus) && \ - __INTEL_COMPILER < 800 -#undef __GNUCLIKE_BUILTIN_CONSTANT_P -#endif #if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) #define__GNUCLIKE_BUILTIN_VARARGS 1 @@ -114,10 +108,8 @@ #define__compiler_membar() __asm __volatile(" " : : : "memory") #endif -#ifndef __INTEL_COMPILER #define__GNUCLIKE_BUILTIN_NEXT_ARG 1 #define__GNUCLIKE_MATH_BUILTIN_RELOPS -#endif #define__GNUCLIKE_BUILTIN_MEMCPY 1 @@ -133,12 +125,12 @@ #define__CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 -#endif /* __GNUC__ || __INTEL_COMPILER */ +#endif /* __GNUC__ */ /* * Macro to test if we're using a specific version of gcc or later. */ -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +#if defined(__GNUC__) #define__GNUC_PREREQ__(ma, mi) \ (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)) #else @@ -212,18 +204,18 @@ * a feature that we cannot live without. */ #define__weak_symbol __attribute__((__weak__)) -#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) +#if !__GNUC_PREREQ__(2, 5) #define__dead2 #define__pure2 #define__unused #endif -#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER) +#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 #define__dead2 __attribute__((__noreturn__)) #define__pure2 __attribute__((__const__)) #define__unused /* XXX Find out what to do for __packed, __aligned and __section */ #endif -#if __GNUC_PREREQ__(2, 7) || defined(__INTEL_COMPILER) +#if __GNUC_PREREQ__(2, 7) #define__dead2 __attribute__((__noreturn__)) #define__pure2 __attribute__((__const__)) #define__unused__attribute__((__unused__)) @@ -360,7 +352,7 @@ #define__pure #endif -#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) +#if __GNUC_PREREQ__(3, 1) #define__always_inline __attribute__((__always_inline__)) #else #define__always_inline @@ -393,11 +385,11 @@ #endif /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ -#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) +#if !__GNUC_PREREQ__(2, 7) #define__func__NULL #endif -#if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 +#if (defined(__GNUC__) && __GNUC__ >= 2) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 #define__LONG_LONG_SUPPORTED #endif @@ -514,7 +506,7 @@ * that are known to support the features properly (old versions of gcc-2 * didn't permit keeping the keywords out of the application namespace). */ -#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) +#if !__GNUC_PREREQ__(2, 7) #define__printflike(fmtarg, firstvararg) #define__scanflike(fmtarg, firstvararg) #define__format_arg(fmtarg) @@ -534,18 +526,16 @@ /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 31 && \ -defined(__GNUC__) && !defined(__INTEL_COMPILER) +defined(__GNUC__) #define__printf0like(fmtarg, firstvararg) \ __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) #else #define__printf0like(fmtarg, fir
svn commit: r367033 - head/sys/cddl/dev/dtrace/riscv
Author: mhorne Date: Sat Oct 24 23:21:51 2020 New Revision: 367033 URL: https://svnweb.freebsd.org/changeset/base/367033 Log: Fix build after r367020 DTrace also relies on these definitions. Reported by: jenkins Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c == --- head/sys/cddl/dev/dtrace/riscv/dtrace_subr.cSat Oct 24 23:21:31 2020(r367032) +++ head/sys/cddl/dev/dtrace/riscv/dtrace_subr.cSat Oct 24 23:21:51 2020(r367033) @@ -202,9 +202,9 @@ dtrace_trap(struct trapframe *frame, u_int type) * All the rest will be handled in the usual way. */ switch (type) { - case EXCP_FAULT_LOAD: - case EXCP_FAULT_STORE: - case EXCP_FAULT_FETCH: + case SCAUSE_LOAD_ACCESS_FAULT: + case SCAUSE_STORE_ACCESS_FAULT: + case SCAUSE_INST_ACCESS_FAULT: /* Flag a bad address. */ cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; cpu_core[curcpu].cpuc_dtrace_illval = 0; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367034 - in head: sbin/fsck_ffs sys/ufs/ffs
Author: mckusick Date: Sun Oct 25 00:43:48 2020 New Revision: 367034 URL: https://svnweb.freebsd.org/changeset/base/367034 Log: Various new check-hash checks have been added to the UFS filesystem over various major releases. Superblock check hashes were added for the 12 release and cylinder-group and inode check hashes will appear in the 13 release. When a disk with a UFS filesystem is writably mounted, the kernel clears the feature flags for anything that it does not support. For example, if a UFS disk from a 12-stable kernel is mounted on an 11-stable system, the 11-stable kernel will clear the flag in the filesystem superblock that indicates that superblock check-hashs are being maintained. Thus if the disk is later moved back to a 12-stable system, the 12-stable system will know to ignore its incorrect check-hash. If the only filesystem modification done on the earlier kernel is to run a utility such as growfs(8) that modifies the superblock but neither updates the check-hash nor clears the feature flag indicating that it does not support the check-hash, the disk will fail to mount if it is moved back to its original newer kernel. This patch moves the code that clears the filesystem feature flags from the mount code (ffs_mountfs()) to the code that reads the superblock (ffs_sbget()). As ffs_sbget() is used by the kernel mount code and is imported into libufs(3), all the filesystem utilities will now also clear these flags when they make modifications to the filesystem. As suggested by John Baldwin, fsck_ffs(8) has been changed to accept and repair bad superblock check-hashes rather than refusing to run. This change allows fsck to recover filesystems that have been impacted by utilities older than those created after this change and is a sensible thing to do in any event. Reported by: John Baldwin (jhb@) MFC after:2 weeks Sponsored by: Netflix Modified: head/sbin/fsck_ffs/setup.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/fs.h Modified: head/sbin/fsck_ffs/setup.c == --- head/sbin/fsck_ffs/setup.c Sat Oct 24 23:21:51 2020(r367033) +++ head/sbin/fsck_ffs/setup.c Sun Oct 25 00:43:48 2020(r367034) @@ -330,7 +330,7 @@ readsb(int listerr) int bad, ret; struct fs *fs; - super = bflag ? bflag * dev_bsize : STDSB; + super = bflag ? bflag * dev_bsize : STDSB_NOHASHFAIL; readcnt[sblk.b_type]++; if ((ret = sbget(fsreadfd, &fs, super)) != 0) { switch (ret) { Modified: head/sys/ufs/ffs/ffs_subr.c == --- head/sys/ufs/ffs/ffs_subr.c Sat Oct 24 23:21:51 2020(r367033) +++ head/sys/ufs/ffs/ffs_subr.c Sun Oct 25 00:43:48 2020(r367034) @@ -165,15 +165,15 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsbloc fs = NULL; *fsp = NULL; - chkhash = 1; if (altsblock >= 0) { - if ((error = readsuper(devfd, &fs, altsblock, 1, chkhash, + if ((error = readsuper(devfd, &fs, altsblock, 1, 0, readfunc)) != 0) { if (fs != NULL) UFS_FREE(fs, filltype); return (error); } } else { + chkhash = 1; if (altsblock == STDSB_NOHASHFAIL) chkhash = 0; for (i = 0; sblock_try[i] != -1; i++) { @@ -277,6 +277,12 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo */ if ((fs->fs_flags & FS_METACKHASH) == 0) fs->fs_metackhash = 0; + /* +* Clear any check-hashes that are not maintained +* by this kernel. Also clear any unsupported flags. +*/ + fs->fs_metackhash &= CK_SUPPORTED; + fs->fs_flags &= FS_SUPPORTED; if (fs->fs_ckhash != (ckhash = ffs_calc_sbhash(fs))) { #ifdef _KERNEL res = uprintf("Superblock check-hash failed: recorded " Modified: head/sys/ufs/ffs/ffs_vfsops.c == --- head/sys/ufs/ffs/ffs_vfsops.c Sat Oct 24 23:21:51 2020 (r367033) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Oct 25 00:43:48 2020 (r367034) @@ -1070,10 +1070,6 @@ ffs_mountfs(odevvp, mp, td) loc = STDSB_NOHASHFAIL; if ((error = ffs_sbget(devvp, &fs, loc, M_UFSMNT, ffs_use_bread)) != 0) goto out; - /* none of these types of check-hashes are maintained by this kernel */ - fs->fs_metackhash &= ~(CK_INDIR | CK_DIR); - /* no support for any undefined flags */ - fs->fs_flags &= FS_SUPPORTED; fs->fs_flags &= ~F
Re: svn commit: r366993 - head/sys/net
On Sat, 24 Oct 2020 at 11:27, Warner Losh wrote: > >> Given we already have nice .clang-format, that does most of the job, maybe >> it's worth considering looking into tweaking it further to fix this part? >> It would be nice if we could finally offload all formatting issues to the >> tool and focus on the actual code :-) > > It would be nice if it produced one of the style(9) acceptable formats > without disrupting things already acceptable. That's been the big problem > with the tweaks to date... some things are fixed, others break. It's getting > a lot closer, though Upstream clang-format comes with a script that can integrate with git, adding a `git clang-format` command. It will apply formatting to modified lines, leaving unchanged ones alone. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367035 - in head/sbin: fsirand growfs tunefs
Author: mckusick Date: Sun Oct 25 01:36:33 2020 New Revision: 367035 URL: https://svnweb.freebsd.org/changeset/base/367035 Log: Filesystem utilities that modify the filesystem (growfs(8), tunefs(8), and fsirand(8)) should check the filesystem status and require that fsck(8) be run if it is unclean. This requirement is not imposed on fsdb(8) or clri(8) since they may be used to clean up a filesystem. MFC after:2 weeks Sponsored by: Netflix Modified: head/sbin/fsirand/fsirand.c head/sbin/growfs/growfs.c head/sbin/tunefs/tunefs.c Modified: head/sbin/fsirand/fsirand.c == --- head/sbin/fsirand/fsirand.c Sun Oct 25 00:43:48 2020(r367034) +++ head/sbin/fsirand/fsirand.c Sun Oct 25 01:36:33 2020(r367035) @@ -134,6 +134,12 @@ fsirand(char *device) return (1); } } + /* +* Check for unclean filesystem. +*/ + if (sblock->fs_clean == 0 || + (sblock->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) + errx(1, "%s is not clean - run fsck.\n", device); if (sblock->fs_magic == FS_UFS1_MAGIC && sblock->fs_old_inodefmt < FS_44INODEFMT) { Modified: head/sbin/growfs/growfs.c == --- head/sbin/growfs/growfs.c Sun Oct 25 00:43:48 2020(r367034) +++ head/sbin/growfs/growfs.c Sun Oct 25 01:36:33 2020(r367035) @@ -1460,6 +1460,12 @@ main(int argc, char **argv) errc(1, ret, "unable to read superblock"); } } + /* +* Check for unclean filesystem. +*/ + if (fs->fs_clean == 0 || + (fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) + errx(1, "%s is not clean - run fsck.\n", *argv); memcpy(&osblock, fs, fs->fs_sbsize); free(fs); memcpy((void *)&fsun1, (void *)&fsun2, osblock.fs_sbsize); Modified: head/sbin/tunefs/tunefs.c == --- head/sbin/tunefs/tunefs.c Sun Oct 25 00:43:48 2020(r367034) +++ head/sbin/tunefs/tunefs.c Sun Oct 25 01:36:33 2020(r367035) @@ -115,12 +115,12 @@ main(int argc, char *argv[]) switch (ch) { case 'A': - found_arg = 1; + found_arg++; Aflag++; break; case 'a': - found_arg = 1; + found_arg++; name = "POSIX.1e ACLs"; avalue = optarg; if (strcmp(avalue, "enable") && @@ -132,7 +132,7 @@ main(int argc, char *argv[]) break; case 'e': - found_arg = 1; + found_arg++; name = "maximum blocks per file in a cylinder group"; evalue = atoi(optarg); if (evalue < 1) @@ -142,7 +142,7 @@ main(int argc, char *argv[]) break; case 'f': - found_arg = 1; + found_arg++; name = "average file size"; fvalue = atoi(optarg); if (fvalue < 1) @@ -152,7 +152,7 @@ main(int argc, char *argv[]) break; case 'j': - found_arg = 1; + found_arg++; name = "softdep journaled file system"; jvalue = optarg; if (strcmp(jvalue, "enable") && @@ -164,7 +164,7 @@ main(int argc, char *argv[]) break; case 'J': - found_arg = 1; + found_arg++; name = "gjournaled file system"; Jvalue = optarg; if (strcmp(Jvalue, "enable") && @@ -176,7 +176,7 @@ main(int argc, char *argv[]) break; case 'k': - found_arg = 1; + found_arg++; name = "space to hold for metadata blocks"; kvalue = atoi(optarg); if (kvalue < 0) @@ -185,7 +185,7 @@ main(int argc, char *argv[]) break; case 'L': - found_arg = 1; + found_arg++; name = "volume label"; Lvalue = optarg; i = -1; @@ -205,7 +205,7 @@ main(int argc, char *argv[]) break; case 'l': - found_arg = 1; + found_arg++;
Re: svn commit: r366993 - head/sys/net
On Sat, Oct 24, 2020 at 7:20 PM Ed Maste wrote: > On Sat, 24 Oct 2020 at 11:27, Warner Losh wrote: > > > >> Given we already have nice .clang-format, that does most of the job, > maybe it's worth considering looking into tweaking it further to fix this > part? > >> It would be nice if we could finally offload all formatting issues to > the tool and focus on the actual code :-) > > > > It would be nice if it produced one of the style(9) acceptable formats > without disrupting things already acceptable. That's been the big problem > with the tweaks to date... some things are fixed, others break. It's > getting a lot closer, though > > Upstream clang-format comes with a script that can integrate with git, > adding a `git clang-format` command. It will apply formatting to > modified lines, leaving unchanged ones alone. > As long as it's optional... Warner ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366962 - in head: include usr.bin/calendar
[ Charset UTF-8 unsupported, converting... ] > Author: se > Date: Fri Oct 23 09:22:23 2020 > New Revision: 366962 > URL: https://svnweb.freebsd.org/changeset/base/366962 > > Log: > Add search of LOCALBASE/share/calendar for calendars supplied by a port. > > Calendar files in LOCALBASE override similarily named ones in the base > system. This could easily be changed if the base system calendars should > have precedence, but it could lead to a violation of POLA since then the > port's files were ignored unless those in base have been deleted. > > There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses > of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease > a consistent modification of this prefix. > > Reviewed by:imp, pfg > Differential Revision: https://reviews.freebsd.org/D26882 > > Modified: > head/include/paths.h > head/usr.bin/calendar/io.c > head/usr.bin/calendar/pathnames.h > > Modified: head/include/paths.h > == > --- head/include/paths.h Fri Oct 23 08:44:53 2020(r366961) > +++ head/include/paths.h Fri Oct 23 09:22:23 2020(r366962) > @@ -37,8 +37,11 @@ > > #include > > +#define _PATH_LOCALBASE "/usr/local" > + Something feels very wrong about this becoming a defined path in base, it is further dependence on /usr/local which in the early days we spent a great deal of time removing. I believe the whole ports system allows this to be something other than /usr/local. Package should also allow it to be some other place. > /* Default search path. */ > -#define _PATH_DEFPATH > "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" > +#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:" \ > + _PATH_LOCALBASE "/sbin:" _PATH_LOCALBASE "/bin" > /* All standard utilities path. */ > #define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" > /* Locate system binaries. */ > > Modified: head/usr.bin/calendar/io.c > == > --- head/usr.bin/calendar/io.cFri Oct 23 08:44:53 2020 > (r366961) > +++ head/usr.bin/calendar/io.cFri Oct 23 09:22:23 2020 > (r366962) > @@ -71,7 +71,7 @@ enum { > }; > > const char *calendarFile = "calendar"; /* default calendar file */ > -static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ > +static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE_LOCAL, > _PATH_INCLUDE}; /* HOME */ > static const char *calendarNoMail = "nomail";/* don't sent mail if file > exist */ > > static char path[MAXPATHLEN]; > > Modified: head/usr.bin/calendar/pathnames.h > == > --- head/usr.bin/calendar/pathnames.h Fri Oct 23 08:44:53 2020 > (r366961) > +++ head/usr.bin/calendar/pathnames.h Fri Oct 23 09:22:23 2020 > (r366962) > @@ -35,3 +35,4 @@ > #include > > #define _PATH_INCLUDE "/usr/share/calendar" > +#define _PATH_INCLUDE_LOCAL _PATH_LOCALBASE "/share/calendar" > -- Rod Grimes rgri...@freebsd.org ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366962 - in head: include usr.bin/calendar
On Sat, Oct 24, 2020 at 8:51 PM Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: se > > Date: Fri Oct 23 09:22:23 2020 > > New Revision: 366962 > > URL: https://svnweb.freebsd.org/changeset/base/366962 > > > > Log: > > Add search of LOCALBASE/share/calendar for calendars supplied by a > port. > > > > Calendar files in LOCALBASE override similarily named ones in the base > > system. This could easily be changed if the base system calendars > should > > have precedence, but it could lead to a violation of POLA since then > the > > port's files were ignored unless those in base have been deleted. > > > > There was no definition of _PATH_LOCALBASE in paths.h, but verbatim > uses > > of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to > ease > > a consistent modification of this prefix. > > > > Reviewed by:imp, pfg > > Differential Revision: https://reviews.freebsd.org/D26882 > > > > Modified: > > head/include/paths.h > > head/usr.bin/calendar/io.c > > head/usr.bin/calendar/pathnames.h > > > > Modified: head/include/paths.h > > > == > > --- head/include/paths.h Fri Oct 23 08:44:53 2020(r366961) > > +++ head/include/paths.h Fri Oct 23 09:22:23 2020(r366962) > > @@ -37,8 +37,11 @@ > > > > #include > > > > +#define _PATH_LOCALBASE "/usr/local" > > + > > Something feels very wrong about this becoming a defined path in base, > it is further dependence on /usr/local which in the early days we spent > a great deal of time removing. > > I believe the whole ports system allows this to be something other > than /usr/local. Package should also allow it to be some other place. > This removes a couple of instances of /usr/local being hardcoded and replaces with a define, so net it's better. It could be even better, but this is slightly better than it was before. Warner > > /* Default search path. */ > > -#define _PATH_DEFPATH > "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" > > +#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:" \ > > + _PATH_LOCALBASE "/sbin:" _PATH_LOCALBASE "/bin" > > /* All standard utilities path. */ > > #define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" > > /* Locate system binaries. */ > > > > Modified: head/usr.bin/calendar/io.c > > > == > > --- head/usr.bin/calendar/io.cFri Oct 23 08:44:53 2020 > (r366961) > > +++ head/usr.bin/calendar/io.cFri Oct 23 09:22:23 2020 > (r366962) > > @@ -71,7 +71,7 @@ enum { > > }; > > > > const char *calendarFile = "calendar"; /* default calendar file */ > > -static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* > HOME */ > > +static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE_LOCAL, > _PATH_INCLUDE}; /* HOME */ > > static const char *calendarNoMail = "nomail";/* don't sent mail if file > exist */ > > > > static char path[MAXPATHLEN]; > > > > Modified: head/usr.bin/calendar/pathnames.h > > > == > > --- head/usr.bin/calendar/pathnames.h Fri Oct 23 08:44:53 2020 > (r366961) > > +++ head/usr.bin/calendar/pathnames.h Fri Oct 23 09:22:23 2020 > (r366962) > > @@ -35,3 +35,4 @@ > > #include > > > > #define _PATH_INCLUDE "/usr/share/calendar" > > +#define _PATH_INCLUDE_LOCAL _PATH_LOCALBASE "/share/calendar" > > > > -- > Rod Grimes > rgri...@freebsd.org > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366962 - in head: include usr.bin/calendar
> On Sat, Oct 24, 2020 at 8:51 PM Rodney W. Grimes > wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > > Author: se > > > Date: Fri Oct 23 09:22:23 2020 > > > New Revision: 366962 > > > URL: https://svnweb.freebsd.org/changeset/base/366962 > > > > > > Log: > > > Add search of LOCALBASE/share/calendar for calendars supplied by a > > port. > > > > > > Calendar files in LOCALBASE override similarily named ones in the base > > > system. This could easily be changed if the base system calendars > > should > > > have precedence, but it could lead to a violation of POLA since then > > the > > > port's files were ignored unless those in base have been deleted. > > > > > > There was no definition of _PATH_LOCALBASE in paths.h, but verbatim > > uses > > > of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to > > ease > > > a consistent modification of this prefix. > > > > > > Reviewed by:imp, pfg > > > Differential Revision: https://reviews.freebsd.org/D26882 > > > > > > Modified: > > > head/include/paths.h > > > head/usr.bin/calendar/io.c > > > head/usr.bin/calendar/pathnames.h > > > > > > Modified: head/include/paths.h > > > > > == > > > --- head/include/paths.h Fri Oct 23 08:44:53 2020(r366961) > > > +++ head/include/paths.h Fri Oct 23 09:22:23 2020(r366962) > > > @@ -37,8 +37,11 @@ > > > > > > #include > > > > > > +#define _PATH_LOCALBASE "/usr/local" > > > + > > > > Something feels very wrong about this becoming a defined path in base, > > it is further dependence on /usr/local which in the early days we spent > > a great deal of time removing. > > > > I believe the whole ports system allows this to be something other > > than /usr/local. Package should also allow it to be some other place. > > > > This removes a couple of instances of /usr/local being hardcoded and > replaces with a define, so net it's better. No, its net worse as it now creates a define that is highly likely to propogate adding additional dependencies on this value. > > It could be even better, but this is slightly better than it was before. I disagree, as it is now easier for additional contamination of the base system. > Warner > > > > > /* Default search path. */ > > > -#define _PATH_DEFPATH > > "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" > > > +#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:" \ > > > + _PATH_LOCALBASE "/sbin:" _PATH_LOCALBASE "/bin" > > > /* All standard utilities path. */ > > > #define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" > > > /* Locate system binaries. */ > > > > > > Modified: head/usr.bin/calendar/io.c > > > > > == > > > --- head/usr.bin/calendar/io.cFri Oct 23 08:44:53 2020 > > (r366961) > > > +++ head/usr.bin/calendar/io.cFri Oct 23 09:22:23 2020 > > (r366962) > > > @@ -71,7 +71,7 @@ enum { > > > }; > > > > > > const char *calendarFile = "calendar"; /* default calendar file */ > > > -static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* > > HOME */ > > > +static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE_LOCAL, > > _PATH_INCLUDE}; /* HOME */ > > > static const char *calendarNoMail = "nomail";/* don't sent mail if file > > exist */ > > > > > > static char path[MAXPATHLEN]; > > > > > > Modified: head/usr.bin/calendar/pathnames.h > > > > > == > > > --- head/usr.bin/calendar/pathnames.h Fri Oct 23 08:44:53 2020 > > (r366961) > > > +++ head/usr.bin/calendar/pathnames.h Fri Oct 23 09:22:23 2020 > > (r366962) > > > @@ -35,3 +35,4 @@ > > > #include > > > > > > #define _PATH_INCLUDE "/usr/share/calendar" > > > +#define _PATH_INCLUDE_LOCAL _PATH_LOCALBASE "/share/calendar" > > > > > > > -- > > Rod Grimes > > rgri...@freebsd.org > > -- Rod Grimes rgri...@freebsd.org ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366962 - in head: include usr.bin/calendar
> On Oct 24, 2020, at 9:46 PM, Rodney W. Grimes > wrote: > >>> >>> Something feels very wrong about this becoming a defined path in base, >>> it is further dependence on /usr/local which in the early days we spent >>> a great deal of time removing. >>> >>> I believe the whole ports system allows this to be something other >>> than /usr/local. Package should also allow it to be some other place. >>> >> >> This removes a couple of instances of /usr/local being hardcoded and >> replaces with a define, so net it's better. > > No, its net worse as it now creates a define that is highly likely > to propogate adding additional dependencies on this value. > You said a bunch of words, but I have no idea what you are trying to accomplish or what action can be taken. >> >> It could be even better, but this is slightly better than it was before. > > I disagree, as it is now easier for additional contamination of > the base system. > Disagreement without action is a waste of time. Stefan proposed this change several days ago to the arch mailing list, and I view it as a good first step to the end goal of making the cal system more flexible and less dependent on a data source that’s fixed in place. It’ll likely evolve more over time, as software projects do. Simply arguing that you disagree with it or with the people involved doesn’t help this process. Please consider ways to be more productive in your communication. As with others recently, you are coming across as being obstructing as disagreeable. Scott ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366962 - in head: include usr.bin/calendar
On Sat, Oct 24, 2020 at 04:37:45PM +0200, Stefan Esser wrote: > Am 24.10.20 um 09:48 schrieb Alex Kozlov: > > On Fri, Oct 23, 2020 at 09:22:23AM +, Stefan Eßer wrote: > > > Author: se > > > Date: Fri Oct 23 09:22:23 2020 > > > New Revision: 366962 > > > URL: https://svnweb.freebsd.org/changeset/base/366962 > > > > > > Log: > > >Add search of LOCALBASE/share/calendar for calendars supplied by a > > > port. > > >Calendar files in LOCALBASE override similarily named ones in the base > > >system. This could easily be changed if the base system calendars > > > should > > >have precedence, but it could lead to a violation of POLA since then > > > the > > >port's files were ignored unless those in base have been deleted. > > >There was no definition of _PATH_LOCALBASE in paths.h, but verbatim > > > uses > > >of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to > > > ease > > >a consistent modification of this prefix. > > You are hardcoding assumption that LOCALBASE = /usr/local. Please make it > > overridable with LOCALBASE environment variable. > This was a trivial change to get us going with calendars provided by > a port (which has not been committed, yet - therefore there are no > port-provided calendars, neither under /usr/local nor under any other > PREFIX, as of now). > I understand what you are asking for, but in such a case I'd rather > think you want to rebuild FreeBSD with _PATH_LOCALBASE modified in > paths.h. The PREFIX != LOCALBASE and both != /usr/local configurations are supported in the ports tree and the base for a long time, please see https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/porting-prefix.html If after this commit you need to rebuild base to use non-default LOCALBASE/PREFIX it is pretty big regression and POLA. > And I have made this a single instance that needs to be changed. > Before my change there were 2 instances of /usr/local hard-coded > in _PATH_DEFPATH - now you have to only change the definition of > _PATH_LOCALBASE to adjust all 3 locations that use it. I think you made situation worse, there were two stray hardcoded string and now there is official LOCALBASE define which likely will be used by other people in the future. > If you can show me precedence of a LOCALBASE environment variable > being used in the way you suggest, I'd be willing to make calendar > use it. Just an analogy from LOCALBASE make variable, perhaps CALENDAR_HOME is a better name. > But then I think a CALENDAR_HOME variable would be even more useful, > since it would allow to search an additional user selected directory > (and not just share/calendar within what you provide as LOCALBASE). > > Regards, STefan > > PS: If you are a source committer, you might even commit such a > change yourself. But I'd think it should be reviewed, and it > might be a good idea to wait until other changes (e.g. the > switch-over to port-supplied calendar files) have been worked > out. -- Alex ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"