svn commit: r272556 - head/sys/boot/common
Author: ae Date: Sun Oct 5 06:00:22 2014 New Revision: 272556 URL: https://svnweb.freebsd.org/changeset/base/272556 Log: Add a bit more debug messages. Modified: head/sys/boot/common/part.c Modified: head/sys/boot/common/part.c == --- head/sys/boot/common/part.c Sun Oct 5 03:58:30 2014(r272555) +++ head/sys/boot/common/part.c Sun Oct 5 06:00:22 2014(r272556) @@ -301,6 +301,7 @@ ptable_gptread(struct ptable *table, voi } } } + DEBUG(GPT detected); if (pri == 0 sec == 0) { /* Both primary and backup tables are invalid. */ table-type = PTABLE_NONE; @@ -378,6 +379,7 @@ ptable_ebrread(struct ptable *table, voi buf = malloc(table-sectorsize); if (buf == NULL) return (table); + DEBUG(EBR detected); for (i = 0; i MAXEBRENTRIES; i++) { #if 0 /* Some BIOSes return an incorrect number of sectors */ if (offset = table-sectors) @@ -470,6 +472,7 @@ ptable_bsdread(struct ptable *table, voi DEBUG(invalid number of partitions); goto out; } + DEBUG(BSD detected); part = dl-d_partitions[0]; raw_offset = le32toh(part[RAW_PART].p_offset); for (i = 0; i dl-d_npartitions; i++, part++) { @@ -553,6 +556,7 @@ ptable_vtoc8read(struct ptable *table, v DEBUG(invalid geometry); goto out; } + DEBUG(VTOC8 detected); for (i = 0; i VTOC8_NPARTS; i++) { dl-part[i].tag = be16toh(dl-part[i].tag); if (i == VTOC_RAW_PART || @@ -665,6 +669,7 @@ ptable_open(void *dev, off_t sectors, ui #endif #ifdef LOADER_MBR_SUPPORT /* Read MBR. */ + DEBUG(MBR detected); table-type = PTABLE_MBR; for (i = has_ext = 0; i NDOSPART; i++) { if (dp[i].dp_typ == 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272557 - in head: sys/boot/common tools/tools/bootparttest
Author: ae Date: Sun Oct 5 06:04:47 2014 New Revision: 272557 URL: https://svnweb.freebsd.org/changeset/base/272557 Log: Rework bootparttest to use more code from sys/boot. Use disk_open() call to emulate loader behavior. Added: head/tools/tools/bootparttest/stub.c - copied, changed from r272555, head/tools/tools/bootparttest/malloc.c Deleted: head/tools/tools/bootparttest/malloc.c Modified: head/sys/boot/common/disk.c head/tools/tools/bootparttest/Makefile head/tools/tools/bootparttest/bootparttest.c Modified: head/sys/boot/common/disk.c == --- head/sys/boot/common/disk.c Sun Oct 5 06:00:22 2014(r272556) +++ head/sys/boot/common/disk.c Sun Oct 5 06:04:47 2014(r272557) @@ -90,7 +90,7 @@ disk_lookup(struct disk_devdesc *dev) entry-d_partition == dev-d_partition) { dev-d_offset = entry-d_offset; DEBUG(%s offset %lld, disk_fmtdev(dev), - dev-d_offset); + (long long)dev-d_offset); #ifdef DISK_DEBUG entry-count++; #endif @@ -367,7 +367,7 @@ out: dev-d_slice = slice; dev-d_partition = partition; DEBUG(%s offset %lld = %p, disk_fmtdev(dev), - dev-d_offset, od); + (long long)dev-d_offset, od); } return (rc); } Modified: head/tools/tools/bootparttest/Makefile == --- head/tools/tools/bootparttest/Makefile Sun Oct 5 06:00:22 2014 (r272556) +++ head/tools/tools/bootparttest/Makefile Sun Oct 5 06:04:47 2014 (r272557) @@ -7,13 +7,14 @@ BINDIR?= /usr/bin PROG= bootparttest MAN= -SRCS= bootparttest.c crc32.c malloc.c part.c +SRCS= bootparttest.c crc32.c stub.c part.c disk.c -CFLAGS=-I${.CURDIR}/../../../sys/boot/common -I. \ - -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -DPART_DEBUG +CFLAGS=-I${.CURDIR}/../../../sys/boot/common \ + -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -DPART_DEBUG \ + -DDISK_DEBUG -DPADD+=${LIBGEOM} ${LIBUTIL} -LDADD+=${LIBGEOM} ${LIBUTIL} -LDFLAGS+= -lgeom -lutil +DPADD+=${LIBGEOM} +LDADD+=${LIBGEOM} +LDFLAGS+= -lgeom .include bsd.prog.mk Modified: head/tools/tools/bootparttest/bootparttest.c == --- head/tools/tools/bootparttest/bootparttest.cSun Oct 5 06:00:22 2014(r272556) +++ head/tools/tools/bootparttest/bootparttest.cSun Oct 5 06:04:47 2014(r272557) @@ -33,140 +33,106 @@ __FBSDID($FreeBSD$); #include err.h #include fcntl.h #include libgeom.h -#include libutil.h +#include disk.h #include part.h #include stdio.h +#include string.h #include unistd.h +static int disk_strategy(void *devdata, int rw, daddr_t blk, +size_t size, char *buf, size_t *rsize); + +/* stub struct devsw */ +struct devsw { + const char dv_name[8]; + int dv_type; + void*dv_init; + int (*dv_strategy)(void *devdata, int rw, daddr_t blk, + size_t size, char *buf, size_t *rsize); + void*dv_open; + void*dv_close; + void*dv_ioctl; + void*dv_print; + void*dv_cleanupa; +} udisk = { + .dv_name = disk, + .dv_strategy = disk_strategy +}; + struct disk { - const char *name; uint64_tmediasize; uint16_tsectorsize; int fd; int file; - off_t offset; -}; +} disk; static int -diskread(void *arg, void *buf, size_t blocks, off_t offset) +disk_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, +size_t *rsize) { - struct disk *dp; + struct disk_devdesc *dev = devdata; + int ret; - dp = (struct disk *)arg; - printf(%s: read %lu blocks from the offset %jd [+%jd]\n, dp-name, - blocks, offset, dp-offset); - if (offset = dp-mediasize / dp-sectorsize) + if (rw != 1 /* F_READ */) return (-1); - - return (pread(dp-fd, buf, blocks * dp-sectorsize, - (offset + dp-offset) * dp-sectorsize) != blocks * dp-sectorsize); -} - -static const char* -ptable_type2str(const struct ptable *table) -{ - - switch (ptable_gettype(table)) { - case PTABLE_NONE: - return (None); - case PTABLE_BSD: - return (BSD); - case PTABLE_MBR: - return (MBR); - case PTABLE_GPT: - return (GPT); - case PTABLE_VTOC8: -
svn commit: r272558 - head/tools/tools/bootparttest
Author: ae Date: Sun Oct 5 06:06:48 2014 New Revision: 272558 URL: https://svnweb.freebsd.org/changeset/base/272558 Log: Fix typo. Modified: head/tools/tools/bootparttest/bootparttest.c Modified: head/tools/tools/bootparttest/bootparttest.c == --- head/tools/tools/bootparttest/bootparttest.cSun Oct 5 06:04:47 2014(r272557) +++ head/tools/tools/bootparttest/bootparttest.cSun Oct 5 06:06:48 2014(r272558) @@ -53,7 +53,7 @@ struct devsw { void*dv_close; void*dv_ioctl; void*dv_print; - void*dv_cleanupa; + void*dv_cleanup; } udisk = { .dv_name = disk, .dv_strategy = disk_strategy ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272559 - head/sys/netinet
Author: rwatson Date: Sun Oct 5 06:28:53 2014 New Revision: 272559 URL: https://svnweb.freebsd.org/changeset/base/272559 Log: Eliminate use of M_EXT in IP6_EXTHDR_CHECK() by trimming a redundant 'if'/'else' case: it matches the simple 'else' case that follows. This reduces awareness of external-storage mechanics outside of the mbuf allocator. Reviewed by: bz MFC after:3 days Sponsored by: EMC / Isilon Storage Division Differential Revision:https://reviews.freebsd.org/D900 Modified: head/sys/netinet/ip6.h Modified: head/sys/netinet/ip6.h == --- head/sys/netinet/ip6.h Sun Oct 5 06:06:48 2014(r272558) +++ head/sys/netinet/ip6.h Sun Oct 5 06:28:53 2014(r272559) @@ -277,12 +277,6 @@ do { \ (((m) = m_pullup((m), (off) + (hlen))) == NULL)) { \ IP6STAT_INC(ip6s_exthdrtoolong); \ return ret; \ - } else if ((m)-m_flags M_EXT) { \ - if ((m)-m_len (off) + (hlen)) { \ - IP6STAT_INC(ip6s_exthdrtoolong); \ - m_freem(m); \ - return ret; \ - } \ } else {\ if ((m)-m_len (off) + (hlen)) { \ IP6STAT_INC(ip6s_exthdrtoolong); \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272560 - head/sys/kern
Author: mjg Date: Sun Oct 5 07:21:41 2014 New Revision: 272560 URL: https://svnweb.freebsd.org/changeset/base/272560 Log: Avoid unnecessary ppeers_lock acquisition in exit1. MFC after:1 week Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c == --- head/sys/kern/kern_exit.c Sun Oct 5 06:28:53 2014(r272559) +++ head/sys/kern/kern_exit.c Sun Oct 5 07:21:41 2014(r272560) @@ -265,8 +265,8 @@ exit1(struct thread *td, int rv) AUDIT_SYSCALL_EXIT(0, td); #endif - /* Are we a task leader? */ - if (p == p-p_leader) { + /* Are we a task leader with peers? */ + if (p-p_peers != NULL p == p-p_leader) { mtx_lock(ppeers_lock); q = p-p_peers; while (q != NULL) { @@ -337,15 +337,17 @@ exit1(struct thread *td, int rv) /* * Remove ourself from our leader's peer list and wake our leader. */ - mtx_lock(ppeers_lock); - if (p-p_leader-p_peers) { - q = p-p_leader; - while (q-p_peers != p) - q = q-p_peers; - q-p_peers = p-p_peers; - wakeup(p-p_leader); + if (p-p_leader-p_peers != NULL) { + mtx_lock(ppeers_lock); + if (p-p_leader-p_peers != NULL) { + q = p-p_leader; + while (q-p_peers != p) + q = q-p_peers; + q-p_peers = p-p_peers; + wakeup(p-p_leader); + } + mtx_unlock(ppeers_lock); } - mtx_unlock(ppeers_lock); vmspace_exit(td); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272561 - head/sys/modules
Author: nyan Date: Sun Oct 5 07:27:05 2014 New Revision: 272561 URL: https://svnweb.freebsd.org/changeset/base/272561 Log: - Refactor defining variables. - Merge common modules both i386 and amd64 into one if-endif. - Sort. - There are no functional changes. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile == --- head/sys/modules/Makefile Sun Oct 5 07:21:41 2014(r272560) +++ head/sys/modules/Makefile Sun Oct 5 07:27:05 2014(r272561) @@ -384,32 +384,7 @@ SUBDIR=\ ${_xe} \ xl \ ${_zfs} \ - zlib \ - -.if ${MACHINE_CPUARCH} == i386 || ${MACHINE_CPUARCH} == amd64 -_filemon= filemon -_vmware= vmware -.endif - -.if ${MACHINE_CPUARCH} != powerpc ${MACHINE_CPUARCH} != arm \ - ${MACHINE_CPUARCH} != mips -_syscons= syscons -_vpo= vpo -.endif - -.if ${MACHINE_CPUARCH} != arm ${MACHINE_CPUARCH} != mips -# no BUS_SPACE_UNSPECIFIED -# No barrier instruction support (specific to this driver) -_sym= sym -# intr_disable() is a macro, causes problems -.if ${MK_SOURCELESS_UCODE} != no -_cxgb= cxgb -.endif -.endif - -.if ${MK_SOURCELESS_UCODE} != no -_cxgbe=cxgbe -.endif + zlib .if ${MK_CRYPT} != no || defined(ALL_MODULES) .if exists(${.CURDIR}/../opencrypto) @@ -423,23 +398,20 @@ _random= random .if (${MK_INET_SUPPORT} != no || ${MK_INET6_SUPPORT} != no) || \ defined(ALL_MODULES) -_carp= carp +_carp= carp _toecore= toecore .endif .if ${MK_INET_SUPPORT} != no || defined(ALL_MODULES) _if_gre= if_gre +_ipdivert= ipdivert +_ipfw= ipfw .endif .if ${MK_IPFILTER} != no || defined(ALL_MODULES) _ipfilter= ipfilter .endif -.if ${MK_INET_SUPPORT} != no || defined(ALL_MODULES) -_ipdivert= ipdivert -_ipfw= ipfw -.endif - .if ${MK_NAND} != no || defined(ALL_MODULES) _nandfs= nandfs _nandsim= nandsim @@ -460,6 +432,7 @@ _pfsync=pfsync .if ${MK_SOURCELESS_UCODE} != no _bce= bce +_cxgbe=cxgbe _fatm= fatm _fxp= fxp _ispfw=ispfw @@ -471,31 +444,33 @@ _ti= ti _txp= txp .endif -.if ${MACHINE_CPUARCH} == i386 -# XXX some of these can move to the general case when de-i386'ed -# XXX some of these can move now, but are untested on other architectures. -_3dfx= 3dfx -_3dfx_linux= 3dfx_linux + +.if ${MACHINE_CPUARCH} != arm ${MACHINE_CPUARCH} != mips \ + ${MACHINE_CPUARCH} != powerpc +_syscons= syscons +_vpo= vpo +.endif + +.if ${MACHINE_CPUARCH} != arm ${MACHINE_CPUARCH} != mips +# no BUS_SPACE_UNSPECIFIED +# No barrier instruction support (specific to this driver) +_sym= sym +# intr_disable() is a macro, causes problems +.if ${MK_SOURCELESS_UCODE} != no +_cxgb= cxgb +.endif +.endif + +.if ${MACHINE_CPUARCH} == i386 || ${MACHINE_CPUARCH} == amd64 _agp= agp -_aic= aic _an= an _aout= aout -_apm= apm -_arcnet= arcnet _bktr= bktr _bxe= bxe _cardbus= cardbus _cbb= cbb -.if ${MK_SOURCELESS_UCODE} != no -_ce= ce -.endif -_coff= coff -.if ${MK_SOURCELESS_UCODE} != no -_cp= cp -.endif _cpuctl= cpuctl _cpufreq= cpufreq -_cs= cs .if ${MK_CDDL} != no || defined(ALL_MODULES) _cyclic= cyclic .endif @@ -506,21 +481,15 @@ _drm2=drm2 _dtrace= dtrace .endif _ed= ed -_elink=elink _em= em -_ep= ep _et= et _exca= exca _ext2fs= ext2fs -_fe= fe -_glxiic= glxiic -_glxsb=glxsb +_filemon= filemon _i2c= i2c .if ${MK_OFED} != no || defined(ALL_MODULES) _ibcore=ibcore .endif -_ibcs2=ibcs2 -_ie= ie _if_ndis= if_ndis _igb= igb _io= io @@ -530,28 +499,15 @@ _ipoib= ipoib _linprocfs=linprocfs _linsysfs= linsysfs _linux=linux -_mse= mse -.if ${MK_OFED} != no || defined(ALL_MODULES) -_mlx4= mlx4 -_mlx4ib= mlx4ib -_mlxen=mlxen -_mthca=mthca -.endif -_ncr= ncr -_ncv= ncv _ndis= ndis -_nsp= nsp .if ${MK_CDDL} != no || defined(ALL_MODULES) _opensolaris= opensolaris .endif _pccard= pccard -_pcfclock= pcfclock -_pst= pst .if ${MK_OFED} != no || defined(ALL_MODULES) _rdma= rdma .endif _safe= safe -_sbni= sbni _scsi_low= scsi_low _si= si _smbfs=smbfs @@ -559,42 +515,27 @@ _sound= sound _speaker= speaker _splash= splash _sppp= sppp -_stg= stg -_streams= streams -_svr4= svr4 +_vmware= vmware _vxge= vxge
svn commit: r272562 - head/lib/libc/stdtime
Author: ache Date: Sun Oct 5 07:29:50 2014 New Revision: 272562 URL: https://svnweb.freebsd.org/changeset/base/272562 Log: 1) For %Z format, understand UTC name too. 2) Return NULL if timegm() fails, because it means we can convert what we have in GMT to local time needed. Modified: head/lib/libc/stdtime/strptime.c Modified: head/lib/libc/stdtime/strptime.c == --- head/lib/libc/stdtime/strptime.cSun Oct 5 07:27:05 2014 (r272561) +++ head/lib/libc/stdtime/strptime.cSun Oct 5 07:29:50 2014 (r272562) @@ -552,7 +552,8 @@ label: strncpy(zonestr, buf, cp - buf); zonestr[cp - buf] = '\0'; tzset(); - if (0 == strcmp(zonestr, GMT)) { + if (0 == strcmp(zonestr, GMT) || + 0 == strcmp(zonestr, UTC)) { *GMTp = 1; } else if (0 == strcmp(zonestr, tzname[0])) { tm-tm_isdst = 0; @@ -674,6 +675,9 @@ strptime_l(const char * __restrict buf, ret = _strptime(buf, fmt, tm, gmt, loc); if (ret gmt) { time_t t = timegm(tm); + + if (t == -1) + return (NULL); localtime_r(t, tm); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272564 - head/contrib/binutils/bfd
Author: andrew Date: Sun Oct 5 11:06:22 2014 New Revision: 272564 URL: https://svnweb.freebsd.org/changeset/base/272564 Log: Merge the big-endian ARM targets together, and the little-endian ARM targets. With this we assume any ARM target containing eb is big-endian, otherwise it is little-endian. Modified: head/contrib/binutils/bfd/config.bfd Modified: head/contrib/binutils/bfd/config.bfd == --- head/contrib/binutils/bfd/config.bfdSun Oct 5 10:20:47 2014 (r272563) +++ head/contrib/binutils/bfd/config.bfdSun Oct 5 11:06:22 2014 (r272564) @@ -273,19 +273,11 @@ case ${targ} in targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec ;; - armeb-*-freebsd*) + arm*eb*-*-freebsd*) targ_defvec=bfd_elf32_bigarm_vec targ_selvecs=bfd_elf32_littlearm_vec ;; - armv6eb-*-freebsd*) -targ_defvec=bfd_elf32_bigarm_vec -targ_selvecs=bfd_elf32_littlearm_vec -;; - armv6-*-freebsd* | armv6hf-*-freebsd*) -targ_defvec=bfd_elf32_littlearm_vec -targ_selvecs=bfd_elf32_bigarm_vec -;; - arm-*-elf | arm-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \ + arm-*-elf | arm*-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \ arm*-*-eabi* ) targ_defvec=bfd_elf32_littlearm_vec ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272565 - head/tools/tools/bootparttest
Author: ae Date: Sun Oct 5 11:16:16 2014 New Revision: 272565 URL: https://svnweb.freebsd.org/changeset/base/272565 Log: Fix format string warnings. Modified: head/tools/tools/bootparttest/bootparttest.c Modified: head/tools/tools/bootparttest/bootparttest.c == --- head/tools/tools/bootparttest/bootparttest.cSun Oct 5 11:06:22 2014(r272564) +++ head/tools/tools/bootparttest/bootparttest.cSun Oct 5 11:16:16 2014(r272565) @@ -78,8 +78,8 @@ disk_strategy(void *devdata, int rw, dad return (-1); if (rsize) *rsize = 0; - printf(read %lu bytes from the block %ld [+%ld]\n, size, - blk, dev-d_offset); + printf(read %zu bytes from the block %lld [+%lld]\n, size, + (long long)blk, (long long)dev-d_offset); ret = pread(disk.fd, buf, size, (blk + dev-d_offset) * disk.sectorsize); if (ret != size) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r272505 - in head/sys: kern sys
On Sat, Oct 04, 2014 at 02:21:54PM +, Bjoern A. Zeeb wrote: On 04 Oct 2014, at 08:08 , Mateusz Guzik m...@freebsd.org wrote: Author: mjg Date: Sat Oct 4 08:08:56 2014 New Revision: 272505 URL: https://svnweb.freebsd.org/changeset/base/272505 Log: Plug capability races. fp and appropriate capability lookups were not atomic, which could result in improper capabilities being checked. This could result either in protection bypass or in a spurious ENOTCAPABLE. Make fp + capability check atomic with the help of sequence counters. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h … This file is included from user space. There is no opt_capsicum.h there. Including an opt_* in the header file seems wrong in a lot of ways usually. I tried to add a bandaid for the moment with r272523 which (to be honest) makes it worse. This needs a better fix. Hi, this also breaks the nvidia-driver port (also with your fix). BR, Stefan ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r272505 - in head/sys: kern sys
On Sun, Oct 05, 2014 at 06:39:54PM +0200, Stefan Farfeleder wrote: On Sat, Oct 04, 2014 at 02:21:54PM +, Bjoern A. Zeeb wrote: On 04 Oct 2014, at 08:08 , Mateusz Guzik m...@freebsd.org wrote: Author: mjg Date: Sat Oct 4 08:08:56 2014 New Revision: 272505 URL: https://svnweb.freebsd.org/changeset/base/272505 Log: Plug capability races. fp and appropriate capability lookups were not atomic, which could result in improper capabilities being checked. This could result either in protection bypass or in a spurious ENOTCAPABLE. Make fp + capability check atomic with the help of sequence counters. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h ??? This file is included from user space. There is no opt_capsicum.h there. Including an opt_* in the header file seems wrong in a lot of ways usually. I tried to add a bandaid for the moment with r272523 which (to be honest) makes it worse. This needs a better fix. Hi, this also breaks the nvidia-driver port (also with your fix). Is the breakage due to missing opt_capsicum.h file ? If yes, what I proposed, i.e. making the new member unconditional, should fix it without changes to the module build system. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272566 - head/sys/kern
Author: kib Date: Sun Oct 5 17:35:59 2014 New Revision: 272566 URL: https://svnweb.freebsd.org/changeset/base/272566 Log: On error, sbuf_bcat() returns -1. Some callers returned this -1 to the upper layers, which interpret it as errno value, which happens to be ERESTART. The result was spurious restarts of the sysctls in loop, e.g. kern.proc.proc, instead of returning ENOMEM to caller. Convert -1 from sbuf_bcat() to ENOMEM, when returning to the callers expecting errno. In collaboration with:pho Sponsored by: The FreeBSD Foundation (kib) MFC after:1 week Modified: head/sys/kern/kern_descrip.c head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.cSun Oct 5 11:16:16 2014 (r272565) +++ head/sys/kern/kern_descrip.cSun Oct 5 17:35:59 2014 (r272566) @@ -3097,7 +3097,7 @@ export_kinfo_to_sb(struct export_fd_buf } efbuf-remainder -= kif-kf_structsize; } - return (sbuf_bcat(efbuf-sb, kif, kif-kf_structsize)); + return (sbuf_bcat(efbuf-sb, kif, kif-kf_structsize) == 0 ? 0 : ENOMEM); } static int Modified: head/sys/kern/kern_proc.c == --- head/sys/kern/kern_proc.c Sun Oct 5 11:16:16 2014(r272565) +++ head/sys/kern/kern_proc.c Sun Oct 5 17:35:59 2014(r272566) @@ -1208,21 +1208,25 @@ kern_proc_out(struct proc *p, struct sbu #ifdef COMPAT_FREEBSD32 if ((flags KERN_PROC_MASK32) != 0) { freebsd32_kinfo_proc_out(ki, ki32); - error = sbuf_bcat(sb, ki32, sizeof(ki32)); + if (sbuf_bcat(sb, ki32, sizeof(ki32)) != 0) + error = ENOMEM; } else #endif - error = sbuf_bcat(sb, ki, sizeof(ki)); + if (sbuf_bcat(sb, ki, sizeof(ki)) != 0) + error = ENOMEM; } else { FOREACH_THREAD_IN_PROC(p, td) { fill_kinfo_thread(td, ki, 1); #ifdef COMPAT_FREEBSD32 if ((flags KERN_PROC_MASK32) != 0) { freebsd32_kinfo_proc_out(ki, ki32); - error = sbuf_bcat(sb, ki32, sizeof(ki32)); + if (sbuf_bcat(sb, ki32, sizeof(ki32)) != 0) + error = ENOMEM; } else #endif - error = sbuf_bcat(sb, ki, sizeof(ki)); - if (error) + if (sbuf_bcat(sb, ki, sizeof(ki)) != 0) + error = ENOMEM; + if (error != 0) break; } } @@ -1777,7 +1781,8 @@ proc_getauxv(struct thread *td, struct p else #endif size = vsize * sizeof(Elf_Auxinfo); - error = sbuf_bcat(sb, auxv, size); + if (sbuf_bcat(sb, auxv, size) != 0) + error = ENOMEM; free(auxv, M_TEMP); } return (error); @@ -2363,9 +2368,10 @@ kern_proc_vmmap_out(struct proc *p, stru strlen(kve-kve_path) + 1; kve-kve_structsize = roundup(kve-kve_structsize, sizeof(uint64_t)); - error = sbuf_bcat(sb, kve, kve-kve_structsize); + if (sbuf_bcat(sb, kve, kve-kve_structsize) != 0) + error = ENOMEM; vm_map_lock_read(map); - if (error) + if (error != 0) break; if (last_timestamp != map-timestamp) { vm_map_lookup_entry(map, addr - 1, tmp_entry); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r272505 - in head/sys: kern sys
On Sun, Oct 05, 2014 at 08:16:17PM +0300, Konstantin Belousov wrote: On Sun, Oct 05, 2014 at 06:39:54PM +0200, Stefan Farfeleder wrote: On Sat, Oct 04, 2014 at 02:21:54PM +, Bjoern A. Zeeb wrote: On 04 Oct 2014, at 08:08 , Mateusz Guzik m...@freebsd.org wrote: Author: mjg Date: Sat Oct 4 08:08:56 2014 New Revision: 272505 URL: https://svnweb.freebsd.org/changeset/base/272505 Log: Plug capability races. fp and appropriate capability lookups were not atomic, which could result in improper capabilities being checked. This could result either in protection bypass or in a spurious ENOTCAPABLE. Make fp + capability check atomic with the help of sequence counters. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h ??? This file is included from user space. There is no opt_capsicum.h there. Including an opt_* in the header file seems wrong in a lot of ways usually. I tried to add a bandaid for the moment with r272523 which (to be honest) makes it worse. This needs a better fix. Hi, this also breaks the nvidia-driver port (also with your fix). Is the breakage due to missing opt_capsicum.h file ? If yes, what I proposed, i.e. making the new member unconditional, should fix it without changes to the module build system. Yes, it breaks due to the missing file. Stefan ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272567 - in head/sys: kern sys
Author: mjg Date: Sun Oct 5 19:40:29 2014 New Revision: 272567 URL: https://svnweb.freebsd.org/changeset/base/272567 Log: filedesc: fix up breakage introduced in 272505 Include sequence counter supports incoditionally [1]. This fixes reprted build problems with e.g. nvidia driver due to missing opt_capsicum.h. Replace fishy looking sizeof with offsetof. Make fde_seq the last member in order to simplify calculations. Suggested by: kib [1] X-MFC:with 272505 Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.cSun Oct 5 17:35:59 2014 (r272566) +++ head/sys/kern/kern_descrip.cSun Oct 5 19:40:29 2014 (r272567) @@ -295,7 +295,7 @@ _fdfree(struct filedesc *fdp, int fd, in filecaps_free(fde-fde_caps); if (last) return; - bzero(fde_change(fde), fde_change_size); + bzero(fde, fde_change_size); fdunused(fdp, fd); #ifdef CAPABILITIES seq_write_end(fde-fde_seq); @@ -894,7 +894,7 @@ do_dup(struct thread *td, int flags, int seq_write_begin(newfde-fde_seq); #endif filecaps_free(newfde-fde_caps); - memcpy(fde_change(newfde), fde_change(oldfde), fde_change_size); + memcpy(newfde, oldfde, fde_change_size); filecaps_copy(oldfde-fde_caps, newfde-fde_caps); if ((flags DUP_CLOEXEC) != 0) newfde-fde_flags = oldfde-fde_flags | UF_EXCLOSE; @@ -2778,7 +2778,7 @@ dupfdopen(struct thread *td, struct file #ifdef CAPABILITIES seq_write_begin(newfde-fde_seq); #endif - memcpy(fde_change(newfde), fde_change(oldfde), fde_change_size); + memcpy(newfde, oldfde, fde_change_size); filecaps_copy(oldfde-fde_caps, newfde-fde_caps); #ifdef CAPABILITIES seq_write_end(newfde-fde_seq); @@ -2793,8 +2793,8 @@ dupfdopen(struct thread *td, struct file #ifdef CAPABILITIES seq_write_begin(newfde-fde_seq); #endif - memcpy(fde_change(newfde), fde_change(oldfde), fde_change_size); - bzero(fde_change(oldfde), fde_change_size); + memcpy(newfde, oldfde, fde_change_size); + bzero(oldfde, fde_change_size); fdunused(fdp, dfd); #ifdef CAPABILITIES seq_write_end(newfde-fde_seq); Modified: head/sys/sys/filedesc.h == --- head/sys/sys/filedesc.h Sun Oct 5 17:35:59 2014(r272566) +++ head/sys/sys/filedesc.h Sun Oct 5 19:40:29 2014(r272567) @@ -33,10 +33,6 @@ #ifndef _SYS_FILEDESC_H_ #define_SYS_FILEDESC_H_ -#ifdef _KERNEL -#include opt_capsicum.h -#endif - #include sys/caprights.h #include sys/queue.h #include sys/event.h @@ -55,24 +51,16 @@ struct filecaps { }; struct filedescent { -#ifdef CAPABILITIES - seq_tfde_seq; /* if you need fde_file and fde_caps in sync */ -#endif struct file *fde_file; /* file structure for open file */ struct filecaps fde_caps; /* per-descriptor rights */ uint8_t fde_flags; /* per-process open file flags */ + seq_tfde_seq; /* if you need fde_file and fde_caps in sync */ }; #definefde_rights fde_caps.fc_rights #definefde_fcntls fde_caps.fc_fcntls #definefde_ioctls fde_caps.fc_ioctls #definefde_nioctls fde_caps.fc_nioctls -#ifdef CAPABILITIES -#definefde_change(fde) ((char *)(fde) + sizeof(seq_t)) -#definefde_change_size (sizeof(struct filedescent) - sizeof(seq_t)) -#else -#definefde_change(fde) ((fde)) -#definefde_change_size (sizeof(struct filedescent)) -#endif +#definefde_change_size (offsetof(struct filedescent, fde_seq)) /* * This structure is used for the management of descriptors. It may be @@ -97,9 +85,7 @@ struct filedesc { int fd_holdleaderscount;/* block fdfree() for shared close() */ int fd_holdleaderswakeup; /* fdfree() needs wakeup */ }; -#ifdef CAPABILITIES #definefd_seq(fdp, fd) ((fdp)-fd_ofiles[(fd)].fde_seq) -#endif /* * Structure to keep track of (process leader, struct fildedesc) tuples. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272568 - head/sys/net
Author: hrs Date: Sun Oct 5 19:43:37 2014 New Revision: 272568 URL: https://svnweb.freebsd.org/changeset/base/272568 Log: Virtualize if_bridge(4) cloner. Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c == --- head/sys/net/if_bridge.cSun Oct 5 19:40:29 2014(r272567) +++ head/sys/net/if_bridge.cSun Oct 5 19:43:37 2014(r272568) @@ -226,7 +226,8 @@ struct bridge_softc { u_char sc_defaddr[6]; /* Default MAC address */ }; -static struct mtx bridge_list_mtx; +static VNET_DEFINE(struct mtx, bridge_list_mtx); +#defineV_bridge_list_mtx VNET(bridge_list_mtx) eventhandler_tag bridge_detach_cookie = NULL; intbridge_rtable_prune_period = BRIDGE_RTABLE_PRUNE_PERIOD; @@ -350,36 +351,64 @@ static struct bstp_cb_ops bridge_ops = { SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, IFT_BRIDGE, bridge, CTLFLAG_RW, 0, Bridge); -static int pfil_onlyip = 1; /* only pass IP[46] packets when pfil is enabled */ -static int pfil_bridge = 1; /* run pfil hooks on the bridge interface */ -static int pfil_member = 1; /* run pfil hooks on the member interface */ -static int pfil_ipfw = 0; /* layer2 filter with ipfw */ -static int pfil_ipfw_arp = 0; /* layer2 filter with ipfw */ -static int pfil_local_phys = 0; /* run pfil hooks on the physical interface for - locally destined packets */ -static int log_stp = 0; /* log STP state changes */ -static int bridge_inherit_mac = 0; /* share MAC with first bridge member */ -SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RWTUN, -pfil_onlyip, 0, Only pass IP packets when pfil is enabled); -SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RWTUN, -pfil_ipfw_arp, 0, Filter ARP packets through IPFW layer2); -SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RWTUN, -pfil_bridge, 0, Packet filter on the bridge interface); -SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RWTUN, -pfil_member, 0, Packet filter on the member interface); -SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RWTUN, -pfil_local_phys, 0, +/* only pass IP[46] packets when pfil is enabled */ +static VNET_DEFINE(int, pfil_onlyip) = 1; +#defineV_pfil_onlyip VNET(pfil_onlyip) +SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, +CTLFLAG_RWTUN | CTLFLAG_VNET, VNET_NAME(pfil_onlyip), 0, +Only pass IP packets when pfil is enabled); + +/* run pfil hooks on the bridge interface */ +static VNET_DEFINE(int, pfil_bridge) = 1; +#defineV_pfil_bridge VNET(pfil_bridge) +SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, +CTLFLAG_RWTUN | CTLFLAG_VNET, VNET_NAME(pfil_bridge), 0, +Packet filter on the bridge interface); + +/* layer2 filter with ipfw */ +static VNET_DEFINE(int, pfil_ipfw); +#defineV_pfil_ipfw VNET(pfil_ipfw) + +/* layer2 ARP filter with ipfw */ +static VNET_DEFINE(int, pfil_ipfw_arp); +#defineV_pfil_ipfw_arp VNET(pfil_ipfw_arp) +SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, +CTLFLAG_RWTUN | CTLFLAG_VNET, VNET_NAME(pfil_ipfw_arp), 0, +Filter ARP packets through IPFW layer2); + +/* run pfil hooks on the member interface */ +static VNET_DEFINE(int, pfil_member) = 1; +#defineV_pfil_member VNET(pfil_member) +SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, +CTLFLAG_RWTUN | CTLFLAG_VNET, VNET_NAME(pfil_member), 0, +Packet filter on the member interface); + +/* run pfil hooks on the physical interface for locally destined packets */ +static VNET_DEFINE(int, pfil_local_phys); +#defineV_pfil_local_phys VNET(pfil_local_phys) +SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, +CTLFLAG_RWTUN | CTLFLAG_VNET, VNET_NAME(pfil_local_phys), 0, Packet filter on the physical interface for locally destined packets); -SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RWTUN, -log_stp, 0, Log STP state changes); -SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RWTUN, -bridge_inherit_mac, 0, + +/* log STP state changes */ +static VNET_DEFINE(int, log_stp); +#defineV_log_stp VNET(log_stp) +SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, +CTLFLAG_RWTUN | CTLFLAG_VNET, VNET_NAME(log_stp), 0, +Log STP state changes); + +/* share MAC with first bridge member */ +static VNET_DEFINE(int, bridge_inherit_mac); +#defineV_bridge_inherit_macVNET(bridge_inherit_mac) +SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, +CTLFLAG_RWTUN | CTLFLAG_VNET, VNET_NAME(bridge_inherit_mac), 0, Inherit MAC address from the first bridge member); static VNET_DEFINE(int, allow_llz_overlap) = 0; #defineV_allow_llz_overlap VNET(allow_llz_overlap) -SYSCTL_VNET_INT(_net_link_bridge, OID_AUTO, allow_llz_overlap, CTLFLAG_RW, -VNET_NAME(allow_llz_overlap), 0, Allow overlap of
svn commit: r272569 - head/sys/sys
Author: mjg Date: Sun Oct 5 19:44:40 2014 New Revision: 272569 URL: https://svnweb.freebsd.org/changeset/base/272569 Log: Keep struct filedescent comments within 80-char limit. Modified: head/sys/sys/filedesc.h Modified: head/sys/sys/filedesc.h == --- head/sys/sys/filedesc.h Sun Oct 5 19:43:37 2014(r272568) +++ head/sys/sys/filedesc.h Sun Oct 5 19:44:40 2014(r272569) @@ -51,10 +51,10 @@ struct filecaps { }; struct filedescent { - struct file *fde_file; /* file structure for open file */ - struct filecaps fde_caps; /* per-descriptor rights */ - uint8_t fde_flags; /* per-process open file flags */ - seq_tfde_seq; /* if you need fde_file and fde_caps in sync */ + struct file *fde_file; /* file structure for open file */ + struct filecaps fde_caps; /* per-descriptor rights */ + uint8_t fde_flags; /* per-process open file flags */ + seq_tfde_seq; /* keep file and caps in sync */ }; #definefde_rights fde_caps.fc_rights #definefde_fcntls fde_caps.fc_fcntls ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r272505 - in head/sys: kern sys
On Sun, Oct 05, 2014 at 08:19:06PM +0200, Stefan Farfeleder wrote: On Sun, Oct 05, 2014 at 08:16:17PM +0300, Konstantin Belousov wrote: On Sun, Oct 05, 2014 at 06:39:54PM +0200, Stefan Farfeleder wrote: On Sat, Oct 04, 2014 at 02:21:54PM +, Bjoern A. Zeeb wrote: On 04 Oct 2014, at 08:08 , Mateusz Guzik m...@freebsd.org wrote: Author: mjg Date: Sat Oct 4 08:08:56 2014 New Revision: 272505 URL: https://svnweb.freebsd.org/changeset/base/272505 Log: Plug capability races. fp and appropriate capability lookups were not atomic, which could result in improper capabilities being checked. This could result either in protection bypass or in a spurious ENOTCAPABLE. Make fp + capability check atomic with the help of sequence counters. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h ??? This file is included from user space. There is no opt_capsicum.h there. Including an opt_* in the header file seems wrong in a lot of ways usually. I tried to add a bandaid for the moment with r272523 which (to be honest) makes it worse. This needs a better fix. Hi, this also breaks the nvidia-driver port (also with your fix). Is the breakage due to missing opt_capsicum.h file ? If yes, what I proposed, i.e. making the new member unconditional, should fix it without changes to the module build system. Yes, it breaks due to the missing file. Can you update the kernel to at least r272569 and test again? Make sure you are running the new kernel before testing the driver. -- Mateusz Guzik mjguzik gmail.com ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272570 - head/sys/net
Author: hrs Date: Sun Oct 5 19:46:52 2014 New Revision: 272570 URL: https://svnweb.freebsd.org/changeset/base/272570 Log: Virtualize if_disc(4) cloner. Modified: head/sys/net/if_disc.c Modified: head/sys/net/if_disc.c == --- head/sys/net/if_disc.c Sun Oct 5 19:44:40 2014(r272569) +++ head/sys/net/if_disc.c Sun Oct 5 19:46:52 2014(r272570) @@ -50,6 +50,7 @@ #include net/if_types.h #include net/route.h #include net/bpf.h +#include net/vnet.h #include opt_inet.h #include opt_inet6.h @@ -74,7 +75,8 @@ static void disc_clone_destroy(struct if static const char discname[] = disc; static MALLOC_DEFINE(M_DISC, discname, Discard interface); -static struct if_clone *disc_cloner; +static VNET_DEFINE(struct if_clone *, disc_cloner); +#defineV_disc_cloner VNET(disc_cloner) static int disc_clone_create(struct if_clone *ifc, int unit, caddr_t params) @@ -129,17 +131,32 @@ disc_clone_destroy(struct ifnet *ifp) free(sc, M_DISC); } +static void +vnet_disc_init(const void *unused __unused) +{ + + V_disc_cloner = if_clone_simple(discname, disc_clone_create, + disc_clone_destroy, 0); +} +VNET_SYSINIT(vnet_disc_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +vnet_disc_init, NULL); + +static void +vnet_disc_uninit(const void *unused __unused) +{ + + if_clone_detach(V_disc_cloner); +} +VNET_SYSUNINIT(vnet_disc_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +vnet_disc_uninit, NULL); + static int disc_modevent(module_t mod, int type, void *data) { switch (type) { case MOD_LOAD: - disc_cloner = if_clone_simple(discname, disc_clone_create, - disc_clone_destroy, 0); - break; case MOD_UNLOAD: - if_clone_detach(disc_cloner); break; default: return (EOPNOTSUPP); @@ -185,6 +202,7 @@ discoutput(struct ifnet *ifp, struct mbu static void discrtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info) { + RT_LOCK_ASSERT(rt); rt-rt_mtu = DSMTU; } @@ -200,7 +218,6 @@ discioctl(struct ifnet *ifp, u_long cmd, int error = 0; switch (cmd) { - case SIOCSIFADDR: ifp-if_flags |= IFF_UP; ifa = (struct ifaddr *)data; @@ -210,7 +227,6 @@ discioctl(struct ifnet *ifp, u_long cmd, * Everything else is done at a higher level. */ break; - case SIOCADDMULTI: case SIOCDELMULTI: if (ifr == 0) { @@ -218,7 +234,6 @@ discioctl(struct ifnet *ifp, u_long cmd, break; } switch (ifr-ifr_addr.sa_family) { - #ifdef INET case AF_INET: break; @@ -227,17 +242,14 @@ discioctl(struct ifnet *ifp, u_long cmd, case AF_INET6: break; #endif - default: error = EAFNOSUPPORT; break; } break; - case SIOCSIFMTU: ifp-if_mtu = ifr-ifr_mtu; break; - default: error = EINVAL; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r272567 - in head/sys: kern sys
On 05 Oct 2014, at 19:40 , Mateusz Guzik m...@freebsd.org wrote: Author: mjg Date: Sun Oct 5 19:40:29 2014 New Revision: 272567 URL: https://svnweb.freebsd.org/changeset/base/272567 Log: filedesc: fix up breakage introduced in 272505 Include sequence counter supports incoditionally [1]. This fixes reprted build problems with e.g. nvidia driver due to missing opt_capsicum.h. Replace fishy looking sizeof with offsetof. Make fde_seq the last member in order to simplify calculations. Seing this on an incremental build now for bmake: stopped in /scratch/tmp/bz/head.svn/lib/libkvm /storage/head/obj//mips.mipsel/scratch/tmp/bz/head.svn/tmp/usr/include/sys/filedesc.h:57: error: expected specifier-qualifier-list before 'seq_t' I’ll see if this persists with a full build but I assume it will. Suggested by:kib [1] X-MFC: with 272505 Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.c Sun Oct 5 17:35:59 2014 (r272566) +++ head/sys/kern/kern_descrip.c Sun Oct 5 19:40:29 2014 (r272567) @@ -295,7 +295,7 @@ _fdfree(struct filedesc *fdp, int fd, in filecaps_free(fde-fde_caps); if (last) return; - bzero(fde_change(fde), fde_change_size); + bzero(fde, fde_change_size); fdunused(fdp, fd); #ifdef CAPABILITIES seq_write_end(fde-fde_seq); @@ -894,7 +894,7 @@ do_dup(struct thread *td, int flags, int seq_write_begin(newfde-fde_seq); #endif filecaps_free(newfde-fde_caps); - memcpy(fde_change(newfde), fde_change(oldfde), fde_change_size); + memcpy(newfde, oldfde, fde_change_size); filecaps_copy(oldfde-fde_caps, newfde-fde_caps); if ((flags DUP_CLOEXEC) != 0) newfde-fde_flags = oldfde-fde_flags | UF_EXCLOSE; @@ -2778,7 +2778,7 @@ dupfdopen(struct thread *td, struct file #ifdef CAPABILITIES seq_write_begin(newfde-fde_seq); #endif - memcpy(fde_change(newfde), fde_change(oldfde), fde_change_size); + memcpy(newfde, oldfde, fde_change_size); filecaps_copy(oldfde-fde_caps, newfde-fde_caps); #ifdef CAPABILITIES seq_write_end(newfde-fde_seq); @@ -2793,8 +2793,8 @@ dupfdopen(struct thread *td, struct file #ifdef CAPABILITIES seq_write_begin(newfde-fde_seq); #endif - memcpy(fde_change(newfde), fde_change(oldfde), fde_change_size); - bzero(fde_change(oldfde), fde_change_size); + memcpy(newfde, oldfde, fde_change_size); + bzero(oldfde, fde_change_size); fdunused(fdp, dfd); #ifdef CAPABILITIES seq_write_end(newfde-fde_seq); Modified: head/sys/sys/filedesc.h == --- head/sys/sys/filedesc.h Sun Oct 5 17:35:59 2014(r272566) +++ head/sys/sys/filedesc.h Sun Oct 5 19:40:29 2014(r272567) @@ -33,10 +33,6 @@ #ifndef _SYS_FILEDESC_H_ #define _SYS_FILEDESC_H_ -#ifdef _KERNEL -#include opt_capsicum.h -#endif - #include sys/caprights.h #include sys/queue.h #include sys/event.h @@ -55,24 +51,16 @@ struct filecaps { }; struct filedescent { -#ifdef CAPABILITIES - seq_tfde_seq; /* if you need fde_file and fde_caps in sync */ -#endif struct file *fde_file; /* file structure for open file */ struct filecaps fde_caps; /* per-descriptor rights */ uint8_t fde_flags; /* per-process open file flags */ + seq_tfde_seq; /* if you need fde_file and fde_caps in sync */ }; #define fde_rights fde_caps.fc_rights #define fde_fcntls fde_caps.fc_fcntls #define fde_ioctls fde_caps.fc_ioctls #define fde_nioctls fde_caps.fc_nioctls -#ifdef CAPABILITIES -#define fde_change(fde) ((char *)(fde) + sizeof(seq_t)) -#define fde_change_size (sizeof(struct filedescent) - sizeof(seq_t)) -#else -#define fde_change(fde) ((fde)) -#define fde_change_size (sizeof(struct filedescent)) -#endif +#define fde_change_size (offsetof(struct filedescent, fde_seq)) /* * This structure is used for the management of descriptors. It may be @@ -97,9 +85,7 @@ struct filedesc { int fd_holdleaderscount;/* block fdfree() for shared close() */ int fd_holdleaderswakeup; /* fdfree() needs wakeup */ }; -#ifdef CAPABILITIES #define fd_seq(fdp, fd) ((fdp)-fd_ofiles[(fd)].fde_seq) -#endif /* * Structure to keep track of (process leader, struct fildedesc) tuples. — Bjoern A. Zeeb Come on. Learn, goddamn it., WarGames, 1983
svn commit: r272571 - head/sys/netinet
Author: tuexen Date: Sun Oct 5 20:30:49 2014 New Revision: 272571 URL: https://svnweb.freebsd.org/changeset/base/272571 Log: Remove unused MC_ALIGN macro as suggested by Robert. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c == --- head/sys/netinet/sctp_output.c Sun Oct 5 19:46:52 2014 (r272570) +++ head/sys/netinet/sctp_output.c Sun Oct 5 20:30:49 2014 (r272571) @@ -6784,13 +6784,6 @@ sctp_sendall_completes(void *ptr, uint32 SCTP_FREE(ca, SCTP_M_COPYAL); } - -#defineMC_ALIGN(m, len) do { \ - SCTP_BUF_RESV_UF(m, ((MCLBYTES - (len)) ~(sizeof(long) - 1)); \ -} while (0) - - - static struct mbuf * sctp_copy_out_all(struct uio *uio, int len) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r272567 - in head/sys: kern sys
On Sun, Oct 05, 2014 at 08:26:59PM +, Bjoern A. Zeeb wrote: On 05 Oct 2014, at 19:40 , Mateusz Guzik m...@freebsd.org wrote: Author: mjg Date: Sun Oct 5 19:40:29 2014 New Revision: 272567 URL: https://svnweb.freebsd.org/changeset/base/272567 Log: filedesc: fix up breakage introduced in 272505 Include sequence counter supports incoditionally [1]. This fixes reprted build problems with e.g. nvidia driver due to missing opt_capsicum.h. Replace fishy looking sizeof with offsetof. Make fde_seq the last member in order to simplify calculations. Seing this on an incremental build now for bmake: stopped in /scratch/tmp/bz/head.svn/lib/libkvm /storage/head/obj//mips.mipsel/scratch/tmp/bz/head.svn/tmp/usr/include/sys/filedesc.h:57: error: expected specifier-qualifier-list before 'seq_t' I’ll see if this persists with a full build but I assume it will. I cannot reproduce it, tried with mips + QEMU config. One crap thing is that typedef uint32_t seq_t is placed before includes. Does it help if you move it after systm.h? Was the failure present prior to this patch? -- Mateusz Guzik mjguzik gmail.com ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272572 - head/sys/net
Author: hrs Date: Sun Oct 5 21:27:26 2014 New Revision: 272572 URL: https://svnweb.freebsd.org/changeset/base/272572 Log: Virtualize if_edsc(4). Modified: head/sys/net/if_edsc.c Modified: head/sys/net/if_edsc.c == --- head/sys/net/if_edsc.c Sun Oct 5 20:30:49 2014(r272571) +++ head/sys/net/if_edsc.c Sun Oct 5 21:27:26 2014(r272572) @@ -51,6 +51,7 @@ #include net/if_clone.h /* network interface cloning */ #include net/if_types.h /* IFT_ETHER and friends */ #include net/if_var.h/* kernel-only part of ifnet(9) */ +#include net/vnet.h static const char edscname[] = edsc; @@ -69,7 +70,8 @@ struct edsc_softc { /* * Attach to the interface cloning framework. */ -static struct if_clone *edsc_cloner; +static VNET_DEFINE(struct if_clone *, edsc_cloner); +#defineV_edsc_cloner VNET(edsc_cloner) static int edsc_clone_create(struct if_clone *, int, caddr_t); static voidedsc_clone_destroy(struct ifnet *); @@ -307,6 +309,36 @@ edsc_start(struct ifnet *ifp) */ } +static void +vnet_edsc_init(const void *unused __unused) +{ + + /* +* Connect to the network interface cloning framework. +* The last argument is the number of units to be created +* from the outset. It's also the minimum number of units +* allowed. We don't want any units created as soon as the +* driver is loaded. +*/ + V_edsc_cloner = if_clone_simple(edscname, edsc_clone_create, + edsc_clone_destroy, 0); +} +VNET_SYSINIT(vnet_edsc_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +vnet_edsc_init, NULL); + +static void +vnet_edsc_uninit(const void *unused __unused) +{ + + /* +* Disconnect from the cloning framework. +* Existing interfaces will be disposed of properly. +*/ + if_clone_detach(V_edsc_cloner); +} +VNET_SYSUNINIT(vnet_edsc_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +vnet_edsc_uninit, NULL); + /* * This function provides handlers for module events, namely load and unload. */ @@ -316,25 +348,8 @@ edsc_modevent(module_t mod, int type, vo switch (type) { case MOD_LOAD: - /* -* Connect to the network interface cloning framework. -* The last argument is the number of units to be created -* from the outset. It's also the minimum number of units -* allowed. We don't want any units created as soon as the -* driver is loaded. -*/ - edsc_cloner = if_clone_simple(edscname, edsc_clone_create, - edsc_clone_destroy, 0); - break; - case MOD_UNLOAD: - /* -* Disconnect from the cloning framework. -* Existing interfaces will be disposed of properly. -*/ - if_clone_detach(edsc_cloner); break; - default: /* * There are other event types, but we don't handle them. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272573 - head/sys/vm
Author: bryanv Date: Sun Oct 5 21:34:56 2014 New Revision: 272573 URL: https://svnweb.freebsd.org/changeset/base/272573 Log: Change the UMA mutex into a rwlock Acquire the lock in read mode when just needed to ensure the stability of the keg list. The UMA lock may be held for a long time (relatively speaking) in uma_reclaim() on machines with lots of zones/kegs. If the uma_timeout() would fire during that period, subsequent callouts on that CPU may be significantly delayed. Reviewed by: jhb Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Sun Oct 5 21:27:26 2014(r272572) +++ head/sys/vm/uma_core.c Sun Oct 5 21:34:56 2014(r272573) @@ -135,8 +135,8 @@ static LIST_HEAD(,uma_keg) uma_kegs = LI static LIST_HEAD(,uma_zone) uma_cachezones = LIST_HEAD_INITIALIZER(uma_cachezones); -/* This mutex protects the keg list */ -static struct mtx_padalign uma_mtx; +/* This RW lock protects the keg list */ +static struct rwlock_padalign uma_rwlock; /* Linked list of boot time pages */ static LIST_HEAD(,uma_slab) uma_boot_pages = @@ -904,7 +904,7 @@ zone_drain_wait(uma_zone_t zone, int wai ZONE_UNLOCK(zone); /* * The DRAINING flag protects us from being freed while -* we're running. Normally the uma_mtx would protect us but we +* we're running. Normally the uma_rwlock would protect us but we * must be able to release and acquire the right lock for each keg. */ zone_foreach_keg(zone, keg_drain); @@ -1540,9 +1540,9 @@ keg_ctor(void *mem, int size, void *udat LIST_INSERT_HEAD(keg-uk_zones, zone, uz_link); - mtx_lock(uma_mtx); + rw_wlock(uma_rwlock); LIST_INSERT_HEAD(uma_kegs, keg, uk_link); - mtx_unlock(uma_mtx); + rw_wunlock(uma_rwlock); return (0); } @@ -1592,9 +1592,9 @@ zone_ctor(void *mem, int size, void *uda zone-uz_release = arg-release; zone-uz_arg = arg-arg; zone-uz_lockptr = zone-uz_lock; - mtx_lock(uma_mtx); + rw_wlock(uma_rwlock); LIST_INSERT_HEAD(uma_cachezones, zone, uz_link); - mtx_unlock(uma_mtx); + rw_wunlock(uma_rwlock); goto out; } @@ -1611,7 +1611,7 @@ zone_ctor(void *mem, int size, void *uda zone-uz_fini = arg-fini; zone-uz_lockptr = keg-uk_lock; zone-uz_flags |= UMA_ZONE_SECONDARY; - mtx_lock(uma_mtx); + rw_wlock(uma_rwlock); ZONE_LOCK(zone); LIST_FOREACH(z, keg-uk_zones, uz_link) { if (LIST_NEXT(z, uz_link) == NULL) { @@ -1620,7 +1620,7 @@ zone_ctor(void *mem, int size, void *uda } } ZONE_UNLOCK(zone); - mtx_unlock(uma_mtx); + rw_wunlock(uma_rwlock); } else if (keg == NULL) { if ((keg = uma_kcreate(zone, arg-size, arg-uminit, arg-fini, arg-align, arg-flags)) == NULL) @@ -1718,9 +1718,9 @@ zone_dtor(void *arg, int size, void *uda if (!(zone-uz_flags UMA_ZFLAG_INTERNAL)) cache_drain(zone); - mtx_lock(uma_mtx); + rw_wlock(uma_rwlock); LIST_REMOVE(zone, uz_link); - mtx_unlock(uma_mtx); + rw_wunlock(uma_rwlock); /* * XXX there are some races here where * the zone can be drained but zone lock @@ -1742,9 +1742,9 @@ zone_dtor(void *arg, int size, void *uda * We only destroy kegs from non secondary zones. */ if (keg != NULL (zone-uz_flags UMA_ZONE_SECONDARY) == 0) { - mtx_lock(uma_mtx); + rw_wlock(uma_rwlock); LIST_REMOVE(keg, uk_link); - mtx_unlock(uma_mtx); + rw_wunlock(uma_rwlock); zone_free_item(kegs, keg, NULL, SKIP_NONE); } ZONE_LOCK_FINI(zone); @@ -1766,12 +1766,12 @@ zone_foreach(void (*zfunc)(uma_zone_t)) uma_keg_t keg; uma_zone_t zone; - mtx_lock(uma_mtx); + rw_rlock(uma_rwlock); LIST_FOREACH(keg, uma_kegs, uk_link) { LIST_FOREACH(zone, keg-uk_zones, uz_link) zfunc(zone); } - mtx_unlock(uma_mtx); + rw_runlock(uma_rwlock); } /* Public functions */ @@ -1787,7 +1787,7 @@ uma_startup(void *bootmem, int boot_page #ifdef UMA_DEBUG printf(Creating uma keg headers zone and keg.\n); #endif - mtx_init(uma_mtx, UMA lock, NULL, MTX_DEF); + rw_init(uma_rwlock, UMA lock); /* manually create the initial zone */ memset(args, 0, sizeof(args)); @@ -3362,12 +3362,12 @@ sysctl_vm_zone_count(SYSCTL_HANDLER_ARGS int count; count = 0; -
svn commit: r272574 - head/sys/sys
Author: mjg Date: Sun Oct 5 21:39:50 2014 New Revision: 272574 URL: https://svnweb.freebsd.org/changeset/base/272574 Log: seq_t needs to be visible to userspace Pointy hat to:mjg Reported by: bz X-MFC:with r272567 Modified: head/sys/sys/seq.h Modified: head/sys/sys/seq.h == --- head/sys/sys/seq.h Sun Oct 5 21:34:56 2014(r272573) +++ head/sys/sys/seq.h Sun Oct 5 21:39:50 2014(r272574) @@ -29,6 +29,16 @@ #define _SYS_SEQ_H_ #ifdef _KERNEL +#include sys/systm.h +#endif +#include sys/types.h + +/* + * seq_t may be included in structs visible to userspace + */ +typedef uint32_t seq_t; + +#ifdef _KERNEL /* * Typical usage: @@ -54,10 +64,7 @@ * foo(lobj); */ -typedef uint32_t seq_t; - /* A hack to get MPASS macro */ -#include sys/systm.h #include sys/lock.h #include machine/cpu.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r272567 - in head/sys: kern sys
On Sun, Oct 05, 2014 at 10:47:16PM +0200, Mateusz Guzik wrote: On Sun, Oct 05, 2014 at 08:26:59PM +, Bjoern A. Zeeb wrote: On 05 Oct 2014, at 19:40 , Mateusz Guzik m...@freebsd.org wrote: Author: mjg Date: Sun Oct 5 19:40:29 2014 New Revision: 272567 URL: https://svnweb.freebsd.org/changeset/base/272567 Log: filedesc: fix up breakage introduced in 272505 Include sequence counter supports incoditionally [1]. This fixes reprted build problems with e.g. nvidia driver due to missing opt_capsicum.h. Replace fishy looking sizeof with offsetof. Make fde_seq the last member in order to simplify calculations. Seing this on an incremental build now for bmake: stopped in /scratch/tmp/bz/head.svn/lib/libkvm /storage/head/obj//mips.mipsel/scratch/tmp/bz/head.svn/tmp/usr/include/sys/filedesc.h:57: error: expected specifier-qualifier-list before 'seq_t' I’ll see if this persists with a full build but I assume it will. I cannot reproduce it, tried with mips + QEMU config. One crap thing is that typedef uint32_t seq_t is placed before includes. Does it help if you move it after systm.h? Was the failure present prior to this patch? Sigh, sorry, totally misread what you wrote. Fixed in r272574. -- Mateusz Guzik mjguzik gmail.com ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272575 - head/bin/sh
Author: jilles Date: Sun Oct 5 21:51:36 2014 New Revision: 272575 URL: https://svnweb.freebsd.org/changeset/base/272575 Log: sh: Eliminate some gotos. Modified: head/bin/sh/eval.c head/bin/sh/expand.c head/bin/sh/jobs.c head/bin/sh/redir.c head/bin/sh/trap.c Modified: head/bin/sh/eval.c == --- head/bin/sh/eval.c Sun Oct 5 21:39:50 2014(r272574) +++ head/bin/sh/eval.c Sun Oct 5 21:51:36 2014(r272575) @@ -316,9 +316,10 @@ evalloop(union node *n, int flags) loopnest++; status = 0; for (;;) { - evaltree(n-nbinary.ch1, EV_TESTED); + if (!evalskip) + evaltree(n-nbinary.ch1, EV_TESTED); if (evalskip) { -skipping:if (evalskip == SKIPCONT --skipcount = 0) { + if (evalskip == SKIPCONT --skipcount = 0) { evalskip = 0; continue; } @@ -337,8 +338,6 @@ skipping: if (evalskip == SKIPCONT } evaltree(n-nbinary.ch2, flags); status = exitstatus; - if (evalskip) - goto skipping; } loopnest--; exitstatus = status; @@ -648,15 +647,15 @@ evalbackcmd(union node *n, struct backcm struct jmploc *savehandler; struct localvar *savelocalvars; - setstackmark(smark); result-fd = -1; result-buf = NULL; result-nleft = 0; result-jp = NULL; if (n == NULL) { exitstatus = 0; - goto out; + return; } + setstackmark(smark); exitstatus = oexitstatus; if (is_valid_fast_cmdsubst(n)) { savelocalvars = localvars; @@ -698,7 +697,6 @@ evalbackcmd(union node *n, struct backcm result-fd = pip[0]; result-jp = jp; } -out: popstackmark(smark); TRACE((evalbackcmd done: fd=%d buf=%p nleft=%d jp=%p\n, result-fd, result-buf, result-nleft, result-jp)); Modified: head/bin/sh/expand.c == --- head/bin/sh/expand.cSun Oct 5 21:39:50 2014(r272574) +++ head/bin/sh/expand.cSun Oct 5 21:51:36 2014(r272575) @@ -328,24 +328,19 @@ exptilde(char *p, int flag) done: *p = '\0'; if (*(startp+1) == '\0') { - if ((home = lookupvar(HOME)) == NULL) - goto lose; + home = lookupvar(HOME); } else { - if ((pw = getpwnam(startp+1)) == NULL) - goto lose; - home = pw-pw_dir; + pw = getpwnam(startp+1); + home = pw != NULL ? pw-pw_dir : NULL; } - if (*home == '\0') - goto lose; *p = c; + if (home == NULL || *home == '\0') + return (startp); if (quotes) STPUTS_QUOTES(home, SQSYNTAX, expdest); else STPUTS(home, expdest); return (p); -lose: - *p = c; - return (startp); } Modified: head/bin/sh/jobs.c == --- head/bin/sh/jobs.c Sun Oct 5 21:39:50 2014(r272574) +++ head/bin/sh/jobs.c Sun Oct 5 21:51:36 2014(r272575) @@ -373,13 +373,13 @@ showjob(struct job *jp, int mode) strcat(statestr, (core dumped)); } - for (ps = jp-ps ; ; ps++) {/* for each process */ + for (ps = jp-ps ; procno 0 ; ps++, procno--) { /* for each process */ if (mode == SHOWJOBS_PIDS || mode == SHOWJOBS_PGIDS) { out1fmt(%d\n, (int)ps-pid); - goto skip; + continue; } if (mode != SHOWJOBS_VERBOSE ps != jp-ps) - goto skip; + continue; if (jobno == curr ps == jp-ps) c = '+'; else if (jobno == prev ps == jp-ps) @@ -410,8 +410,6 @@ showjob(struct job *jp, int mode) out1c('\n'); } else printjobcmd(jp); -skip: if (--procno = 0) - break; } } Modified: head/bin/sh/redir.c == --- head/bin/sh/redir.c Sun Oct 5 21:39:50 2014(r272574) +++ head/bin/sh/redir.c Sun Oct 5 21:51:36 2014(r272575) @@ -173,21 +173,12 @@ openredirect(union node *redir, char mem fname = redir-nfile.expfname; if ((f = open(fname, O_RDONLY)) 0) error(cannot open %s: %s, fname, strerror(errno)); -movefd: - if
svn commit: r272576 - head
Author: markj Date: Sun Oct 5 22:13:13 2014 New Revision: 272576 URL: https://svnweb.freebsd.org/changeset/base/272576 Log: Fix dependency errors when linking libproc. Reported by: Oliver Hartmann X-MFC-With: r272488 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Sun Oct 5 21:51:36 2014(r272575) +++ head/Makefile.inc1 Sun Oct 5 22:13:13 2014(r272576) @@ -1536,6 +1536,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_cddl_lib_libuutil} \ ${_cddl_lib_libavl} \ ${_cddl_lib_libzfs_core} \ + ${_cddl_lib_libctf} \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ ${_secure_lib_libssh} ${_secure_lib_libssl} @@ -1586,9 +1587,11 @@ _cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib_libavl= cddl/lib/libavl _cddl_lib_libuutil= cddl/lib/libuutil _cddl_lib_libzfs_core= cddl/lib/libzfs_core +_cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L cddl/lib/libzfs__L: lib/libgeom__L +cddl/lib/libctf__L: lib/libz__L .endif .if ${MK_CRYPT} != no ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272577 - in stable/10: etc etc/defaults share/man/man5
Author: bdrewery Date: Sun Oct 5 23:32:58 2014 New Revision: 272577 URL: https://svnweb.freebsd.org/changeset/base/272577 Log: MFC r271424: - Add $netif_ipexpand_max to specify the upper limit for the number of addresses generated by an address range specification. The default value is 2048. This can be increased by setting $netif_ipexpand_max in rc.conf. PR: 186841 Modified: stable/10/etc/defaults/rc.conf stable/10/etc/network.subr stable/10/share/man/man5/rc.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf == --- stable/10/etc/defaults/rc.conf Sun Oct 5 22:13:13 2014 (r272576) +++ stable/10/etc/defaults/rc.conf Sun Oct 5 23:32:58 2014 (r272577) @@ -110,6 +110,7 @@ synchronous_dhclient=NO # Start dhclie # interfaces during startup. defaultroute_delay=30# Time to wait for a default route on a DHCP interface. defaultroute_carrier_delay=5 # Time to wait for carrier while waiting for a default route. +netif_ipexpand_max=2048 # Maximum number of IP addrs in a range spec. wpa_supplicant_program=/usr/sbin/wpa_supplicant wpa_supplicant_flags=-s # Extra flags to pass to wpa_supplicant wpa_supplicant_conf_file=/etc/wpa_supplicant.conf Modified: stable/10/etc/network.subr == --- stable/10/etc/network.subr Sun Oct 5 22:13:13 2014(r272576) +++ stable/10/etc/network.subr Sun Oct 5 23:32:58 2014(r272577) @@ -25,9 +25,7 @@ # $FreeBSD$ # IFCONFIG_CMD=/sbin/ifconfig - -# Maximum number of addresses expanded from a address range specification. -_IPEXPANDMAX=31 +: ${netif_ipexpand_max:=2048} # # Subroutines commonly used from network startup scripts. @@ -888,8 +886,8 @@ ifalias_expand_addr_inet() _ipcount=$_iplow while [ $_ipcount -le $_iphigh ]; do _retstr=${_retstr} ${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail}${_plen:+/}${_plen} - if [ $_ipcount -gt $(($_iplow + $_IPEXPANDMAX)) ]; then - warn Range specification is too large (${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}). ${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail} was processed. + if [ $_ipcount -gt $(($_iplow + $netif_ipexpand_max)) ]; then + warn Range specification is too large (${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}). ${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail} was processed. Increase \$netif_ipexpand_max in rc.conf. break else _ipcount=$(($_ipcount + 1)) @@ -978,9 +976,9 @@ ifalias_expand_addr_inet6() $_ipleft $_ipcount $_ipright \ ${_plen:+/}$_plen` _retstr=$_retstr $_r - if [ $_ipcount -gt $(($_iplow + $_IPEXPANDMAX)) ] + if [ $_ipcount -gt $(($_iplow + $netif_ipexpand_max)) ] then - warn Range specification is too large $(printf '(%s:%04x%s-%s:%04x%s)' $_ipleft $_iplow $_ipright $_ipleft $_iphigh $_ipright). $(printf '%s:%04x%s-%s:%04x%s' $_ipleft $_iplow $_ipright $_ipleft $_ipcount $_ipright) was processed. + warn Range specification is too large $(printf '(%s:%x%s-%s:%x%s)' $_ipleft $_iplow $_ipright $_ipleft $_iphigh $_ipright). $(printf '%s:%x%s-%s:%x%s' $_ipleft $_iplow $_ipright $_ipleft $_ipcount $_ipright) was processed. Increase \$netif_ipexpand_max in rc.conf. break else _ipcount=$(($_ipcount + 1)) Modified: stable/10/share/man/man5/rc.conf.5 == --- stable/10/share/man/man5/rc.conf.5 Sun Oct 5 22:13:13 2014 (r272576) +++ stable/10/share/man/man5/rc.conf.5 Sun Oct 5 23:32:58 2014 (r272577) @@ -1159,6 +1159,19 @@ or .Li inet6 2001:db8:1-f::1/64 . This notation allows address and prefix length part only, not the other address modifiers. +Note that the maximum number of the generated addresses from a range +specification is limited to an integer value specified in +.Va
svn commit: r272578 - head/usr.sbin/pw/tests
Author: brd (doc committer) Date: Mon Oct 6 00:16:23 2014 New Revision: 272578 URL: https://svnweb.freebsd.org/changeset/base/272578 Log: - Add some tests for modifying groups Reviewed by: will Added: head/usr.sbin/pw/tests/pw_modify.sh (contents, props changed) Modified: head/usr.sbin/pw/tests/Makefile Modified: head/usr.sbin/pw/tests/Makefile == --- head/usr.sbin/pw/tests/Makefile Sun Oct 5 23:32:58 2014 (r272577) +++ head/usr.sbin/pw/tests/Makefile Mon Oct 6 00:16:23 2014 (r272578) @@ -2,7 +2,7 @@ TESTSDIR= ${TESTSBASE}/usr.sbin/pw -ATF_TESTS_SH= pw_delete +ATF_TESTS_SH= pw_delete pw_modify FILES= group helper_functions.shin master.passwd FILESDIR= ${TESTSDIR} Added: head/usr.sbin/pw/tests/pw_modify.sh == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pw/tests/pw_modify.sh Mon Oct 6 00:16:23 2014 (r272578) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + + +# Test adding removing a user from a group +atf_test_case groupmod_user +groupmod_user_body() { + populate_etc_skel + atf_check -s exit:0 pw -V ${HOME} addgroup test + atf_check -s exit:0 pw -V ${HOME} groupmod test -m root + atf_check -s exit:0 -o match:^test:\*:1001:root$ \ + grep ^test:\*:.*:root$ $HOME/group + atf_check -s exit:0 pw -V ${HOME} groupmod test -d root + atf_check -s exit:0 -o match:^test:\*:1001:$ \ + grep ^test:\*:.*:$ $HOME/group +} + + +# Test adding and removing a user that does not exist +atf_test_case groupmod_invalid_user +groupmod_invalid_user_body() { + populate_etc_skel + atf_check -s exit:0 pw -V ${HOME} addgroup test + atf_check -s exit:67 -e match:does not exist pw -V ${HOME} groupmod test -m foo + atf_check -s exit:0 pw -V ${HOME} groupmod test -d foo +} + + +atf_init_test_cases() { + atf_add_test_case groupmod_user + atf_add_test_case groupmod_invalid_user +} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272579 - head/share/man/man5
Author: bdrewery Date: Mon Oct 6 00:25:10 2014 New Revision: 272579 URL: https://svnweb.freebsd.org/changeset/base/272579 Log: Bump .Dd missed in r271424 Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 == --- head/share/man/man5/rc.conf.5 Mon Oct 6 00:16:23 2014 (r272578) +++ head/share/man/man5/rc.conf.5 Mon Oct 6 00:25:10 2014 (r272579) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd August 27, 2014 +.Dd September 11, 2014 .Dt RC.CONF 5 .Os .Sh NAME ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272580 - stable/10/share/man/man5
Author: bdrewery Date: Mon Oct 6 00:27:08 2014 New Revision: 272580 URL: https://svnweb.freebsd.org/changeset/base/272580 Log: MFC r272579: Bump .Dd missed in r271424 Modified: stable/10/share/man/man5/rc.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man5/rc.conf.5 == --- stable/10/share/man/man5/rc.conf.5 Mon Oct 6 00:25:10 2014 (r272579) +++ stable/10/share/man/man5/rc.conf.5 Mon Oct 6 00:27:08 2014 (r272580) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd August 27, 2014 +.Dd September 11, 2014 .Dt RC.CONF 5 .Os .Sh NAME ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272581 - in stable/9: etc etc/defaults share/man/man5
Author: bdrewery Date: Mon Oct 6 00:31:31 2014 New Revision: 272581 URL: https://svnweb.freebsd.org/changeset/base/272581 Log: MFC r271424,r272579: - Add $netif_ipexpand_max to specify the upper limit for the number of addresses generated by an address range specification. The default value is 2048. This can be increased by setting $netif_ipexpand_max in rc.conf. - Bump .Dd missed in r271424 Modified: stable/9/etc/defaults/rc.conf stable/9/etc/network.subr stable/9/share/man/man5/rc.conf.5 Directory Properties: stable/9/etc/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/9/etc/defaults/rc.conf == --- stable/9/etc/defaults/rc.conf Mon Oct 6 00:27:08 2014 (r272580) +++ stable/9/etc/defaults/rc.conf Mon Oct 6 00:31:31 2014 (r272581) @@ -114,6 +114,7 @@ synchronous_dhclient=NO # Start dhclie # interfaces during startup. defaultroute_delay=30# Time to wait for a default route on a DHCP interface. defaultroute_carrier_delay=5 # Time to wait for carrier while waiting for a default route. +netif_ipexpand_max=2048 # Maximum number of IP addrs in a range spec. wpa_supplicant_program=/usr/sbin/wpa_supplicant wpa_supplicant_flags=-s # Extra flags to pass to wpa_supplicant wpa_supplicant_conf_file=/etc/wpa_supplicant.conf Modified: stable/9/etc/network.subr == --- stable/9/etc/network.subr Mon Oct 6 00:27:08 2014(r272580) +++ stable/9/etc/network.subr Mon Oct 6 00:31:31 2014(r272581) @@ -25,9 +25,7 @@ # $FreeBSD$ # IFCONFIG_CMD=/sbin/ifconfig - -# Maximum number of addresses expanded from a address range specification. -_IPEXPANDMAX=31 +: ${netif_ipexpand_max:=2048} # # Subroutines commonly used from network startup scripts. @@ -820,8 +818,8 @@ ifalias_expand_addr_inet() _ipcount=$_iplow while [ $_ipcount -le $_iphigh ]; do _retstr=${_retstr} ${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail}${_plen:+/}${_plen} - if [ $_ipcount -gt $(($_iplow + $_IPEXPANDMAX)) ]; then - warn Range specification is too large (${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}). ${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail} was processed. + if [ $_ipcount -gt $(($_iplow + $netif_ipexpand_max)) ]; then + warn Range specification is too large (${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}). ${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail} was processed. Increase \$netif_ipexpand_max in rc.conf. break else _ipcount=$(($_ipcount + 1)) @@ -910,9 +908,9 @@ ifalias_expand_addr_inet6() $_ipleft $_ipcount $_ipright \ ${_plen:+/}$_plen` _retstr=$_retstr $_r - if [ $_ipcount -gt $(($_iplow + $_IPEXPANDMAX)) ] + if [ $_ipcount -gt $(($_iplow + $netif_ipexpand_max)) ] then - warn Range specification is too large $(printf '(%s:%04x%s-%s:%04x%s)' $_ipleft $_iplow $_ipright $_ipleft $_iphigh $_ipright). $(printf '%s:%04x%s-%s:%04x%s' $_ipleft $_iplow $_ipright $_ipleft $_ipcount $_ipright) was processed. + warn Range specification is too large $(printf '(%s:%x%s-%s:%x%s)' $_ipleft $_iplow $_ipright $_ipleft $_iphigh $_ipright). $(printf '%s:%x%s-%s:%x%s' $_ipleft $_iplow $_ipright $_ipleft $_ipcount $_ipright) was processed. Increase \$netif_ipexpand_max in rc.conf. break else _ipcount=$(($_ipcount + 1)) Modified: stable/9/share/man/man5/rc.conf.5 == --- stable/9/share/man/man5/rc.conf.5 Mon Oct 6 00:27:08 2014 (r272580) +++ stable/9/share/man/man5/rc.conf.5 Mon Oct 6 00:31:31 2014 (r272581) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd February 13, 2014 +.Dd September 11, 2014 .Dt RC.CONF 5 .Os .Sh NAME @@ -1137,6 +1137,19 @@ or .Li inet6 2001:db8:1-f::1/64 . This notation allows address and
svn commit: r272582 - in head/sys: kern sys
Author: mjg Date: Mon Oct 6 02:31:33 2014 New Revision: 272582 URL: https://svnweb.freebsd.org/changeset/base/272582 Log: Convert racct stubs to inline functions. This saves some symbols and function calls for kernel without RACCT. MFC after:1 week Modified: head/sys/kern/kern_racct.c head/sys/sys/racct.h Modified: head/sys/kern/kern_racct.c == --- head/sys/kern/kern_racct.c Mon Oct 6 00:31:31 2014(r272581) +++ head/sys/kern/kern_racct.c Mon Oct 6 02:31:33 2014(r272582) @@ -1203,88 +1203,4 @@ racct_init(void) } SYSINIT(racct, SI_SUB_RACCT, SI_ORDER_FIRST, racct_init, NULL); -#else /* !RACCT */ - -int -racct_add(struct proc *p, int resource, uint64_t amount) -{ - - return (0); -} - -void -racct_add_cred(struct ucred *cred, int resource, uint64_t amount) -{ -} - -void -racct_add_force(struct proc *p, int resource, uint64_t amount) -{ - - return; -} - -int -racct_set(struct proc *p, int resource, uint64_t amount) -{ - - return (0); -} - -void -racct_set_force(struct proc *p, int resource, uint64_t amount) -{ -} - -void -racct_sub(struct proc *p, int resource, uint64_t amount) -{ -} - -void -racct_sub_cred(struct ucred *cred, int resource, uint64_t amount) -{ -} - -uint64_t -racct_get_limit(struct proc *p, int resource) -{ - - return (UINT64_MAX); -} - -uint64_t -racct_get_available(struct proc *p, int resource) -{ - - return (UINT64_MAX); -} - -void -racct_create(struct racct **racctp) -{ -} - -void -racct_destroy(struct racct **racctp) -{ -} - -int -racct_proc_fork(struct proc *parent, struct proc *child) -{ - - return (0); -} - -void -racct_proc_fork_done(struct proc *child) -{ -} - -void -racct_proc_exit(struct proc *p) -{ -} - #endif /* !RACCT */ Modified: head/sys/sys/racct.h == --- head/sys/sys/racct.hMon Oct 6 00:31:31 2014(r272581) +++ head/sys/sys/racct.hMon Oct 6 02:31:33 2014(r272582) @@ -37,6 +37,7 @@ #define_RACCT_H_ #include sys/cdefs.h +#include sys/stdint.h #include sys/queue.h #include sys/types.h @@ -141,6 +142,8 @@ struct racct { LIST_HEAD(, rctl_rule_link) r_rule_links; }; +#ifdef RACCT + intracct_add(struct proc *p, int resource, uint64_t amount); void racct_add_cred(struct ucred *cred, int resource, uint64_t amount); void racct_add_force(struct proc *p, int resource, uint64_t amount); @@ -162,4 +165,88 @@ void racct_proc_ucred_changed(struct pro struct ucred *newcred); void racct_move(struct racct *dest, struct racct *src); +#else + +static inline int +racct_add(struct proc *p, int resource, uint64_t amount) +{ + + return (0); +} + +static inline void +racct_add_cred(struct ucred *cred, int resource, uint64_t amount) +{ +} + +static inline void +racct_add_force(struct proc *p, int resource, uint64_t amount) +{ +} + +static inline int +racct_set(struct proc *p, int resource, uint64_t amount) +{ + + return (0); +} + +static inline void +racct_set_force(struct proc *p, int resource, uint64_t amount) +{ +} + +static inline void +racct_sub(struct proc *p, int resource, uint64_t amount) +{ +} + +static inline void +racct_sub_cred(struct ucred *cred, int resource, uint64_t amount) +{ +} + +static inline uint64_t +racct_get_limit(struct proc *p, int resource) +{ + + return (UINT64_MAX); +} + +static inline uint64_t +racct_get_available(struct proc *p, int resource) +{ + + return (UINT64_MAX); +} + +static inline void +racct_create(struct racct **racctp) +{ +} + +static inline void +racct_destroy(struct racct **racctp) +{ +} + +static inline int +racct_proc_fork(struct proc *parent, struct proc *child) +{ + + return (0); +} + +static inline void +racct_proc_fork_done(struct proc *child) +{ +} + +static inline void +racct_proc_exit(struct proc *p) +{ +} + +#endif + #endif /* !_RACCT_H_ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272583 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: delphij Date: Mon Oct 6 05:42:20 2014 New Revision: 272583 URL: https://svnweb.freebsd.org/changeset/base/272583 Log: MFV r272500: Don't inherit flags other than DS_FLAG_CI_DATASET and DS_FLAG_INCONSISTENT when cloning. This prevents DS_FLAG_DEFER_DESTROY being inherited from a clone that is marked for deferred destroy, which causes snapshots of the clone being destroyed when getting a hold or clone. Illumos issue: 5150 zfs clone of a defer_destroy snapshot causes strangeness MFC after:1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Oct 6 02:31:33 2014(r272582) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Oct 6 05:42:20 2014(r272583) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright (c) 2011 Martin Matuska m...@freebsd.org - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2014 RackTop Systems. */ @@ -699,7 +699,13 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dsphys-ds_uncompressed_bytes = origin-ds_phys-ds_uncompressed_bytes; dsphys-ds_bp = origin-ds_phys-ds_bp; - dsphys-ds_flags |= origin-ds_phys-ds_flags; + + /* +* Inherit flags that describe the dataset's contents +* (INCONSISTENT) or properties (Case Insensitive). +*/ + dsphys-ds_flags |= origin-ds_phys-ds_flags + (DS_FLAG_INCONSISTENT | DS_FLAG_CI_DATASET); dmu_buf_will_dirty(origin-ds_dbuf, tx); origin-ds_phys-ds_num_children++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272584 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: delphij Date: Mon Oct 6 05:46:51 2014 New Revision: 272584 URL: https://svnweb.freebsd.org/changeset/base/272584 Log: MFV r272501: Illumos issue: 5177 remove dead code from dsl_scan.c MFC after:2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Oct 6 05:42:20 2014(r272583) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Oct 6 05:46:51 2014(r272584) @@ -375,13 +375,12 @@ dsl_scan_cancel(dsl_pool_t *dp) dsl_scan_cancel_sync, NULL, 3, ZFS_SPACE_CHECK_RESERVED)); } -static void dsl_scan_visitbp(blkptr_t *bp, -const zbookmark_phys_t *zb, dnode_phys_t *dnp, arc_buf_t *pbuf, -dsl_dataset_t *ds, dsl_scan_t *scn, dmu_objset_type_t ostype, -dmu_tx_t *tx); +static void dsl_scan_visitbp(blkptr_t *bp, const zbookmark_phys_t *zb, +dnode_phys_t *dnp, dsl_dataset_t *ds, dsl_scan_t *scn, +dmu_objset_type_t ostype, dmu_tx_t *tx); static void dsl_scan_visitdnode(dsl_scan_t *, dsl_dataset_t *ds, dmu_objset_type_t ostype, -dnode_phys_t *dnp, arc_buf_t *buf, uint64_t object, dmu_tx_t *tx); +dnode_phys_t *dnp, uint64_t object, dmu_tx_t *tx); void dsl_free(dsl_pool_t *dp, uint64_t txg, const blkptr_t *bp) @@ -615,7 +614,7 @@ dsl_scan_check_resume(dsl_scan_t *scn, c static int dsl_scan_recurse(dsl_scan_t *scn, dsl_dataset_t *ds, dmu_objset_type_t ostype, dnode_phys_t *dnp, const blkptr_t *bp, -const zbookmark_phys_t *zb, dmu_tx_t *tx, arc_buf_t **bufp) +const zbookmark_phys_t *zb, dmu_tx_t *tx) { dsl_pool_t *dp = scn-scn_dp; int zio_flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD; @@ -626,76 +625,72 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da int i; blkptr_t *cbp; int epb = BP_GET_LSIZE(bp) SPA_BLKPTRSHIFT; + arc_buf_t *buf; - err = arc_read(NULL, dp-dp_spa, bp, arc_getbuf_func, bufp, + err = arc_read(NULL, dp-dp_spa, bp, arc_getbuf_func, buf, ZIO_PRIORITY_ASYNC_READ, zio_flags, flags, zb); if (err) { scn-scn_phys.scn_errors++; return (err); } - for (i = 0, cbp = (*bufp)-b_data; i epb; i++, cbp++) { - dsl_scan_prefetch(scn, *bufp, cbp, zb-zb_objset, + for (i = 0, cbp = buf-b_data; i epb; i++, cbp++) { + dsl_scan_prefetch(scn, buf, cbp, zb-zb_objset, zb-zb_object, zb-zb_blkid * epb + i); } - for (i = 0, cbp = (*bufp)-b_data; i epb; i++, cbp++) { + for (i = 0, cbp = buf-b_data; i epb; i++, cbp++) { zbookmark_phys_t czb; SET_BOOKMARK(czb, zb-zb_objset, zb-zb_object, zb-zb_level - 1, zb-zb_blkid * epb + i); dsl_scan_visitbp(cbp, czb, dnp, - *bufp, ds, scn, ostype, tx); - } - } else if (BP_GET_TYPE(bp) == DMU_OT_USERGROUP_USED) { - uint32_t flags = ARC_WAIT; - - err = arc_read(NULL, dp-dp_spa, bp, arc_getbuf_func, bufp, - ZIO_PRIORITY_ASYNC_READ, zio_flags, flags, zb); - if (err) { - scn-scn_phys.scn_errors++; - return (err); + ds, scn, ostype, tx); } + (void) arc_buf_remove_ref(buf, buf); } else if (BP_GET_TYPE(bp) == DMU_OT_DNODE) { uint32_t flags = ARC_WAIT; dnode_phys_t *cdnp; int i, j; int epb = BP_GET_LSIZE(bp) DNODE_SHIFT; + arc_buf_t *buf; - err = arc_read(NULL, dp-dp_spa, bp, arc_getbuf_func, bufp, + err = arc_read(NULL, dp-dp_spa, bp, arc_getbuf_func, buf, ZIO_PRIORITY_ASYNC_READ, zio_flags, flags, zb); if (err) { scn-scn_phys.scn_errors++; return (err); } - for (i = 0, cdnp = (*bufp)-b_data; i epb; i++, cdnp++) { + for (i = 0, cdnp = buf-b_data; i epb; i++, cdnp++) { for (j = 0; j cdnp-dn_nblkptr; j++) { blkptr_t *cbp = cdnp-dn_blkptr[j]; - dsl_scan_prefetch(scn, *bufp, cbp, + dsl_scan_prefetch(scn, buf, cbp, zb-zb_objset, zb-zb_blkid * epb + i, j);
svn commit: r272585 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb
Author: delphij Date: Mon Oct 6 05:54:39 2014 New Revision: 272585 URL: https://svnweb.freebsd.org/changeset/base/272585 Log: 5176 lock contention on godfather zio Reviewed by: Adam Leventhal a...@delphix.com Reviewed by: Alex Reece alex.re...@delphix.com Reviewed by: Christopher Siden christopher.si...@delphix.com Reviewed by: George Wilson george.wil...@delphix.com Reviewed by: Richard Elling richard.ell...@gmail.com Reviewed by: Bayard Bell bayard.b...@nexenta.com Approved by: Garrett D'Amore garr...@damore.org Author: Matthew Ahrens mahr...@delphix.com illumos/illumos-gate@6f834bc197c703a6568554c889157fb345bac079 Modified: vendor/illumos/dist/cmd/zdb/zdb.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c == --- vendor/illumos/dist/cmd/zdb/zdb.c Mon Oct 6 05:46:51 2014 (r272584) +++ vendor/illumos/dist/cmd/zdb/zdb.c Mon Oct 6 05:54:39 2014 (r272585) @@ -2565,10 +2565,12 @@ dump_block_stats(spa_t *spa) * all async I/Os to complete. */ if (dump_opt['c']) { - (void) zio_wait(spa-spa_async_zio_root); - spa-spa_async_zio_root = zio_root(spa, NULL, NULL, - ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | - ZIO_FLAG_GODFATHER); + for (int i = 0; i max_ncpus; i++) { + (void) zio_wait(spa-spa_async_zio_root[i]); + spa-spa_async_zio_root[i] = zio_root(spa, NULL, NULL, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | + ZIO_FLAG_GODFATHER); + } } if (zcb.zcb_haderrors) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272585 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb
Author: delphij Date: Mon Oct 6 05:54:39 2014 New Revision: 272585 URL: https://svnweb.freebsd.org/changeset/base/272585 Log: 5176 lock contention on godfather zio Reviewed by: Adam Leventhal a...@delphix.com Reviewed by: Alex Reece alex.re...@delphix.com Reviewed by: Christopher Siden christopher.si...@delphix.com Reviewed by: George Wilson george.wil...@delphix.com Reviewed by: Richard Elling richard.ell...@gmail.com Reviewed by: Bayard Bell bayard.b...@nexenta.com Approved by: Garrett D'Amore garr...@damore.org Author: Matthew Ahrens mahr...@delphix.com illumos/illumos-gate@6f834bc197c703a6568554c889157fb345bac079 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c == --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Oct 6 05:46:51 2014(r272584) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Oct 6 05:54:39 2014(r272585) @@ -1222,7 +1222,9 @@ spa_unload(spa_t *spa) * Wait for any outstanding async I/O to complete. */ if (spa-spa_async_zio_root != NULL) { - (void) zio_wait(spa-spa_async_zio_root); + for (int i = 0; i max_ncpus; i++) + (void) zio_wait(spa-spa_async_zio_root[i]); + kmem_free(spa-spa_async_zio_root, max_ncpus * sizeof (void *)); spa-spa_async_zio_root = NULL; } @@ -2141,8 +2143,13 @@ spa_load_impl(spa_t *spa, uint64_t pool_ /* * Create The Godfather zio to hold all async IOs */ - spa-spa_async_zio_root = zio_root(spa, NULL, NULL, - ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | ZIO_FLAG_GODFATHER); + spa-spa_async_zio_root = kmem_alloc(max_ncpus * sizeof (void *), + KM_SLEEP); + for (int i = 0; i max_ncpus; i++) { + spa-spa_async_zio_root[i] = zio_root(spa, NULL, NULL, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | + ZIO_FLAG_GODFATHER); + } /* * Parse the configuration into a vdev tree. We explicitly set the @@ -3481,8 +3488,13 @@ spa_create(const char *pool, nvlist_t *n /* * Create The Godfather zio to hold all async IOs */ - spa-spa_async_zio_root = zio_root(spa, NULL, NULL, - ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | ZIO_FLAG_GODFATHER); + spa-spa_async_zio_root = kmem_alloc(max_ncpus * sizeof (void *), + KM_SLEEP); + for (int i = 0; i max_ncpus; i++) { + spa-spa_async_zio_root[i] = zio_root(spa, NULL, NULL, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | + ZIO_FLAG_GODFATHER); + } /* * Create the root vdev. Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h == --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.hMon Oct 6 05:46:51 2014(r272584) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.hMon Oct 6 05:54:39 2014(r272585) @@ -204,7 +204,8 @@ struct spa { uint64_tspa_failmode; /* failure mode for the pool */ uint64_tspa_delegation; /* delegation on/off */ list_t spa_config_list;/* previous cache file(s) */ - zio_t *spa_async_zio_root;/* root of all async I/O */ + /* per-CPU array of root of async I/O: */ + zio_t **spa_async_zio_root; zio_t *spa_suspend_zio_root; /* root of all suspended I/O */ kmutex_tspa_suspend_lock; /* protects suspend_zio_root */ kcondvar_t spa_suspend_cv; /* notification of resume */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c == --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Mon Oct 6 05:46:51 2014(r272584) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Mon Oct 6 05:54:39 2014(r272585) @@ -1367,7 +1367,7 @@ zio_nowait(zio_t *zio) */ spa_t *spa = zio-io_spa; - zio_add_child(spa-spa_async_zio_root, zio); + zio_add_child(spa-spa_async_zio_root[CPU_SEQID], zio); } zio_execute(zio); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r272586 - stable/9/sys/dev/usb/controller
Author: hselasky Date: Mon Oct 6 05:58:16 2014 New Revision: 272586 URL: https://svnweb.freebsd.org/changeset/base/272586 Log: MFC r272349, r272422 and r272479: - Fix XHCI driver for devices which have more than 15 physical root HUB ports. The current bitmap array was too small to hold more than 16 bits and would at some point toggle the context size, which then would trigger an enumeration fault and cause a fallback to the EHCI companion controller, if any. - Make sure we always set the maximum number of valid contexts. - Set default cycle state in case of early interrupts. Modified: stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/controller/xhci.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c == --- stable/9/sys/dev/usb/controller/xhci.c Mon Oct 6 05:54:39 2014 (r272585) +++ stable/9/sys/dev/usb/controller/xhci.c Mon Oct 6 05:58:16 2014 (r272586) @@ -593,6 +593,10 @@ xhci_init(struct xhci_softc *sc, device_ sc-sc_bus.devices = sc-sc_devices; sc-sc_bus.devices_max = XHCI_MAX_DEVICES; + /* set default cycle state in case of early interrupts */ + sc-sc_event_ccs = 1; + sc-sc_command_ccs = 1; + /* setup command queue mutex and condition varible */ cv_init(sc-sc_cmd_cv, CMDQ); sx_init(sc-sc_cmd_sx, CMDQ lock); @@ -2236,14 +2240,17 @@ xhci_configure_mask(struct usb_device *u /* adjust */ x--; - /* figure out maximum */ - if (x sc-sc_hw.devs[index].context_num) { + /* figure out the maximum number of contexts */ + if (x sc-sc_hw.devs[index].context_num) sc-sc_hw.devs[index].context_num = x; - temp = xhci_ctx_get_le32(sc, pinp-ctx_slot.dwSctx0); - temp = ~XHCI_SCTX_0_CTX_NUM_SET(31); - temp |= XHCI_SCTX_0_CTX_NUM_SET(x + 1); - xhci_ctx_set_le32(sc, pinp-ctx_slot.dwSctx0, temp); - } + else + x = sc-sc_hw.devs[index].context_num; + + /* update number of contexts */ + temp = xhci_ctx_get_le32(sc, pinp-ctx_slot.dwSctx0); + temp = ~XHCI_SCTX_0_CTX_NUM_SET(31); + temp |= XHCI_SCTX_0_CTX_NUM_SET(x + 1); + xhci_ctx_set_le32(sc, pinp-ctx_slot.dwSctx0, temp); } return (0); } Modified: stable/9/sys/dev/usb/controller/xhci.h == --- stable/9/sys/dev/usb/controller/xhci.h Mon Oct 6 05:54:39 2014 (r272585) +++ stable/9/sys/dev/usb/controller/xhci.h Mon Oct 6 05:58:16 2014 (r272586) @@ -482,7 +482,8 @@ struct xhci_softc { uint8_t sc_noscratch; /* root HUB device configuration */ uint8_t sc_conf; - uint8_t sc_hub_idata[2]; + /* root HUB port event bitmap, max 256 ports */ + uint8_t sc_hub_idata[32]; /* size of context */ uint8_t sc_ctx_is_64_byte; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org