svn commit: r306306 - head/sys/kern
Author: julian Date: Sat Sep 24 22:56:13 2016 New Revision: 306306 URL: https://svnweb.freebsd.org/changeset/base/306306 Log: Give the user a clue as to which process hit maxfiles. MFC after:1 week Sponsored by: Panzura Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.cSat Sep 24 21:40:24 2016 (r306305) +++ head/sys/kern/kern_descrip.cSat Sep 24 22:56:13 2016 (r306306) @@ -1761,8 +1761,8 @@ falloc_noinstall(struct thread *td, stru priv_check(td, PRIV_MAXFILES) != 0) || openfiles >= maxfiles) { if (ppsratecheck(&lastfail, &curfail, 1)) { - printf("kern.maxfiles limit exceeded by uid %i, " - "please see tuning(7).\n", td->td_ucred->cr_ruid); + printf("kern.maxfiles limit exceeded by uid %i, (%s) " + "please see tuning(7).\n", td->td_ucred->cr_ruid, td->td_proc->p_comm); } return (ENFILE); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306305 - head/sys/netinet6
Author: markj Date: Sat Sep 24 21:40:24 2016 New Revision: 306305 URL: https://svnweb.freebsd.org/changeset/base/306305 Log: Convert checks in nd6_dad_start() and nd6_dad_timer() to assertions. In particular, these functions can assume they are operating on tentative addresses. MFC after:2 weeks Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c == --- head/sys/netinet6/nd6_nbr.c Sat Sep 24 21:40:14 2016(r306304) +++ head/sys/netinet6/nd6_nbr.c Sat Sep 24 21:40:24 2016(r306305) @@ -1217,40 +1217,26 @@ nd6_dad_start(struct ifaddr *ifa, int de struct dadq *dp; char ip6buf[INET6_ADDRSTRLEN]; + KASSERT((ia->ia6_flags & IN6_IFF_TENTATIVE) != 0, + ("starting DAD on non-tentative address %p", ifa)); + /* * If we don't need DAD, don't do it. * There are several cases: -* - DAD is disabled (ip6_dad_count == 0) +* - DAD is disabled globally or on the interface * - the interface address is anycast */ - if (!(ia->ia6_flags & IN6_IFF_TENTATIVE)) { - log(LOG_DEBUG, - "nd6_dad_start: called with non-tentative address " - "%s(%s)\n", - ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), - ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???"); - return; - } - if (ia->ia6_flags & IN6_IFF_ANYCAST) { - ia->ia6_flags &= ~IN6_IFF_TENTATIVE; - return; - } - if (!V_ip6_dad_count) { - ia->ia6_flags &= ~IN6_IFF_TENTATIVE; - return; - } - if (ifa->ifa_ifp == NULL) - panic("nd6_dad_start: ifa->ifa_ifp == NULL"); - if (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_NO_DAD) { + if ((ia->ia6_flags & IN6_IFF_ANYCAST) != 0 || + V_ip6_dad_count == 0 || + (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_NO_DAD) != 0) { ia->ia6_flags &= ~IN6_IFF_TENTATIVE; return; } - if (!(ifa->ifa_ifp->if_flags & IFF_UP) || - !(ifa->ifa_ifp->if_drv_flags & IFF_DRV_RUNNING) || - (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_IFDISABLED)) { - ia->ia6_flags |= IN6_IFF_TENTATIVE; + if ((ifa->ifa_ifp->if_flags & IFF_UP) == 0 || + (ifa->ifa_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_IFDISABLED) != 0) return; - } + if ((dp = nd6_dad_find(ifa, NULL)) != NULL) { /* * DAD is already in progress. Let the existing entry @@ -1329,11 +1315,10 @@ nd6_dad_timer(struct dadq *dp) struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; char ip6buf[INET6_ADDRSTRLEN]; - /* Sanity check */ - if (ia == NULL) { - log(LOG_ERR, "nd6_dad_timer: called with null parameter\n"); - goto err; - } + KASSERT(ia != NULL, ("DAD entry %p with no address", dp)); + KASSERT((ia->ia6_flags & IN6_IFF_TENTATIVE) != 0, + ("DAD entry %p for non-tentative address", dp)); + if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) { /* Do not need DAD for ifdisabled interface. */ log(LOG_ERR, "nd6_dad_timer: cancel DAD on %s because of " @@ -1347,13 +1332,6 @@ nd6_dad_timer(struct dadq *dp) ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???"); goto err; } - if ((ia->ia6_flags & IN6_IFF_TENTATIVE) == 0) { - log(LOG_ERR, "nd6_dad_timer: called with non-tentative address " - "%s(%s)\n", - ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), - ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???"); - goto err; - } /* Stop DAD if the interface is down even after dad_maxtry attempts. */ if ((dp->dad_ns_tcount > V_dad_maxtry) && ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306304 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/intel/dtrace cddl/contrib/opensolaris/uts/powerpc/dtrace conf modules/openso...
Author: markj Date: Sat Sep 24 21:40:14 2016 New Revision: 306304 URL: https://svnweb.freebsd.org/changeset/base/306304 Log: Move implementations of uread() and uwrite() to the illumos compat layer. MFC after:1 week Added: head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c (contents, props changed) Modified: head/sys/cddl/compat/opensolaris/sys/proc.h head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c head/sys/conf/files head/sys/modules/opensolaris/Makefile Added: head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_proc.cSat Sep 24 21:40:14 2016(r306304) @@ -0,0 +1,57 @@ +/*- + * Copyright 2016 Mark Johnston + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +int +uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) +{ + ssize_t n; + + PHOLD(p); + n = proc_readmem(curthread, p, uaddr, kaddr, len); + PRELE(p); + if (n != len) + return (ENOMEM); + return (0); +} + +int +uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) +{ + ssize_t n; + + PHOLD(p); + n = proc_writemem(curthread, p, uaddr, kaddr, len); + PRELE(p); + if (n != len) + return (ENOMEM); + return (0); +} Modified: head/sys/cddl/compat/opensolaris/sys/proc.h == --- head/sys/cddl/compat/opensolaris/sys/proc.h Sat Sep 24 20:58:59 2016 (r306303) +++ head/sys/cddl/compat/opensolaris/sys/proc.h Sat Sep 24 21:40:14 2016 (r306304) @@ -92,6 +92,9 @@ do_thread_create(caddr_t stk, size_t stk do_thread_create(stk, stksize, proc, arg, len, pp, state, pri) #definethread_exit() kthread_exit() +inturead(proc_t *, void *, size_t, uintptr_t); +intuwrite(proc_t *, void *, size_t, uintptr_t); + #endif /* _KERNEL */ #endif /* _OPENSOLARIS_SYS_PROC_H_ */ Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c == --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Sep 24 20:58:59 2016(r306303) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Sep 24 21:40:14 2016(r306304) @@ -59,34 +59,8 @@ #include #else #include - -static int -uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) -{ - ssize_t n; - - PHOLD(p); - n = proc_readmem(curthread, p, uaddr, kaddr, len); - PRELE(p); - if (n != len) - return (ENOMEM); - return (0); -} - -static int -uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) -{ - ssize_t n; - - PHOLD(p); - n = proc_writemem(curthread, p, uaddr, kaddr, len); - PRELE(p); - if (n != len) - return (ENOMEM); - return (0); -} - #endif /* illumos */ + #ifdef __i386__ #definer_rax r_eax #definer_rbx r_ebx Modified: head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c == --- head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Sat Sep 24 20:58:59 2016(r306303) +++ head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Sat Sep 24 21:40:14 2016(r306304) @@
Re: svn commit: r306282 - head/sys/compat/cloudabi
2016-09-24 1:08 GMT+02:00 Mateusz Guzik : > Log: > cloudabi: use fget_cap instead of hand-rolling capability read Thank you! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r305353 - in head/sys/boot: i386 i386/boot0 i386/boot2 i386/btx/btx i386/btx/btxldr i386/cdboot i386/gptboot i386/gptzfsboot i386/mbr i386/pmbr i386/pxeldr i386/zfsboot pc98 pc98/boot0
On Fri, Sep 23, 2016 at 4:17 PM, Allan Jude wrote: > On 09/03/16 11:26 AM, Warner Losh wrote: >> Author: imp >> Date: Sat Sep 3 15:26:28 2016 >> New Revision: 305353 >> URL: https://svnweb.freebsd.org/changeset/base/305353 >> >> Log: >> Don't use -N to set the OMAGIC with data and text writeable and data >> not page aligned. To do this, use the ld script gnu ld installs on my >> system. >> >> This is imperfect: LDFLAGS_BIN and LD_FLAGS_BIN describe different >> things. The loader script could be better named and take into account >> other architectures. And having two different mechanisms to do >> basically the same thing needs study. However, it's blocking forward >> progress on lld, so I'll work in parallel to sort these out. >> >> Differential Revision: https://reviews.freebsd.org/D7409 >> Reviewed by: emaste >> > > This breaks booting on my Lenovo laptop. The BTX client crashes and > dumps the registers. > > Reverting this commit solved it. > > Is there something I can do to help investigate this? I assume you bisected all boot loader changes and it fails across this commit? If not, that's the first step. If so, perhaps the place to start is with the dump? Warner ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306301 - head/sys/dev/cxgbe
Author: np Date: Sat Sep 24 19:03:05 2016 New Revision: 306301 URL: https://svnweb.freebsd.org/changeset/base/306301 Log: cxgbe(4): Use the port's top speed to figure out whether it is "high speed" or not (for the purpose of calculating the number of queues etc.) This does the right thing for 25Gbps and 100Gbps ports. Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_vf.c Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cSat Sep 24 17:50:11 2016 (r306300) +++ head/sys/dev/cxgbe/t4_main.cSat Sep 24 19:03:05 2016 (r306301) @@ -970,7 +970,7 @@ t4_attach(device_t dev) pi->tc = malloc(sizeof(struct tx_sched_class) * sc->chip_params->nsched_cls, M_CXGBE, M_ZERO | M_WAITOK); - if (is_10G_port(pi) || is_40G_port(pi)) { + if (port_top_speed(pi) >= 10) { n10g++; } else { n1g++; @@ -1086,7 +1086,7 @@ t4_attach(device_t dev) vi->first_rxq = rqidx; vi->first_txq = tqidx; - if (is_10G_port(pi) || is_40G_port(pi)) { + if (port_top_speed(pi) >= 10) { vi->tmr_idx = t4_tmr_idx_10g; vi->pktc_idx = t4_pktc_idx_10g; vi->flags |= iaq.intr_flags_10g & INTR_RXQ; @@ -1110,7 +1110,7 @@ t4_attach(device_t dev) #ifdef TCP_OFFLOAD vi->first_ofld_rxq = ofld_rqidx; vi->first_ofld_txq = ofld_tqidx; - if (is_10G_port(pi) || is_40G_port(pi)) { + if (port_top_speed(pi) >= 10) { vi->flags |= iaq.intr_flags_10g & INTR_OFLD_RXQ; vi->nofldrxq = j == 0 ? iaq.nofldrxq10g : iaq.nofldrxq_vi; Modified: head/sys/dev/cxgbe/t4_vf.c == --- head/sys/dev/cxgbe/t4_vf.c Sat Sep 24 17:50:11 2016(r306300) +++ head/sys/dev/cxgbe/t4_vf.c Sat Sep 24 19:03:05 2016(r306301) @@ -662,7 +662,7 @@ t4vf_attach(device_t dev) pi->tc = malloc(sizeof(struct tx_sched_class) * sc->chip_params->nsched_cls, M_CXGBE, M_ZERO | M_WAITOK); - if (is_10G_port(pi) || is_40G_port(pi)) { + if (port_top_speed(pi) >= 10) { n10g++; } else { n1g++; @@ -729,7 +729,7 @@ t4vf_attach(device_t dev) vi->first_rxq = rqidx; vi->first_txq = tqidx; - if (is_10G_port(pi) || is_40G_port(pi)) { + if (port_top_speed(pi) >= 10) { vi->tmr_idx = t4_tmr_idx_10g; vi->pktc_idx = t4_pktc_idx_10g; vi->flags |= iaq.intr_flags_10g & INTR_RXQ; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306300 - head/contrib/ofed/usr.lib/libsdp
Author: marcel Date: Sat Sep 24 17:50:11 2016 New Revision: 306300 URL: https://svnweb.freebsd.org/changeset/base/306300 Log: When MAKEOBJDIRPREFIX points to a case-insensitive file system, the build can break when different source files create the same target files (case-insensitivity speaking). This is the case for object files compiled with -fpic and shared libraries. The former uses an extension of ".So", and the latter an extension ".so". Rename shared object files from *.So to *.pico to match what NetBSD does. Missed in r306297 MFC after:1 month Sponsored by: Bracket Computing Differential Revision:https://reviews.freebsd.org/D7906 Modified: head/contrib/ofed/usr.lib/libsdp/Makefile Modified: head/contrib/ofed/usr.lib/libsdp/Makefile == --- head/contrib/ofed/usr.lib/libsdp/Makefile Sat Sep 24 17:29:27 2016 (r306299) +++ head/contrib/ofed/usr.lib/libsdp/Makefile Sat Sep 24 17:50:11 2016 (r306300) @@ -22,4 +22,4 @@ CFLAGS+= -I${OFEDSYS}/include # Remove .[ly] since the checked-in version is preferred. .SUFFIXES: -.SUFFIXES: .o .po .So .c .ln +.SUFFIXES: .o .po .pico .c .ln ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306299 - head/usr.bin/mkimg
Author: marcel Date: Sat Sep 24 17:29:27 2016 New Revision: 306299 URL: https://svnweb.freebsd.org/changeset/base/306299 Log: Update local variable 'block' after calling capacity_resize(), otherwise format_resize(), which is called right after, isn't getting the current/actual image size. Rather than rounding up, format_resize() could end up truncating the size and we don't allow that by design. MFC after:1 week Modified: head/usr.bin/mkimg/mkimg.c Modified: head/usr.bin/mkimg/mkimg.c == --- head/usr.bin/mkimg/mkimg.c Sat Sep 24 16:46:37 2016(r306298) +++ head/usr.bin/mkimg/mkimg.c Sat Sep 24 17:29:27 2016(r306299) @@ -463,13 +463,16 @@ mkimg(void) block = scheme_metadata(SCHEME_META_IMG_END, block); error = image_set_size(block); - if (!error) + if (!error) { error = capacity_resize(block); - if (!error) + block = image_get_size(); + } + if (!error) { error = format_resize(block); + block = image_get_size(); + } if (error) errc(EX_IOERR, error, "image sizing"); - block = image_get_size(); ncyls = block / (nsecs * nheads); error = scheme_write(block); if (error) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306298 - in stable: 10/lib/libc/sys 11/lib/libc/sys
Author: badger Date: Sat Sep 24 16:46:37 2016 New Revision: 306298 URL: https://svnweb.freebsd.org/changeset/base/306298 Log: MFC r305956: Add manpage for rctl_* system calls Approved by: kib (mentor) Sponsored by: Dell Technologies Added: stable/10/lib/libc/sys/rctl_add_rule.2 - copied unchanged from r305956, head/lib/libc/sys/rctl_add_rule.2 Modified: stable/10/lib/libc/sys/Makefile.inc Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/11/lib/libc/sys/rctl_add_rule.2 - copied unchanged from r305956, head/lib/libc/sys/rctl_add_rule.2 Modified: stable/11/lib/libc/sys/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/10/lib/libc/sys/Makefile.inc == --- stable/10/lib/libc/sys/Makefile.inc Sat Sep 24 15:11:27 2016 (r306297) +++ stable/10/lib/libc/sys/Makefile.inc Sat Sep 24 16:46:37 2016 (r306298) @@ -259,6 +259,7 @@ MAN+= abort2.2 \ pselect.2 \ ptrace.2 \ quotactl.2 \ + rctl_add_rule.2 \ read.2 \ readlink.2 \ reboot.2 \ @@ -414,6 +415,10 @@ MLINKS+=pdfork.2 pdgetpid.2\ pdfork.2 pdwait4.2 MLINKS+=pipe.2 pipe2.2 MLINKS+=poll.2 ppoll.2 +MLINKS+=rctl_add_rule.2 rctl_get_limits.2 \ + rctl_add_rule.2 rctl_get_racct.2 \ + rctl_add_rule.2 rctl_get_rules.2 \ + rctl_add_rule.2 rctl_remove_rule.2 MLINKS+=read.2 pread.2 \ read.2 preadv.2 \ read.2 readv.2 Copied: stable/10/lib/libc/sys/rctl_add_rule.2 (from r305956, head/lib/libc/sys/rctl_add_rule.2) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/sys/rctl_add_rule.2 Sat Sep 24 16:46:37 2016 (r306298, copy of r305956, head/lib/libc/sys/rctl_add_rule.2) @@ -0,0 +1,220 @@ +.\" Copyright (c) 2016 Eric Badger +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 14, 2016 +.Dt RCTL_ADD_RULE 2 +.Os +.Sh NAME +.Nm rctl_add_rule, +.Nm rctl_get_limits +.Nm rctl_get_racct, +.Nm rctl_get_rules, +.Nm rctl_remove_rule +.Nd manipulate and query the resource limits database +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/rctl.h +.Ft int +.Fo rctl_add_rule +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_get_limits +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_get_racct +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_get_rules +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_remove_rule +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Sh DESCRIPTION +These system calls are used to manipulate and query the resource limits +database. +For all functions, +.Fa inbuflen +refers to the length of the buffer pointed to by +.Fa inbufp +and +.Fa outbuflen +refers to the length of the buffer pointed to by +.Fa outbufp . +.Pp +The +.Fn rctl_add_rule +function adds the rule pointed to by +.Fa inbufp +to the resource limits database. +The +.Fa outbufp +and +.Fa outbuflen +arguments are unused. +Rule format is as described in +.Xr rctl 8 , +with exceptions noted in the +.Sx RULES AND FILTERS +section. +.Pp +The +.Fn rctl_get_limits +function returns in +.Fa outbufp +a comma-separated list of rules that apply to the process that +matches the filter specified in +.Fa inbufp . +This in
svn commit: r306298 - in stable: 10/lib/libc/sys 11/lib/libc/sys
Author: badger Date: Sat Sep 24 16:46:37 2016 New Revision: 306298 URL: https://svnweb.freebsd.org/changeset/base/306298 Log: MFC r305956: Add manpage for rctl_* system calls Approved by: kib (mentor) Sponsored by: Dell Technologies Added: stable/11/lib/libc/sys/rctl_add_rule.2 - copied unchanged from r305956, head/lib/libc/sys/rctl_add_rule.2 Modified: stable/11/lib/libc/sys/Makefile.inc Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/10/lib/libc/sys/rctl_add_rule.2 - copied unchanged from r305956, head/lib/libc/sys/rctl_add_rule.2 Modified: stable/10/lib/libc/sys/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/11/lib/libc/sys/Makefile.inc == --- stable/11/lib/libc/sys/Makefile.inc Sat Sep 24 15:11:27 2016 (r306297) +++ stable/11/lib/libc/sys/Makefile.inc Sat Sep 24 16:46:37 2016 (r306298) @@ -249,6 +249,7 @@ MAN+= abort2.2 \ pselect.2 \ ptrace.2 \ quotactl.2 \ + rctl_add_rule.2 \ read.2 \ readlink.2 \ reboot.2 \ @@ -412,6 +413,10 @@ MLINKS+=pdfork.2 pdgetpid.2\ pdfork.2 pdwait4.2 MLINKS+=pipe.2 pipe2.2 MLINKS+=poll.2 ppoll.2 +MLINKS+=rctl_add_rule.2 rctl_get_limits.2 \ + rctl_add_rule.2 rctl_get_racct.2 \ + rctl_add_rule.2 rctl_get_rules.2 \ + rctl_add_rule.2 rctl_remove_rule.2 MLINKS+=read.2 pread.2 \ read.2 preadv.2 \ read.2 readv.2 Copied: stable/11/lib/libc/sys/rctl_add_rule.2 (from r305956, head/lib/libc/sys/rctl_add_rule.2) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/sys/rctl_add_rule.2 Sat Sep 24 16:46:37 2016 (r306298, copy of r305956, head/lib/libc/sys/rctl_add_rule.2) @@ -0,0 +1,220 @@ +.\" Copyright (c) 2016 Eric Badger +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 14, 2016 +.Dt RCTL_ADD_RULE 2 +.Os +.Sh NAME +.Nm rctl_add_rule, +.Nm rctl_get_limits +.Nm rctl_get_racct, +.Nm rctl_get_rules, +.Nm rctl_remove_rule +.Nd manipulate and query the resource limits database +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/rctl.h +.Ft int +.Fo rctl_add_rule +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_get_limits +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_get_racct +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_get_rules +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Ft int +.Fo rctl_remove_rule +.Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen" +.Fc +.Sh DESCRIPTION +These system calls are used to manipulate and query the resource limits +database. +For all functions, +.Fa inbuflen +refers to the length of the buffer pointed to by +.Fa inbufp +and +.Fa outbuflen +refers to the length of the buffer pointed to by +.Fa outbufp . +.Pp +The +.Fn rctl_add_rule +function adds the rule pointed to by +.Fa inbufp +to the resource limits database. +The +.Fa outbufp +and +.Fa outbuflen +arguments are unused. +Rule format is as described in +.Xr rctl 8 , +with exceptions noted in the +.Sx RULES AND FILTERS +section. +.Pp +The +.Fn rctl_get_limits +function returns in +.Fa outbufp +a comma-separated list of rules that apply to the process that +matches the filter specified in +.Fa inbufp . +This in
svn commit: r306297 - in head: gnu/lib/libgcc gnu/lib/libgcov lib/libedit lib/libprocstat lib/libthr/support share/mk sys/conf usr.sbin/bsnmpd/modules/snmp_hostres
Author: marcel Date: Sat Sep 24 15:11:27 2016 New Revision: 306297 URL: https://svnweb.freebsd.org/changeset/base/306297 Log: When MAKEOBJDIRPREFIX points to a case-insensitive file system, the build can break when different source files create the same target files (case-insensitivity speaking). This is the case for object files compiled with -fpic and shared libraries. The former uses an extension of ".So", and the latter an extension ".so". Rename shared object files from *.So to *.pico to match what NetBSD does. See also r305855 MFC after:1 month Sponsored by: Bracket Computing Differential Revision:https://reviews.freebsd.org/D7906 Modified: head/gnu/lib/libgcc/Makefile head/gnu/lib/libgcov/Makefile head/lib/libedit/Makefile head/lib/libprocstat/Makefile head/lib/libthr/support/Makefile.inc head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk head/share/mk/meta.autodep.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Modified: head/gnu/lib/libgcc/Makefile == --- head/gnu/lib/libgcc/MakefileSat Sep 24 13:44:18 2016 (r306296) +++ head/gnu/lib/libgcc/MakefileSat Sep 24 15:11:27 2016 (r306297) @@ -258,8 +258,8 @@ OBJ_GRPS += FPBIT DPBIT .for T in ${OBJ_GRPS} ${T}_OBJS_T = ${${T}_FUNCS:S/$/.o/} ${T}_OBJS_P = ${${T}_FUNCS:S/$/.po/} -${T}_OBJS_S = ${${T}_FUNCS:S/$/.So/} -SOBJS += ${${T}_FUNCS:S/$/.So/} +${T}_OBJS_S = ${${T}_FUNCS:S/$/.pico/} +SOBJS += ${${T}_FUNCS:S/$/.pico/} ${${T}_OBJS_T}: ${${T}_CFILE} ${COMMONHDRS} ${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c} @@ -274,7 +274,7 @@ ${${T}_OBJS_S}: ${${T}_CFILE} ${COMMONHD # Extra objects coming from separate files # .if !empty(LIB2ADD) -SOBJS += ${LIB2ADD:R:S/$/.So/} +SOBJS += ${LIB2ADD:R:S/$/.pico/} .endif #--- @@ -298,9 +298,9 @@ ${STAT_OBJS_P}: ${STD_CFILE} ${COMMONHDR .if defined(LIB1ASMSRC) ASM_T =${LIB1ASMFUNCS:S/$/.o/} ASM_P =${LIB1ASMFUNCS:S/$/.po/} -ASM_S =${LIB1ASMFUNCS:S/$/.So/} +ASM_S =${LIB1ASMFUNCS:S/$/.pico/} ASM_V =${LIB1ASMFUNCS:S/$/.vis/} -SOBJS += ${LIB1ASMFUNCS:S/$/.So/} +SOBJS += ${LIB1ASMFUNCS:S/$/.pico/} ${ASM_T}: ${LIB1ASMSRC} ${.PREFIX}.vis ${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \ @@ -327,7 +327,7 @@ CLEANFILES += ${ASM_V} ${ASM_V:R:S/$/.vo # EH_OBJS_T = ${LIB2ADDEHSTATIC:R:S/$/.o/} EH_OBJS_P = ${LIB2ADDEHSTATIC:R:S/$/.po/} -EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.So/} +EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.pico/} EH_CFLAGS = -fexceptions -D__GLIBC__=3 -DElfW=__ElfN .if ${TARGET_CPUARCH} != "riscv64" # RISCVTODO: unwinding support @@ -341,7 +341,7 @@ ${_src:R:S/$/.po/}: ${_src} ${COMMONHDRS ${CC_P} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} .endfor .for _src in ${LIB2ADDEHSHARED:M*.c} -${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS} +${_src:R:S/$/.pico/}: ${_src} ${COMMONHDRS} ${CC_S} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC} .endfor Modified: head/gnu/lib/libgcov/Makefile == --- head/gnu/lib/libgcov/Makefile Sat Sep 24 13:44:18 2016 (r306296) +++ head/gnu/lib/libgcov/Makefile Sat Sep 24 15:11:27 2016 (r306297) @@ -35,7 +35,7 @@ SYMS = _gcov _gcov_merge_add _gcov_merge OBJS= ${SYMS:S/$/.o/} OBJS_T=${SYMS:S/$/.o/} OBJS_P=${SYMS:S/$/.po/} -OBJS_S=${SYMS:S/$/.So/} +OBJS_S=${SYMS:S/$/.pico/} #--- # Modified: head/lib/libedit/Makefile == --- head/lib/libedit/Makefile Sat Sep 24 13:44:18 2016(r306296) +++ head/lib/libedit/Makefile Sat Sep 24 15:11:27 2016(r306297) @@ -76,7 +76,7 @@ historyn.c: makelist Makefile sh ${.CURDIR}/makelist -n history.c > ${.TARGET} # minimal dependency to make "make depend" optional -editline.o editline.po editline.So editline.ln:\ +editline.o editline.po editline.pico editline.ln: \ common.h emacs.h fcns.c fcns.h help.c help.h vi.h tc1.o: ${.CURDIR}/TEST/tc1.c Modified: head/lib/libprocstat/Makefile == --- head/lib/libprocstat/Makefile Sat Sep 24 13:44:18 2016 (r306296) +++ head/lib/libprocstat/Makefile Sat Sep 24 15:11:27 2016 (r306297) @@ -58,13 +58,13 @@ MLINKS+=libprocstat.3 procstat_close.3 \ .if ${MK_CDDL} != "no" CFLAGS+= -DLIBPROCSTAT_ZFS OBJS+= zfs/zfs.o -SOBJS+=zfs/zfs.So +SOBJS+=zfs/zfs.pico POBJS+=
svn commit: r306296 - stable/11/tools/tools/crypto
Author: gnn Date: Sat Sep 24 13:44:18 2016 New Revision: 306296 URL: https://svnweb.freebsd.org/changeset/base/306296 Log: MFC: 305066,305304,305312 Update cryptotest for modern algorithms Clean up the usage message and remove dead code. Add cpuset support to separate forked processes. Reviewed by:cem Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/tools/tools/crypto/cryptotest.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/tools/crypto/cryptotest.c == --- stable/11/tools/tools/crypto/cryptotest.c Sat Sep 24 13:23:47 2016 (r306295) +++ stable/11/tools/tools/crypto/cryptotest.c Sat Sep 24 13:44:18 2016 (r306296) @@ -84,6 +84,7 @@ */ #include +#include #include #include #include @@ -96,6 +97,7 @@ #include #include #include +#include #include #include @@ -126,12 +128,10 @@ struct alg { { "blf",0, 8, 5, 56, CRYPTO_BLF_CBC }, { "cast", 0, 8, 5, 16, CRYPTO_CAST_CBC }, { "skj",0, 8, 10, 10, CRYPTO_SKIPJACK_CBC }, - { "aes",0, 16, 16, 16, CRYPTO_RIJNDAEL128_CBC}, - { "aes192", 0, 16, 24, 24, CRYPTO_RIJNDAEL128_CBC}, - { "aes256", 0, 16, 32, 32, CRYPTO_RIJNDAEL128_CBC}, -#ifdef notdef - { "arc4", 0, 8, 1, 32, CRYPTO_ARC4 }, -#endif + { "rij",0, 16, 16, 16, CRYPTO_RIJNDAEL128_CBC}, + { "aes",0, 16, 16, 16, CRYPTO_AES_CBC}, + { "aes192", 0, 16, 24, 24, CRYPTO_AES_CBC}, + { "aes256", 0, 16, 32, 32, CRYPTO_AES_CBC}, { "md5",1, 8, 16, 16, CRYPTO_MD5_HMAC }, { "sha1", 1, 8, 20, 20, CRYPTO_SHA1_HMAC }, { "sha256", 1, 8, 32, 32, CRYPTO_SHA2_256_HMAC }, @@ -139,27 +139,29 @@ struct alg { { "sha512", 1, 8, 64, 64, CRYPTO_SHA2_512_HMAC }, }; -static void +void usage(const char* cmd) { printf("usage: %s [-czsbv] [-d dev] [-a algorithm] [count] [size ...]\n", cmd); printf("where algorithm is one of:\n"); - printf("des 3des (default) blowfish cast skipjack\n"); - printf("aes (aka rijndael) aes192 aes256 arc4\n"); + printf("null des 3des (default) blowfish cast skipjack rij\n"); + printf("aes aes192 aes256 md5 sha1 sha256 sha384 sha512\n"); printf("count is the number of encrypt/decrypt ops to do\n"); printf("size is the number of bytes of text to encrypt+decrypt\n"); printf("\n"); printf("-c check the results (slows timing)\n"); - printf("-d use specific device\n"); + printf("-d use specific device, specify 'soft' for testing software implementations\n"); + printf("\tNOTE: to use software you must set:\n\t sysctl kern.cryptodevallowsoft=1\n"); printf("-z run all available algorithms on a variety of sizes\n"); printf("-v be verbose\n"); printf("-b mark operations for batching\n"); printf("-p profile kernel crypto operation (must be root)\n"); + printf("-t n for n threads and run tests concurrently\n"); exit(-1); } -static struct alg* +struct alg* getalgbycode(int cipher) { int i; @@ -170,7 +172,7 @@ getalgbycode(int cipher) return NULL; } -static struct alg* +struct alg* getalgbyname(const char* name) { int i; @@ -181,10 +183,10 @@ getalgbyname(const char* name) return NULL; } -static int +int devcrypto(void) { - static int fd = -1; + int fd = -1; if (fd < 0) { fd = open(_PATH_DEV "crypto", O_RDWR, 0); @@ -196,11 +198,14 @@ devcrypto(void) return fd; } -static int +int crlookup(const char *devname) { struct crypt_find_op find; + if (strncmp(devname, "soft", 4) == 0) + return CRYPTO_FLAG_SOFTWARE; + find.crid = -1; strlcpy(find.name, devname, sizeof(find.name)); if (ioctl(devcrypto(), CIOCFINDDEV, &find) == -1) @@ -208,10 +213,10 @@ crlookup(const char *devname) return find.crid; } -static const char * +const char * crfind(int crid) { - static struct crypt_find_op find; + struct crypt_find_op find; bzero(&find, sizeof(find)); find.crid = crid; @@ -220,7 +225,7 @@ crfind(int crid) return find.name; } -static int +int crget(void) { int fd; @@ -232,7 +237,7 @@ crget(void) return fd; } -static char +char rdigit(void) { const char a[] = { @@ -242,7 +247,7 @@ rdigit(void) return 0x20+a[random()%nitems(a)]; } -static void +void runtest(struct alg *alg, int count, i
svn commit: r306295 - head/sys/dev/cxgbe
Author: np Date: Sat Sep 24 13:23:47 2016 New Revision: 306295 URL: https://svnweb.freebsd.org/changeset/base/306295 Log: cxgbe(4): Support SIOGIFXMEDIA so that ifconfig displays correct media for 25Gbps and 100Gbps ports. This should have been part of r305713, which is when the driver first started reporting extended media types. Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_tracer.c Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cSat Sep 24 10:34:35 2016 (r306294) +++ head/sys/dev/cxgbe/t4_main.cSat Sep 24 13:23:47 2016 (r306295) @@ -1737,6 +1737,7 @@ fail: case SIOCSIFMEDIA: case SIOCGIFMEDIA: + case SIOCGIFXMEDIA: ifmedia_ioctl(ifp, ifr, &vi->media, cmd); break; Modified: head/sys/dev/cxgbe/t4_tracer.c == --- head/sys/dev/cxgbe/t4_tracer.c Sat Sep 24 10:34:35 2016 (r306294) +++ head/sys/dev/cxgbe/t4_tracer.c Sat Sep 24 13:23:47 2016 (r306295) @@ -472,6 +472,7 @@ tracer_ioctl(struct ifnet *ifp, unsigned break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: + case SIOCGIFXMEDIA: sx_xlock(&t4_trace_lock); sc = ifp->if_softc; if (sc == NULL) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r306294 - stable/10/sys/compat/linux
On 24.09.2016 13:34, Dmitry Chagin wrote: > Author: dchagin > Date: Sat Sep 24 10:34:35 2016 > New Revision: 306294 > URL: https://svnweb.freebsd.org/changeset/base/306294 > > Log: > MFC r305896: > > Implement BLKSSZGET ioctl for the Linuxulator. Off topic: is there any chance to get linux ALSA working, at least its PulseAudio plugin? Currently linux PulseAudio itself works nice (transfering all sounds from remote machine to local), but linux ALSA PulseAudio plugin exits with thread assert error. The same things compiled natively (i.e. ALSA + PulseAudio plugin for FreeBSD) works nice. I mean this ALSA setup: pcm.!default { type pulse hint.description "PulseAudio" } ctl.!default { type pulse } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306294 - stable/10/sys/compat/linux
Author: dchagin Date: Sat Sep 24 10:34:35 2016 New Revision: 306294 URL: https://svnweb.freebsd.org/changeset/base/306294 Log: MFC r305896: Implement BLKSSZGET ioctl for the Linuxulator. PR: 212700 Modified: stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ioctl.c == --- stable/10/sys/compat/linux/linux_ioctl.cSat Sep 24 10:32:26 2016 (r306293) +++ stable/10/sys/compat/linux/linux_ioctl.cSat Sep 24 10:34:35 2016 (r306294) @@ -296,6 +296,15 @@ linux_ioctl_disk(struct thread *td, stru return (copyout(§orsize, (void *)args->arg, sizeof(sectorsize))); break; + case LINUX_BLKSSZGET: + error = fo_ioctl(fp, DIOCGSECTORSIZE, + (caddr_t)§orsize, td->td_ucred, td); + fdrop(fp, td); + if (error) + return (error); + return (copyout(§orsize, (void *)args->arg, + sizeof(sectorsize))); + break; } fdrop(fp, td); return (ENOIOCTL); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306293 - stable/11/sys/compat/linux
Author: dchagin Date: Sat Sep 24 10:32:26 2016 New Revision: 306293 URL: https://svnweb.freebsd.org/changeset/base/306293 Log: MFC r305896: Implement BLKSSZGET ioctl for the Linuxulator. PR: 212700 Modified: stable/11/sys/compat/linux/linux_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ioctl.c == --- stable/11/sys/compat/linux/linux_ioctl.cSat Sep 24 08:13:15 2016 (r306292) +++ stable/11/sys/compat/linux/linux_ioctl.cSat Sep 24 10:32:26 2016 (r306293) @@ -297,6 +297,15 @@ linux_ioctl_disk(struct thread *td, stru return (copyout(§orsize, (void *)args->arg, sizeof(sectorsize))); break; + case LINUX_BLKSSZGET: + error = fo_ioctl(fp, DIOCGSECTORSIZE, + (caddr_t)§orsize, td->td_ucred, td); + fdrop(fp, td); + if (error) + return (error); + return (copyout(§orsize, (void *)args->arg, + sizeof(sectorsize))); + break; } fdrop(fp, td); return (ENOIOCTL); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306292 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Sat Sep 24 08:13:15 2016 New Revision: 306292 URL: https://svnweb.freebsd.org/changeset/base/306292 Log: fix vnode lock assertion for extended attributes directory Background. In ZFS a file with extended attributes has a special directory associated with it where each extended attribute is a file. The attribute's name is a file name and its value is a file content. When the ownership of a file with extended attributes is changed, ZFS also changes ownership of the special directory. This is where the bug was hit. The bug was introduced in r209158. Nota bene. ZFS vnode locks are typically acquired before z_teardown_lock (i.e., before ZFS_ENTER). But this is not the case for the vnodes that represent the extended attribute directory and files. Those are always locked after ZFS_ENTER. This is confusing and fragile. PR: 212702 Reported by: Christian Fuss to FreeNAS Tested by:mav MFC after:1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Sep 24 07:59:54 2016(r306291) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Sep 24 08:13:15 2016(r306292) @@ -3197,6 +3197,11 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, i if (err == 0 && xattr_obj) { err = zfs_zget(zp->z_zfsvfs, xattr_obj, &attrzp); + if (err == 0) { + err = vn_lock(ZTOV(attrzp), LK_EXCLUSIVE); + if (err != 0) + vrele(ZTOV(attrzp)); + } if (err) goto out2; } @@ -3206,7 +3211,7 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, i if (new_uid != zp->z_uid && zfs_fuid_overquota(zfsvfs, B_FALSE, new_uid)) { if (attrzp) - vrele(ZTOV(attrzp)); + vput(ZTOV(attrzp)); err = SET_ERROR(EDQUOT); goto out2; } @@ -3218,7 +3223,7 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, i if (new_gid != zp->z_gid && zfs_fuid_overquota(zfsvfs, B_TRUE, new_gid)) { if (attrzp) - vrele(ZTOV(attrzp)); + vput(ZTOV(attrzp)); err = SET_ERROR(EDQUOT); goto out2; } @@ -3449,7 +3454,7 @@ out: } if (attrzp) - vrele(ZTOV(attrzp)); + vput(ZTOV(attrzp)); if (aclp) zfs_acl_free(aclp); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306291 - head/sys/dev/amdsbwd
Author: avg Date: Sat Sep 24 07:59:54 2016 New Revision: 306291 URL: https://svnweb.freebsd.org/changeset/base/306291 Log: the rest of changes intended to be committed in r306290 MFC after:5 days X-MFC with: r306218 Modified: head/sys/dev/amdsbwd/amd_chipset.h Modified: head/sys/dev/amdsbwd/amd_chipset.h == --- head/sys/dev/amdsbwd/amd_chipset.h Sat Sep 24 07:55:49 2016 (r306290) +++ head/sys/dev/amdsbwd/amd_chipset.h Sat Sep 24 07:59:54 2016 (r306291) @@ -40,10 +40,11 @@ * o SB8x0, SB9x0 southbridges where the SMBus controller device has a PCI * Device ID of 0x43851002 and a revision greater than or equal to 0x40 * o FCHs where the controller has an ID of 0x780b1022 and a revision less - * than 0x41 (various revisions of "Hudson" and "Bolton") + * than 0x41 (various variants of "Hudson" and "Bolton" as well as FCHs + * integrated into processors, e.g. "Kabini") * o FCHs where the controller has an ID of 0x790b1022 and a revision less * than 0x49 - * - several types of southbridges and FCHs: + * - several types of FCHs: * o FCHs where the SMBus controller device has a PCI Device ID of 0x780b1022 * and a revision greater than or equal to 0x41 (integrated into "Mullins" * processors, code named "ML") @@ -131,6 +132,8 @@ * SB600 RRG 2.3.1.1, * SB7xx RRG 2.3.1.1, * SB8xx RRG 2.3.1, + * BKDG for Family 15h Models 60h-6Fh 3.26.6.1, + * BKDG for Family 15h Models 70h-7Fh 3.26.6.1, * BKDG for Family 16h Models 00h-0Fh 3.26.7.1, * BKDG for Family 16h Models 30h-3Fh 3.26.7.1. * Also, see i2c-piix4 aka piix4_smbus Linux driver. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306290 - head/sys/dev/amdsbwd
Author: avg Date: Sat Sep 24 07:55:49 2016 New Revision: 306290 URL: https://svnweb.freebsd.org/changeset/base/306290 Log: clarify description of the 0x790b1022 / "KERNCZ"/ "CZ" device MFC after:5 days X-MFC with: r306218 Modified: head/sys/dev/amdsbwd/amd_chipset.h Modified: head/sys/dev/amdsbwd/amd_chipset.h == --- head/sys/dev/amdsbwd/amd_chipset.h Sat Sep 24 07:09:43 2016 (r306289) +++ head/sys/dev/amdsbwd/amd_chipset.h Sat Sep 24 07:55:49 2016 (r306290) @@ -36,18 +36,23 @@ * At present there are three classes of supported chipsets: * - SB600 and S7x0 southbridges where the SMBus controller device has * a PCI Device ID of 0x43851002 and a revision less than 0x40 - * - SB8x0, SB9x0 southbridges and FCHs where the SMBus controller device has - * a PCI Device ID of 0x43851002 and a revision greater than or equal to 0x40 - * or the controller has an ID of 0x780b1022 and a revision less than 0x41 - * - FCHs where the SMBus controller device has a PCI Device ID of 0x780b1022 - * and a revision greater than or equal to 0x41 + * - several types of southbridges and FCHs: + * o SB8x0, SB9x0 southbridges where the SMBus controller device has a PCI + * Device ID of 0x43851002 and a revision greater than or equal to 0x40 + * o FCHs where the controller has an ID of 0x780b1022 and a revision less + * than 0x41 (various revisions of "Hudson" and "Bolton") + * o FCHs where the controller has an ID of 0x790b1022 and a revision less + * than 0x49 + * - several types of southbridges and FCHs: + * o FCHs where the SMBus controller device has a PCI Device ID of 0x780b1022 + * and a revision greater than or equal to 0x41 (integrated into "Mullins" + * processors, code named "ML") + * o FCHs where the controller has an ID of 0x790b1022 and a revision greater + * than or equal to 0x49 (integrated into "Carrizo" processors, code named + * "KERNCZ" or "CZ") + * * The register definitions are compatible within the classes and may be * incompatible accross them. - * So far there is no public documentation for "KERNCZ" FCH where the SMBus - * controller has a PCI ID of 0x790b1022. Based on some code in Linux it is - * assumed that revisions less than 0x49 are compatible with the SB8x0 class - * and revisions greater than or equal to 0x49 are compatible with the class - * of FCHs with 0x41+ revisions. */ /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r306289 - head/sys/net
Author: kp Date: Sat Sep 24 07:09:43 2016 New Revision: 306289 URL: https://svnweb.freebsd.org/changeset/base/306289 Log: bridge: Fix fragment handling and memory leak Fragmented UDP and ICMP packets were corrupted if a firewall with reassembling feature (like pf'scrub) is enabled on the bridge. This patch fixes corrupted packet problem and the panic (triggered easly with low RAM) as explain in PR 185633. bridge_pfil and bridge_fragment relationship: bridge_pfil() receive (IN direction) packets and sent it to the firewall The firewall can be configured for reassembling fragmented packet (like pf'scrubing) in one mbuf chain when bridge_pfil() need to send this reassembled packet to the outgoing interface, it needs to re-fragment it by using bridge_fragment() bridge_fragment() had to split this mbuf (using ip_fragment) first then had to M_PREPEND each packet in the mbuf chain for adding Ethernet header. But M_PREPEND can sometime create a new mbuf on the begining of the mbuf chain, then the "main" pointer of this mbuf chain should be updated and this case is tottaly forgotten. The original bridge_fragment code (Revision 158140, 2006 April 29) came from OpenBSD, and the call to bridge_enqueue was embedded. But on FreeBSD, bridge_enqueue() is done after bridge_fragment(), then the original OpenBSD code can't work as-it of FreeBSD. PR: 185633 Submitted by: Olivier Cochard-Labbé Differential Revision:https://reviews.freebsd.org/D7780 Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c == --- head/sys/net/if_bridge.cSat Sep 24 05:27:12 2016(r306288) +++ head/sys/net/if_bridge.cSat Sep 24 07:09:43 2016(r306289) @@ -333,7 +333,7 @@ static int bridge_ip_checkbasic(struct m #ifdef INET6 static int bridge_ip6_checkbasic(struct mbuf **mp); #endif /* INET6 */ -static int bridge_fragment(struct ifnet *, struct mbuf *, +static int bridge_fragment(struct ifnet *, struct mbuf **mp, struct ether_header *, int, struct llc *); static voidbridge_linkstate(struct ifnet *ifp); static voidbridge_linkcheck(struct bridge_softc *sc); @@ -1917,6 +1917,7 @@ bridge_enqueue(struct bridge_softc *sc, m->m_flags &= ~M_VLANTAG; } + M_ASSERTPKTHDR(m); /* We shouldn't transmit mbuf without pkthdr */ if ((err = dst_ifp->if_transmit(dst_ifp, m))) { m_freem(m0); if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); @@ -3234,10 +3235,12 @@ bridge_pfil(struct mbuf **mp, struct ifn break; /* check if we need to fragment the packet */ + /* bridge_fragment generates a mbuf chain of packets */ + /* that already include eth headers */ if (V_pfil_member && ifp != NULL && dir == PFIL_OUT) { i = (*mp)->m_pkthdr.len; if (i > ifp->if_mtu) { - error = bridge_fragment(ifp, *mp, &eh2, snap, + error = bridge_fragment(ifp, mp, &eh2, snap, &llc1); return (error); } @@ -3476,56 +3479,77 @@ bad: /* * bridge_fragment: * - * Return a fragmented mbuf chain. + * Fragment mbuf chain in multiple packets and prepend ethernet header. */ static int -bridge_fragment(struct ifnet *ifp, struct mbuf *m, struct ether_header *eh, +bridge_fragment(struct ifnet *ifp, struct mbuf **mp, struct ether_header *eh, int snap, struct llc *llc) { - struct mbuf *m0; + struct mbuf *m = *mp, *nextpkt = NULL, *mprev = NULL, *mcur = NULL; struct ip *ip; int error = -1; if (m->m_len < sizeof(struct ip) && (m = m_pullup(m, sizeof(struct ip))) == NULL) - goto out; + goto dropit; ip = mtod(m, struct ip *); m->m_pkthdr.csum_flags |= CSUM_IP; error = ip_fragment(ip, &m, ifp->if_mtu, ifp->if_hwassist); if (error) - goto out; + goto dropit; - /* walk the chain and re-add the Ethernet header */ - for (m0 = m; m0; m0 = m0->m_nextpkt) { - if (error == 0) { - if (snap) { - M_PREPEND(m0, sizeof(struct llc), M_NOWAIT); - if (m0 == NULL) { - error = ENOBUFS; - continue; - } - bcopy(llc, mtod(m0, caddr_t), - sizeof(struct llc)); - } - M_PREPEND(m0, ETHER_HDR_LEN, M_NOWAIT); -